Skip to content

Instantly share code, notes, and snippets.

@peanutbother
peanutbother / console.log.disable.js
Created July 25, 2016 23:02
Disable console.log for on website
// backup console object
var debug = console;
//create Console Class
var Console;
(Console = function (showError) {
if (typeof showError == 'boolean') {
this.showError = showError;
}
}).prototype = {
showError: false;
@peanutbother
peanutbother / sorts.py
Created May 30, 2016 14:00 — forked from amix/sorts.py
The confidence sort in pure Python (from Reddit's codebase)
# Rewritten code from /r2/r2/lib/db/_sorts.pyx
from math import sqrt
def confidence(ups, downs):
n = ups + downs
if n == 0:
return 0
z = 1.281551565545