Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Shadowen committed Aug 13, 2015
0 parents commit dbd112f
Show file tree
Hide file tree
Showing 18 changed files with 256 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
@@ -0,0 +1,2 @@
_site
.sass-cache
3 changes: 3 additions & 0 deletions Gemfile
@@ -0,0 +1,3 @@
source 'https://rubygems.org'
gem 'github-pages'
gem 'wdm', '>=0.1.0' if Gem.win_platform?
133 changes: 133 additions & 0 deletions Gemfile.lock
@@ -0,0 +1,133 @@
GEM
remote: https://rubygems.org/
specs:
RedCloth (4.2.9)
activesupport (4.2.3)
i18n (~> 0.7)
json (~> 1.7, >= 1.7.7)
minitest (~> 5.1)
thread_safe (~> 0.3, >= 0.3.4)
tzinfo (~> 1.1)
blankslate (2.1.2.4)
celluloid (0.16.0)
timers (~> 4.0.0)
classifier-reborn (2.0.3)
fast-stemmer (~> 1.0)
coffee-script (2.4.1)
coffee-script-source
execjs
coffee-script-source (1.9.1.1)
colorator (0.1)
execjs (2.5.2)
fast-stemmer (1.0.2)
ffi (1.9.10-x64-mingw32)
gemoji (2.1.0)
github-pages (39)
RedCloth (= 4.2.9)
github-pages-health-check (~> 0.2)
jekyll (= 2.4.0)
jekyll-coffeescript (= 1.0.1)
jekyll-feed (= 0.3.1)
jekyll-mentions (= 0.2.1)
jekyll-redirect-from (= 0.8.0)
jekyll-sass-converter (= 1.3.0)
jekyll-sitemap (= 0.8.1)
jemoji (= 0.5.0)
kramdown (= 1.5.0)
liquid (= 2.6.2)
maruku (= 0.7.0)
mercenary (~> 0.3)
pygments.rb (= 0.6.3)
rdiscount (= 2.1.7)
redcarpet (= 3.3.2)
terminal-table (~> 1.4)
github-pages-health-check (0.3.1)
net-dns (~> 0.6)
public_suffix (~> 1.4)
hitimes (1.2.2)
html-pipeline (1.9.0)
activesupport (>= 2)
nokogiri (~> 1.4)
i18n (0.7.0)
jekyll (2.4.0)
classifier-reborn (~> 2.0)
colorator (~> 0.1)
jekyll-coffeescript (~> 1.0)
jekyll-gist (~> 1.0)
jekyll-paginate (~> 1.0)
jekyll-sass-converter (~> 1.0)
jekyll-watch (~> 1.1)
kramdown (~> 1.3)
liquid (~> 2.6.1)
mercenary (~> 0.3.3)
pygments.rb (~> 0.6.0)
redcarpet (~> 3.1)
safe_yaml (~> 1.0)
toml (~> 0.1.0)
jekyll-coffeescript (1.0.1)
coffee-script (~> 2.2)
jekyll-feed (0.3.1)
jekyll-gist (1.3.0)
jekyll-mentions (0.2.1)
html-pipeline (~> 1.9.0)
jekyll (~> 2.0)
jekyll-paginate (1.1.0)
jekyll-redirect-from (0.8.0)
jekyll (>= 2.0)
jekyll-sass-converter (1.3.0)
sass (~> 3.2)
jekyll-sitemap (0.8.1)
jekyll-watch (1.2.1)
listen (~> 2.7)
jemoji (0.5.0)
gemoji (~> 2.0)
html-pipeline (~> 1.9)
jekyll (>= 2.0)
json (1.8.3)
kramdown (1.5.0)
liquid (2.6.2)
listen (2.10.1)
celluloid (~> 0.16.0)
rb-fsevent (>= 0.9.3)
rb-inotify (>= 0.9)
maruku (0.7.0)
mercenary (0.3.5)
mini_portile (0.6.2)
minitest (5.7.0)
net-dns (0.8.0)
nokogiri (1.6.6.2-x64-mingw32)
mini_portile (~> 0.6.0)
parslet (1.5.0)
blankslate (~> 2.0)
posix-spawn (0.3.11)
public_suffix (1.5.1)
pygments.rb (0.6.3)
posix-spawn (~> 0.3.6)
yajl-ruby (~> 1.2.0)
rb-fsevent (0.9.5)
rb-inotify (0.9.5)
ffi (>= 0.5.0)
rdiscount (2.1.7)
redcarpet (3.3.2)
safe_yaml (1.0.4)
sass (3.4.16)
terminal-table (1.5.2)
thread_safe (0.3.5)
timers (4.0.1)
hitimes
toml (0.1.2)
parslet (~> 1.5.0)
tzinfo (1.2.2)
thread_safe (~> 0.1)
wdm (0.1.1)
yajl-ruby (1.2.1)

