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
# Add to .profile to run bin/rake if it's present | |
function rake() { | |
if [ -e bin/rake ]; then | |
bin/rake $* | |
else | |
`which rake` $* | |
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
(defun tell-terminal (commands) | |
"Use osascript to tell Terminal.app to do stuff" | |
(interactive) | |
(shell-command | |
(concat | |
"osascript" | |
(mapconcat | |
'(lambda (command) (concat " -e 'tell application \"Terminal\" " | |
command "'")) | |
commands "")))) |
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
require 'web' | |
urls = { | |
'/', 'index', | |
'/users', 'users', | |
'/user/(\d+)', 'user', | |
'/users/new', 'new_user', | |
'/user/(\d+)/edit', 'edit_user' | |
} | |
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
du -sk . * | perl -e '$sum=<>; | |
while (<>) { | |
($size, $inode)=split; | |
chop $size; | |
printf("%30s | %5d | %2.2f%%\n",$inode,$size,$size/$sum*1000); | |
}' | sort -rn -k 3 | head | |
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> | |
<script type="text/javascript"> | |
$(function() { | |
<%= yield :jquery %> | |
}); | |
</script> | |
..... | |
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
diff --git a/lib/merb-core/bootloader.rb b/lib/merb-core/bootloader.rb | |
index 5853c1a..fd15c31 100644 | |
--- a/lib/merb-core/bootloader.rb | |
+++ b/lib/merb-core/bootloader.rb | |
@@ -9,7 +9,6 @@ module Merb | |
self.subclasses, self.after_load_callbacks, self.before_load_callbacks, self.finished = [], [], [], [] | |
class << self | |
- | |
# Adds the inheriting class to the list of subclasses in a position |
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
# Michael Ivey's RPS entry | |
# Implements the TenutaRSB strategy, named for former | |
# Georgia Tech defensive coordinator John Tenuta | |
class JohnTenutaRSBBot | |
attr_accessor :their_plays | |
attr_accessor :do_debugging | |
def initialize | |
@their_plays = Hash.new(0) |
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
def following | |
@following ||= twitter.friends_for(uid, :list_only => true) | |
end | |
def followers | |
@followers ||= twitter.followers_for(uid, :list_only => true) | |
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
def following_pages | |
twitter_user.friends_count.to_i / 100 + 1 | |
end | |
def following | |
return @following if @following | |
@following = [] | |
1.upto(following_pages) do |i| | |
@following += twitter.friends_for(uid, :page => i, :lite => true) | |
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
testing gist | |
omg this rocks |
NewerOlder