Skip to content

Instantly share code, notes, and snippets.

Will Rigby wrigby

  • New York, USA
Block or report user

Report or block wrigby

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
@wrigby
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
wrigby / Axis Session Plugin.md
Last active Jul 18, 2016
Python suds plugin for Apache Axis sessions
View Axis Session Plugin.md

Why?

  • 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])
View keybase.md

Keybase proof

I hereby claim:

  • I am wrigby on github.
  • I am wrigby (https://keybase.io/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
wrigby / 24bitwav.py
Created Dec 22, 2016
Reading a 24-bit wave file in Python
View 24bitwav.py
def sign_extend(bits, value):
""" Sign-extend from http://stackoverflow.com/questions/32030412/twos-complement-sign-extension-python """
sign_bit = 1 << (bits - 1)
return (value & (sign_bit - 1)) - (value & sign_bit)
def get_samples(w):
w.rewind()
num_samples = w.getnframes()
sample_depth = w.getsampwidth()
You can’t perform that action at this time.