Skip to content

Instantly share code, notes, and snippets.

View tomfrazier's full-sized avatar

Tom Frazier tomfrazier

View GitHub Profile
@dancodery
dancodery / bitcoin-burn-address-generator.py
Created September 23, 2021 21:16
This script generates bitcoin coin burning addresses with a custom bitcoin address prefix. The symbols at the end of the btc burning address are made for checksum verification.
#!/usr/bin/env python
"""bitcoin-burn-address-generator.py: This script generates bitcoin coin burning addresses with a custom bitcoin address prefix.
The symbols at the end of the burning btc address are made for checksum verification."""
__author__ = "Daniel Gockel"
__website__ = "https://www.10xrecovery.org/"
import sys
@gahabeen
gahabeen / 8base-with-Auth0-Passwordless.txt
Last active January 21, 2021 05:30
8base / Auth0 - Passwordless Login/Signup
# 8base / Auth0 - Passwordless Login/Signup
Follow the conversation over there: [https://community.8base.com/t/using-auth0-passwordless-email-connection/529/6](https://community.8base.com/t/using-auth0-passwordless-email-connection/529/6)
'use strict';
const http = require('https');
exports.appWebhook = (req, res) => {
let content = req.body.result.parameters['content'];
getContent(content).then((output) => {  
res.setHeader('Content-Type', 'application/json');  
res.send(JSON.stringify({ 'speech': output, 'displayText': output    }));
}).catch((error) => {  
// If there is an error let the user know  
res.setHeader('Content-Type', 'application/json');  
@amix
amix / sorts.py
Created March 19, 2016 11:10
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
# Author: Aram Grigorian <aram@opendns.com>
# https://github.com/aramg
# https://github.com/opendns
#
# By default, nginx will close upstream connections after every request.
# The upstream-keepalive module tries to remedy this by keeping a certain minimum number of
# persistent connections open at all times to upstreams. These connections are re-used for
# all requests, regardless of downstream connection source. There are options available
# for load balacing clients to the same upstreams more consistently.
# This is all designed around the reverse proxy case, which is nginxs main purpose.
@regadas
regadas / nginx.conf
Created November 9, 2013 03:17
nginx cached forward proxy #example
user www-data;
worker_processes 1;
pid /var/run/nginx.pid;
events {
worker_connections 2048;
multi_accept on;
use epoll;
}
@amontalenti
amontalenti / script-inject-http-proxy.js
Created November 21, 2012 17:16
script injecting proxy for Node.JS
var httpProxy = require('http-proxy');
var url = require('url');
httpProxy.createServer(function(req, res, proxy) {
var isHtml = false,
write = res.write,
writeHead = res.writeHead,
params = url.parse(req.url, true).query,
dest = params.dest || 'localhost',