Skip to content

Instantly share code, notes, and snippets.

brew install git
git config --global alias.st status
git config --global alias.ci commit
git config --global alias.co checkout
git config --global alias.br branch
git config --global user.name "First Last"
git config --global user.email [email protected]
git config --global color.branch auto
git config --global color.diff auto
git config --global color.interactive auto
~$ ARCHFLAGS='-arch i386 -arch x86_64'
~$ rvm install 1.8.7 --debug --reconfigure -C --enable-shared=yes
~$ wget http://sourceforge.net/projects/rubycocoa/files/RubyCocoa/1.0.0/RubyCocoa-1.0.0.tar.gz/download
~$ tar xzf RubyCocoa-1.0.0.tar.gz && rm RubyCocoa-1.0.0.tar.gz && cd RubyCocoa-1.0.0
~/RubyCocoa-1.0.0$ ruby install.rb config --build-universal=yes
~/RubyCocoa-1.0.0$ ruby install.rb setup
~/RubyCocoa-1.0.0$ sudo ruby install.rb install
@hchoroomi
hchoroomi / gist:304703
Created February 15, 2010 15:01 — forked from wayneeseguin/gist:296055
rails3, rvm
This example shows how to setup an environment running Rails 3 beta under 1.9.1 with a 'rails3' gem set.
∴ rvm update --head
# ((Open a new shell))
# If you do not already have the ruby interpreter installed, install it:
∴ rvm install 1.9.1
# Use the ruby + gem set
∴ rvm 1.9.1%rails3
@hchoroomi
hchoroomi / convert.rb
Created February 19, 2010 16:08 — forked from look/convert.rb
# Convert a Gemfile to Heroku's .gems file plus config.gem statements for Rails 2.3
herokuconfig = ""
railsconfig = ""
gemfile = File.new("Gemfile")
gemfile.readlines.each do |line|
if line =~ /gem ['"](\w+)['"](?:, ['"](.+?)['"]){0,1}(?:, :require => ['"](.+?)['"]){0,1}/
herokuconfig << "#{$1}" + ($2 ? %Q( --version "#{$2}") : '') + "\n"
railsconfig << "config.gem '#{$1}'" + ($2 ? ", :version => '#{$2}'" : '') + ($3 ? ", :lib => '#{$3}'" : '') + "\n"
// An Unobtrusive Javascript (UJS) driver based on explicit behavior definitions. Just
// put a "data-behaviors" attribute on your view elements, and then assign callbacks
// for those named behaviors via Behaviors.add.
var Behaviors = {
add: function(trigger, behavior, handler) {
document.observe(trigger, function(event) {
var element = event.findElement("*[data-behaviors~=" + behavior + "]");
if (element) handler(element, event);
});
# multi git user...
function iam() {
rm ~/.gitconfig
rm ~/.ssh/id_rsa
rm ~/.ssh/id_rsa.pub
ln -s ~/.dotfiles/git/$1.gitconfig ~/.gitconfig
ln -s ~/.ssh/$1/id_rsa.pub ~/.ssh/id_rsa.pub
ln -s ~/.ssh/$1/id_rsa ~/.ssh/id_rsa
}
require 'etc'
require 'campfire'
namespace :notify do
desc 'Alert Campfire of a deploy'
task :campfire do
branch_name = branch.split('/', 2).last
deployer = Etc.getlogin
deployed = `curl -s http://github.com/site/sha`[0,7]
deploying = `git rev-parse HEAD`[0,7]
# stolen from http://github.com/cschneid/irclogger/blob/master/lib/partials.rb
# and made a lot more robust by me
# this implementation uses erb by default. if you want to use any other template mechanism
# then replace `erb` on line 13 and line 17 with `haml` or whatever
module Sinatra::Partials
def partial(template, *args)
template_array = template.to_s.split('/')
template = template_array[0..-2].join('/') + "/_#{template_array[-1]}"
options = args.last.is_a?(Hash) ? args.pop : {}
options.merge!(:layout => false)

Gist Clients

Want to create a Gist from your editor, the command line, or the Services menu? Here's how.

Editor Support

# create /etc/default/god file:
GOD_CONFIG=/path/to/god.conf
####
# create /etc/init.d/god file:
#!/bin/sh