Current status: incomplete draft.
- Computation: V8 very fast; significantly faster than most interpreted languages. The one very big exception is PyPy, which is in the same ballpark
| """ | |
| liveyamlfile.py | |
| Live Pythonic attribute access to properties in a yaml file. | |
| by Peter Sobot ([email protected]), August 8, 2012 | |
| """ | |
| import os | |
| import time | |
| import yaml | |
| import logging |
| """ | |
| "The Beatbox Machine" by Peter Sobot and Borna Almasi | |
| Designed and written in 4 hours on Sept. 25, 2011 at Music Hack Day Montréal | |
| Dependencies: | |
| EchoNest.Remix | |
| Wubmachine.Remixer (https://github.com/psobot/wub-machine) | |
| this file should end up in <wub-root>/remixers/beatbox.py | |
| Honestly, this is just a code-dump to Github. (And the code only sorta-kinda-works, with hardcoded values.) |
| ;; Read-only, network-free sandbox | |
| ;; Mac OS X 10.7+ | |
| ;; Restricts file writes and network access for any command run like: | |
| ;; sandbox-exec -f ronf.sb <command> | |
| ;; Useful for untrusted programs that should only do computation. | |
| (version 1) | |
| (allow default) | |
| (deny file-write*) | |
| (deny network*) |
| \documentclass[10pt]{article} | |
| \usepackage[margin=1in]{geometry} | |
| \usepackage[utf8]{inputenc} | |
| \usepackage{amsmath} | |
| \usepackage{amsfonts} | |
| \usepackage{amssymb} | |
| \setcounter{secnumdepth}{0} | |
| \usepackage{fancyhdr, lastpage} | |
| \pagestyle{fancy} |
| import Queue | |
| import multiprocessing | |
| import threading | |
| class BufferedReadQueue(Queue.Queue): | |
| def __init__(self, lim=None): | |
| self.raw = multiprocessing.Queue(lim) | |
| self.__listener = threading.Thread(target=self.listen) | |
| self.__listener.setDaemon(True) |
| """ | |
| 1) Be someone crazy working with Apple's CoreAudio. | |
| 2) Put "CAShow(graph)" somewhere in your Objective-C code. | |
| 3) Copy the resulting output from your XCode Console window. | |
| 4) Do `pbpaste | python plot.py && open out.png` | |
| 5) See a very basic rendering of the crazy audio graph you've made. | |
| """ | |
| import re | |
| import sys |
| // Some really hacky code being used in my next blog redesign. | |
| // by Peter Sobot (psobot.com) on December 16, 2012 | |
| ;(function ( $, window, document, undefined ) { | |
| var pluginName = 'punchout', | |
| defaults = { | |
| }; | |
| function Plugin( element, options ) { | |
| this.element = element; |
| """ | |
| Simple, asynchronous, nonblocking UDP emitter for Cube metrics. | |
| """ | |
| import json | |
| import socket | |
| from datetime import datetime | |
| class Emitter(object): |
| class MyClass(object): | |
| def __init__(self): | |
| self.foo = "I'm the correct variable!" | |
| def do_something(self): | |
| # Whoops, I forgot to write this as "self.foo". | |
| print foo | |
| if __name__ == "__main__": | |
| foo = "Herp derp, I'm the wrong variable." |