Skip to content

Instantly share code, notes, and snippets.

🐕
eating a tortilla

Neil Williams spladug

🐕
eating a tortilla
View GitHub Profile
View benchmark-isOpen.py
"""Check the time penalty for checking socket liveliness"""
import errno
import gc
import socket
import time
import gevent.socket
ITERATIONS = 10_000
View gist:e4c94d1e6a270af21f14
### Keybase proof
I hereby claim:
* I am spladug on github.
* I am spladug (https://keybase.io/spladug) on keybase.
* I have a public key whose fingerprint is 2A2D AD15 78F0 5F89 5CF7 336A 4343 B50C 8F8D 8190
To claim this, I am signing this object:
View gist:8309144
#!/usr/bin/python
import itertools
import random
IDEAL_SLEEP = 300
SLEEPER_COUNT = 3000
View gist:5087447
function retry {
local retry_max=$1
shift
local count=$retry_max
while [ $count -gt 0 ]; do
"$@" && break
count=$(($count - 1))
sleep 1
done
@spladug
spladug / gist:1711628
Created Jan 31, 2012
precomputed queries
View gist:1711628
### Following are all the precomputed queries in reddit including
### those from queries.py and promote.py. user/author_id is an account
### sr is a subreddit, sort is one of ("hot", "new", "top", "controversial")
### and time is one of ("all", "hour", "day", "week", "month", "year").
### I've divided them into two rough groupings: user and subreddit.
def get_links(sr, sort, time):
def get_spam_links(sr):
def get_spam_comments(sr):
def get_reported_links(sr):
View install-reddit.sh
The install script has moved to the main reddit repository:
https://github.com/reddit/reddit/blob/master/install-reddit.sh
You can’t perform that action at this time.