This file contains hidden or 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
MerbAdmin.config User do | |
label "Users" # @model.pretty_name | |
list do | |
before do | |
puts "Called before list" | |
end | |
fields :name, :description # All columns | |
filters :publication_date, :retired # All booleans |
This file contains hidden or 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 'curb' | |
require 'json' | |
followers_response = Curl::Easy.http_get("http://twitter.com/followers/ids/perpetually.json") | |
followers = JSON.parse(followers_response.body_str) | |
winner_id = followers[rand(followers.length)] | |
users_response = Curl::Easy.http_get("http://twitter.com/users/show/#{winner_id}.json") | |
winner = JSON.parse(users_response.body_str) | |
puts "We have a winner!" |
This file contains hidden or 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 | |
nodes = [] | |
edges = {} | |
ObjectSpace.each_object(Class) do |klass| | |
# Skip classes outside the global namespace | |
next if klass.to_s.include?(':') | |
# Skip classes like ARGF.class | |
next if klass.to_s.include?('.') |
This file contains hidden or 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
$(document).ready(function() { | |
$('img').error(function(){ | |
$(this).attr('src', 'not_found.png'); | |
}); | |
}); |
NewerOlder