Skip to content

Instantly share code, notes, and snippets.

View fredkelly's full-sized avatar

Freddy Kelly fredkelly

View GitHub Profile
### Keybase proof
I hereby claim:
* I am fredkelly on github.
* I am fredkelly (https://keybase.io/fredkelly) on keybase.
* I have a public key whose fingerprint is C136 6714 3B16 C5A5 2AB8 7CB6 3F46 C1D7 7087 503A
To claim this, I am signing this object:
@fredkelly
fredkelly / a16z_your_name.rb
Created November 4, 2015 10:28
"Andreessen Horowitz" => "A16z" etc.
def a16z_your_name(name)
(h, *m, t) = name.gsub(/\s/,'').split(//)
[h, m.size, t].join
end
@fredkelly
fredkelly / navigation.html
Last active April 19, 2018 13:38
Generating a nested navigation in Jekyll with Liquid
{% assign pages = site.html_pages | where: 'visible', true | where_exp: 'page', 'page.url contains include.context' | group_by: 'dir' %}
<ul>
{% for group in pages %}
{% if group.size > 1 and group.name != include.context %}
<li class="{% if page.url contains group.name %}active{% endif %}">
<span>{{ group.name | replace: '/', '' | capitalize }}</span>
{% include navigation.html context=group.name %}
</li>
{% else %}
{% for item in group.items %}