This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function! Command_T_Local() "Go to the root of the git repo, then CommandT | |
"Ask git for the root of the git repo (as a relative '../../' path) | |
let git_top = system('git rev-parse --show-cdup') | |
let git_fail = 'fatal: Not a git repository' | |
if strpart(git_top, 0, strlen(git_fail)) == git_fail | |
" Above line says we are not in git repo. Ugly. Better version? | |
call Command_T_Work() | |
else | |
" Move working dir to root of repo, then CommandT | |
execute ":cd ./" . git_top |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function git_show_deleted_file { | |
# Rev-list command gets commit that deleted the file, ^ gets prior commit | |
git show $(git rev-list -n 1 HEAD -- $1)^:$1 | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import readline | |
readline.parse_and_bind("tab: complete") | |
class VolcabCompleter: | |
def __init__(self,volcab): | |
self.volcab = volcab | |
def complete(self,text,state): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Install git http://docs.webfaction.com/software/git.html#git-install-home | |
# Install vim <current-version> using techniques above, ie wget, configure, make, make install | |
echo 'alias python=python2.6' > ~/.bash_profile # Set default python => 2.6 | |
easy_install-2.5 -s ~/bin -d ~/lib/python2.5 python-dateutil # Get dateutil, also, general python module | |
http://docs.webfaction.com/software/git.html#git-install-home | |
import sys.path |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// From Douglas Crockford's http://javascript.crockford.com/remedial.html | |
// | |
// Usage: | |
// var person = { name: "James", age: 22 }; | |
// var template = "Hello {name}, how does it feel to be {age}?"; | |
// var personalGreeting = template.subs(person); | |
// => "Hello James, how does it feel to be 22?" | |
if (!String.prototype.subs) { | |
String.prototype.subs = function (o) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Copy the id_rsa.pub public key from local box to remote server | |
user@hostname "echo `cat ~/.ssh/id_rsa.pub` >> ~/.ssh/authorized_keys" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// usage: log('inside coolFunc',this,arguments); | |
// http://paulirish.com/2009/log-a-lightweight-wrapper-for-consolelog/ | |
window.log = function(){ | |
log.history = log.history || []; // store logs to an array for reference | |
log.history.push(arguments); | |
if(this.console){ | |
console.log( Array.prototype.slice.call(arguments) ); | |
} | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# List all symlinks in current directory | |
lns() { | |
find ./ -type l -maxdepth 1 | awk '{ sub(/.\/+/, ""); print }' | |
} | |
# List broken symlinks under current directory | |
lnsm() { | |
find -L ./ -type l -maxdepth 1 | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# | |
# A quick script to dump an overview of all the open issues in all my github projects | |
# | |
require 'octokit' | |
require 'awesome_print' | |
require 'rainbow' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Object literal code organization pattern. From Rebecca Murphy's blog: | |
// http://blog.rebeccamurphey.com/2009/10/15/using-objects-to-organize-your-code | |
var myModule = { | |
'config' : { | |
'option1' = val, | |
'cached_elem' = $(this) | |
}, | |
'init' : function(config) { | |
// provide for custom configuration via init() |
OlderNewer