Skip to content

Instantly share code, notes, and snippets.

@minus7
minus7 / EventDispatcher.cpp
Created June 17, 2018 19:06
EventDispatcher
#include <string>
#include <tuple>
#include <functional>
#include <vector>
#include <map>
#include <boost/hana.hpp>
#include <memory>
#include <iostream>
#include <queue>
#include <utility>
#!/usr/bin/env python3
# vim: set noexpandtab:
from functools import wraps
from inspect import signature
def type_checked(func):
@wraps(func)
def wrapper(*args, **kwargs):
sig = signature(func)
bound = sig.bind(*args, **kwargs)
@minus7
minus7 / befunge.py
Created July 18, 2015 15:54
Befunge Interpreter
from StringIO import StringIO
import inspect
from functools import wraps
import random
DEBUG = False
instructions = {}
def instr(opcode):
@minus7
minus7 / typecheck.py
Created February 14, 2015 21:37
Python Type-Checking Decorator
# Check if a function's arguments are instances of a (set of) type(s):
# >>> @type_checked
# >>> def test(asdf: str):
# >>> print(type(asdf))
# >>> test(3)
# ValueError: Argument asdf should be of type str but is int
# Using @type_checked_cast instead of @type_checked tries
# casting the argument to the desired type:
# >>> @type_checked_cast
  • contact (support/support_and_contact.md + more?)
  • faq (general faq with links to other articles, tired_matricks/license stuff should probably be here too)
  • game_rules (ctf_scoring, more?)
  • troubleshooting (reset_config and alike)
  • map_editor
  • configuration (should include a basic tutorial + a list of commands)
  • client
  • server (server_setup.md, server_setup_2.md, server_tuning.md, server_commands.md)
  • common (everything that can be useful for both client and server)
  • rules (merge forum_rules, irc_rules, support_rules)