Skip to content

Instantly share code, notes, and snippets.

Avatar

Jeremy Bornstein unprolix

View GitHub Profile
View FilesystemUtil.hs
{-# LANGUAGE AllowAmbiguousTypes #-}
{-# LANGUAGE ConstrainedClassMethods #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE InstanceSigs #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TypeFamilies #-}
module FilesystemUtil where
import qualified Data.ByteString as BS
import qualified Data.ByteString.Lazy as BSL
@unprolix
unprolix / gist:43e361ce3ba2b9f07214
Created Feb 26, 2015
Commandline tool to extract a method or a function from a python source file
View gist:43e361ce3ba2b9f07214
#!/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
View keybase.md

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 Oct 24, 2017
This code will allow a Rasperry Pi to read temperatures from the Freetronics infrared temperature sensor.
View irtemp.c
// irtemp.c
// Raspberry Pi code to read temperature from the Freetronics infrared temperature module.
// By Jeremy Bornstein <jeremy@jeremy.org> 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.