Skip to content

Instantly share code, notes, and snippets.

dct = {}
x, dct[x], x, dct[x], x, dct[x], x, dct[x], x, dct[x], x, dct[x], x, dct[x],\
x, dct[x], x, dct[x], x, dct[x], x, dct[x], x, dct[x] = \
'\u0101\u0200\u0201\u0100'\
'\u0102\u0148\u0103\u0157\u0104\u012c\u0105\u0120\u0106\u0121'\
'\u0202\u0265\u0203\u026c\u0204\u026f\u0205\u0272\u0206\u0264'
def decode(inp):
state = '\x01'
######iw]iyf######l(ipjf##################
# mi)t o )nroo #
# pt e=r =. iir THIS SIDE UP #
# ohar lnn #
# r s( x ( ]t(x #
# t f [ +(x #
import sys
with open( sys. argv[1
]) as f: l = list(
iter(f ))
from __future__ import division
import subprocess
from docopt import docopt
import os
import shutil
import tempfile
import json
from pprint import pprint
import time
import numpy
@SuperDoxin
SuperDoxin / game_of_life.py
Last active June 17, 2019 15:00
game of life
#!/usr/bin/python3
import numpy
from functools import reduce
import time
# I am terribly sorry for what is about to follow
initial_state = "random" # possible values: glider, random
if initial_state == "glider":
from __future__ import division
from collections import namedtuple
import pygame
import math
import numpy as np
W,H=640,480#screen resolution
DIST=10#distance of the horizon
Y_SHIFT=200#how much to shift the plane down
Y_UNDU=100#how much to undulate the plane up and down
@SuperDoxin
SuperDoxin / split.py
Created August 30, 2014 19:22
split an email file into months and clean it up in general
import codecs
import os.path
import sys
import json
import email.parser
import email.generator
import parsedatetime.parsedatetime as pdt
import cStringIO as StringIO
import time
#import parsedatetime.parsedatetime_consts as pdc
import pygame
pygame.init()
screen=pygame.display.set_mode((640,480))
while True:
for event in pygame.event.get():
if event.type==pygame.QUIT:
raise SystemExit()
import kassa
import inspect
import pytest
import random
def test_classes():
assert inspect.isclass(kassa.Product)
def test_getprice():
p=kassa.Product(name="TestProduct",prijs=4.80,barcode="0001234567017")
@SuperDoxin
SuperDoxin / test.fragment.glsl
Last active August 29, 2015 14:05
attempt at python/sdl/opengl3
#version 330 core
in vec2 pos;
out vec4 color_out;
void main()
{
color_out=vec4(1.0,0.0,0.0,1.0);
}
@SuperDoxin
SuperDoxin / tutorial.lua
Created June 10, 2014 17:39
lua script to show a very basic tutorial in The Powder Toy
function lerp(a,b,t)
return {(a[1]*(1-t))+(b[1]*t),(a[2]*(1-t))+(b[2]*t)}
end
function bezier(p0,p1,p2,p3,t)
local p4=lerp(p0,p1,t)
local p5=lerp(p2,p3,t)
local p6=lerp(p4,p5,t)
return p6
end