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
describe "when handling results" do | |
before(:each) do | |
AMQP.stub!(:connect) | |
MQ.stub!(:new) | |
Nanite::MapperProxy.new('mapperproxy', {}) | |
@instance = Nanite::MapperProxy.instance | |
@fanout = stub(:fanout, :publish => true) | |
@instance.amqp.stub!(:fanout).and_return(@fanout) | |
end | |
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
#$LOAD_PATH.unshift(File.expand_path('../../lib', __FILE__)) | |
require 'mongo_mapper' | |
require 'pp' | |
class NedFlanders | |
def initialize | |
MongoMapper.database = 'testing' | |
end | |
end |
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
#hopefully this will help anyone else that ends up looking for this. I ended up looking this up a couple of times and figured it was worth writing down. | |
xml_document = Nokogiri::XML(File.read(File.join(File.dirname(__FILE__),'somexmlfile.xml'))) | |
xml_document.internal_subset.system_id | |
xml_document.internal_subset.external_id |
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
require 'rubygems' | |
require 'httparty' | |
require 'set' | |
class FBProblem | |
include HTTParty | |
format :json | |
base_uri "https://graph.facebook.com" | |
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
rabbitmqctl -n rabbit@localhost list_queues -p /nanite name durable auto_delete arguments pid owner_pid exclusive_consumer_pid exclusive_consumer_tag messages_ready messages_unacknowledged messages consumers memory |
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
#assumption that all Hashes have the de-dupe key, and the de-dupe key represents a unique | |
#identifier | |
def dedupe_by_key array,key | |
collector = {} | |
array.each{|element| | |
collector[element[key]] = element | |
} |
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
1. Homebrew was previously installed, but I encountered an issue when attempting to upgrade/install because I was not the owner of /usr/local |
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
Thoughts on being an api provider | |
1. Its a contract, be sure to have a clear idea on how you intend to version your api. Header fields set, special pathing, choose your poison but for the sake of your users prepare to stick to it. Choosing this early will allow you a good amount of wiggle room without pulling the rug from under your users. | |
2. Know your consumers, is this an internal only api. Do you need to restrict data from certain user? Is this public or will it be in the future. | |
Are you acting on a user's behalf or just providing data to everyone |
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
{ name: "Tattoo Artist I Follow" | |
[{username: "2spirit_tattoo"}, | |
{username: "allyriley"}, | |
{username: "alvaroflorestattooer"}, | |
{username: "babakhintatau"}, | |
{username: "trocchio"}, | |
{username: "davetattoos"}, | |
{username: "gerhardwiesbeck"}, | |
{username: "jondix"}, | |
{username: "black_ink_power"}, |
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
dnsimple - http://blog.dnsimple.com/a-golang-redirection-service/ | |
soundcloud - http://backstage.soundcloud.com/2012/07/go-at-soundcloud/ | |
ironmq - http://blog.iron.io/2013/03/how-we-went-from-30-servers-to-2-go.html |
OlderNewer