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
""" | |
Simple, asynchronous, nonblocking UDP emitter for Cube metrics. | |
""" | |
import json | |
import socket | |
from datetime import datetime | |
class Emitter(object): |
// 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; |
""" | |
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 |
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) |
\documentclass[10pt]{article} | |
\usepackage[margin=1in]{geometry} | |
\usepackage[utf8]{inputenc} | |
\usepackage{amsmath} | |
\usepackage{amsfonts} | |
\usepackage{amssymb} | |
\setcounter{secnumdepth}{0} | |
\usepackage{fancyhdr, lastpage} | |
\pagestyle{fancy} |
;; 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*) |
""" | |
"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.) |
""" | |
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 |
""" | |
Detect exactly which bytes have changed in a file. | |
Useful for binary reverse engineering: | |
- Start script | |
- Save file from program, changing one attribute | |
- See which byte(s) have changed | |
""" | |
import os | |
import traceback |