Skip to content

Instantly share code, notes, and snippets.

View toke's full-sized avatar

Thomas Kerpe toke

View GitHub Profile
@kyledrake
kyledrake / ferengi-plan.txt
Last active April 6, 2024 00:30
How to throttle the FCC to dial up modem speeds on your website using Nginx
# The blog post that started it all: https://neocities.org/blog/the-fcc-is-now-rate-limited
#
# Current known FCC address ranges:
# https://news.ycombinator.com/item?id=7716915
#
# Confirm/locate FCC IP ranges with this: http://whois.arin.net/rest/net/NET-165-135-0-0-1/pft
#
# In your nginx.conf:
location / {
0-mail.com
0815.ru
0845.ru
0clickemail.com
0wnd.net
0wnd.org
10mail.com
10mail.org
10minutemail.cf
10minutemail.co.za
@rberenguel
rberenguel / reddi.py
Last active July 7, 2019 11:22
*reddi.py*: Browse reddit from the command line (you'll have to change the location of your python *reddit*: Bindings to use reddipy from within the acme text editor from plan9ports (Plan 9 from User Space) reddit assumes reddi.py is in the same folder. Change it to suit your tastes. To read a little more about the shell reddit script that drive…
#!/opt/local/Library/Frameworks/Python.framework/Versions/2.6/bin/python
import urllib,json
import argparse
parser = argparse.ArgumentParser()
parser.add_argument( 'subreddit', nargs=1,help="Subreddit to browse, f.e. programming")
args= parser.parse_args()
subreddit = args.subreddit[0]
a = urllib.urlopen('http://www.reddit.com/r/'+str(subreddit)+'/.json')
try:
@adamloving
adamloving / temporary-email-address-domains
Last active May 31, 2024 15:43
A list of domains for disposable and temporary email addresses. Useful for filtering your email list to increase open rates (sending email to these domains likely will not be opened).
0-mail.com
0815.ru
0clickemail.com
0wnd.net
0wnd.org
10minutemail.com
20minutemail.com
2prong.com
30minutemail.com
3d-painting.com
@iiska
iiska / lut-helper.c
Created January 11, 2012 13:19
Floating point --> Fixed point --> Bit string conversion for constellation code lookup tables
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
const double qpsk[] = {-1.0, 1.0};
const double qam16[] = {-3.0, -1.0, 3.0, 1.0};
const double qam64[] = {-7.0, -5.0, -1.0, -3.0, 7.0, 5.0, 1.0, 3.0};
/* Generic function for converting short integers to bit string
* representation.
@jed
jed / LICENSE.txt
Created May 11, 2011 07:05 — forked from 140bytes/LICENSE.txt
use localStorage
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 Jed Schmidt <http://jed.is>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@faried
faried / maildirtocouch.py
Created February 1, 2011 22:02
Store messages in a Maildir into a couchdb database.
#!/usr/bin/env python
"""Store messages in a Maildir into a couchdb database."""
import couchdb
from mailbox import Maildir
from optparse import OptionParser
import os
from pprint import pprint
import sys
from uuid import uuid4
@sh1mmer
sh1mmer / The Koan of Closure
Created December 15, 2010 22:18
Programming Koans
The venerable master Qc Na was walking with his student, Anton. Hoping to
prompt the master into a discussion, Anton said "Master, I have heard that
objects are a very good thing - is this true?" Qc Na looked pityingly at
his student and replied, "Foolish pupil - objects are merely a poor man's
closures."
Chastised, Anton took his leave from his master and returned to his cell,
intent on studying closures. He carefully read the entire "Lambda: The
Ultimate..." series of papers and its cousins, and implemented a small
Scheme interpreter with a closure-based object system. He learned much, and
@hugs
hugs / tweet_archiver.py
Created December 13, 2010 23:59
Python code for retrieving all your tweets, based on code from @terrycojones.
# Based on http://blogs.fluidinfo.com/terry/2009/06/24/python-code-for-retrieving-all-your-tweets/
# Patched to retry upon failure until *all* tweets are downloaded.
import sys, twitter, operator
from dateutil.parser import parse
import time
twitterURL = 'http://twitter.com'
def fetch(user):
data = {}
api = twitter.Api()
@jchris
jchris / reduce.js
Created November 26, 2010 04:41
unique key count reduce
function(ks, vs, rr) {
// values are discarded by reduce
// todo: configurable key function, for complex queries
var fk, lk;
function uniqCount(keys) {
var count = 0, obj = {};
for (var i=0; i < keys.length; i++) {
if (!obj[keys[i]]) {
count++;
obj[keys[i]] = true;