Skip to content

Instantly share code, notes, and snippets.

class Identifier(object):
def __init__(self, name):
if isinstance(name, Identifier):
name = name.name
self.name = name
def __repr__(self):
return self.name
class Symbol(Identifier):
from PIL import Image
from math import cos, sin, sqrt
import struct
import psyco
psyco.full()
def f(x, y):
tsin = sin(3.14159/4)
tcos = cos(3.14159/4)
from PIL import Image
from math import cos, sin, sqrt
import struct
import psyco
psyco.full()
def f(x, y):
tsin = sin(3.14159/4)
tcos = cos(3.14159/4)
[BITS 16]
[ORG 0x7C00]
jmp main
; Reads sectors
; bx == Low 16 bits of addr
; cx == High 12 bits of addr
; dx == Output buffer
; di == Number of sectors
from json import loads
from urllib2 import HTTPError, urlopen
class Exchange(object):
def __init__(self, username, key):
self.username = username
self.key = key
def getPage(self, url):
try:
def decorator(func):
"""
This is a meta-decorator to facilitate decorator creation. When used on a
function, it returns a function which, when called, passes the decorated
function and the arguments of the call to the decorator.
Example:
@decorator
def test(func, *args, **kwargs):
@daeken
daeken / readme.md
Created June 15, 2012 15:23
Readme

Requirements

Install Python 2.7 and then run:

easy_install flask sqlalchemy coffeescript alembic twilio
easy_install --index-url https://code.stripe.com --upgrade stripe
git clone https://github.com/trentm/python-markdown2.git
cd python-markdown2
sudo python setup.py install
@daeken
daeken / encoder.py
Created August 3, 2012 06:15
Encoder
class Encoder(object):
instance = None
@staticmethod
def get():
if Encoder.instance != None: #and Encoder.instance.test():
return Encoder.instance
ports = getPorts()
port = None
for tport in ports:
#include <EEPROM.h>
#define CONSERVATIVE
int ioPin = 3;
#define BUFSIZE 200
unsigned char buf[BUFSIZE];
#define pullLow() pinMode(ioPin, OUTPUT)
#define pullHigh() pinMode(ioPin, INPUT)
@daeken
daeken / security.md
Created August 16, 2012 03:05
Outline
  • Intro
    • Mindset
      • Break all the things
    • Understanding is key
      • Security people are the most diverse in tech for that reason
  • Web security
    • Tools
      • Burp
    • XSS
    • CSRF