PLATFORMS
x64-mingw32

DEPENDENCIES
github-pages
wdm (>= 0.1.0)

BUNDLED WITH
1.10.6
Empty file added README.md
Empty file.
37 changes: 37 additions & 0 deletions _config.yml
@@ -0,0 +1,37 @@
# Site settings
title: Wesley Heung
email: wesley@heungs.com
description: > # this means to ignore newlines until "baseurl:"
Write an awesome description for your new site here. You can edit this
line in _config.yml. It will appear in your document head meta (for
Google search results) and in your feed.xml site description.
baseurl: "lqf" # the subpath of your site, e.g. /blog/
url: "http://wesley.heungs.com" # the base hostname & protocol for your site
github_username: Shadowen

# GitHub defaults
highlighter: pygments

# Build settings
markdown: kramdown
input: GFM

# The array seperator for LQF
lqf-array-sep: "&"

collections:
docs:
output: true
permalink: /docs/:path/

defaults:
-
scope:
path: ""
type: docs
values:
layout: doc

# GitHub overrides
safe: true
lsi: false
11 changes: 11 additions & 0 deletions _docs/array-remove.html
@@ -0,0 +1,11 @@
---
---
{% assign array = "Cats|Dogs|Mice|Cats|Cats|Mice|Mice" | split:'|' %}
Array: [{{ array | join: "," }}]<br>
{% capture newArray %}{% include array-remove array=array remove="Dogs" %}{% endcapture %}
{% assign array = newArray | split: "&" %}
Intermediate: [{{ array | join: ","}}]<br>
{% capture newArray %}{% include array-remove array=array remove="Cats" %}{% endcapture %}
{% assign array = newArray | split: "&" %}
Final: [{{ array | join: "," }}]<br>
<hr>
2 changes: 2 additions & 0 deletions _docs/max.html
@@ -0,0 +1,2 @@
---
---
Empty file added _docs/min.html
Empty file.
6 changes: 6 additions & 0 deletions _docs/most-occurences.html
@@ -0,0 +1,6 @@
---
---
{% assign array = "Cats|Dogs|Mice|Cats|Cats|Mice|Mice" | split:'|' %}
{% capture mostCommonString %}{% include most-occurences array=array %}{% endcapture %}
{% assign mostCommon = mostCommonString | split: "&" %}
{{ mostCommon | join: ", " }}
1 change: 1 addition & 0 deletions _includes/array-remove
@@ -0,0 +1 @@
{% assign ret = "" %}{% assign removed = "false" %}{% for elem in include.array %}{% if elem == include.remove and removed != "true" %}{% assign removed = "true" %}{% continue %}{% endif %}{% assign ret = ret | append: "&" | append: {{elem}} %}{% endfor %}{{ ret | remove_first: "&" }}
10 changes: 10 additions & 0 deletions _includes/array-remove.lqf
@@ -0,0 +1,10 @@
{% assign ret = "" %}
{% assign removed = "false" %}
{% for elem in include.array %}
{% if elem == include.remove and removed != "true" %}
{% assign removed = "true" %}
{% continue %}
{% endif %}
{% assign ret = ret | append: "&" | append: {{elem}} %}
{% endfor %}
{{ ret | remove_first: "&" }}
1 change: 1 addition & 0 deletions _includes/max
@@ -0,0 +1 @@
{{ include.arg1 | append: ',' | append: include.arg2 | split: ',' | sort | last }}
1 change: 1 addition & 0 deletions _includes/max.lqf
@@ -0,0 +1 @@
{{ include.arg1 | append: ',' | append: include.arg2 | split: ',' | sort | last }}
1 change: 1 addition & 0 deletions _includes/min
@@ -0,0 +1 @@
{{ include.arg1 | append: ',' | append: include.arg2 | split: ',' | sort | first }}
1 change: 1 addition & 0 deletions _includes/min.lqf
@@ -0,0 +1 @@
{{ include.arg1 | append: ',' | append: include.arg2 | split: ',' | sort | first }}
1 change: 1 addition & 0 deletions _includes/most-occurences
@@ -0,0 +1 @@
{% assign array = include.array %}{% assign setString = "" %}{% for elem in array %}{% unless setString contains elem %}{% assign setString = setString | append: "&" | append: elem %}{% endunless %}{% endfor %}{% assign set = setString | remove_first: "&" | split: "&" %}{% for x in array %}{% assign removedElements = "" %}{% for elem in set %}{% if array contains elem %}{% capture newArray %}{% include array-remove array=array remove=elem %}{% endcapture %}{% assign array = newArray | split: "&" %}{% assign removedElements = removedElements | append: "&" | append: elem %}{% unless array contains elem %}{% capture newSet %}{% include array-remove array=set remove=elem %}{% endcapture %}{% assign set = newSet | split: "&" %}{% endunless %}{% endif %}{% endfor %}{% assign arraySize = array | size %}{% if arraySize == 0 %}{% break %}{% endif %}{% endfor %}{{ removedElements | remove_first: "&" }}
36 changes: 36 additions & 0 deletions _includes/most-occurences.lqf
@@ -0,0 +1,36 @@
{% comment %}Take the parameters{% endcomment %}
{% assign array = include.array %}

