Skip to content

Instantly share code, notes, and snippets.

View guillec's full-sized avatar

Guille Carlos guillec

View GitHub Profile
# ME
tmux -S /tmp/pair
chmod 777 /tmp/pair
# Partner
tmux -S /tmp/pair attach
@csexton
csexton / jbuilder.rb
Created March 14, 2014 04:35
Extend the jbuilder api to support JSON API conventions
class Jbuilder
def links! model, *args
args.each do |arg|
if model.reflections[arg].collection?
_set_value arg, model.send(arg).map(&:id)
else
_set_value arg, model.send(arg).id
end
end
end

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

@jpmckinney
jpmckinney / tz_identifiers_to_rails_identifiers.rb
Created January 5, 2011 21:44
Maps tz database time zone identifiers to Rails time zone identifiers
# blog post: http://blog.slashpoundbang.com/post/2613268281/changing-from-tz-database-identifiers-to-rails-friendly
{
"Australia/Adelaide" => "Adelaide",
"Australia/Broken_Hill" => "Adelaide",
"America/Anchorage" => "Alaska",
"America/Juneau" => "Alaska",
"America/Nome" => "Alaska",
"America/Yakutat" => "Alaska",
"Pacific/Gambier" => "Alaska",
"Asia/Almaty" => "Almaty",