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
class Hash | |
def dig(*path) | |
path.inject(self) do |location, key| | |
location.is_a?(Hash) ? location[key] : nil | |
end | |
end | |
end |
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($) { | |
$.fn.dwr = function(fn){ | |
return this.each(function() { | |
var $this = $(this); | |
var tmpElement = $('<div/>'); | |
$(this).after(tmpElement); | |
$this.detach(); | |
fn.call(this); | |
tmpElement.replaceWith($this); | |
}); |
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/sh | |
has_console_log=$(git diff --cached | fgrep 'console.log') | |
if [ "$has_console_log" != "" ] | |
then | |
echo "ERROR: You have console.log in your commit. Remove them." | |
exit 1 | |
fi |
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
revision 3 |
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 ChangeSourceImagesCollectionName < Mongoid::Migration | |
def self.up | |
collection = connection.collection('source_images') | |
collection.rename('imagickals') | |
end | |
def self.down | |
collection = connection.collection('imagickals') | |
collection.rename('source_images') | |
end |
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 next-instance-of() | |
"Find next instance of current word." | |
(interactive) | |
(let (myStr) | |
(setq myStr (thing-at-point 'word)) | |
(search-forward myStr) | |
(backward-word) | |
)) | |
(defun previous-instance-of() |
NewerOlder