Skip to content

Instantly share code, notes, and snippets.

View abonhomme's full-sized avatar

Arjumand Bonhomme abonhomme

View GitHub Profile

Keybase proof

I hereby claim:

  • I am abonhomme on github.
  • I am jumand (https://keybase.io/jumand) on keybase.
  • I have a public key whose fingerprint is 0D60 DBE8 9A79 6D94 66A1 9D7E 39ED 2195 6DBC 96AB

To claim this, I am signing this object:

@abonhomme
abonhomme / gist:baf5c909bd1f147f488a
Created April 3, 2015 20:15
recovering force-deleted & remote-deleted branches #justGitThings
git fsck --full --no-reflogs --unreachable --lost-found | grep commit | cut -d\ -f3 | xargs -n 1 git log -n 1 --pretty=oneline > .git/lost-found.txt`
@abonhomme
abonhomme / test_apns.py
Created January 7, 2014 22:07
Manual sending of a push notification to APNS via python
import socket, ssl, json, struct, sys
#originally from: http://stackoverflow.com/questions/1052645/apple-pns-push-notification-services-sample-code
# device token returned when the iPhone application
# registers to receive alerts
deviceToken = 'XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX'
thePayLoad = {
@abonhomme
abonhomme / printStorageStats.js
Last active December 26, 2015 09:49
Adds a function to the MongoDB shell context that prints out a table showing info for each collection: storage size, storage efficiency%, size of all indexes
/*
This allows you print some stats about the storage efficiency of
your collections in MongoDB.
Example:
> printStorageStats()
Thu Oct 31 2013 14:07:36 GMT-0400 (EDT)
Collection | *Size | Effcy% | Idxs
-------------------------------------------------
test.people | 8.2 kB | 0.63 | 16.4 kB
@abonhomme
abonhomme / scale_heroku.sh
Created April 4, 2013 09:15
Bash script for scaling a Heroku process via REST (does NOT require the Heroku toolbelt to be installed)
#!/bin/bash
APP="YOUR_APP"
TOKEN="YOUR_TOKEN"
PROCESS="web"
QTY=
usage()
{
cat << EOF
@abonhomme
abonhomme / bulbs_simple.py
Created December 5, 2012 06:25
Experiment with Bulbs framework and transactions. Meant to mimic the examples in "lightbulb" mentioned at the bottom of this post https://groups.google.com/forum/#!msg/gremlin-users/HaznTd_8bG4/LzqhdXsdA00J
from bulbs.model import Node, NodeProxy, Relationship, build_data
from bulbs.property import String, Integer, DateTime
from bulbs.utils import extract, get_file_path, current_datetime
from bulbs.neo4jserver import Graph as Neo4jGraph
class Knows(Relationship):