Skip to content

Instantly share code, notes, and snippets.

View titanous's full-sized avatar

Jonathan Rudenberg titanous

View GitHub Profile
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>vc-build-version</key><string>1W16</string>
<key>vc-build-revision</key><string>198959</string>
<key>id-validation-cert</key><string>https://identity.ess.apple.com/WebObjects/TDIdentityService.woa/wa/validationCert</string>
<key>id-initialize-validation</key><string>https://identity.ess.apple.com/WebObjects/TDIdentityService.woa/wa/initializeValidation</string>
<key>id-provision-phone-number</key><string>https://identity.ess.apple.com/WebObjects/TDIdentityService.woa/wa/provisionPhoneNumber</string>
<key>id-provision-ds-id</key><string>https://profile.ess.apple.com/WebObjects/VCProfileService.woa/wa/idsProvisionEmails</string>
DEBUG -- : Test Load (0.2ms) SELECT "tests".* FROM "tests" ORDER BY COALESCE(updated_at DESC, created_at) ASC LIMIT 1
DEBUG -- : SQLite3::SQLException: near "DESC": syntax error: SELECT "tests".* FROM "tests" ORDER BY COALESCE(updated_at DESC, created_at) ASC LIMIT 1
/Users/titanous/.rvm/gems/ree-1.8.7-2011.03@fix/gems/activerecord-3.0.8/lib/active_record/connection_adapters/abstract_adapter.rb:207:in `log': SQLite3::SQLException: near "DESC": syntax error: SELECT "tests".* FROM "tests" ORDER BY COALESCE(updated_at DESC, created_at) ASC LIMIT 1 (ActiveRecord::StatementInvalid)
from /Users/titanous/.rvm/gems/ree-1.8.7-2011.03@fix/gems/activerecord-3.0.8/lib/active_record/connection_adapters/sqlite_adapter.rb:135:in `execute'
from /Users/titanous/.rvm/gems/ree-1.8.7-2011.03@fix/gems/activerecord-3.0.8/lib/active_record/connection_adapters/sqlite_adapter.rb:284:in `select'
from /Users/titanous/.rvm/gems/ree-1.8.7-2011.03@fix/gems/activerecord-3.0.8/lib/active_record/connection_adapters/abstract/database_
@titanous
titanous / get.js
Created May 24, 2011 22:52
node.js v0.4.8 https.get regression
var https = require('https');
https.get({ host: 'www.google.com', path: '/accounts/o8/site-xrds?hd=jadedpixel.com' }, function(res) {
res.on('data', function(d) {
console.log('chunk');
});
res.on('end', function() {
console.log('end');
});
require 'json'
require 'net/http'
require 'uri'
module Bayeux
ENDPOINT = URI.parse('http://localhost:3000/faye')
def self.publish(channel, data)
message = {'channel' => channel, 'data' => data.to_hash}
Net::HTTP.post_form(ENDPOINT, :message => JSON.unparse(message))
@titanous
titanous / long_url.rb
Created March 7, 2011 04:17
Long URL finder
# Long URL finder
# Copyright 2011 Jonathan Rudenberg
# Licensed under the MIT License
#
# Usage:
# LongURL.find('http://t.co/tssMTwK') #=> "http://fuckyeahnouns.com/Bacon"
require 'net/http'
require 'uri'
@titanous
titanous / twitter_spy.rb
Created March 4, 2011 20:17
Live tweets in Campfire
#!/usr/bin/env ruby
$KCODE = 'u' # for twitter-text
# gem install httparty json twitter-stream twitter-text
#
# set these environment variables:
# TWITTER_USER = twitter username
# TWITTER_PASS = twitter password
# TWITTER_KEYWORDS = the keywords to track, comma separated (see http://dev.twitter.com/pages/streaming_api_methods#track)
# CAMPFIRE_SUBDOMAIN = the subdomain of your campfire account (ex. flames if your domain is flames.campfirenow.com)
133a134,136
> url = re.compile("URL: (\S+)").search(msg)
> if url is not None:
> subprocess.Popen(['open', url.group(1)])
require 'heroku'
heroku = Heroku::Client.new('[email protected]', 'supersecret')
heroku.add_config_vars 'vanbergen.org', 'LAST_BUMP' => Time.now.strftime('%F')
require 'active_merchant'
require 'test/unit'
class CreditCardThing < Struct.new(:number, :month, :year, :type)
include ActiveMerchant::Billing::CreditCardMethods
def valid_number?
self.class.valid_number?(number)
end
@titanous
titanous / gist:762761
Created January 2, 2011 19:45
OC Transpo GPS API access in Ruby
require 'open-uri'
require 'nokogiri'
require 'active_support/time'
module OCTranspo
class GPSData
API_URL = 'http://octranspo.opendataottawa.ca'
API_KEY = 'YOUR API KEY HERE'