Skip to content

Instantly share code, notes, and snippets.

View zeke's full-sized avatar
🍊
Busy! @-message me directly if I'm slow to respond.

Zeke Sikelianos zeke

🍊
Busy! @-message me directly if I'm slow to respond.
View GitHub Profile
#!/usr/bin/env ruby
# Parses the itunes playlist xml file and sticks it in a mysql table.
# Gem requirements:
# ActiveRecord
# Hpricot
# Create a database called "itunes_library"
# Schema is as follows:
@zeke
zeke / gist:69117
Created February 23, 2009 19:18 — forked from peterc/gist:33337
# SUPER DARING APP TEMPLATE 1.0
# By Peter Cooper
# Link to local copy of edge rails
inside('vendor') { run 'ln -s ~/dev/rails/rails rails' }
# Delete unnecessary files
run "rm README"
run "rm public/index.html"
run "rm public/favicon.ico"
@zeke
zeke / gist:69118
Created February 23, 2009 19:18 — forked from peterc/gist:33337
# SUPER DARING APP TEMPLATE 1.0
# By Peter Cooper
# Link to local copy of edge rails
inside('vendor') { run 'ln -s ~/dev/rails/rails rails' }
# Delete unnecessary files
run "rm README"
run "rm public/index.html"
run "rm public/favicon.ico"

FracturedAtlas.org API: Email Sending

Overview

  • To use the API, you’ll first need an API Key.

Methods

send

# requires curb gem (http://curb.rubyforge.org/)
# I used matthooks’ vimeo gem to get the required token, sig and ticket. http://github.com/matthooks/vimeo/tree/master
# (flickraw has an alternative method of doing a http POST in the source using net/http which could be adapted for vimeo, avoiding the use of this curb gem)
# connect to Vimeo
VIMEO_API_KEY = "your api key"
VIMEO_SHARED_SECRET = "your shared secret"
#!/usr/bin/env ruby
require 'rubygems'
require 'daemons'
dir = File.expand_path(File.join(File.dirname(__FILE__), '..'))
daemon_options = {
:multiple => false,
:dir_mode => :normal,
:dir => File.join(dir, 'tmp', 'pids'),
:backtrace => true
@zeke
zeke / link_to.rb
Created June 2, 2009 18:26 — forked from emk/link_to.rb
@zeke
zeke / irb
Created October 21, 2009 19:10 — forked from tjstankus/irb
[08:48 AM:gist-99771(master)] $ irb -rubygems -r myapp.rb -r rack/test
>> app = Rack::Test::Session.new(Sinatra::Application)
=> #<Rack::Test::Session:0x17e8820 @headers={}, @app=Sinatra::Application>
>> app.get '/'
=> #<Rack::Response:0x17ad4dc @block=nil, @writer=#<Proc:0x0189f7b4@/opt/local/lib/ruby/gems/1.8/gems/rack-0.9.1/lib/rack/response.rb:24>, header{"Content-Type"=>"text/html", "Content-Length"=>"7"}, body["testing"], length7, status200
>> app.body
NoMethodError: undefined method `body' for #<Rack::Test::Session:0x17e8820>
from (irb):3
@zeke
zeke / irb
Created October 21, 2009 19:19 — forked from bmizerany/irb
blake:carealot$ irb -rubygems -r myapp.rb -r sinatra/test
irb(main):001:0> app = Sinatra::TestHarness.new(Sinatra::Application)
=> #<Sinatra::TestHarness:0x10c3d74 @app=Sinatra::Application>
irb(main):002:0> app.get '/'
=> #<Rack::MockResponse:0x10ae780 @original_headers={"Content-Type"=>"text/html", "Content-Length"=>"7"}, @status=200, @errors="", @headers={"Content-Type"=>"text/html", "Content-Length"=>"7"}, @body="testing">
irb(main):003:0> app.body
=> "testing"
# How to setup multiple heroku accounts
# (assuming you already have one setup)
# make sure ~/bin is in your path
create ~/bin/hcred and populate it with the following:
1 #!/usr/bin/env ruby
2
3 `rm ~/.heroku/credentials`