Skip to content

Instantly share code, notes, and snippets.

View gotwalt's full-sized avatar

Aaron Gotwalt gotwalt

View GitHub Profile
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"
<!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="" />
@gotwalt
gotwalt / shiftjis-csv.rb
Created February 23, 2011 09:45
Convert a CSV file to Shift-JIS for use in Japanese versions of Microsoft Excel in ruby-1.8.7
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
@gotwalt
gotwalt / gist:528586
Created August 17, 2010 05:33
Posting to twitpic in Ruby using oauth echo
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",