Skip to content

Instantly share code, notes, and snippets.

/**
* Override or insert variables into the node templates.
*
* @param $vars
* An array of variables to pass to the theme template.
* @param $hook
* The name of the template being rendered ("node" in this case.)
*/
function YOURTHEME_preprocess_node(&$vars, $hook) {
require 'autotest/growl'
require 'autotest/fsevent'
Autotest.add_hook :initialize do |at|
unless ARGV.empty?
at.find_directories = ARGV.dup
end
end
if ENV['AUTOTEST'] and not ENV['AUTOTEST'].empty?
describe "#all_projects" do
before(:each) do
@user = Factory(:user)
@owned_project = Factory(:project, :owner => @user)
@project_user1 = Factory(:project_user, :user => @user)
@project_user2 = Factory(:project_user, :user => @user)
end
it "should return two projects" do
@user.all_projects.count.should == 3
describe "Answer.for_parent_slug" do
before(:each) do
site = Factory(:site)
@page = Factory(:page)
@page2 = Factory(:page)
@answer = Factory(:answer, :parent_slug => @page.slug, :question => "Question 1", :site_id => site.id)
@answer2 = Factory(:answer, :parent_slug => @page2.slug, :question => "Question 2", :site_id => site.id)
end
@mwise
mwise / ag.vim
Last active December 14, 2015 09:59
backbone snippets
" NOTE: You must, of course, install the ag script
" in your path.
" On Debian / Ubuntu:
" sudo apt-get install ag-grep
" On your vimrc:
" let g:agprg="ag-grep -H --nocolor --nogroup --column"
"
" With MacPorts:
" sudo port install p5-app-ag
source ~/.bin/git-prompt.sh
# Colors from http://wiki.archlinux.org/index.php/Color_Bash_Prompt # misc
NO_COLOR='\e[0m' #disable any colors # regular colors
BLACK='\e[0;30m'
RED='\e[0;31m'
GREEN='\e[0;32m'
YELLOW='\e[0;33m'
BLUE='\e[0;34m'
MAGENTA='\e[0;35m'
nnoremap <leader>ls :OpenSpecInSplit<cr>
nnoremap <leader>FF :ToggleCurrentDescribeFocus<cr>
nnoremap <leader>FA :FocusCurrentDescribe<cr>
nnoremap <leader>FD :UnFocusCurrentDescribe<cr>
fun! OpenSpecInSplit()
let file = expand('%:p')
if match(file, "app/") >= 0
if match(file, "assets/javascripts") >= 0
nnoremap <leader>ls :OpenSpecInSplit<cr>
fun! OpenFilesInSplit(left, right)
if a:left == a:right
return
endif
only
exec "edit " . a:left
exec "vs " . a:right
guard 'spork', :rspec_env => { 'RAILS_ENV' => 'test' } do
watch('config/application.rb')
watch('config/environment.rb')
watch('config/environments/test.rb')
watch(%r{^config/initializers/.+\.rb$})
watch('Gemfile')
watch('Gemfile.lock')
watch('spec/spec_helper.rb') { :rspec }
watch(%r{^spec/factories/.+\.rb$})
end
- (void) midiSource:(PGMidiSource*)midi midiReceived:(const MIDIPacketList *)packetList