Skip to content

Instantly share code, notes, and snippets.

View akeem's full-sized avatar

Akeem Adeniji akeem

  • New York, New York
View GitHub Profile
@akeem
akeem / gist:8698074
Created January 29, 2014 22:02
rre glossary
Revenue Recognition Event
Spending transaction - A customer has used coins to purchase cards.
Purchasing transaction - A customer has purchased coins for money.
Bucket - Coins yet to be recognized from a purchasing transaction.
Revenue Recognition Event - records the steps taken in the revenue recognition process. This objects records the coins used, the purchasing transaction, the spending transaction, number of coins used during the recognition, and the cost of the coins recognized during the recognition process
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
#$LOAD_PATH.unshift(File.expand_path('../../lib', __FILE__))
require 'mongo_mapper'
require 'pp'
class NedFlanders
def initialize
MongoMapper.database = 'testing'
end
end
@akeem
akeem / nokogiri_dtd_info.rb
Created July 26, 2010 21:44
dtd information using Nokogiri
#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
@akeem
akeem / facebook_seatlle_puzzle.rb
Created August 14, 2010 05:15
quick and dirty answer to facebook seattle puzzle
require 'rubygems'
require 'httparty'
require 'set'
class FBProblem
include HTTParty
format :json
base_uri "https://graph.facebook.com"
@akeem
akeem / gist:731059
Created December 6, 2010 22:01
command to return all options from rabbitmq queue
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
@akeem
akeem / gist:1528102
Created December 28, 2011 14:22
de-duping an array of Hashes based on a given hash key
#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
}
@akeem
akeem / gist:3183188
Created July 26, 2012 16:53
issues encountered while setting up new machine
1. Homebrew was previously installed, but I encountered an issue when attempting to upgrade/install because I was not the owner of /usr/local
@akeem
akeem / gist:3734290
Created September 16, 2012 20:36
thoughts on being an api provider
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
@akeem
akeem / instagram_tattoo_list
Created March 16, 2013 02:02
Tattoo Artists I Follow on Instagram
{ 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"},