Skip to content

Instantly share code, notes, and snippets.

Tim Akinbo takinbo

Block or report user

Report or block takinbo

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View onename.io
Verifying that +takinbo is my Bitcoin username. You can send me #bitcoin here: https://onename.io/takinbo
View keybase.md

Keybase proof

I hereby claim:

  • I am takinbo on github.
  • I am takinbo (https://keybase.io/takinbo) on keybase.
  • I have a public key whose fingerprint is DF7F B883 8949 37A9 ABAA 27F5 AB3B B959 BC3F 6CED

To claim this, I am signing this object:

@takinbo
takinbo / diffbot.py
Created May 19, 2012 — forked from david-torres/diffbot.py
Simple Python interface for Diffbot API
View diffbot.py
import requests
import json
class Diffbot(object):
"""
A simple Python interface for the Diffbot api.
Relies on the Requests library - python-requests.org
Usage:
View keypress_nav.js
// Adds the ability to navigate text boxes while pressing either n or p
$('.bigbox2').keypress(function (e) {
switch (e.which) {
case 78:
case 110:
// N was pressed
el = $(this);
prefix = el.attr('name').replace(/-.*$/, "");
pos = $('input[name|="'+prefix+'"]').index(el);
if (pos < $('input[name|="'+prefix+'"]').length) {
@takinbo
takinbo / shorty.py
Created Feb 19, 2012
url shortening snippet
View shorty.py
import string
import sys
# list of valid characters to use in the shortener slug
CHARSET = string.digits + string.lowercase + string.uppercase
# convert a numeric id to a url-shortener-type slug
def shorty(id):
slug = ""
while id > 0:
@takinbo
takinbo / network_operator_function.sql
Created Feb 17, 2012
PostgreSQL function to determine network prefix from a phone number
View network_operator_function.sql
CREATE OR REPLACE FUNCTION network_operator(msisdn text)
RETURNS text AS
$$
DECLARE
operator TEXT;
BEGIN
IF msisdn ~ '^(0|234)(703|706|803|806|810|813|816)\\d+$' THEN
operator := 'MTN';
ELSEIF msisdn ~ '^(0|234)(705|805|807|815)\\d+$' THEN
operator := 'GLO';
@takinbo
takinbo / paginated_collection.js
Created Jul 25, 2011 — forked from io41/paginated_collection.js
Pagination with Backbone.js & django-tastypie
View paginated_collection.js
// includes bindings for fetching/fetched
var PaginatedCollection = Backbone.Collection.extend({
initialize: function() {
_.bindAll(this, 'parse', 'url', 'pageInfo', 'nextPage', 'previousPage', 'filtrate', 'sort_by');
typeof(options) != 'undefined' || (options = {});
typeof(this.limit) != 'undefined' || (this.limit = 20);
typeof(this.offset) != 'undefined' || (this.offset = 0);
typeof(this.filter_options) != 'undefined' || (this.filter_options = {});
typeof(this.sort_field) != 'undefined' || (this.sort_field = '');
@takinbo
takinbo / gist:669561
Created Nov 9, 2010
generic wsgi file for wsgi-based django app deployments
View gist:669561
import os, sys
import django.core.handlers.wsgi
sys.path.append(os.path.dirname(os.path.abspath(__file__)))
os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'
application = django.core.handlers.wsgi.WSGIHandler()
View fizzbuzz.py
# FizzBuzz
# ----------------------------------------------------------------------------
# in response to Pascal Ehigie Aito's blog post
# http://aitoehigie.wordpress.com/2010/10/24/most-programmers-cant-solve-this/
# here's an attempt to solve it
for i in range(1, 101):
if not (i % 3 or i % 5):
print "FizzBuzz"
elif not i % 3:
print "Fizz"
View gist:611494
from boss import BossFactory
from sys import argv
import yaml
config = yaml.load(file('config.yml', 'rb').read())
boss = BossFactory(appid=config['yahookey'])
offset = 0
done = False
urls = []
You can’t perform that action at this time.