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
{ | |
"text": "RT @PostGradProblem: In preparation for the NFL lockout, I will be spending twice as much time analyzing my fantasy baseball team during ...", | |
"truncated": true, | |
"in_reply_to_user_id": null, | |
"in_reply_to_status_id": null, | |
"favorited": false, | |
"source": "<a href=\"http://twitter.com/\" rel=\"nofollow\">Twitter for iPhone</a>", | |
"in_reply_to_screen_name": null, | |
"in_reply_to_status_id_str": null, | |
"id_str": "54691802283900928", |
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 'terminal-table/import' | |
array = [[1,2,3,4],[5,6,7,8],[9,10,11,12]] | |
t = table do | |
array.each do |a| | |
add_row a | |
end | |
end | |
puts t |
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
HTTParty | |
nhl videos / goals / hits / players / game results | |
base_uri: video.nhl.com/videocenter | |
get_games_in_month: | |
/highlights | |
xml = 0 | |
month = 4 |
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 simple/configurable rake task that generates some random fake data for the app (using faker) at various sizes | |
# NOTE: requires the faker or ffaker gem | |
# sudo gem install faker - http://faker.rubyforge.org | |
# OR | |
# sudo gem install ffaker - http://github.com/EmmanuelOga/ffaker | |
require 'faker' | |
class Fakeout |
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
// from http://darcyclarke.me/development/library-agnostic-pubsub-publish-subscribe/ | |
App = {}; | |
App.cache = {}; | |
App.publish = function(topic, args){ | |
App.cache[topic] && $.each(App.cache[topic], function(){ | |
this.apply($, args || []); | |
}); | |
}; | |
App.subscribe = function(topic, callback){ |
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
/*! | |
* Bootstrap v2.0.4 | |
* | |
* Copyright 2012 Twitter, Inc | |
* Licensed under the Apache License v2.0 | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Designed and built with all the love in the world @twitter by @mdo and @fat. | |
*/ | |
.clearfix{*zoom:1;}.clearfix:before,.clearfix:after{display:table;content:"";} |
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 'net/http' | |
require 'uri' | |
namespace :airbrake do | |
task :notify, except: {no_release: true} do | |
api_key = API_KEY | |
rails_env = fetch(:rails_env, "production") | |
airbrake_env = fetch(:airbrake_env, fetch(:rails_env, "production")) | |
local_user = ENV['USER'] || ENV['USERNAME'] |
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
# merge sort in ruby | |
class Array | |
def merge_sort | |
if length > 1 | |
halves = split.map do |half| | |
half.merge_sort | |
end | |
combine(*halves) | |
else |
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
<html> | |
<head> | |
</head> | |
<body> | |
<select style="width:300px" id="source"> | |
<optgroup label="Alaskan/Hawaiian Time Zone"> | |
<option value="AK">Alaska</option> | |
<option value="HI">Hawaii</option> | |
</optgroup> | |
<optgroup label="Pacific Time Zone"> |