Skip to content

Instantly share code, notes, and snippets.

@trtg
trtg / fibonacci.py
Created January 29, 2013 07:24
dynamic programming in python using the @lru_cache decorator
#from functools import lru_cache#python >=3.2
from functools32 import lru_cache#python 2.7
#from repoze.lru import lru_cache#python 2.7
#NOTE: you can use python -m trace --count fibonacci.py
#to see how many times each instruction is called
#@lru_cache(maxsize=500)#repoze.lru needs maxsize arg
@lru_cache()#using functools32
def fibonacci(n):
@trtg
trtg / _.md
Created January 21, 2013 20:39
leap_motion_test
@trtg
trtg / _.md
Created January 8, 2013 13:17
d3 tributary drag and drop example

An inlet to tributary

@trtg
trtg / gist:4483703
Created January 8, 2013 13:10
mendeley oauth python client using rauth note the comments on web flow vs app flow
from rauth.service import OAuth1Service
from credentials import consumer_key,consumer_secret
mendeley = OAuth1Service(
name='mendeley',
consumer_key=consumer_key,
consumer_secret=consumer_secret,
request_token_url='http://api.mendeley.com/oauth/request_token/',
access_token_url='http://api.mendeley.com/oauth/access_token/',
authorize_url='http://api.mendeley.com/oauth/authorize/',
@trtg
trtg / _.md
Created January 7, 2013 23:27
d3 tributary parallel coordinates

An inlet to tributary

@trtg
trtg / _.md
Created January 7, 2013 23:09
d3 tributary reusable bar chart

An inlet to tributary

@trtg
trtg / gist:4453837
Created January 4, 2013 16:22
building openframeworks in gentoo
scripts/compileOF.sh
emerge freeimage
emerge glew
emerge jack-audio-connection-kit
add USER_LDFLAGS = -lGLEW -lGLU to apps/projectGenerator/projectGeneratorSimple/config.make
scripts/compilePG.sh
@trtg
trtg / _.md
Last active March 19, 2016 05:39 — forked from enjalot/_.md
d3 tributary 3.js 3D plotting example
@trtg
trtg / blink.c
Last active October 27, 2020 18:10
msp430 launchpad sample code to blink LED 1
@trtg
trtg / gist:4451949
Last active November 20, 2017 12:53
Commands for setting up MSP430 toolchain in gentoo
emerge crossdev
mkdir /usr/local/portage
add PORTDIR_OVERLAY="/usr/local/portage" to /etc/make.conf
mv /etc/portage/package.env /etc/portage/package.env.bak
mkdir /etc/portage/package.env
mv /etc/portage/package.env.bak /etc/portage/package.env/x86_64-pc-linux-gnu
crossdev -s4 -t msp430 #stage 4 will build gcc, libc, and binutils
#This will also create: /usr/msp430/etc/portage/make.conf
crossdev --ex-only --ex-gdb -t msp430 #just cross compile gdb
emerge mspdebug