Skip to content

Instantly share code, notes, and snippets.

View tdsmith's full-sized avatar

Tim D. Smith tdsmith

View GitHub Profile
require "formula"
class UniversalPython < Requirement
satisfy(:build_env => false) { archs_for_command("python").universal? }
def message; <<-EOS.undent
A universal build was requested, but Python is not a universal build
Boost compiles against the Python it finds in the path; if this Python
is not a universal build then linking will likely fail.
require "formula"
class Vpython < Formula
url "https://downloads.sourceforge.net/project/vpythonwx/6.10-release/vpython-wx-src.6.10.tgz"
sha1 "d51ca07dad92a1ae9a3d5cc57af48b180f457228"
head "https://github.com/BruceSherwood/vpython-wx.git"
homepage "http://vpython.org/"
# no python3 support from Homebrew boost yet
depends_on :python
Log time: 2014-04-19 21:54:43.794614
Log time: 2014-04-19 21:54:57.000539
Log time: 2014-04-19 21:55:25.484416
MarkInstall cracklib-runtime [ i386 ] < 2.8.22-1 -> 2.9.1-1build1 > ( admin ) FU=0
ignore old unsatisfied important dependency on wamerican:i386
MarkInstall iputils-ping [ i386 ] < 3:20121221-1ubuntu1 -> 3:20121221-4ubuntu1 > ( net ) FU=0
new important dependency: libcap2-bin:i386
Installing libcap2-bin as Recommends of iputils-ping
MarkInstall libcap2-bin [ i386 ] < none -> 1:2.24-0ubuntu2 > ( utils ) FU=0
Installing libpam-cap as Recommends of libcap2-bin
wilma:~ tim$ brew deps --tree tbb
tbb
wilma:~ tim$ brew remove tbb
Uninstalling /usr/local/Cellar/tbb/4.2...
wilma:~ tim$ brew install tbb
==> Downloading https://www.threadingbuildingblocks.org/sites/default/files/software_releases/source/tbb42_20130725oss_src.tgz
Already downloaded: /Library/Caches/Homebrew/tbb-4.2.tgz
==> Patching
patching file build/version_info_macos.sh
import tifffile as tf
import numpy as np
from os.path import splitext
def z_project(fn):
tiff = tf.TiffFile(fn)
n = len(tiff.pages)
immap = np.arange(n).reshape((-1, 2), order='F')
d = {}
d['cars'] = immap[:-1,0]
@tdsmith
tdsmith / gist:5768065
Created June 12, 2013 18:54
ctypes.macholib.dyld.dyld_default_search
def dyld_default_search(name, env=None):
yield name
framework = framework_info(name)
if framework is not None:
fallback_framework_path = dyld_fallback_framework_path(env)
for path in fallback_framework_path:
yield os.path.join(path, framework['name'])
@tdsmith
tdsmith / list.py
Last active December 12, 2015 03:08
A tool to help with Twitter list management. Shows you: a) people who are in your list who you don't follow and b) who you follow (newest first-ish), and whether your follows are in your list or not. To start, go to https://dev.twitter.com/apps, create a new app, and get app tokens. Use the dev web interface to create an OAuth token. Put those i…
#!/usr/bin/env python
import twython, secrets
from math import ceil
def cursored_request(method, sequence, *args, **kwargs):
myseq = []
nextCursor = -1
while nextCursor != 0:
kwargs['cursor'] = nextCursor
@tdsmith
tdsmith / gist:4478232
Last active December 10, 2015 18:58
QMJC planning meeting

Quantitative Microdevice Journal Club

Attending: Siavash Ahrar, David Li, Tim Smith; Kamran wandered in at some point

Unable to attend: Mindy Simon

Schedule

Once a month, in the third week? TBD.

Siavash will present first, since he has Feelings about how these should work so he can serve as a model.

@tdsmith
tdsmith / twevernote.py
Created December 24, 2012 21:45
A little script to dump your Twitter .zip archive into an Evernote notebook on OS X. For, you know, cloudiness. Loads tweets at about one per second, so don't expect it to be super-zippy. pip install appscript if you haven't, yet, which will give you aem.
#!/usr/bin/env python
import json, appscript, aem, sys, os, glob, datetime
def usage(called_name):
print 'Usage: %s <path to unzipped twitter archive> <name of Evernote notebook>' % called_name
print 'e.g., %s tweets/ "My Tweets"' % called_name
def main(tweet_path, notebook_name):
if not os.path.isdir(tweet_path):
@tdsmith
tdsmith / gist:4223645
Created December 6, 2012 10:55
Rooting your first-gen Kindle Fire from OS X

You don't need some stupid collection of batch files; this isn't that hard.

  1. Set up the Android SDK with Kindle Fire add-ons so that adb devices shows the Kindle in your list, like so: https://developer.amazon.com/sdk/fire/connect-adb.html
  2. Attain bootloader access per http://forum.xda-developers.com/showthread.php?p=24129239 -- go only as far as flashing the bootloader and recovery with fastboot. Do not use a version of twrp newer than 2.2.2.0: http://techerrata.com/file/twrp2/blaze/openrecovery-twrp-2.2.2.0-blaze.img or else a process named zygote will continuously segfault when you try to boot and all you will see is spinning triangles. If fastboot seems to hang without printing output, it hasn't done anything; you can safely hit Ctrl+C and force-reboot your Kindle.
  3. Boot in to twrp, Wipe Fucking Everything, and sideload and install your ROM of choice (I am partial to this one: http://forum.xda-developers.com/showthread.php?t=1765288 -- do not unzip it before copying it to your Kindle). Make sur