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 / .bashrc
Created March 29, 2013 14:10 — forked from henrik/.bashrc
# http://henrik.nyh.se/2008/12/git-dirty-prompt
# http://www.simplisticcomplexity.com/2008/03/13/show-your-git-branch-name-in-your-prompt/
# username@Machine ~/dev/dir[master]$ # clean working directory
# username@Machine ~/dev/dir[master*]$ # dirty working directory
function parse_git_dirty {
[[ $(git status 2> /dev/null | tail -n1) != "nothing to commit (working directory clean)" ]] && echo "*"
}
function parse_git_branch {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e "s/* \(.*\)/[\1$(parse_git_dirty)]/"
@akeem
akeem / go_in_production.txt
Last active December 15, 2015 09:19
peeps using go lang in production
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
@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"},
@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 / 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: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: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 / 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 / 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
#$LOAD_PATH.unshift(File.expand_path('../../lib', __FILE__))
require 'mongo_mapper'
require 'pp'
class NedFlanders
def initialize
MongoMapper.database = 'testing'
end
end