Skip to content

Instantly share code, notes, and snippets.

@unprolix
unprolix / gist:43e361ce3ba2b9f07214
Created February 26, 2015 22:15
Commandline tool to extract a method or a function from a python source file
#!/usr/bin/env python
"""
Extracts a method or function from a python source file.
If there is no such method or function, produces empty output.
Parsing is *not sophisticated* and could easily mess up. However, it's likely to work well enough.
Usage:
py_extract somefile.py some_function

Keybase proof

I hereby claim:

  • I am unprolix on github.
  • I am jjb (https://keybase.io/jjb) on keybase.
  • I have a public key whose fingerprint is C439 80C1 E1CB 3BBA 15DA C84F 3DFE 9125 B721 3077

To claim this, I am signing this object:

@unprolix
unprolix / irtemp.c
Last active October 24, 2017 16:43
This code will allow a Rasperry Pi to read temperatures from the Freetronics infrared temperature sensor.
// irtemp.c
// Raspberry Pi code to read temperature from the Freetronics infrared temperature module.
// By Jeremy Bornstein <[email protected]> after the Arduino-specific code from Andy Gelme (@geekscape)
// See http://www.freetronics.com/irtemp for more information about the module.
// This code requires the wiringPi library to be installed. See http://wiringpi.com/ for more information.
//
// NOTE: On the author's system, isnan(FP_NAN) returns false.
// This is clearly an error which could impact this code; I haven't tracked it down yet.
//
// There is no makefile. This isn't polished up to be a library--just a demonstration.