Skip to content

Instantly share code, notes, and snippets.

View lesssummer's full-sized avatar
🏠
Working from home

Less Sugar lesssummer

🏠
Working from home
View GitHub Profile
@lesssummer
lesssummer / appsScript_ListFilesFolders_ver.2.js
Created August 9, 2019 02:10 — forked from mesgarpour/appsScript_ListFilesFolders_ver.2.js
[Google Apps Script] List all files & folders in a Google Drive folder, & write into a speadsheet
/*
* Copyright 2017 Mohsen Mesgarpour
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@lesssummer
lesssummer / jekyll-og-meta-generator
Created May 9, 2018 06:48 — forked from budparr/jekyll-og-meta-generator
Jekyll Open Graph meta-data Generator
<!-- TODO: add og, twitter card -->
{% comment %}
http://ogp.me/
{% endcomment %}
<meta name="description" content="{% if page.tagline %}{{page.tagline}}{% endif %}">
{% if page.categories %}
{% for category in page.categories limit:1 %}
<meta content="{{ category }}" property="article:section">
@lesssummer
lesssummer / list-categories-count.liquid
Created May 9, 2018 02:21 — forked from konstantin-morenko/list-categories-count.liquid
Jekyll: List all categories with according post count and show and link all post items listed in the according category
<h2>Categories</h2>
<ul>
{% assign categories_list = site.categories %}
{% if categories_list.first[0] == null %}
{% for category in categories_list %}
<li><a href="#{{ category }}">{{ category | capitalize }} ({{ site.tags[category].size }})</a></li>
{% endfor %}
{% else %}
{% for category in categories_list %}
<li><a href="#{{ tag[0] }}">{{ category[0] | capitalize }} ({{ category[1].size }})</a></li>
@lesssummer
lesssummer / jeykll-post-counter.liquid
Created May 9, 2018 02:19 — forked from Phlow/jeykll-post-counter.liquid
Counter: This code snippet just counts your jekyll posts and spits out the result
{% comment %}
*
* Counter: This include counts your jekyll posts
*
{% endcomment %}{% assign counter = 1 %}{% for item in site.posts %}{% unless item.published == false %}{% assign counter=counter | plus:1 %}{% endunless %}{% endfor %}{{ counter }}
@lesssummer
lesssummer / jekyll-loop-all-collections.liquid
Created May 9, 2018 02:12 — forked from Phlow/jekyll-loop-all-collections.liquid
Loop through all collections of a Jekyll website
{% for c in site.collections %}
{% assign docs=c[1].docs %}
{% for doc in docs %}
// do something
{% endfor %}
{% endfor %}
@lesssummer
lesssummer / list-categories-count.liquid
Created May 9, 2018 02:08 — forked from Phlow/list-categories-count.liquid
Jekyll: List all categories with according post count and show and link all post items listed in the according category
<h2>Categories</h2>
<ul>
{% assign categories_list = site.categories %}
{% if categories_list.first[0] == null %}
{% for category in categories_list %}
<li><a href="#{{ category }}">{{ category | capitalize }} ({{ site.tags[category].size }})</a></li>
{% endfor %}
{% else %}
{% for category in categories_list %}
<li><a href="#{{ category[0] | downcase }}">{{ category[0] | capitalize }} ({{ category[1].size }})</a></li>
@lesssummer
lesssummer / jekyll-and-liquid.md
Created May 4, 2018 09:01 — forked from magicznyleszek/jekyll-and-liquid.md
Jekyll & Liquid Cheatsheet

Jekyll & Liquid Cheatsheet

A list of the most common functionalities in Jekyll (Liquid). You can use Jekyll with GitHub Pages, just make sure you are using the proper version.

Running

Running a local server for testing purposes:

{% assign sorted_cats = site.categories | sort %}
{% for category in sorted_cats %}
<!-- <p><a href="posts/{{ category | first }}">{{ category | first }}</a></p> -->
<p><a href="post.html">{{ category | first }}</a></p>
{% for posts in category %}
{% for post in posts %}
<li><a href="{{site.baseurl}}{{ post.url }}">{{ post.title }}</a></li>
{% endfor %}
{% endfor %}
{% endfor %}
@lesssummer
lesssummer / php-oracle.md
Created January 24, 2018 09:16 — forked from odan/php-oracle.md
XAMPP - Oracle Driver Setup (v12)
@lesssummer
lesssummer / grouping.sql
Created October 6, 2017 00:59 — forked from hidayat365/grouping.sql
Grouping by transactions using custom group
-- ---------------------------------------
-- Generate Data
-- ---------------------------------------
CREATE table trans_history AS
SELECT 'TRANS-A' AS transactions, '2017-08-30 08:00:00' AS history UNION ALL
SELECT 'TRANS-A' AS transactions, '2017-08-30 08:10:00' AS history UNION ALL
SELECT 'TRANS-A' AS transactions, '2017-08-30 08:20:00' AS history UNION ALL
SELECT 'TRANS-A' AS transactions, '2017-08-30 08:30:00' AS history UNION ALL
SELECT 'TRANS-A' AS transactions, '2017-08-30 08:40:00' AS history UNION ALL
SELECT 'TRANS-A' AS transactions, '2017-08-30 08:50:00' AS history UNION ALL