Skip to content

Instantly share code, notes, and snippets.

@timo
timo / conftest.py
Created May 6, 2012 11:10 — forked from minrk/checkipnb.py
collect ipython notebook files for py.test runs
# put this file into any folder under which ipynb files shall be collected.
import pytest
import os,sys
wrapped_stdin = sys.stdin
sys.stdin = sys.__stdin__
from IPython.zmq.blockingkernelmanager import BlockingKernelManager
sys.stdin = wrapped_stdin
from IPython.nbformat.current import reads
@timo
timo / voronoi.py
Created January 20, 2012 14:48 — forked from purpleposeidon/voronoi.py
Voronoi!
#!/usr/bin/python
import math
import pygame
import random
import time
class Coord:
def __init__(self, x=0, y=0):
class City(Base):
__tablename__ = "city"
name = Column(Unicode(6), primary_key=True)
rooms = relationship("Room", backref="city")
def __repr__(self):
return u'<City "%s" with %d rooms>' % (self.name, len(self.rooms))
class Room(Base):
__tablename__ = "room"
@timo
timo / Dancer.rb
Created June 12, 2009 10:30 — forked from tene/Dancer.rb
class Dancer
def description()
"is like a beautiful swan, gracefully flying over a lake"
end
def steps()
"⚡→→→→↓↓↓↓←↓→↓←↑↑↑↑→↓←↑Ϟ"
end
def dance()
puts self.WHAT
puts "My dance " + self.description