Skip to content

Instantly share code, notes, and snippets.

View tdsmith's full-sized avatar

Tim D. Smith tdsmith

View GitHub Profile
@tdsmith
tdsmith / diff.rb
Last active August 29, 2015 14:03
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 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):