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
#! /bin/bash | |
case "$1" in | |
'' | -h | --help) | |
NOARGS=1 ;; | |
-d) | |
DRY=1; FIND=$2 ;; | |
*) | |
DRY=0; FIND=$1 ;; | |
esac |
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 bash | |
checkout_dir=$1 | |
from_remote=$2 | |
to_remote=$3 | |
cd $checkout_dir |
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
(defun prettify-json () | |
"NOTE: requires ruby in $PATH. Replace a valid json region with | |
pretty printed json By default uses the jj method to print, | |
uses pp if there is a prefix argument" | |
(interactive) | |
(let* ((print-method (if current-prefix-arg "pp" "jj")) | |
(cmd (format | |
"ruby -e 'require \"json\"; require \"pp\"; %s JSON.parse(gets)'" print-method))) | |
(shell-command-on-region | |
(region-beginning) |
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
Namespaced = {} | |
class Foo | |
constructor: -> | |
@property = 'i am Foo' | |
class Namespaced.Foo | |
constructor: -> |
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
class Foo | |
# always works | |
def read_instance_property | |
bar | |
end | |
# assigns thing, but not Foo instance thing | |
def write_instance_property | |
thing = 'baz' |
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
(defun magit-quick-stash () | |
"Immediately stash with mesage | |
WIP on branchname: short-sha commit-message" | |
(interactive) | |
(magit-stash "")) | |
(add-hook | |
'magit-status-mode-hook | |
(lambda () |
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
;; M-x customize-variable RET magit-default-tracking-name-function RET | |
;; Set "other" to magit-tracking-name-unfucked-with | |
(defun magit-tracking-name-unfucked-with (remote branch) | |
branch) |
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($){ | |
$.collect = function(){ | |
var selector = arguments[0]; | |
var fn = arguments[1]; | |
var arg = arguments[2]; | |
var collected = []; | |
$(selector).each(function(){ | |
value = arg ? $(this)[fn](arg) : $(this)[fn](); | |
collected.push(value); | |
}); |
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
var Differ = function(obj){ | |
this.obj = obj; | |
}; | |
Differ.prototype.cacheVars = function(){ | |
this.cache = {}; | |
for(var prop in this.obj){ | |
this.cache[prop] = this.obj[prop]; | |
} | |
}; |
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
var GlobalVars = function(){}; | |
GlobalVars.prototype.cacheVars = function(){ | |
this.cache = {}; | |
for(var prop in window){ | |
this.cache[prop] = window[prop]; | |
} | |
}; | |
GlobalVars.prototype.diff = function(){ |