Skip to content

Instantly share code, notes, and snippets.

@o-sam-o
o-sam-o / .vimrc.local
Created March 19, 2011 07:08
My VIM settings used with Janus
" Disable toolbar
if has("gui_running")
set guioptions=egmrt
endif
color rootwater
set guifont=Monaco:h12
set spell
@o-sam-o
o-sam-o / Shell Commands Cheetsheet
Created March 19, 2011 02:05
Cheatsheet for shell commands that i want to remember
# Setup dir so changes to a ruby version and gemset on entry
rvm --rvmrc --create <ruby>@<gemset>
# Backup a mysql database
mysqldump -u [username] -p [databasename] > [backupfile.sql]
# Stop mac from sleeping
pmset noidle
# Strip quotes around digits in VIM
@o-sam-o
o-sam-o / Check Cookie Cucumber Step
Created February 9, 2011 23:12
Cucumber step for testing if a cookie is set correctly
@o-sam-o
o-sam-o / Act-As-Dag Graph
Created January 31, 2011 01:56
Use GraphViz to construct a diagram of a Rails act as dag relation
desc 'Uses graphviz to construct a graph of SuperCategories'
task :super_category_graph => :environment do
File.open('super_categories.dot', 'w') do |f|
f.puts "digraph super_categories {\n"
SuperCategory.all.each do |super_category|
super_category.children.each do |child|
f.puts %{"#{super_category.name}" -> "#{child.name}";\n}
end
end
f.puts '}'