Skip to content

Instantly share code, notes, and snippets.

View harrisj's full-sized avatar

Jacob Harris harrisj

View GitHub Profile
@harrisj
harrisj / article_fetcher.rb
Created June 22, 2012 20:16
Basic code for the nytimes_ebooks
# encoding: UTF-8
require 'rubygems'
require 'rest-client'
require 'nokogiri'
class ArticleFetcher
def self.fetch_text(url)
case url
when /video\.nytimes\.com/
@harrisj
harrisj / tinyurl_test.rb
Created April 26, 2012 16:44
Testing Punctuation on URL Shorteners
require 'net/http'
# These links were taken from my twitter timeline. No endorsement implied.
tiny_urls = {
'bitly' => ['http://bit.ly/3S9c5K', 'http://developer.nytimes.com/'],
'j.mp' => ['http://j.mp/JsML0u', 'http://www.npr.org/2012/04/26/151303230/an-african-trader-and-the-perils-of-business-in-china'],
'tinyurl' => ['http://tinyurl.com/6rq9vob', 'http://politicsoftheplate.com/?p=1283'],
'owly' => ['http://ow.ly/axesj', 'http://threatpost.com/en_us/blogs/opera-12-beta-released-new-security-features-including-do-not-track-support-042612'],
'ht.ly' => ['http://ht.ly/1j7LiX', 'http://rssfeeds.usatoday.com/~r/usatoday-LifeTopStories/~3/8vFV-fFfhAc/1'],
'is.gd' => ['http://is.gd/gk0FoM', 'http://www.wired.com/dangerroom/2012/04/joe-schmoe-drones/'],
@harrisj
harrisj / gist:1269322
Created October 7, 2011 02:53
Tweet Sources about Steve Jobs
715944 tweets collected on Wed. night for 80 minutes
Filtering out to clients that had at least 1% of traffic, here is the breakdown
Echofon: 28308 3.95%
Mobile Web: 16266 2.27%
UberSocial for BlackBerry: 47728 6.67%
TweetDeck: 35792 5.00%
Twitter for BlackBerry®: 59479 8.31%
Twitter for iPhone: 136235 19.03%
Twitter for Mac: 12870 1.80%
require_dependency 'net/ftp'
class FTPMock
def gettextfile(remote_path, local_path)
test_file = File.join(RAILS_ROOT, 'test', 'data', 'dbready', remote_path)
if !File.exists?(test_file)
raise Net::FTPPermError, test_file + ' not found!'
end
FileUtils.cp test_file, local_path
--- a/subversion-1.6.5/Makefile 2009-09-23 16:34:05.000000000 -0400
+++ b/subversion-1.6.5/Makefile 2009-09-23 17:53:37.000000000 -0400
@@ -41,8 +41,8 @@
-SVN_APR_LIBS = -L/usr/lib -R/usr/lib -lapr-1 -lpthread
-SVN_APRUTIL_LIBS = -L/usr/lib -R/usr/lib -laprutil-1 -lsqlite3 -lexpat -liconv
+SVN_APR_LIBS = -L#{HOMEBREW_PREFIX}/lib -L/usr/lib -R/usr/lib -lapr-1 -lpthread
+SVN_APRUTIL_LIBS = -L#{HOMEBREW_PREFIX}/lib -L/usr/lib -R/usr/lib -laprutil-1 -lsqlite3 -lexpat -liconv
SVN_APR_MEMCACHE_LIBS =
SVN_DB_LIBS =
SVN_GNOME_KEYRING_LIBS =