Skip to content

Instantly share code, notes, and snippets.

template(:factorylabs_shoulda) do
gem 'mislav-will_paginate'
gem 'mocha'
gem 'thoughtbot-factory_girl'
gem 'thoughtbot-shoulda'
gem 'quietbacktrace'
plugin 'hoptoad_notifier', :git => 'git://github.com/thoughtbot/hoptoad_notifier.git'
plugin 'migration_concordance', :git => 'git://github.com/joshsusser/migration_concordance.git'
plugin 'factory_utils', :svn => 'https://svn.factorylabs.com/repos/interactive/Library/AppDev/rails/plugins/factory_utils/trunk'
# http://gist.github.com/10524
# Prevents autotest from running your entire test suite after fixing a failed test.
# Works with ZenTest 3.10.0
# Place this in your .autotest file and run autotest with RERUN=false to disable running the entire test suite
if ENV['RERUN'] == 'false'
require 'rubygems'
require 'active_support'
Nokogiri::XML(resource["4165/stories?limit=10&filter=state%3Astarted"].get).xpath('//story').collect do |story|
{
:name => story.at('name'),
:owner => story.at('owned_by'),
:created_at => story.at('created_at'),
:description => story.at('description'),
:url => story.at('url'),
:type => story.at('story_type')
:notes => story.at('notes').collect { |note| { :note => { :text => note.at('text').content, :created_at => note.at('noted_at').content } } } unless story.at('notes').nil?
Capistrano::Configuration.instance(:must_exist).load do
task :ssh do
role = (ENV['ROLE'] || :app).to_sym
servers = find_servers :roles => role
server = servers.first
if server
`echo '#{password}' | /usr/bin/pbcopy`
exec "/usr/bin/ssh #{user}@#{server.host} -p #{server.port || 22} "
end
end
#!/bin/sh
git filter-branch --env-filter '
an="$GIT_AUTHOR_NAME"
am="$GIT_AUTHOR_EMAIL"
cn="$GIT_COMMITTER_NAME"
cm="$GIT_COMMITTER_EMAIL"
if [ "$GIT_COMMITTER_EMAIL" = "jayzeschin@0c2636a8-f7e4-4949-a4be-0920dbe5b3d6" ]
@jayzes
jayzes / bootstrap-chef-client-osx.sh
Created January 19, 2011 19:54
commands to bootstrap chef-client on ubuntu and osx
# Run with bash < <( curl https://gist.github.com/raw/786735/bootstrap-chef-client-osx.sh )
# Switch to system Ruby
if [ -s "$HOME/.rvm/scripts/rvm" ]; then
rvm use system
fi
sudo gem install chef --no-ri --no-rdoc
sudo mkdir -p /etc/chef
sudo scp interactive@chef.factorylabs.com:/etc/chef/validation.pem /etc/chef/validation.pem
@jayzes
jayzes / Procfile
Created May 26, 2011 20:59
Thinking Sphinx and Foreman
sphinx: bundle exec rake ts:run_in_foreground
<script>
//Get any tickets from view 22567988, outage Tickets that are currently open.
new Ajax.Request('/rules/22567988', {
method:'get',
asynchronous: true,
onSuccess: function(transport){
var obj = transport.responseText.evalJSON();
$('active-views').innerHTML = '<p>' + obj.length + ' current service outage.'
+ ' First outage is '
+ obj[0].subject + '</p>'
@jayzes
jayzes / .cook
Created July 6, 2011 17:14
Cookfile
{
"imagemagick": {"ghostscript": true},
"redis": {"launchd": true},
"rvm": {"rubies": ["1.9.2", "ree", "rbx"]},
"basic_brew": {
"formulae": [
"android-sdk",
"wget" ] },
"cookbooks": ["https://github.com/gvarela/osx-cookbooks/tarball/master", "https://github.com/gvarela/osx-cookbooks-ext/tarball/master"],
"recipes": [
@jayzes
jayzes / config.ru
Created September 30, 2011 23:56
Sprockets/Compass Madness
require 'rubygems'
require "bundler/setup"
require 'rack'
require 'sprockets'
require 'sprockets-sass'
require 'compass'
map '/assets' do