Skip to content

Instantly share code, notes, and snippets.

testing gist
omg this rocks
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
def following
@following ||= twitter.friends_for(uid, :list_only => true)
end
def followers
@followers ||= twitter.followers_for(uid, :list_only => true)
end
# 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)
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
<html>
<script type="text/javascript">
$(function() {
<%= yield :jquery %>
});
</script>
.....
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
@ivey
ivey / myapp.rb
Created September 12, 2008 01:14
require 'web'
urls = {
'/', 'index',
'/users', 'users',
'/user/(\d+)', 'user',
'/users/new', 'new_user',
'/user/(\d+)/edit', 'edit_user'
}
@ivey
ivey / terminal-here.el
Created September 17, 2008 21:14
emacs lisp function to open a Terminal.app window in default-directory
(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 ""))))
# Add to .profile to run bin/rake if it's present
function rake() {
if [ -e bin/rake ]; then
bin/rake $*
else
`which rake` $*
fi
}