Skip to content

Instantly share code, notes, and snippets.

Avatar
🍌
I am here to bring bananas to the people

Tom-Oliver Heidel blackjack4494

🍌
I am here to bring bananas to the people
  • Bremen/Hamburg, Germany
View GitHub Profile
View SpectatorServer.cs
// Type: LOLReplay.SpectatorServer
// Assembly: LOLReplay, Version=0.8.1.4, Culture=neutral, PublicKeyToken=null
// Assembly location: C:\Dokumente und Einstellungen\[...]\Desktop\Downloads\LOLReplay.exe
using System;
using System.Collections.Generic;
using System.IO;
using System.Net;
using System.Net.Sockets;
using System.Text;
@rich20bb
rich20bb / PythonSimpleWebsocket
Created Dec 2, 2012
Simple websocket server in Python. Echos back whatever is received. Works with Chome, Firefox 16, IE 10.
View PythonSimpleWebsocket
import time
import struct
import socket
import hashlib
import base64
import sys
from select import select
import re
import logging
from threading import Thread
@gregburek
gregburek / rateLimitDecorator.py
Created Dec 7, 2011
Rate limiting function calls with Python Decorators
View rateLimitDecorator.py
import time
def RateLimited(maxPerSecond):
minInterval = 1.0 / float(maxPerSecond)
def decorate(func):
lastTimeCalled = [0.0]
def rateLimitedFunction(*args,**kargs):
elapsed = time.clock() - lastTimeCalled[0]
leftToWait = minInterval - elapsed
if leftToWait>0:
@teepark
teepark / btree.py
Created Sep 9, 2010
a pure-python B tree and B+ tree implementation
View btree.py
import bisect
import itertools
import operator
class _BNode(object):
__slots__ = ["tree", "contents", "children"]
def __init__(self, tree, contents=None, children=None):
self.tree = tree
@mumrah
mumrah / websocketserver.py
Created Aug 7, 2010
Simple WebSockets in Python
View websocketserver.py
import time
import struct
import socket
import hashlib
import sys
from select import select
import re
import logging
from threading import Thread
import signal