Skip to content

Instantly share code, notes, and snippets.

@rentalcustard
rentalcustard / 01_readme.markdown
Created October 25, 2010 11:20
Fix tmux bootstrap

The author of this patch is 'toby' from the MacPorts project, and the original commit containing this diff can be found at https://trac.macports.org/changeset/58563. The trac ticket prompting the commit (and with additional context) is at https://trac.macports.org/ticket/18357.

Toby, if you're reading this, apologies for not attributing the gist originally; I put this up quickly while experimenting with tmux under Leopard and abandoned it when it didn't solve the problem at hand. It's only fair now that other people are looking at the gist to give you credit.

screen -t root 0 su -
screen -t shell 1 zsh
screen -t vim 2 vim
@rentalcustard
rentalcustard / gist:662328
Created November 4, 2010 10:54
Checkout state of code at last cap deploy to production.
#!/bin/bash
#Checkout source as at last prod deploy
tag=$(git tag | grep deploy-prod | tail -1)
git checkout $tag
$ launchctl limit maxfiles 1000000 1000000
$ launchctl limit
cpu unlimited unlimited
filesize unlimited unlimited
data 6291456 unlimited
stack 8388608 67104768
core 0 unlimited
rss unlimited unlimited
memlock unlimited unlimited
maxproc 266 532
#RSpec Mocks...
it "does something with a collaborator" do
#Given
collab = mock(:collab)
it.collaborator = collab
#Then
collab.should_receive(:call).with(3)
#When
#RSpec Mocks...
it "does something with a collaborator" do
#Given
collab = mock(:collab)
it.collaborator = collab
#Then
collab.should_receive(:call).with(3)
#When
#RSpec Mocks...
it "does something with a collaborator" do
#Given
collab = mock(:collab)
it.collaborator = collab
#Then
collab.should_receive(:call).with(3)
#When
@rentalcustard
rentalcustard / gist:789781
Created January 21, 2011 14:59
Hudson + RVM wierdness?

via a login shell:

deploy@jgp-dev01:~$ cat test.sh
which bundle
deploy@jgp-dev01:~$ /usr/local/bin/rvm-shell test.sh 
/usr/local/rvm/gems/ruby-1.8.7-p330@ci/bin/bundle

via hudson:

[workspace] $ /usr/local/bin/rvm-shell 1.8.7@ci /tmp/hudson8555917946525882045.sh

class String
def replace_line_break
return String.new if self.nil?
return_str = String.new
return_str = self.gsub(/[\x0D|\x0A]/,'<br />')
return return_str
end
end
source 'http://rubygems.org'
gem 'aasm', '2.2.0'
gem 'activeresource', '2.3.11'
gem 'activesupport', '2.3.11'
gem 'acts-as-taggable-on', '2.0.6'
gem 'block_helpers', '0.3.3'
gem 'coderay', '0.9.7'
gem 'fcgi', '0.8.8'
gem 'hoe', '2.9.1'