Skip to content

Instantly share code, notes, and snippets.

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
gavinhungry / nginx-tls.conf
Last active Dec 6, 2021
Nginx SSL/TLS configuration for "A+" Qualys SSL Labs rating
View nginx-tls.conf
# Name: nginx-tls.conf
# Auth: Gavin Lloyd <>
# Desc: Nginx SSL/TLS configuration for "A+" Qualys SSL Labs rating
# Enables HTTP/2, PFS, HSTS and OCSP stapling. Configuration options not related
# to SSL/TLS are not included here.
# Additional tips:
teepark /
Created Sep 9, 2010
a pure-python B tree and B+ tree implementation
import bisect
import itertools
import operator
class _BNode(object):
__slots__ = ["tree", "contents", "children"]
def __init__(self, tree, contents=None, children=None):
self.tree = tree
gregburek /
Created Dec 7, 2011
Rate limiting function calls with Python Decorators
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:
Zearin /
Last active Nov 26, 2021
The best explanation of Python decorators I’ve ever seen. (An archived answer from StackOverflow.)

NOTE: This is a question I found on StackOverflow which I’ve archived here, because the answer is so effing phenomenal.

Q: How can I make a chain of function decorators in Python?

If you are not into long explanations, see [Paolo Bergantino’s answer][2].

JBou / SoundCloud API Endpoints.cs
Last active Nov 25, 2021
SoundCloud API Endpoints
View SoundCloud API Endpoints.cs
{ ApiCommand.AuthorizationCodeFlow, new Uri("{0}&response_type={1}&redirect_uri={2}") },
{ ApiCommand.UserAgentFlow, new Uri("{0}&response_type=token&redirect_uri={1}") },
{ ApiCommand.UserCredentialsFlow, new Uri("{0}&client_secret={1}&grant_type=password&username={2}&password={3}") },
{ ApiCommand.RefreshToken, new Uri("{0}&client_secret={1}&grant_type=refresh_token&refresh_token={2}") },
{ ApiCommand.Me, new Uri("") },
{ ApiCommand.MeTracks, new Uri("") },
{ ApiCommand.MeComments, new Uri("") },
awesomebytes /
Last active Nov 25, 2021
Make a function or method threaded in python with a decorator

How to make a python function or class method threaded

From this stack overflow question I got this great snippet.

# Threaded function snippet
def threaded(fn):
    """To use as decorator to make a function call threaded.
    Needs import
    from threading import Thread"""
Prajjwal /
Last active Nov 6, 2021
A List of Ephemeral File Sharing Services

A List of Ephemeral File Sharing Services

Contributions welcome.

~ Prajjwal Singh

Service CLI? Max Size Direct Access Files Expire? Can Limit Download Count? Password Protection HTTPS curl -F 4 GB Yes Yes, by Mister Alg. No No Enforced
FileIO Yes 5 GB Yes Optionally Fixed @ 1 No Yes
tanaikech /
Last active Oct 16, 2021
Downloading Files From Google Drive Under No Authorization Using Browser

Downloading Files From Google Drive Under No Authorization Using Browser

This is a sample script for downloading files from Google Drive under no authorization using browser. By using this sample, you can make other users download files from your Google Drive. Even if the other users are not Google users, they can download the files.


mumrah /
Created Aug 7, 2010
Simple WebSockets in Python
import time
import struct
import socket
import hashlib
import sys
from select import select
import re
import logging
from threading import Thread
import signal
johndrinkwater / dualshock-research
Last active Oct 10, 2021
I’m interested in writing (or helping to spec out the protocol so someone else can write) the linux kernel driver for Sony’s DualShock 4 (PS4’s lovely controller) Currently using the output of HID RAW from a USB connected dualshock 4… For the gyro/touchpad discovery, I’ve just been using some terrible c code to throw numbers on the screen and it…
View dualshock-research
TADA, it’s `hexdump -v -e '64/1 "%02x" "\n"' < /dev/hidraw3`
No idea what the first byte is… but I’m going to assume its for device ID for the many users that are connected, but it probably has to be set by the connected machine?
left stick, value, first field is horz (00 left), second field is vertical (00 top)