Skip to content

Instantly share code, notes, and snippets.

#!/bin/sh
#
# Will append the current Lighthouse ticket number to the commit message automatically
# when you use the 1234-foo-bar branch naming convention.
#
# Drop into .git/hooks/commit-msg
# chmod +x .git/hooks/commit-msg
exec < /dev/tty
@miketierney
miketierney / gist:69768
Created February 24, 2009 20:36 — forked from loe/gist:69444
class Group < ActiveRecord::Base
belongs_to :location
validates_presence_of :name, :location_id
def self.sort(page, order)
options = {}
if order == 'location'
options[:order] = 'location_id'
#!/bin/sh
#
# Will append the current Lighthouse ticket number to the commit message automatically
# when you use the 1234-foo-bar branch naming convention.
#
# Drop into .git/hooks/commit-msg
# chmod +x .git/hooks/commit-msg
exec < /dev/tty
# Copyright (c) 1993-1999 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# put this in ~/.bash_profile or whatever
ruby_or_irb () {
if [ "$1" == "" ]; then
irb
else
ruby "$@"
fi
}
alias ruby="ruby_or_irb"

Poor Man's Deploy

  • Start a Sinatra server on port 4000
  • GET / to that server triggers a git pull and mod_rails restart
  • Hit port 4000 locally after pushing

Why?

##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting. Do not change this entry.
##
127.0.0.1 localhost db001 db002 db003 db004 web030 web048
255.255.255.255 broadcasthost
::1 localhost
fe80::1%lo0 localhost
(?xi)
\b
( # Capture 1: entire matched URL
(?:
[a-z][\w-]+: # URL protocol and colon
(?:
/{1,3} # 1-3 slashes
| # or
[a-z0-9%] # Single letter or digit or '%'
# (Trying not to match e.g. "URI::Escape")
[alias]
up = !sh -c 'git pull && git log --pretty=format:\"%Cred%ae %Creset- %C(yellow)%s %Creset(%ar)\" HEAD@{1}..'
// Run via OS X Terminal.app to block junk tweets in Tweetie.
// Info: http://atebits.posterous.com/test-filtering-in-tweetie-for-mac
defaults write com.atebits.tweetie-mac filterTerms -array "@gowalla" "http://gowal.la" "@foursquare" "http://4sq.com"