This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DISABLE_PRY_RAILS=1 rails console |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set nocompatible " We are using Vim | |
syntax on | |
set colorcolumn=80 | |
set ruler | |
hi StatusLine ctermfg=0 ctermbg=3 cterm=bold " Window highlighting | |
hi StatusLineNC ctermfg=white ctermbg=4 cterm=none | |
hi Folded ctermfg=244 ctermbg=0 cterm=none " Code folding highlight |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set nocompatible " We are using Vim | |
syntax on | |
set colorcolumn=80 | |
set ruler | |
hi StatusLine ctermfg=0 ctermbg=3 cterm=bold " Window highlighting | |
hi StatusLineNC ctermfg=0 ctermbg=238 cterm=none | |
hi Folded ctermfg=244 ctermbg=0 cterm=none " Code folding highlight |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rack/test' | |
browser = Rack::Test::Session.new(Rack::MockSession.new(Fooproject::Application)) | |
browser.get("/posts.json") | |
browser.post("/posts.json", {:id => 1}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# For an R dataframe that has a column of email | |
# addresses, e.g. joe@example.com, return just | |
# the domain name | |
sapply(strsplit(my.df$email, "@"), "[", 2) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CONTENT_TYPES = {:html => 'text/html', :css => 'text/css', :js => 'application/javascript'} | |
before do | |
request_uri = case request.env['REQUEST_URI'] | |
when /\.css$/ : :css | |
when /\.js$/ : :js | |
else :html | |
end | |
content_type CONTENT_TYPES[request_uri], :charset => 'utf-8' | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Regexp.new(%w[ www www3 ].collect { |p| Regexp.escape(p) }.join('|')) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git log --oneline -1 | newrelic deployments -c |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rvm get latest | |
rvm package install readline | |
rvm install 1.9.2 --with-readline-dir=$rvm_path/usr | |
rvm 1.9.2 --default | |
gem install rails | |
bundle install |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'typhoeus' | |
require 'ap' | |
begin | |
request = Typhoeus::Easy.new | |
request.url = "http://www.google.com" | |
request.max_redirects = 2 | |
request.verbose = 1 | |
request.method = :get |