Skip to content

Instantly share code, notes, and snippets.

iangreenleaf / lychee_tag.rb
Last active Apr 7, 2021 — forked from tobru/lychee_tag.rb
A Liquid tag for Jekyll sites that allows embedding Lychee albums. See
View lychee_tag.rb
# Connects Jekyll with Lychee (
# # Features
# * Generate album overview and link to image
# * Caching of JSON data
# # Usage
# {% lychee_album <album_id> %}
iangreenleaf /
Last active Jan 8, 2019
Shotwell RAW metadata migrator - rescue your data from Shotwell
# Shotwell RAW metadata migrator
# This software is provided WITHOUT WARRANTY OF ANY KIND
# Shotwell doesn't write metadata to RAW files. This was a problem when I wished to migrate all my data out of Shotwell.
# This script pulls data out of Shotwell's database and writes it to the files using exiftool.
# This is not elegant, performant, or well-tested. However, it seems to get the job done!
iangreenleaf / Gemfile
Last active Jan 25, 2018
Usage example of the Bundler plugin I built for testing with JSON fixtures
View Gemfile
source "test/fixtures/my_rubygems_fixture", type: "json_fixture" do
gem "whatever"
gem "foobar", "~> 1.0.1"
iangreenleaf / npm-troubleshooter
Last active Apr 29, 2016
View npm-troubleshooter
# Guaranteed to fix any and every problem with your npm install!**
# © ️Ian Young 2016
# Usage:
# Simply run the script, passing as arguments the command that is failing.
# Come back in 1-45 minutes to a totally fixed npm install.
<ruleset name="">
<target host="" />
<target host="" />
<rule from="^http:" to="https:" />
View gist:897534a599ba652a5d3d
#= dump database to yaml for fixtures
# originated by elm200 <>
#== install
# move this file to RAILS_ROOT/lib/tasks/extract_fixtures.rake
namespace :db do
View gist:b206d09c587e8fc6399e

Rails naming conventions

General Ruby conventions

Class names are CamelCase.

Methods and variables are snake_case.

Methods with a ? suffix will return a boolean.

View gist:6dfb4d0847ebda0cc3dd
ack -f --print0 | xargs -0 -n1 vim +wq
iangreenleaf /
Created Jan 14, 2015
Keybase identity proof

Keybase proof

I hereby claim:

  • I am iangreenleaf on github.
  • I am iangreenleaf ( on keybase.
  • I have a public key whose fingerprint is 3820 459D 1ADA C0D3 6F33 988E 0D31 6FB4 774E 9147

To claim this, I am signing this object:

iangreenleaf / gist:984bc6765d2a4dc49862
Created May 12, 2014
Import seperate git repo as subdirectory
View gist:984bc6765d2a4dc49862
export target=my_dir
git remote add "$target" file:////path/to/original/repo
git fetch "$target"
git co -b "$target" "$target/master"
# Probably breaks on whitespace, sorry dawg.
git filter-branch -f --tree-filter "mkdir -p \"$target\"; git ls-tree \$GIT_COMMIT --name-only | xargs --no-run-if-empty mv -t $target" "$target"
git co master
git merge "$target"
git remote remove "$target"
git br -d "$target"