Skip to content

Instantly share code, notes, and snippets.

Steps to install and run PostgreSQL 9.2 using Homebrew (Mac OS X)
(if you aren't using version 9.1.5, change line 6 with the correct version)
1. pg_ctl -D /usr/local/var/postgres stop -s -m fast
2. mv /usr/local/var/postgres /usr/local/var/postgres91
3. curl https://raw.github.com/fragility/homebrew/737af01178590950749cf5e841f2d086c57c5a80/Library/Formula/postgresql.rb > /usr/local/Library/Formula/postgresql.rb
4. brew upgrade postgresql
5. initdb /usr/local/var/postgres -E utf8
6. pg_upgrade -b /usr/local/Cellar/postgresql/9.1.5/bin -B /usr/local/Cellar/postgresql/9.2.0/bin -d /usr/local/var/postgres91 -D /usr/local/var/postgres
7. pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start
@jwang
jwang / gist:3363574
Created August 15, 2012 20:54 — forked from ambar/gist:1534274
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
if (typeof (AC) === "undefined") {
AC = {}
}
AC.ImageReplacer = Class.create({
_defaultOptions: {
listenToSwapView: true,
filenameRegex: /(.*)(\.[a-z]{3}($|#.*|\?.*))/i,
filenameInsert: "_☃x",
ignoreCheck: /(^http:\/\/movies\.apple\.com\/|\/105\/|\/global\/elements\/quicktime\/|_(([2-9]|[1-9][0-9]+)x|nohires)(\.[a-z]{3})($|#.*|\?.*))/i,
attribute: "data-hires",
@jwang
jwang / contact.html
Created February 21, 2012 23:35
contact snippet
<script type="text/javascript">var host = (("https:" == document.location.protocol) ? "https://secure." : "http://");document.write(unescape("%3Cscript src='" + host + "wufoo.com/scripts/embed/form.js' type='text/javascript'%3E%3C/script%3E"));</script>
<script type="text/javascript">
var m7x3s5 = new WufooForm();
m7x3s5.initialize({
'userName':'aloharubyconf',
'formHash':'m7x3s5',
'autoResize':true,
'height':'738',
'header':'show'});
@jwang
jwang / wufoo.html
Created January 28, 2012 17:54
embed code
<script type="text/javascript">var host = (("https:" == document.location.protocol) ? "https://secure." : "http://");document.write(unescape("%3Cscript src='" + host + "wufoo.com/scripts/embed/form.js' type='text/javascript'%3E%3C/script%3E"));</script>
<script type="text/javascript">
var z7x3k1 = new WufooForm();
z7x3k1.initialize({
'userName':'aloharubyconf',
'formHash':'z7x3k1',
'autoResize':true,
'height':'1557',
'header':'show'});
@jwang
jwang / .zshrc
Created January 24, 2012 05:11
zshrc
. ~/bin/dotfiles/zsh/config
. ~/bin/dotfiles/zsh/aliases
. ~/bin/dotfiles/zsh/env
@jwang
jwang / gist:1394868
Created November 26, 2011 02:48
Jasmine Sproutcore Stacktrace from Chrome Developer Tools
TypeError: Object #<Object> has no method 'registerDependentKeyWithChain'
at [object Object].activate (http://localhost:4020/static/sproutcore/runtime/en/current/javascript.js?1321949495:9222:17)
at [object Object]._clonePropertyChainToItem (http://localhost:4020/static/sproutcore/runtime/en/current/javascript.js?1321949495:6841:11)
at [object Object].<anonymous> (http://localhost:4020/static/sproutcore/runtime/en/current/javascript.js?1321949495:6789:16)
at [object Object].forEach (http://localhost:4020/static/sproutcore/runtime/en/current/javascript.js?1321949495:7902:43)
at [object Object].setupEnumerablePropertyChains (http://localhost:4020/static/sproutcore/runtime/en/current/javascript.js?1321949495:6782:14)
at [object Object]._scac_arrayContentDidChange (http://localhost:4020/static/sproutcore/core_foundation/en/current/javascript.js?1321949495:883:10)
at Array.arrayContentDidChange (http://localhost:4020/static/sproutcore/runtime/en/current/javascript.js?1321949495:6680:16)
@jwang
jwang / make.log
Created November 6, 2011 21:28
CC=/usr/bin/gcc-4.2 rvm install ruby-1.8.7 --force
[2011-11-06 11:22:04] make
clang -arch x86_64 -g -Os -pipe -no-cpp-precomp -fno-common -pipe -fno-common -DRUBY_EXPORT -I. -I. -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -c array.c
clang: warning: argument unused during compilation: '-no-cpp-precomp'
clang -arch x86_64 -g -Os -pipe -no-cpp-precomp -fno-common -pipe -fno-common -DRUBY_EXPORT -I. -I. -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -c bignum.c
clang: warning: argument unused during compilation: '-no-cpp-precomp'
clang -arch x86_64 -g -Os -pipe -no-cpp-precomp -fno-common -pipe -fno-common -DRUBY_EXPORT -I. -I. -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -c class.c
clang: warning: argument unused during compilation: '-no-cpp-precomp'
clang -arch x86_64 -g -Os -pipe -no-cpp-precomp -fno-common -pipe -fno-common -DRUBY_EXPORT -I. -I. -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -c compar.c
clang: warning: argument unused during compilation: '-no-cpp-precomp'
clang -arch x86_64 -g -Os -pipe -no-cpp-precomp -fno-common -pipe -fno-common -DRUBY_EXPORT -
@jwang
jwang / env.rb
Created September 8, 2011 08:11 — forked from bmabey/env.rb
how to get spork working for cucumber in a rails app
require 'rubygems'
require 'spork'
Spork.prefork do
# Sets up the Rails environment for Cucumber
ENV["RAILS_ENV"] ||= "cucumber"
require File.expand_path(File.dirname(__FILE__) + '/../../config/environment')
require 'webrat'
@jwang
jwang / Sorl Cell Dependencies List
Created September 5, 2011 23:50
Sorl Cell Dependencies List
apache-solr-cell-1.4.1.jar
asm-3.1.jar
bcmail-jdk14-136.jar
bcprov-jdk14-136.jar
commons-codec-1.3.jar
commons-compress-1.0.jar
commons-io-1.4.jar
commons-lang-2.1.jar
commons-logging-1.1.1.jar
dom4j-1.6.1.jar