Skip to content

Instantly share code, notes, and snippets.

' DROP TABLE user_statuses; --

Rich T. rtt

' DROP TABLE user_statuses; --
Block or report user

Report or block rtt

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
simonw /
Last active Dec 20, 2019
How to recover lost Python source code if it's still resident in-memory

How to recover lost Python source code if it's still resident in-memory

I screwed up using git ("git checkout --" on the wrong file) and managed to delete the code I had just written... but it was still running in a process in a docker container. Here's how I got it back, using and

Attach a shell to the docker container

Install GDB (needed by pyrasite)

apt-get update && apt-get install gdb
#!/usr/bin/env bash
set -eu -o pipefail
REDIS_CMD=(redis-cli -h "$HOST" scan)
if [[ ! -z ${1:-} ]]; then CMD_EXTRA+=(MATCH "$1"); fi
if [[ ! -z ${2:-} ]]; then CMD_EXTRA+=(COUNT "$2"); fi
shreyansb /
Last active Jan 15, 2020
A profiler for Flask apps
This module provides a simple WSGI profiler middleware for finding
bottlenecks in web application. It uses the profile or cProfile
module to do the profiling and writes the stats to the stream provided
To use, run `` instead of ``
rtt / gist:5a2e0cfa638c938cca59
Created Aug 14, 2014
example python tinderbot
View gist:5a2e0cfa638c938cca59
# encoding: utf8 1,1 Top# encoding: utf8
import argparse
from datetime import datetime
import json
from random import randint
import requests
import sys
from time import sleep
glenrobertson /
Last active Jun 30, 2019
Flask response cache decorator
import datetime
import time
from functools import wraps
from wsgiref.handlers import format_date_time
from flask import make_response
def cache(expires=None, round_to_minute=False):
Add Flask cache response headers based on expires in seconds.
TSiege / The Technical Interview Cheat
Last active Feb 27, 2020
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.
View The Technical Interview Cheat


I have moved this over to the Tech Interview Cheat Sheet Repo and has been expanded and even has code challenges you can run and practice against!


rtt /
Last active Feb 24, 2020
Tinder API Documentation

Tinder API documentation

I've sniffed most of the Tinder API to see how it works. You can use this to create bots (etc) very trivially. Some example python bot code is here -> (horribly quick and dirty, you've been warned!)

Note: this was written in April/May 2014 and the API may have changed since. I have nothing to do with Tinder, nor their API, and I do not offer any support for anything you may build on top of this

API Details

robcowie /
Created Apr 5, 2013
Python version of php's best feature
def extract(d):
import inspect
View gist:3940886
class WeatherTypes
const CLEAR_NIGHT = 0;
const SUNNY_DAY = 1;
const NOT_USED = 4;
const MIST = 5;
const FOG = 6;
nikcub /
Created Oct 4, 2012
Facebook PHP Source Code from August 2007
You can’t perform that action at this time.