This file contains hidden or 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/ruby | |
require 'rubygems' | |
require 'tinder' #https://github.com/collectiveidea/tinder | |
campfire = Tinder::Campfire.new('your-subdomain', | |
:token => 'your token', | |
:ssl => true, | |
:proxy => 'http://your-proxy:1234') | |
room = campfire.rooms.first |
This file contains hidden or 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
public String convert(List<Map<String, Object>> queryResults) { | |
//json-simple - WINNAR! | |
return JSONValue.toJSONString(queryResults); | |
//flexjson - fail - requires java.lang.Enum | |
// return new JSONSerializer().serialize(queryResults); | |
//Jackson - fail - requires java.io.Closeable | |
// try { | |
// return new ObjectMapper().writeValueAsString(queryResults); |
This file contains hidden or 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
window.context = window.describe | |
describe ".googlePandaStatus", -> | |
Given -> @ajaxCaptor = jasmine.captor() | |
Given -> spyOn($, "get") | |
When -> googlePandaStatus("Happy") | |
And -> expect($.get).toHaveBeenCalledWith("http://google.com", @ajaxCaptor.capture()) | |
describe "~ the AJAX success handler", -> | |
Given -> spyOn(window, "printMessage") |
This file contains hidden or 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 Bunny | |
attr_accessor :carrots, :lettuce_heads, :garden, :mate | |
def eat | |
@carrots.nom | |
@lettuce_heads.nom | |
end | |
def find_carrots | |
@garden.visit do |soil| |
This file contains hidden or 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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> |
This file contains hidden or 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
2011-05-13 15:29:27 | |
Full thread dump OpenJDK Client VM (19.0-b09 mixed mode, sharing): | |
"Attach Listener" daemon prio=10 tid=0x09381400 nid=0x465 waiting on condition [0x00000000] | |
java.lang.Thread.State: RUNNABLE | |
"RequestHandlerThread[#5]" daemon prio=10 tid=0x092c1c00 nid=0x3a9 in Object.wait() [0xb442f000] | |
java.lang.Thread.State: WAITING (on object monitor) | |
at java.lang.Object.wait(Native Method) | |
- waiting on <0x7b4a73a0> (a winstone.RequestHandlerThread) |
This file contains hidden or 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
//Save this as a bookmarklet in your browser's bookmark bar & click it while viewing your netflix instant queue. If it looks right, click "Update Queue" to save the changes. | |
javascript:void((function($){$.each($('#qbody tr a.mdpLink').contents().toArray().sort(function(a,b){ return a.nodeValue > b.nodeValue ? 1 : -1; }),function(i,e){ $(e).closest('tr').find('input.o').val(i) });})(jQuery)) |
This file contains hidden or 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
buttonifyAndHide = function($obj) { | |
$obj.button().hide(); | |
}; |
This file contains hidden or 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
#compare to RSpec Book: http://media.pragprog.com/titles/achbd/code/cb/42/spec/codebreaker/game_spec.rb | |
require 'spec_helper' | |
module Codebreaker | |
describe Codebreaker::Game do | |
let(:output) { gimme(IO) } | |
let(:game) { Game.new(output) } | |
describe '#start' do | |
before do |
This file contains hidden or 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
if($.browser.msie && document.compatMode === 'BackCompat') { | |
document.write('<!DOCTYPE html>'+document.documentElement.outerHTML); | |
history.go(0); | |
} |