Skip to content

Instantly share code, notes, and snippets.

<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 / Procfile
Created May 26, 2011 20:59
Thinking Sphinx and Foreman
sphinx: bundle exec rake ts:run_in_foreground
@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 [email protected]:/etc/chef/validation.pem /etc/chef/validation.pem
#!/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" ]
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
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?
# 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'
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'