Skip to content

Instantly share code, notes, and snippets.


Adam Merberg amerberg

  • Massachusetts, USA
View GitHub Profile
View weibull-sum.R
#set seed for replicability
#generate 10^3 deviations, 10^6 replicates
w = replicate(10^6, rweibull(10^3, 0.9, 1))
#recall Weibull is subexponential when shape parameter is < 1.
amerberg / bookmarklets.js
Last active Jul 25, 2016
Quora bookmarklets
View bookmarklets.js
/* These are bookmarks for making various tasks on Quora easier.
* Since GitHub Markdown doesn't allow JavaScript links, you'll have to install the complicated way.
* Each of the lines beginning with `javascript:` below is a bookmarklet.
* To install, create a new bookmark in your browser and paste that line as the URL.
* Leave feedback in Gist comments or contact
//Get the rank of the answer belonging to the logged-in user (in a JS alert box).
//You will have to scroll down far enough that your answer has loaded before you use it.
//Perhaps a future version will do that automatically.
amerberg / monitor.js
Last active Aug 29, 2015
Monitor Quora questions
View monitor.js
//Initialize counts of how many are already monitored,
//how many we're newly monitoring, how many we failed to monitor
var already = 0;
var succeeded = 0;
var failed = 0;
var interrupt = false;
$(document).keyup(function(e){if(e.keyCode==27){interrupt = true;}});
amerberg /
Last active Jun 6, 2021
A script to remove comments from LaTeX source
import ply.lex, argparse, io
# python input.tex > output.tex
# python input.tex -e encoding > output.tex
#This utility is released under the WTFPL license:
def strip_comments(source):
tokens = (