Skip to content

Instantly share code, notes, and snippets.

View armandocanals's full-sized avatar
🦢
Build

Armando Canals armandocanals

🦢
Build
View GitHub Profile
@mshafrir
mshafrir / states_hash.json
Created May 9, 2012 17:05
US states in JSON form
{
"AL": "Alabama",
"AK": "Alaska",
"AS": "American Samoa",
"AZ": "Arizona",
"AR": "Arkansas",
"CA": "California",
"CO": "Colorado",
"CT": "Connecticut",
"DE": "Delaware",
@ggilder
ggilder / stub_method_chain.rb
Created January 17, 2012 23:05
Stub class or instance methods on anything!
class Object
def metaclass
class << self; self; end
end
def self.stub_method_chain chain, &blk
chain = chain.split('.') if chain.is_a? String
metaclass.instance_eval do
define_method chain.first do |*values|
Object.new.tap do |o|
@spicycode
spicycode / tmux.conf
Created September 20, 2011 16:43
The best and greatest tmux.conf ever
# 0 is too far from ` ;)
set -g base-index 1
# Automatically set window title
set-window-option -g automatic-rename on
set-option -g set-titles on
#set -g default-terminal screen-256color
set -g status-keys vi
set -g history-limit 10000
@rstacruz
rstacruz / 0.md
Created September 6, 2011 06:12
JST support for Sinatra

JST Support for Sinatra

Usage

class App < Sinatra::Base
  register 'sinatra/jstsupport'
  serve_jst '/jst.js'
end

This serves all JST files found in /views/**/*.jst.* as /jst.js.

@jurisgalang
jurisgalang / gist:663353
Created November 4, 2010 23:00
Gitisms - useful git invocations for everyday use.
# get the name of the currently checked out tag
git describe --tags --abbrev=0
# list all branches (local and remote)
git branch -a
# list all tags
git tag
# delete a tag
@zhengjia
zhengjia / capybara cheat sheet
Created June 7, 2010 01:35
capybara cheat sheet
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')