Skip to content

Instantly share code, notes, and snippets.

diracdeltas /
Last active Oct 1, 2020
COVID-19 in SF calculations


I am NOT a subject matter expert. The calculations below rely on some oversimplifying assumptions which are probably wrong. This is NOT intended to be public health advice.

Bayes Theorem

P(B|A) = P(A|B) * P(B) / P(A)

Probability of being COVID-negative when you test positive for COVID in SF

diracdeltas /
Last active Jun 27, 2022
copy all your rekordbox hotcues to memory cues
# usage: python3 $XML_FILENAME
# see for XML export/import instructions
import xml.etree.ElementTree as ET
import sys
print('converting ' + sys.argv[1])
tree = ET.parse(sys.argv[1])
root = tree.getroot()
View gist:41d117566206e298f092c0c69fcc9045
diracdeltas /
Last active Jun 14, 2017
protocol for domain ownership verification in Brave Payments


The Brave browser now includes a way for users to allocate ~monthly anonymized micropayments for online publishers. These payments are held in an escrow wallet managed by Brave Inc., which must then provide a way for publishers to claim their total allocated funds (minus processing fees).

Note that for 1.0, we only support allocating payments at the domain-name level. Hence, and would count as separately payable publishers, but any funds calculated based on pageviews for and would simply go to Note that currently Brave includes an exception list that prevents us from paying platforms with user-generated content, like

Verification steps

  1. is eligible to claim payments if its total contributed amount is at least $10. Once this happens, Brave sends verification initiation emails from `paym
diracdeltas / jquery.min.js
Created Aug 23, 2015
a sketchy fork of jquery 1.11.3
View jquery.min.js
/*! jQuery v1.11.3 | (c) 2005, 2015 jQuery Foundation, Inc. | */
!function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=c.slice,e=c.concat,f=c.push,g=c.indexOf,h={},i=h.toString,j=h.hasOwnProperty,k={},l="1.11.3",m=function(a,b){return new m.fn.init(a,b)},n=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,o=/^-ms-/,p=/-([\da-z])/gi,q=function(a,b){return b.toUpperCase()};m.fn=m.prototype={jquery:l,constructor:m,selector:"",length:0,toArray:function(){return},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]},pushStack:function(a){var b=m.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a,b){return m.each(this,a,b)},map:function(a){return this.pushStack(,function(b,c){return,c,b)}))},sl
diracdeltas /
Created Jun 27, 2014
sample test script for https everywhere
set -e
# should be the root of the HTTPS E git repo
cd "`dirname $0`"
# path to a dummy Jetpack addon that contains HTTPS-E tests
diracdeltas / https-everywhere-heartbleed.txt
Created Apr 8, 2014
How to check that your HTTPS Everywhere signing keys are correct
View https-everywhere-heartbleed.txt
Hash: SHA512
To check that you have a "good" copy of HTTPS Everywhere (one with the
correct update signing keys), you can do the following:
# Firefox:
1. Go to your Firefox profile directory:

Keybase proof

I hereby claim:

  • I am diracdeltas on github.
  • I am bcrypt ( on keybase.
  • I have a public key whose fingerprint is BDE7 D508 3BB3 5EDC 7A66 BD97 388C E229 FAC7 8CF7

To claim this, I am signing this object:

diracdeltas / update
Created Nov 4, 2013
A server-side Git update hook for HTTPS Everywhere that forces ruleset validation before accepting commits.
View update
# Hook script to validate rules and check locales before accepting
# pushed changes on the server side.
# See
# By default, this should run in the root of the git repository.
# --- Command line
git clone ./tmp/https-everywhere
cd ./tmp/https-everywhere
git checkout deterministic
git log --abbrev-commit -n 1
# TODO: replace the following with Python that does unicode normalization
find ./src/ -type f -print0 | LC_ALL=C sort -z | xargs -0 cat | shasum
shasum pkg/https-everywhere-4.0development.11~pre.xpi