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
graph = {} | |
ObjectSpace.each_object(Class) do |klass| | |
sup = klass.superclass and graph[klass] = sup | |
end | |
puts "digraph{" | |
graph.map do |key, value| | |
puts %("#{key}"\n"#{key}"->"#{value}") | |
end | |
puts"}" |
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
class Square < Rectangle | |
def initialize(side) | |
@side = side | |
end | |
def height | |
@side | |
end |
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
class CreateUsers < ActiveRecord::Migration | |
def change | |
create_table :users do |t| | |
t.string :name | |
t.timestamps | |
end | |
end | |
end |
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
search_id | rank | property_id | price | |
---|---|---|---|---|
3 | 1 | 8011 | 3787 | |
4 | 1 | 326 | 752 | |
5 | 1 | 7973 | 780 | |
5 | 2 | 87 | 13580 | |
5 | 3 | 5265 | 19920 | |
6 | 1 | 5981 | 8349 | |
7 | 1 | 5814 | 6585 | |
9 | 1 | 3942 | 14780 | |
10 | 1 | 6925 | 11286 |
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
# [X] length/size | |
# [X] push | |
# [X] [] (slice) | |
# [X] pop | |
# [X] first | |
# [X] last | |
# [X] shift | |
# [X] unshift | |
# [X] each | |
# [X] select/reject/collect/inject |
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
a = 1 # one | |
b = a - 1 # zero | |
(b..a).include?(a) #=> true | |
(b..a).include?(a.to_f) #=> true | |
(b..a).include?(0.5) #=> true | |
a = DateTime.now # now | |
b = a - 1 # 24 hours ago | |
(b..a).include?(a) #=> true | |
(b..a).include?(a.to_date) #=> false |
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
var server = require('http').createServer(serveFile); | |
var fs = require('fs'); | |
var ntwitter = require("ntwitter"); | |
var io = require('socket.io').listen(server); | |
function serveFile(request, response){ | |
fs.readFile(__dirname + '/index.html', function(error, data){ | |
if(error) { | |
response.writeHead(404, {'Content-Type': 'text/html'}); | |
response.write("<html><body>No drank for you!</body></html>"); |
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
var ntwitter = require("ntwitter"); | |
var client = new ntwitter({ | |
consumer_key: process.env["TWITTER_CONSUMER_KEY"], | |
consumer_secret: process.env["TWITTER_CONSUMER_SECRET"], | |
access_token_key: process.env["TWITTER_ACCESS_TOKEN"], | |
access_token_secret: process.env["TWITTER_ACCESS_SECRET"] | |
}); | |
var coffee, tea, wine, beer, water; |
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
var fortunes = [ | |
"Have a nice day", | |
"You look really good today", | |
"It's your birthday!", | |
"Never play leapfrog with a unicorn" | |
]; | |
var net = require('net'); | |
var server = net.createServer(function(connection){ | |
connection.write("Enter the number of fortunes you want: "); |
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
/Users/sferik/.rbenv/versions/2.0.0-p195/bin/ruby -S rspec ./spec/twitter/action/favorite_spec.rb ./spec/twitter/action/follow_spec.rb ./spec/twitter/action/list_member_added_spec.rb ./spec/twitter/action/mention_spec.rb ./spec/twitter/action/reply_spec.rb ./spec/twitter/action/retweet_spec.rb ./spec/twitter/action_factory_spec.rb ./spec/twitter/action_spec.rb ./spec/twitter/api/direct_messages_spec.rb ./spec/twitter/api/favorites_spec.rb ./spec/twitter/api/friends_and_followers_spec.rb ./spec/twitter/api/geo_spec.rb ./spec/twitter/api/help_spec.rb ./spec/twitter/api/lists_spec.rb ./spec/twitter/api/oauth_spec.rb ./spec/twitter/api/saved_searches_spec.rb ./spec/twitter/api/search_spec.rb ./spec/twitter/api/spam_reporting_spec.rb ./spec/twitter/api/suggested_users_spec.rb ./spec/twitter/api/timelines_spec.rb ./spec/twitter/api/trends_spec.rb ./spec/twitter/api/tweets_spec.rb ./spec/twitter/api/undocumented_spec.rb ./spec/twitter/api/users_spec.rb ./spec/twitter/base_spec.rb ./spec/twitter/basic_user_spec.rb ./ |