Skip to content

Instantly share code, notes, and snippets.

View damon's full-sized avatar

Damon Clinkscales damon

View GitHub Profile
I was having a conversation the other day with a friend about the dearth of
wine spots in North Austin that served *good wine* at reasonable prices.
At the Taste North Austin event today, many of The Domain spots were
advertising their happy hours. So my thought is...collect all the
happy hour wines, take their price and compare the by the glass price
with the retail bottle price, how many ounces they pour (so, compute a $/oz)
look at wine ratings, etc...and basically ferret out the best wine deals. Haven't
built anything yet, but hope to build a list with some interesting stats soon!
Share that information with others and who knows maybe have some wine
require 'rubygems'
require 'yajl/http_stream'
require 'uri'
require 'open-uri'
USERNAME = 'username'
PASSWORD = 'password'
# If you've got a ton of either, you'll have to fork and cursor through
fr_ids = Yajl::HttpStream.get(URI.parse("http://#{USERNAME}:#{PASSWORD}@api.twitter.com/1/friends/ids/#{USERNAME}.json"))
module Kernel
def m(object=Object.new, pattern=nil)
methods = object.public_methods(false).sort
methods = methods.grep pattern unless pattern.nil?
ObjectMethods.new(methods)
end
class ObjectMethods < Array
def inspect
puts sort
# Put this in your .irbrc, and then type
# "some_object.my_methods" in an IRB session
# for less noisy exploration of what objects
# can do.
class Object
def my_methods
base_object = case self
when Class then Class.new
when Module then Module.new
@damon
damon / json_hax.rb
Created January 6, 2010 22:09 — forked from tobi/json_hax.rb
class JsonHax
def initialize(app)
@app = app
end
def call(env)
if env['CONTENT_TYPE'] == 'application/json'
env['CONTENT_TYPE'] = 'application/xml'
env['REQUEST_URI'].gsub!(/\.json/, '.xml')
#!/usr/bin/env ruby
begin
require 'rubygems'
require 'fastercsv'
fn,result = ARGV[0],{}
FasterCSV.foreach(fn) do |row|
d,p = row[0],row[1]
result[d] = 0 if !result[d]
@damon
damon / url_dsl.rb
Created December 14, 2009 16:19 — forked from defunkt/url_dsl.rb
require 'open-uri'
# url dsl -- the ultimate url dsl!
#
# You just can't beat this:
#
# $ irb -r url_dsl
# >> include URLDSL
# => Object
# >> http://github.com/defunkt.json
Dd09
150-200k max - if can't get to break even in Valley, those just go away
Entrep. who is a good dev - can make it on your own
1/2 million on social games, iPhone
Versus 120k/year
Facebook platform
We couldn’t find that file to show.
@damon
damon / 0what.md
Created August 24, 2009 02:32 — forked from defunkt/0what.md

Poor Man's Deploy

  • Start a Sinatra server on port 4000
  • GET / to that server triggers a git pull and mod_rails restart
  • Hit port 4000 locally after pushing

Why?