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 'yaml' | |
require 'twitter' | |
class TwitterOutput | |
def initialize | |
@client = client | |
end | |
def client | |
creds = YAML.load_file('creds.yml').values.first |
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 'rubygems' | |
require 'mechanize' | |
require 'google_drive' | |
agent = Mechanize.new | |
@base_url = "https://www.baltimorecitibuy.org" | |
page = agent.get("#{@base_url}/bso/external/publicContracts.sdo") | |
page.css('td[class="inputs-01"][align="center"]').first.text[/ of (\d+)/] | |
item_count = $1.to_i | |
puts "item 1 of #{item_count}" |
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
import XCTest | |
@testable import NewApp | |
class FRCTests: CoreDataTestCase, NSFetchedResultsControllerDelegate { | |
var expectedProperties: [String:AnyObject]? = nil | |
var changeExpectation: XCTestExpectation? | |
var deleteExpectation: XCTestExpectation? | |
var insertExpectation: XCTestExpectation? |
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
import XCTest | |
import TLIndexPathTools | |
@testable import NewApp | |
class TLToolsTests: CoreDataTestCase, TLIndexPathControllerDelegate { | |
var expectedProperties: [String:AnyObject]? = nil | |
var changeExpectation: XCTestExpectation? |
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 'rubygems' | |
require 'youtube_search' # https://github.com/grosser/youtube_search | |
require 'youtube_dl' # https://github.com/tonic20/youtube_dl | |
FFMPEG = "/usr/local/bin/ffmpeg" | |
res = YoutubeSearch.search('music|song|musicians|performance|instruments', :author => 'TEDxTalks', :per_page => 50, 'orderby' => 'viewCount') | |
res.each do |r| | |
puts "https://www.youtube.com/watch?v=#{r['video_id']} <#{r['title']}>" | |
youtube = YoutubeDl::YoutubeVideo.new("http://www.youtube.com/watch?v=#{r['video_id']}", :location => './video') |
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
s/Wheather/Weather | |
s/anything more powerful then Gödel/anything more powerful than Gödel's/ | |
s/deductions wont/deductions won't/ | |
s/that maps refers/that map refers/ | |
s/Lets work/Let's work/ | |
s/complicated then arithmetic/complicated than arithmetic | |
s/in such system/in such a system/ | |
s/cannot at same time/cannot at the same time/ | |
s/higher then average/higher than average/ | |
s/or disproved it/or disprove it/ |
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 'rubygems' | |
require 'time' | |
require 'yajl' | |
require 'yajl/json_gem' | |
require 'csv' | |
PARSER = Yajl::Parser.new | |
def add_point(s) | |
if s['geo'] |
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
#!/usr/bin/env ruby | |
$: << File.dirname(__FILE__) | |
require 'rubygems' | |
require 'eventmachine' | |
require 'em-http' | |
require 'yajl' | |
require 'yajl/json_gem' | |
class Streamer |
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
{ | |
"lon": -76.74754313, | |
"coordinates": { | |
"coordinates": [-76.74754313, 39.2086797], | |
"type": "Point" | |
}, | |
"truncated": false, | |
"favorited": false, | |
"created_at": "Wed Aug 29 04:01:40 +0000 2012", | |
"timestamp": 1346212900, |
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 'rubygems' | |
require 'yajl' | |
require 'fastercsv' | |
tweetfile = ARGV[0] | |
PARSER = Yajl::Parser.new | |
def output_tweet(s) | |
if s['geo'] |