Skip to content

Instantly share code, notes, and snippets.

View tholder's full-sized avatar

Tom Holder tholder

View GitHub Profile

Keybase proof

I hereby claim:

  • I am tholder on github.
  • I am tholder (https://keybase.io/tholder) on keybase.
  • I have a public key ASDyL7R9pTRLhj1xAToXNOnym8ZnrH8QHd3ty516N6TWsQo

To claim this, I am signing this object:

Keybase proof

I hereby claim:

  • I am tholder on github.
  • I am tholder (https://keybase.io/tholder) on keybase.
  • I have a public key ASDrMjACOXWAPhzX5BfDQpq0wfgOq__xrfgzLCsGQZBnLAo

To claim this, I am signing this object:

@tholder
tholder / export_repo_issues_to_csv.py
Last active July 14, 2016 14:07 — forked from unbracketed/export_repo_issues_to_csv.py
Export Issues from Github repo to CSV (API v3)
"""
Exports Issues from a specified repository to a CSV file
Uses basic authentication (Github username + password) to retrieve Issues
from a repository that username has access to. Supports Github API v3.
"""
import csv
import requests
import icu #to install CFLAGS=-I/usr/local/opt/icu4c/include LDFLAGS=-L/usr/local/opt/icu4c/lib pip install pyicu
#!/usr/bin/env python
"""
A pure python ping implementation using raw socket.
Note that ICMP messages can only be sent from processes running as root.
Derived from ping.c distributed in Linux's netkit. That code is
@tholder
tholder / gist:1515424
Created December 23, 2011 21:38
Puling an array item matching a value
<?php
public function testPullTest()
{
$doc = new Model_Mongo_Lab();
$doc->laboratory = new Shanty_Mongo_Document();
$doc->laboratory->mixtures = array(
array(
'id' => 'abc',
@tholder
tholder / gist:1513997
Created December 23, 2011 12:04
Map Reduce - Using Shanty
<?php
$id = new MongoId($contact['custom']['skadoosh_id']);
$mapFunction = new MongoCode("function() { if (this.actor.id == \"$id\") emit(this.verb, 1); }");
$reduceFunction = new MongoCode("function(k,v) { var sum=0; for(var i in v) sum += v[i]; return sum; }");
$verbs = Model_Mongo_Activities::getMongoDb()->command(array(
"mapreduce" => "activities",
"map" => $mapFunction,
"reduce" => $reduceFunction,
"out" => array("inline" => true)));
@tholder
tholder / gist:1257513
Created October 2, 2011 14:48
Problem updating document set of existing doc
<?
/**
* Represents the invite system. The invite collection contains one document for each invited email address.
**/
class Model_Mongo_Invite extends Shanty_Mongo_Document {
protected static $_db = 'contactzilla';
protected static $_collection = 'invite';
protected static $_requirements = array(
[mysql*]
user root
group wheel
env.mysqladmin /usr/bin/mysqladmin
env.mysqlopts -u munin -pmunin
@tholder
tholder / versions
Created May 21, 2011 19:59
express madness
node -v
v0.4.7
npm -v
1.0.6
npm ls -g
/usr/local/lib
├── coffee-script@1.1.1
├─┬ express@2.3.6