Skip to content

Instantly share code, notes, and snippets.

View micahwalter's full-sized avatar
👋

Micah Walter micahwalter

👋
View GitHub Profile
""" base58 encoding / decoding functions """
import unittest
alphabet = '123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ'
base_count = len(alphabet)
def encode(num):
""" Returns num in a base58-encoded string """
encode = ''
@micahwalter
micahwalter / objectphone.py
Last active December 16, 2015 08:39
Welcome to object phone!
import os
from flask import Flask, request, redirect
from twilio import twiml
import cStringIO
import pycurl
import urllib
import simplejson as json
api_token = os.environ['CH_API_KEY']
def shannon_entropy(img):
# calculate the shannon entropy for an image
histogram = img.histogram()
histogram_length = sum(histogram)
samples_probability = [float(h) / histogram_length for h in histogram]
return -sum([p * math.log(p, 2) for p in samples_probability if p != 0])
<!--
_____ ______) ______) ____ ___)
(, / | (, / , /) (, / (, / / /)
/---| / __ (/_ _/_ _ / ___ /---/ _ _ _/_(/ _ __
) / |_ ) / / (__(_/_) (_(_(___(/_ ) / (_) ) / (___(/_(_(_(__/ )__(/_/ (_
(_/ (_/ (_/ (_/
flower-on-lightgrey.com by Evan Roth, 2013
A Tribute To Heather (http://tribute-to-heather.com) is a series of One Gif Compositions
# Want to show hidden files and folders in your TextMate project drawer? Simple, just modify the file and folder patterns in TextMate's preferences.
# Instructions:
# Go to TextMate > Preferences...
# Click Advanced
# Select Folder References
# Replace the following:
# File Pattern
@micahwalter
micahwalter / albersify.py
Last active December 12, 2015 05:48
a short script to grab a random object and then get its Albers rings and build and image.
#!/usr/bin/env python
import glob
import pycurl
import urllib
import simplejson as json
import cStringIO
import Image, ImageDraw
import sys
import os
@micahwalter
micahwalter / mamp.py
Created January 29, 2013 12:23
make pycurl work with mamp
c.setopt(c.SSL_VERIFYPEER, False)
c.setopt(c.SSL_VERIFYHOST, False)
#!/usr/bin/env python
import sys
import os
import os.path
import sqlite3 as lite
import urlparse
import oauth2 as oauth
import urllib
@micahwalter
micahwalter / oauth
Created January 16, 2013 05:41 — forked from codingjester/oauth
#!/usr/bin/env python
import oauth2 as oauth
import urlparse
import urllib
consumer_key = '<your-key-here>'
consumer_secret = '<your-secret-key-here>'
request_token_url = 'http://www.tumblr.com/oauth/request_token'

Cultural Source Code

This afternoon I gave a talk, similar to the talk Aaron and I gave at MCN last year. This one however was for the METRO Annual Meeting. Below are the slides and notes. It was fun!

I'll begin with a quote from my boss, Seb Chan on what we mean by "cultural source code."