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 "nestful" | |
require "roauth" | |
def upload(path_to_file) | |
twitpic_key = "my_twitpic_api_key" | |
oauth_url = "https://api.twitter.com/1/account/verify_credentials.json" | |
oauth = { | |
:access_key => "account_access_key", | |
:access_secret => "account_access_secret", |
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 "iconv" | |
encoding = "SHIFT-JIS" | |
# Open a file for writing in the Shift-JIS format | |
File.open("output.csv", "w:#{encoding}") do |io| | |
# Read the CSV file, and convert CRs to CRLFs. | |
csv = File.open("input.csv").read.gsub("\r", "\r\n") | |
# Convert the CSV to the correct encoding | |
io.write Iconv.iconv(encoding, "UTF-8", csv).join | |
end |
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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en-US" xmlns:og="http://opengraphprotocol.org/schema/" xmlns:fb="http://www.facebook.com/2008/fbml"> | |
<head profile="http://gmpg.org/xfn/11"> | |
<title>This Guy Took A Picture Of His Face Every Day For 8 Years</title> | |
<link rel="SHORTCUT ICON" href="favicon.ico" /> | |
<meta http-equiv="content-type" content="text/html; charset=us-ascii" /> | |
<meta property="og:title" content="This Guy Took A Picture Of His Face Every Day For 8 Years" /> | |
<meta name="description" content="" /> |
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 'spec_helper' | |
require 'rack/test' | |
require 'support/vcr' | |
describe User do | |
describe '#find_or_initialize_by_facebook_token' do | |
puts "it gets here" | |
it "creates a new user for a valid" do | |
puts "but never gets inside here" |
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 'rake/testtask' | |
require 'cucumber/rake/task' | |
Rake::TestTask.new(:test) do |t| | |
t.libs << 'spec' | |
t.pattern = 'spec/**/*_spec.rb' | |
t.verbose = true | |
end | |
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
rvm gemset use global | |
gem uninstall -ax bundler | |
gem install bundler --pre | |
bundle --version | |
rvm gemset use giver |
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 bash | |
# This is an RVM Project .rvmrc file, used to automatically load the ruby | |
# development environment upon cd'ing into the directory | |
# First we specify our desired <ruby>[@<gemset>], the @gemset name is optional. | |
environment_id="ruby-1.9.3-p125@thumbs" | |
# | |
# First we attempt to load the desired environment directly from the environment | |
# file, this is very fast and efficicent compared to running through the entire |
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
8:24:20 AM Aaron Gotwalt: we're having the collection-json vs other api forms argument tomorrow | |
8:24:36 AM Aaron Gotwalt: or hypermedia types, i suppose | |
8:25:00 AM Aaron Gotwalt: he's concerned about verbosity and that it presents the data in a format that is not ideal for either the client or the server | |
8:25:33 AM Larry Marburger: that's a feature | |
8:26:09 AM Larry Marburger: it's designed to be future proof which hand-rolled json won't be | |
8:26:19 AM Larry Marburger: it's an interchange format | |
8:26:31 AM Larry Marburger: i may have just made that up | |
8:26:34 AM Aaron Gotwalt: right, but it has processing cost on either side | |
8:26:39 AM Aaron Gotwalt: which is less of a concern in ruby-land | |
8:26:43 AM Aaron Gotwalt: but on ios |
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
# how many posts to we rip on the daily? | |
def count | |
# say me say many moni, say me say manymanymany | |
redis.zcount(key, '-inf', '+inf') | |
end |
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
class NoChoice < Choice | |
end |
OlderNewer