Skip to content

Instantly share code, notes, and snippets.

Clone & Build

curl https://gist.github.com/raw/970438/caff9a09ed2d223b1123a69ede17cb19ad352af9/build.sh | sh
@sohooo
sohooo / gist:3267112
Created August 5, 2012 20:59 — forked from g3d/gist:2709563
Clean Install – Mountain Lion OS X 10.8 DP3
@sohooo
sohooo / memorysize_raw.rb
Created February 3, 2012 11:58 — forked from ahpook/memorysize_raw.rb
Custom facter fact for raw memorysize.
# for some reason facter takes the raw memorysize and reports it as
# a formatted string, which is useless for calculation
#
Facter.add("memorysize_raw") do
confine :kernel => :linux
setcode do
size = 0
File.readlines("/proc/meminfo").each do |l|
size = $1.to_f if l =~ /^MemTotal:\s+(\d+)/
@sohooo
sohooo / git-deploy.sh
Created June 5, 2011 07:37
$ git deploy
#!/bin/sh
# Git push then pull over ssh
#
# Supposing you have these environments on the same ssh git remote:
# project/origin.git
# project/dev/.git
# project/prod/.git
#
# You can then push the current branch and pull it in dev/ and prod/ by doing:
# $ git deploy dev
@sohooo
sohooo / Capfile
Created January 24, 2010 10:29 — forked from mig/Capfile
Wordpress Capistrano task
require 'capistrano/version'
load 'deploy'
# Customize the following variables
set :domain, "host.example.com"
set :user, "username"
set :application, "my_wordpress_blog"
set :deploy_to, "/var/www/apps/#{application}"
# These variables probably don't need to change
@sohooo
sohooo / gist:260245
Created December 19, 2009 21:01 — forked from mudge/gist:191473
Sinatra Rack Testing
require 'sinatra_app'
require 'test/unit'
require 'rack/test'
set :environment, :test
class SinatraAppTest < Test::Unit::TestCase
include Rack::Test::Methods
# Make all tests transactional.
@sohooo
sohooo / carbon.md
Created November 15, 2009 19:15 — forked from defunkt/carbon.md
remove evil whitespace

Vim

autocmd BufWritePre * :%s/\s\+$//e

Emacs

(add-hook 'before-save-hook 'delete-trailing-whitespace)

Textmate

@sohooo
sohooo / vhost.sh
Created May 10, 2009 09:04 — forked from trey/vhost.sh
vhost script
#!/bin/sh
ME=soho
DIR=/Users/$ME/Sites/$1
if [ ! -d $DIR ]
then
sudo -u $ME mkdir $DIR
sudo -u $ME touch $DIR/index.php
echo "<h1>$1</h1>" >> $DIR/index.php
fi
@sohooo
sohooo / vhost.sh
Created March 18, 2009 20:17 — forked from trey/vhost.sh
vhosts script
#!/bin/sh
ME=your-username
DIR=/Users/$ME/Sites/$1
if [ ! -d $DIR ]
then
sudo -u $ME mkdir $DIR
sudo -u $ME touch $DIR/index.php
echo "<h1>$1</h1>" >> $DIR/index.php
fi