Skip to content

Instantly share code, notes, and snippets.

View steveclarke's full-sized avatar

Steve Clarke steveclarke

View GitHub Profile
worker_processes Integer(ENV["WEB_CONCURRENCY"] || 3)
timeout 15
preload_app true
before_fork do |server, worker|
Signal.trap 'TERM' do
puts 'Unicorn master intercepting TERM and sending myself QUIT instead'
Process.kill 'QUIT', Process.pid
end
@steveclarke
steveclarke / jsbin.sodav.css
Created February 12, 2014 00:07
Company / Jobs
body {
font-family: arial;
}
source :rubygems
# We are not loading Active Record, nor Active Resources etc.
# We can do this in any app by simply replacing the rails gem
# by the parts we want to use.
gem "actionpack", "~> 4.0"
gem "railties", "~> 4.0"
gem "tzinfo"
# Let's use thin
box: wercker/ubuntu12.04-ruby1.9.3
services:
- wercker/postgresql
build:
# The steps that will be executed on build
steps:
- script:
name: Enable virtual display
code: |-
# Start xvfb which gives the context an virtual display
@steveclarke
steveclarke / cinst.bat
Last active August 29, 2015 14:01 — forked from beakr/cinst.bat
cinst GoogleChrome
cinst 7zip
cinst git.install
cinst putty
cinst ruby
cinst ruby.devkit
cinst RubyMine
cinst SourceTree
@steveclarke
steveclarke / rename.sh
Created November 30, 2011 21:57
Iteratively rename files in Bash
for f in *.rhtml; do git mv $f `basename $f rhtml`html.erb; done
@steveclarke
steveclarke / gist:1411340
Created November 30, 2011 22:17
Useful shell script functions to pretty things up
pretty_echo(){
echo '--------------------------------'
echo " $*"
echo '--------------------------------'
echo ''
}
prompt(){
read -p 'Press any key to continue...'
}
@steveclarke
steveclarke / delay.js
Created December 1, 2011 01:08
jQuery Tips
// When you’re queuing up a chain of animations, you can use the delay()
// method to pause the animation for a length of time; pass that time as
// a parameter in milliseconds.
$('div').hide().delay(2000).show(); // div will stay hidden for 2 seconds before showing.
@steveclarke
steveclarke / application.rb
Created December 1, 2011 01:18
Rails Configuration Howto
moduleConfigurator
classApplication < Rails::Application
# By default, let OSX resolve the path to the binary
config.wkhtmltopdf = "wkhtmltopdf"
end
end
@steveclarke
steveclarke / errors.html.erb
Created December 1, 2011 01:19
Error messages for object
<% if @obj.errors.any? %>
<div class="error-messages">
<h2><%= pluralize(@obj.errors.count, 'error') %> are preventing this object from being created:</h2>
<ul>
<% @obj.errors.full_messages.each do |message| %>
<li><%= message %></li>
<% end %>
</ul>
</div>