Skip to content

Instantly share code, notes, and snippets.


Will Rigby wrigby

  • New York, USA
View GitHub Profile
wrigby / honeycomb_example.php
Last active May 13, 2020
Submitting data to Honeycomb from PHP 5
View honeycomb_example.php
// Send some data to Honeycomb, where $data is just an associative array
// that can be JSON encoded. Wire this up in a callback with
// `register_shutdown_function` to ship data off after your request is finished.
function send_data($dataset, $data) {
$url = ''.$dataset;
$team_id = 'secret';
$timestamp = microtime(True);
$options = array(
wrigby /
Created Dec 22, 2016
Reading a 24-bit wave file in Python
def sign_extend(bits, value):
""" Sign-extend from """
sign_bit = 1 << (bits - 1)
return (value & (sign_bit - 1)) - (value & sign_bit)
def get_samples(w):
num_samples = w.getnframes()
sample_depth = w.getsampwidth()

Keybase proof

I hereby claim:

  • I am wrigby on github.
  • I am wrigby ( on keybase.
  • I have a public key whose fingerprint is 47E0 AE95 3A5A E818 4805 9A03 A5AB 9C37 F71B 6BCE

To claim this, I am signing this object:

wrigby / recolor_background.css
Last active Jan 25, 2016
Applying CSS filters to background images
View recolor_background.css
/* Some elements may need this to make sure they are the
* position parent of the child pseudo-element we'll create
* below
your_element {
position: relative;
/* This pseudo-element copies the background from its parent,
* allowing you to apply CSS filters just to the background image.
wrigby / Axis Session
Last active Jul 18, 2016
Python suds plugin for Apache Axis sessions
View Axis Session


  • Because the MultiRef support in Suds doesn't handle references in the header of the reply, but it does remove all the multirefs from the body, so it eats the session ID before you can do anything about it.
  • Because with this plugin, you don't even have to think about handling sessions
  • Because I was trying to figure out how to use Diamond IP's IPControl SOAP API, and had to write this to make it work

How to use it?

session_plugin = AxisSessionPlugin()
c = Client(..., plugins=[session_plugin])