This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Monkeypatch Devise so HTTP Basic auth remembers you! | |
# config/initializers/devise_http_rememberable.rb | |
# Try 1... | |
module Devise | |
module Hooks | |
module Rememberable | |
def remember_me? | |
STDERR.puts "******* Devise::Hooks::Rememberable.remember_me?" | |
true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
CORE_PATH="/Library/Application Support/TextMate/Bundles/" | |
USER_PATH="/Users/$(whoami)/Library/Application Support/TextMate/Bundles/" | |
echo "Updating core TextMate bundles..." | |
cd "${CORE_PATH}" | |
#svn up *.tmbundle | |
svn up |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ENV['RAILS_ENV'] = ENV['RACK_ENV'] | |
require "config/environment" | |
use Rails::Rack::LogTailer | |
use Rails::Rack::Static | |
use Rack::ProcTitle | |
run ActionController::Dispatcher.new |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'mechanize' | |
$agent = Mechanize.new | |
$agent.user_agent = "car_shopping.rb 001" | |
cars = [] | |
def cars_from_url(url) | |
page = $agent.get(url) | |
(page/'.vehicleInfoColumn').map{|x| |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
parse_git_branch() { | |
ref=$(git symbolic-ref -q HEAD 2> /dev/null) || return | |
printf "${1:-(%s)}" "${ref#refs/heads/}" | |
} | |
parse_svn_revision() { | |
local DIRTY REV=$(svn info 2>/dev/null | grep Revision | sed -e 's/Revision: //') | |
[ "$REV" ] || return | |
[ "$(svn st)" ] && DIRTY=' *' | |
echo "(r$REV$DIRTY)" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[user] | |
name = Jamie Wilkinson | |
email = [email protected] | |
[github] | |
user = jamiew | |
token = <REDACTED> | |
[apply] | |
whitespace = nowarn | |
[branch] | |
autosetuprebase = always |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if [ -z $1 ]; then | |
echo STDERR "Usage: $0 [branchname]" | |
exit 1 | |
fi | |
echo "Creating local+remote git branch: $1" | |
git push origin origin:refs/heads/$1 | |
git fetch origin | |
git checkout -b $1 --track origin/$1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# *replaces* the deploy user's crontab with config/crontab.txt | |
# only does this on the *primary* :app server | |
role :app, "website.com", :primary => true | |
after "deploy:symlink", "deploy:crontab" | |
namespace :deploy do | |
desc "Install crontab" | |
task :crontab, :roles => :app, :only=>{:primary => true} do |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# capistrano deployment | |
require "bundler/capistrano" | |
require "capistrano/ext/multistage" | |
set :stages, %w(canary production) | |
set :default_stage, "canary" | |
set :application, "lolcats" | |
set :deploy_to, "/srv/#{application}" |