Skip to content

Instantly share code, notes, and snippets.

thorsummoner /
Last active Oct 12, 2016 — forked from hurricanerix/
Simple python app setting up SDL2 & OpenGL.
#!/usr/bin/env python
# The MIT License (MIT)
# Copyright (c) 2014 Richard Hawkins
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
thorsummoner / .gitignore
Last active Mar 3, 2020 — forked from cournape/gist:1077528
cython c++ example
View .gitignore
# Byte-compiled / optimized / DLL files
# C extensions
# Distribution / packaging
thorsummoner /
Last active Oct 10, 2015 — forked from keturn/
xwarppointer python script, updated to be more python, (and pylint passing)
#!/usr/bin/env python
"""Make the X cursor wrap-around.
Adapted from
to work around lack of relative mouse movement
for Thief: Dark Shadows (and possibly others)
This version is a little kinder to your CPU than the shell script with
the busy-loop that starts a new process for every pointer query.
#!/usr/bin/env python
import argparse
import cairo
from gi.repository import Gtk
from gi.repository import Gdk
from gi.repository import GdkPixbuf
from gi.repository import GObject
View gist:e906529da9b3b26f4a65
from itertools import izip, product, tee
# Logic functions: take and return iterators of truth values
def AND(a, b):
for p, q in izip(a, b):
yield p and q
def OR(a, b):
for p, q in izip(a, b):