Skip to content

Instantly share code, notes, and snippets.

View koenbollen's full-sized avatar

Koen Bollen koenbollen

View GitHub Profile
@koenbollen
koenbollen / imgur.py
Created May 20, 2010 22:10
Commandline tool for uploading images to imgur.com.
#!/usr/bin/env python
# Koen Bollen <meneer koenbollen nl>
# 2010 GPL
#
import sys
import os
import optparse
import base64
import urllib2
@koenbollen
koenbollen / go4celebrity.py
Created July 4, 2010 20:44
Download a random wallpaper from go4celebrity.com
#!/usr/bin/env python
# Koen Bollen <meneer koenbollen nl>
# 2010 GPL
#
# Download an random wallpaper from go4celebrity.com
#
#
# My setup:
# =========
#
@koenbollen
koenbollen / spc.py
Created July 4, 2010 21:39
Simple Persistence Caching: make a function cached to disk with a simple decorator.
#!/usr/bin/env python
# Koen Bollen <meneer koenbollen nl>
# 2010 GPL
#
# Simple Persistence Caching
#
import os
import shelve
import urllib2
@koenbollen
koenbollen / punch.py
Created July 5, 2010 19:10
Proof of Concept: UDP Hole Punching
#!/usr/bin/env python
#
# Proof of Concept: UDP Hole Punching
# Two client connect to a server and get redirected to each other.
#
# This is the client.
#
# Koen Bollen <meneer koenbollen nl>
# 2010 GPL
#
@koenbollen
koenbollen / mastersteam.py
Created October 25, 2010 22:44
Query the Steam master servers.
#!/usr/bin/env python
#
# Query the Steam master servers.
#
# See: http://developer.valvesoftware.com/wiki/Master_Server_Query_Protocol
#
# Koen Bollen <meneer koenbollen nl>
# 2010 GPL
#
@koenbollen
koenbollen / torrentz.user.js
Created October 31, 2010 18:38
A Chrome Userscript that adds direct-download-links to torrent pages of http://torrentz.com/.
// ==UserScript==
// @name Torrentz Direct Link
// @description Adds direct links to torrent pages, you won't have to go to the original index.
// @author Koen Bollen
// @match http://torrentz.com/*
// ==/UserScript==
var rxs = {
'piratebay.org': [
@koenbollen
koenbollen / addrhash.py
Created November 28, 2010 19:29
Utility to convert an address to a hash and back.
#!/usr/bin/env python
# Convert an address to a hash and back.
#
# Koen Bollen <meneer koenbollen nl>
# 2010 GPL
#
import socket
import struct
import base64
@koenbollen
koenbollen / Screen.cs
Created April 18, 2011 14:43
A simple but complete ScreenManager for XNA.
using Microsoft.Xna.Framework;
using System.Linq;
namespace Screens
{
/// <summary>
/// This is a screen that can be added to the ScreenManager. Extend it and add components
/// to it in the Initialize() method. You can also override the Update() and Draw() method.
/// </summary>
@koenbollen
koenbollen / Terrain.cs
Created April 26, 2011 12:12
A multitextured heightmap.
using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;
@koenbollen
koenbollen / SimpleConsole.cs
Created April 26, 2011 12:23
A simple line based game console for XNA.
using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;