Skip to content

Instantly share code, notes, and snippets.

name "production.site.com"
run_list [ "role[general]", "role[app-production-site-com]", "role[app-production-appraiser-site-com]" ]
#!/bin/sh
HUDSON_URL="http://127.0.0.1:8081"
run_build () {
JOB_NAME=$1
echo "Run Hudson build for $JOB_NAME application"
curl "$HUDSON_URL/job/$JOB_NAME/build?delay=10sec"
}
while read rev_old rev_new ref; do
#!/usr/bin/env ruby
def parse_chunk(chunk)
remove_start_line, add_start_line = chunk.scan(/@@ -(\d+),\d+ \+(\d+),\d+/).flatten.map { |line| line.to_i }
{ :removed => chunk.grep(/^[- ]/),
:added => chunk.grep(/^[+ ]/),
:remove_start_line => remove_start_line,
:add_start_line => add_start_line }
end
def parse_chunks(file_diff)
@timcharper
timcharper / inf-ruby.el
Created July 3, 2010 22:28
Tim's refactoring of ruby-send-region, which overcomes issue where new local variables would not persist past an evaluation.
;;; inf-ruby.el --- Run a ruby process in a buffer
;; Copyright (C) 1999-2008 Yukihiro Matsumoto, Nobuyoshi Nakada
;; Authors: Yukihiro Matsumoto, Nobuyoshi Nakada, Tim Harper
;; URL: http://www.emacswiki.org/cgi-bin/wiki/RubyMode
;; Created: 8 April 1998
;; Keywords: languages ruby
;; Version: 2.1
;; Package-Requires: ((ruby-mode "1.1"))
@timcharper
timcharper / .irbrc
Created July 7, 2010 04:09
.irbrc snippet for loading Bond
begin
require 'bond'
Bond.start
puts "Bond activated"
rescue LoadError
IRB.conf[:LOAD_MODULES] ||= []
IRB.conf[:LOAD_MODULES] << 'irb/completion' unless IRB.conf[:LOAD_MODULES].include?('irb/completion')
end
@timcharper
timcharper / console
Created July 9, 2010 06:08
script/console that loads your .irbrc before activating bundler
#!/usr/bin/env ruby
require "irb"
load "#{ENV['HOME']}/.irbrc"
def IRB.run_config; end
ARGV.unshift "console"
load File.dirname(__FILE__) + "/rails"
@timcharper
timcharper / em
Created July 14, 2010 19:03
Ruby-debug command to open a file in emacs using emacsclient
#!/bin/sh
osascript -e 'tell application "Emacs" to activate'
while true; do
emacsclient -n "$@" 2> /dev/null 1> /dev/null
if [ $? == 0 ]; then
break
else
printf .
sleep 1
fi
(eval-after-load "org-mode"
'(defadvice org-insert-item (before org-insert-item-autocheckbox activate)
(save-excursion
(when (org-at-item-p)
(org-beginning-of-item)
(when (org-at-item-checkbox-p)
(ad-set-args 0 '(checkbox)))))))
;;; vimpulse-surround.el --- emulates surround.vim, for vimpulse -*- coding: utf-8 -*-
;; Copyright (C) 2010 Tim Harper
;;
;; Author: Tim Harper
;; Maintainer: Tim Harper <timcharper at gmail dat com>
;; Please send bug reports to the mailing list (see below).
;; Created: July 23 2010
;; Version: 0.1+git
;; Keywords: emulations, viper
(add-to-list 'load-path "~/.emacs.d/elpa-to-submit/vimpulse")
(require 'vimpulse)
(setq viper-inhibit-startup-message 't)
(setq viper-expert-level '5)
(viper-mode)
;; My custom stuff!
(global-set-key (kbd "s-j") 'viper-intercept-ESC-key)