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
$ irb | |
> require 'roadtrip' | |
=> true | |
> t = Roadtrip::Trip.new 'rdu', 'hilton downtown, nashville, tn', 2.75, 15 | |
=> #<Roadtrip::Trip:0x00000100a23e28 @start="rdu", @destination="hilton downtown, nashville, tn", @cost_per_gallon=2.75, @mpg=15> | |
> t.distance | |
=> "528 mi" | |
> t.duration | |
=> "8 hours 23 mins" | |
> t.cost |
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
EXTERNAL_PORT = 42063 | |
require 'UPnP' | |
upnp = UPnP::UPnP.new(true, 10) | |
upnp.addPortMapping(EXTERNAL_PORT, 9292, UPnP::Protocol::TCP, "Test Port") | |
at_exit{upnp.deletePortMapping(EXTERNAL_PORT, UPnP::Protocol::TCP)} | |
puts "Call externally: http://#{upnp.externalIP}:#{EXTERNAL_PORT}" | |
run proc{|env| p :env => env; [200, {"Content-Type" => "text/html"}, ["success\n"]]} |
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 'test/unit' | |
class TestHashedSprintf < Test::Unit::TestCase | |
def hashed_sprintf(string, hash) | |
array = [] | |
cleaned_string = string.gsub(/%<(\w+)>/) do |match| | |
array << hash[$1.to_sym] | |
'%' | |
end | |
sprintf(cleaned_string, *array) |
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
"An entrepreneur is a person who takes responsibility for finding a sustainable way to deliver value in an uncertain environment." | |
-- adapted from Eric Ries' definition of a startup in http://www.startuplessonslearned.com/2010/06/what-is-startup.html, broadened to include Steve Blank's four types of entrepreneurs in http://steveblank.com/2010/06/10/you%E2%80%99re-not-a-real-entrepreneur/ |
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
@interface TT : NSObject { | |
} | |
-(BOOL)isEnabled; | |
@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
#!/usr/bin/env ruby | |
target = ARGV[0] | |
dest = ARGV[1] | |
unless target && dest | |
puts "Github Archive Usage: gharch <user/repo> <destdir>" | |
exit(1) | |
end | |
remote, repo = target.split("/") |
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 AppDelegate | |
attr_accessor :window | |
def applicationDidFinishLaunching(a_notification) | |
NSRunLoop.currentRunLoop.performSelector :test, target: self, argument: nil, order: 1, modes: NSDefaultRunLoopMode | |
end | |
def test | |
puts "Hi!" | |
end | |
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
Duff OMelia (8): | |
Don't use an rvm gemset. | |
Fixed unit test. | |
Upgrade colored gem | |
Don't need the version for map_by_method gem. | |
Don't need to specify a version for the will_paginate_gem. | |
Upgrade the database_cleaner gem. | |
Upgraded mocha gem. | |
Fix exception we just received. |
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
ntalbott@joshua:~/git/riak$ make rel | |
./rebar get-deps | |
==> cluster_info (get-deps) | |
==> skerl (get-deps) | |
==> protobuffs (get-deps) | |
==> basho_stats (get-deps) | |
==> riak_sysmon (get-deps) | |
==> mochiweb (get-deps) | |
==> webmachine (get-deps) | |
==> riak_core (get-deps) |
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
<?php | |
$apiLogin = 'Ll6fAtoVSTyVMlJEmtpoJV8Shw5'; | |
$apiSecret = 'RKOCG5D8D3fZxDSg504D0IxU2XD4Io5VXmyzdCtTivHFTTSylzM2ZzTWFwVH4ucG'; | |
$paymentToken = 'N2V9GWfTgYv4jXAz2vcc4T3i8f6'; | |
$url = 'https://spreedlycore.com/v1/payment_methods/' . $paymentToken . '/retain.xml'; | |
$ch = curl_init($url); | |
curl_setopt($ch, CURLOPT_USERPWD, $apiLogin . ':' . $apiSecret); |