Skip to content

Instantly share code, notes, and snippets.

# Variation on Hashrocket's script for managing the git process
# as documented here: http://reinh.com/blog/2008/08/27/hack-and-and-ship.html
# Create shell scripts out of each of these, put them in your path (~/bin for example)
# chmod 755 them and use like this:
#
# This version of hack is totally different than Hackrockets. I feel that hack implies
# that you are getting started, not finishing up. sink is Hashrockets hack.
#
# $ hack branch_name
# Test and Implement until done
@ozeias
ozeias / spawn-fcgi.sh
Created January 15, 2009 12:49
starts FastCGI for PHP using start-stop-daemon
## railsbox.org:~ ozeias$ vim /etc/init.d/spawn-fcgi
#! /bin/sh
### BEGIN INIT INFO
# Provides: nginx
# Required-Start: $all
# Required-Stop: $all
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: starts FastCGI for PHP
@ozeias
ozeias / pre-commit
Created April 18, 2016 00:06 — forked from tmaiaroto/pre-commit
A Go Commit Hook for Less Future Headaches
#!/bin/bash
#
# Check a "few" things to help write more maintainable Go code.
#
# OK, it's fairly comprehensive. So simply remove or comment out
# anything you don't want.
#
# Don't forget to install (go get) each of these tools.
# More info at the URLs provided.
#
@ozeias
ozeias / capybara-helpers.rb
Created October 2, 2012 19:09 — forked from ntreadway/capybara-helpers.rb
Capybara helpers
def set_mobile_agent
page.driver.header('User-Agent', 'iPhone')
end
def js_click(selector)
page.driver.execute_script "$('##{selector}').click()"
end
def screenshot
require 'capybara/util/save_and_open_page'
@ozeias
ozeias / unicorn.rb
Created May 16, 2012 11:21 — forked from jamiew/unicorn.rb
Unicorn config for use with bundler and capistrano - fixes issues with environment pollution.rb
# My pimped out unicorn config, with incremental killof
# and all the latest capistrano & bundler-proofing
# @jamiew :: http://github.com/jamiew
application = "000000book.com"
environment = ENV['RACK_ENV'] || ENV['RAILS_ENV'] || 'production'
app_path = "/srv/#{application}"
bundle_path = "#{app_path}/shared/bundle"
timeout 30
@ozeias
ozeias / settings.json
Created November 21, 2011 23:03 — forked from JeanMertz/syntax_highlighting.py
Ruby on Rails syntax highlight switcher for Sublime Text 2 #Packages/User
{
// "color_scheme": "Packages/Color Scheme - Default/Monokai Bright.tmTheme",
"color_scheme": "Packages/Color Scheme - Default/Twilight.tmTheme",
"detect_indentation": true,
"ensure_newline_at_eof_on_save": true,
"find_selected_text": true,
//"font_face": "inconsolata",
//"font_face": "consolas",
//"font_face": "mensch",
"font_face": "monaco",
def tip(msg); puts; puts msg; puts "-"*100; end
#
# 30 Ruby 1.9 Tips, Tricks & Features:
# http://www.igvita.com/2011/02/03/new-ruby-19-features-tips-tricks/
#
tip "Upgrading to Ruby 1.9 is simple: rvm install 1.9.2 && rvm --default 1.9.2"
tip "Ruby 1.9 supports named captures in regular expressions!"
We couldn’t find that file to show.
ActionView::Base.field_error_proc = Proc.new { |html_tag, instance| %[<span class="fieldWithError">#{html_tag}</span>] }
RAILS_ROOT ||= ENV["RAILS_ROOT"]
namespace :bundle do
task :all => [ :js, :gist_js, :css ]
task :js do
require 'lib/js_minimizer'
paths = []
paths += Dir[RAILS_ROOT + '/public/javascripts/jquery.*.js'].sort
paths += Dir[RAILS_ROOT + '/public/javascripts/github.*.js'].sort