Skip to content

Instantly share code, notes, and snippets.

@jordelver
jordelver / gist:6b436fb90f42d17bf7ce
Last active April 8, 2018 02:01
How to install RestfulGit locally

How to install RestfulGit locally

This works on my Mac, YMMV :-/

Install

Clone the repo

git clone git@github.com:hulu/restfulgit.git

What to put in ActiveRecord classes

Validations and relationships

Normal validations

  • Favour putting these into a Form Object once it becomes anything but the simplest example

Regular relationships (has_many, belongs_to etc)

Mutation

#!/bin/sh
for dotfile in *; do
source="$PWD/$dotfile"
target="$HOME/.$dotfile"
if [[ "$dotfile" != "README" && "$dotfile" != "install.sh" ]]; then
ln -s "$source" "$target"
fi
done
@jordelver
jordelver / gist:8863630
Created February 7, 2014 14:33
Middleman - Disable directory indexes for individual page

Middleman - Disable directory indexes for individual page

Add directory_index: false to the frontmatter of your page

--
directory_index: false
--
namespace :assets do
task :precompile do
sh 'middleman build'
end
end
@jordelver
jordelver / Gemfile
Created January 21, 2014 09:21
Middleman config
# If you have OpenSSL installed, we recommend updating
# the following line to use "https"
source 'https://rubygems.org'
ruby "2.1.0"
gem "middleman", "~> 3.1.0"
gem "middleman-blog"
gem "middleman-livereload"
gem "middleman-syntax"
@jordelver
jordelver / gist:8402408
Last active January 3, 2016 03:29
Learning Go
@jordelver
jordelver / gist:8355554
Last active January 2, 2016 20:19
Git - Fix master if something goes wrong
@jordelver
jordelver / gist:8350917
Last active January 2, 2016 19:29
How to clean up branches on GitHub

How to clean up branches on GitHub

Delete un-needed branches

I do this from the GitHub interface.

https://github.com/<account>/<repo>/branches?merged=1

Remove references to remotes

@jordelver
jordelver / gist:6610926
Created September 18, 2013 15:30
Prune remote tracking branches

Prune remote tracking branches

git remote prune --dry-run origin

Remove --dry-run to make it happen.