Skip to content

Instantly share code, notes, and snippets.

#!/bin/sh
#
# init.d script for single or multiple unicorn installations. Expects at least one .conf
# file in /etc/unicorn
#
# Modified by jay@gooby.org http://github.com/jaygooby
# based on http://gist.github.com/308216 by http://github.com/mguterl
#
## A sample /etc/unicorn/my_app.conf
##
#!/bin/sh
#
# init.d script for single or multiple unicorn installations. Expects at least one .conf
# file in /etc/unicorn
#
# Modified by jay@gooby.org http://github.com/jaygooby
# based on http://gist.github.com/308216 by http://github.com/mguterl
#
## A sample /etc/unicorn/my_app.conf
##
#!/bin/sh
#
# init.d script for single or multiple unicorn installations. Expects at least one .conf
# file in /etc/unicorn
#
# Modified by jay@gooby.org http://github.com/jaygooby
# based on http://gist.github.com/308216 by http://github.com/mguterl
#
## A sample /etc/unicorn/my_app.conf
##
#!/bin/bash
### BEGIN INIT INFO
# Provides: APPLICATION
# Required-Start: $all
# Required-Stop: $network $local_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start the APPLICATION unicorns at boot
# Description: Enable APPLICATION at boot time.
### END INIT INFO
$:.unshift(File.expand_path('./lib', ENV['rvm_path'])) # Add RVM's lib directory to the load path.
require 'rvm/capistrano' # Load RVM's capistrano plugin.
require 'bundler/capistrano'
require 'whenever/capistrano'
set :application, 'application_name'
set :base_path, '/u/apps'
default_run_options[:pty] = true
set :scm, :git
@agirorn
agirorn / cucumber_step_that_needs_to_run_slowly.rv
Created August 29, 2011 18:51
Control the speed of Capybara Selenium from the cucumber
When /^I drag a tree node somewhere that results in a lot of ajax calls$/ do
tree_node = page.find('#tree_node_1')
drop_spot = page.find('#drop_spot')
delay_capybara do
tree_node.drag_to(drop_spot)
end
end
@agirorn
agirorn / jQueryEvents.rb
Created September 7, 2011 11:28
Trigger change event in Capybara
module JQueryEventsHelpers
def trigger_change(jQuerySelector)
script = "$('#{jQuerySelector}').trigger('change');"
page.execute_script(script);
end
end
World(JQueryEventsHelpers)
@agirorn
agirorn / active_model_lint.rb
Created October 31, 2012 17:21
ActiveModel::Lint for RSpec without loading Rails
# hijacked from :http://library.edgecase.com/activemodel-lint-test-for-rspeca
#
# Usage:
#
# describe SomeModelClass do
# it_should_behave_like "ActiveModel" do
# let(:model) { SomeModelClass.new }
# end
# end
@agirorn
agirorn / .gitignore
Last active August 29, 2015 14:19 — forked from karmi/.gitignore
.DS_Store
tmp/
@agirorn
agirorn / fix-shrinkwrap.sh
Created January 27, 2016 14:15
Fix your shrinkwrap file
npm cache clean; \
rm -Rf node_modules; \
rm npm-shrinkwrap.json; \
npm install; \
rm -Rf node_modules; \
npm install; \
npm shrinkwrap;