{% comment %}Generate a set out of the array{% endcomment %}
{% assign setString = "" %}
{% for elem in array %}
{% unless setString contains elem %}
{% assign setString = setString | append: '|' | append: elem %}
{% endunless %}
{% endfor %}
{% assign set = setString | remove_first: '|' | split: '|' %}

{% comment %}Remove in the set from the array until no more can be removed{% endcomment %}
{% for x in array %}
{% assign removedElements = "" %}
{% for elem in set %}
{% if array contains elem %}
{% capture newArray %}{% include array-remove array=array remove=elem %}{% endcapture %}
{% assign array = newArray | split: "|" %}
{% assign removedElements = removedElements | append: '|' | append: elem %}
{% unless array contains elem %}
{% capture newSet %}{% include array-remove array=set remove=elem %}{% endcapture %}
{% assign set = newSet | split: "|" %}
{% endunless %}
{% endif %}
{% endfor %}

{% comment %}If the array is now empty, we're done{% endcomment %}
{% assign arraySize = array | size %}
{% if arraySize == 0 %}
{% break %}
{% endif %}
{% endfor %}

{% comment %}Output{% endcomment %}
{{ removedElements | remove_first: "|" }}
10 changes: 10 additions & 0 deletions index.html
@@ -0,0 +1,10 @@
---
---
<html>
<body>
{{site.posts}}
{% for p in site.posts %}
<a href="p.url"><h1>p.url</h1></a>
{% endfor %}
</body>
</html>

0 comments on commit dbd112f

Please sign in to comment.