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 | |
### BEGIN INIT INFO | |
# Provides: nginx | |
# Required-Start: $all | |
# Required-Stop: $all | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: starts the nginx web server | |
# Description: starts nginx using start-stop-daemon |
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
alias gi="echo is \'gitx\' really that hard to type?; gitx; osascript -e 'tell application \"System Events\" to keystroke \"2\" using command down'" |
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 | |
reminder_location = 'ignored/reminders.txt' | |
file_location = File.join( File.dirname(__FILE__), '..', '..', reminder_location) | |
more_work_needed = IO.readlines(file_location).join('').strip != '' | |
exit 1 if more_work_needed |
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 appendParamsToUrl(url, params){ | |
if(url.match(/\?/)){ | |
//it just has a question mark at the end | |
if(url.indexOf('?') == url.length-1){ | |
return url + jQuery.param(params); | |
}else{ | |
//it already has query params | |
return url + '&' + jQuery.param(params); | |
} | |
}else{ |
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
http://paulbarry.com/articles/2009/08/30/active-record-random | |
class ActiveRecord::Base | |
def self.random | |
if (c = count) > 0 | |
first(:offset => rand(c)) | |
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
# http://optimisdev.com/posts/open-all-conflicted-files-in-textmate | |
git ls-files --unmerged | awk '{print $4}' | sort -u | xargs mate |
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 | |
### BEGIN INIT INFO | |
# Provides: nginx | |
# Required-Start: $all | |
# Required-Stop: $all | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: starts the nginx web server | |
# Description: starts nginx using start-stop-daemon |
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
<html> | |
<head> | |
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.0/jquery.min.js"></script> | |
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script> | |
<script type="text/javascript" src="http://code.google.com/apis/gears/gears_init.js"></script> | |
<script type="text/javascript" src="http://cdn.simplegeo.com/js/1.2/simplegeo.all.jq.min.js"></script> | |
<script type="text/javascript" charset="utf-8"> | |
;var Maps = function(){ |
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
<html> | |
<head> | |
<script type="text/javascript" charset="utf-8"> | |
var FB = function(){ | |
//defaults and accessors | |
var initialized = false, | |
loggedIn = null, | |
shouldSucceed = true, | |
uid = '12345'; |
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
#! | |
ps -e -f | grep `ruby -e 'puts "[#{ARGV[0][0,1]}]#{ARGV[0][1..-1]}"' $*` | awk '{print $2}' | xargs kill -9 |