autocmd BufWritePre * :%s/\s\+$//e
(add-hook 'before-save-hook 'delete-trailing-whitespace)
#!/usr/bin/env ruby | |
# Usage: | |
# gpick http://github.com/cmelbye/github-services/commit/4f1559a82c9aa710baa3497f913ed3d9a666ced7 | |
if ARGV[0] =~ /github\.com\/([^\/]+)\/.+\/commit\/(.+)/ | |
user = $1 | |
sha = $2 | |
exec "hub remote add -f #$1 && git cherry-pick #$2" | |
else | |
abort "Usage: gpick http://github.com/user/repo/commit/sha" |
config.action_mailer.smtp_settings = { | |
:address => "mail.authsmtp.com", | |
:domain => "famspam.com", | |
:port => 2525, | |
:user_name => "user", | |
:password => "pass", | |
:authentication => :cram_md5 | |
} |
# by bryan helmkamp with slight modification by chris wanstrath | |
# from http://www.brynary.com/2008/8/3/our-git-deployment-workflow | |
module GitCommands | |
extend self | |
def diff_staging | |
`git fetch` | |
puts `git diff origin/production origin/staging` | |
end |
"""A small wrapper file for parsing rST files at Github.""" | |
__author__ = "Jannis Leidel" | |
__copyright__ = "Copyright (C) 2008 Jannis Leidel" | |
__license__ = "Public Domain" | |
__version__ = "0.1" | |
try: | |
import locale | |
locale.setlocale(locale.LC_ALL, '') |
# version 2.0 of http://ozmm.org/posts/easy_rails_asset_ids_with_git.html | |
repo = Grit::Repo.new('/path/to/your/app/shared/cached-copy') | |
js = repo.log('deploy', 'public/javascripts', :max_count => 1).first | |
css = repo.log('deploy', 'public/stylesheets', :max_count => 1).first | |
ENV['RAILS_ASSET_ID'] = js.committed_date > css.committed_date ? js.id : css.id |
# deploy to staging from your current topic branch, with ease | |
set :branch, "origin/#{`git branch`.scan(/^\* (\S+)/)}" |
rails_root = "/data/github/current" | |
20.times do |num| | |
God.watch do |w| | |
w.name = "dj-#{num}" | |
w.group = 'dj' | |
w.interval = 30.seconds | |
w.start = "rake -f #{rails_root}/Rakefile production jobs:work" | |
w.uid = 'git' |
# my new favorite bashrc function | |
# quickly inspect source files in style | |
function pless { | |
pygmentize $1 | less -r | |
} | |
set :normal_symlinks, %w( | |
config/solr.yml | |
config/memcached.yml | |
config/database.yml | |
config/mongrel_cluster.yml | |
) | |
set :weird_symlinks, { | |
'network_data_cache' => 'tmp/network_data_cache', | |
'impact_data_cache' => 'tmp/impact_data_cache', |