Skip to content

Instantly share code, notes, and snippets.

@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')
@napcs
napcs / .vimrc
Last active December 14, 2022 17:40
Set up Vim on Mac, Linux, or Windows. For Mac and Linux: sh <(curl -s https://gist.githubusercontent.com/napcs/532968/raw/vim.sh)
if has('win32') || has ('win64')
let $VIMHOME = $HOME."/Dropbox/dotfiles/.vim"
if !empty($CONEMUBUILD)
set term=xterm
set t_Co=256
let &t_AB="\e[48;5;%dm"
let &t_AF="\e[38;5;%dm"
endif
@uasi
uasi / vim.rb
Created November 30, 2010 16:46
Vim formula for Homebrew (EDIT: recent versions of official Homebrew distribution includes one)
require 'formula'
class Vim < Formula
homepage 'http://www.vim.org/'
url 'ftp://ftp.vim.org/pub/vim/unix/vim-7.3.tar.bz2'
head 'https://vim.googlecode.com/hg/'
sha256 '5c5d5d6e07f1bbc49b6fe3906ff8a7e39b049928b68195b38e3e3d347100221d'
version '7.3.682'
def features; %w(tiny small normal big huge) end
@unicornrainbow
unicornrainbow / remove_project_trailing_whitespace.sh
Created January 27, 2011 16:17
A shell function to auto remove whitespace from an entire rails project in one shot.
remove_project_trailing_whitespace () {
for file in * (app|config|test|lib|public)/**/*.(rb|js|sass|css|yml|md|txt|erb|haml|config)
do
sed -i "" 's/[[:space:]]*$//' ${file}
sed -i "" -e :a -e '/^\n*$/N;/\n$/ba' ${file}
done
}
@jondkinney
jondkinney / gist:828864
Created February 16, 2011 04:22
PreSonus UC Cleanup
on run {input, parameters}
-- Setup the list of the main files to be deleted
set searchList to {¬
POSIX file ("/Applications/Universal Control.app") as text, ¬
POSIX file ("/Applications/FireStudio Control Console.app") as text, ¬
POSIX file ("/Applications/FireControl.app") as text, ¬
POSIX file ("/Applications/FireStudio Lightpipe Mixer.app") as text, ¬
POSIX file ("/Applications/StudioLive.app") as text, ¬
POSIX file ("/Library/Application Support/PaeFireStudio") as text, ¬
@JohnPlummer
JohnPlummer / .gvimrc
Created May 16, 2011 10:15
NerdTree Janus Fix
autocmd WinEnter * call s:CloseIfOnlyNerdTreeLeft()
" Close all open buffers on entering a window if the only
" buffer that's left is the NERDTree buffer
function s:CloseIfOnlyNerdTreeLeft()
if exists("t:NERDTreeBufName")
if bufwinnr(t:NERDTreeBufName) != -1
if winnr("$") == 1
q
endif
@jraines
jraines / rails31init.md
Created May 24, 2011 17:03
Rails 3.1 with Rspec, Cucumber, Factory Girl, Haml, and Simple Form

Install Rails 3.1 RC

gem install rails --pre

generate new app, skipping Test::Unit file generation

rails new my_app -T

Set up Gemfile

@joshsusser
joshsusser / gist:998055
Created May 29, 2011 19:20
turn off 255 limit for string fields in postgresql
# in rails application.rb
initializer "postgresql.no_default_string_limit" do
ActiveSupport.on_load(:active_record) do
ActiveRecord::ConnectionAdapters::PostgreSQLAdapter::NATIVE_DATABASE_TYPES[:string].delete(:limit)
end
end
@somebox
somebox / gh-like.css
Created July 14, 2011 14:55
github markdown css+script with syntax highlighting. Works with http://markedapp.com
/*
Some simple Github-like styles, with syntax highlighting CSS via Pygments.
*/
body{
font-family: helvetica, arial, freesans, clean, sans-serif;
color: #333;
background-color: #fff;
border: none;
line-height: 1.5;
margin: 2em 3em;
@andyfowler
andyfowler / .vimrc
Created September 5, 2011 18:08
Swap iTerm2 cursors in vim insert mode when using tmux
" tmux will only forward escape sequences to the terminal if surrounded by a DCS sequence
" http://sourceforge.net/mailarchive/forum.php?thread_name=AANLkTinkbdoZ8eNR1X2UobLTeww1jFrvfJxTMfKSq-L%2B%40mail.gmail.com&forum_name=tmux-users
if exists('$TMUX')
let &t_SI = "\<Esc>Ptmux;\<Esc>\<Esc>]50;CursorShape=1\x7\<Esc>\\"
let &t_EI = "\<Esc>Ptmux;\<Esc>\<Esc>]50;CursorShape=0\x7\<Esc>\\"
else
let &t_SI = "\<Esc>]50;CursorShape=1\x7"
let &t_EI = "\<Esc>]50;CursorShape=0\x7"
endif