Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@bjhess
bjhess / st_cheat.txt
Created January 11, 2012 21:39
Sublime Text Cheatsheet
Navigation:
cmd-p Goto Anything ('@' for functions, ':' for line number)
cmd-r Function finder
ctl-g Goto line number
cmd-sft-p Command palette
cmd-sft-f Find in Files
cmd-opt-r Toggle regex when finding
cmd-opt-# Columns
ctr-# Switch columns
@bjhess
bjhess / aliases
Created December 19, 2011 01:04
git diff'n
# side by side diff
alias gside="git difftool -t opendiff"
# resolve merge conflicts with filemerge
alias gmergetool="git mergetool -t opendiff"
Mac Mini:
http://minneapolis.craigslist.org/dak/sys/2597426604.html
BenQ 24" monitor:
http://minneapolis.craigslist.org/dak/sys/2597456508.html
Dell 18" monitor:
@bjhess
bjhess / action_methods.rb
Created June 17, 2011 14:12
WTH do I get all of these `_conditional_callback` methods when I use an `around_filter`? Rails 3.0.6
> UsersController.action_methods
=> #<Set: {"new", "_conditional_callback_around_36", "edit", "forgot_password", "_conditional_callback_around_60", "_conditional_callback_around_49", "_conditional_callback_around_27", "_conditional_callback_around_50", "_conditional_callback_around_39", "delete_avatar", "_conditional_callback_around_30", "show", "raw", "activate", "_conditional_callback_around_65", "create", "_conditional_callback_around_55", "_conditional_callback_around_33", "update", "_conditional_callback_around_44"}>
> UsersController.action_methods
=> #<Set: {"new", "_conditional_callback_around_36", "edit", "forgot_password", "_conditional_callback_around_60", "_conditional_callback_around_49", "_conditional_callback_around_27", "_conditional_callback_around_50", "_conditional_callback_around_39", "delete_avatar", "_conditional_callback_around_30", "show", "raw", "activate", "_conditional_callback_around_65", "create", "_conditional_callback_around_55", "_conditional_callback_around_33", "update", "_conditional_callback_around_44"}>
@bjhess
bjhess / xero-partner-oauth-plain.rb
Created June 16, 2011 15:21
Getting Xero Partner app to work on a Mac (from Xero)
require 'rubygems'
require 'oauth'
require 'oauth/signature/rsa/sha1'
class SSLConsumer < OAuth::Consumer
def initialize *args
@ssl = {}
super
end
<!DOCTYPE HTML>
<html>
<head>
<style type="text/css">
html, body { height:100%; margin: 0 auto; }
body { display: table; vertical-align: middle; }
.column { display:table-cell; vertical-align: middle; }
p { text-align: center; }
</style>
</head>
~ $ which rvm
/Users/barry/.rvm/bin/rvm
~ $ sudo gem uninstall rvm
Password:
Select gem to uninstall:
1. rvm-0.1.47
2. rvm-1.0.20
3. rvm-1.0.21
4. rvm-1.0.19
[Mon, 08 Nov 2010 13:34:19 -0600] INFO: Setting the run_list to ["homebrew", "homebrew::dbs", "homebrew::misc", "ruby", "ruby::irbrc", "node", "python"] from JSON
[Mon, 08 Nov 2010 13:34:19 -0600] INFO: Starting Chef Run (Version 0.9.12)
[Mon, 08 Nov 2010 13:34:19 -0600] INFO: Ran script[install_something] successfully
[Mon, 08 Nov 2010 13:34:19 -0600] INFO: Ran execute[include cinderella environment into defaults for ~/.zshrc] successfully
[Mon, 08 Nov 2010 13:34:19 -0600] INFO: Installing homebrew[git] version 1.7.3.2
[Mon, 08 Nov 2010 13:34:20 -0600] INFO: Ran script[updating homebrew from github] successfully
[Mon, 08 Nov 2010 13:34:21 -0600] INFO: Installing homebrew_db[redis] version 2.0.4
[Mon, 08 Nov 2010 13:34:21 -0600] INFO: Configuring redis to automatically start on login
[Mon, 08 Nov 2010 13:34:22 -0600] INFO: Installing homebrew_db[mongodb] version 1.6.3-x86_64
[Mon, 08 Nov 2010 13:34:22 -0600] INFO: Configuring mongodb to automatically start on login
~ $ cinderella
[Mon, 08 Nov 2010 13:04:35 -0600] INFO: Setting the run_list to ["homebrew", "homebrew::dbs", "homebrew::misc", "ruby", "ruby::irbrc", "node", "python"] from JSON
[Mon, 08 Nov 2010 13:04:35 -0600] INFO: Starting Chef Run (Version 0.9.12)
[Mon, 08 Nov 2010 13:04:35 -0600] ERROR: Running exception handlers
[Mon, 08 Nov 2010 13:04:35 -0600] ERROR: Exception handlers complete
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/tempfile.rb:167:in `close': closed stream (IOError)
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/tempfile.rb:167:in `callback'
~ $ cinderella
[Mon, 08 Nov 2010 13:04:43 -0600] INFO: Setting the run_list to ["homebrew", "homebrew::dbs", "homebrew::misc", "ruby", "ruby::irbrc", "node", "python"] from JSON
[Mon, 08 Nov 2010 13:04:43 -0600] INFO: Starting Chef Run (Version 0.9.12)