Skip to content

Instantly share code, notes, and snippets.

@borisreitman
borisreitman / 0-README.md
Last active August 2, 2026 21:55
Let your devs publish a local webserver safely

Let your devs publish a local webserver safely

Each developer gets a stable HTTPS URL on your domain (foo.dev.example.com) pointing at his laptop while his tunnel is up — without paying for ngrok reserved domains or handing everyone a random *.ngrok-free.* URL.

Browser → https://foo.dev.example.com
            nginx (TLS, shared host)
            proxy → 127.0.0.1:5001 (foo's port on server)
            SSH reverse tunnel
 → 127.0.0.1:8080 (foo's laptop)
@borisreitman
borisreitman / test_case.html
Created October 10, 2019 02:38
Gmail API replaces text/plain alternative body part with automatically generated one from HTML
<!DOCTYPE html>
<HTML><HEAD><TITLE>test</TITLE></HEAD><BODY>
<script src="https://code.jquery.com/jquery-1.11.3.min.js"></script>
<script src="https://cdn.jsdelivr.net/gh/dankogai/js-base64/base64.js"></script>
<h1> demo of bug </h1>
<p> Edit the source of this page, to set your FROM_ADDRESS, TO_ADDRESS, CLIENT_ID, API_KEY </p>
<p> Run this page in Google Chrome. First make sure you are signed in by clicking "authorize" button. Then click the "send" button. Watch output in JavaScript console. </p>
@borisreitman
borisreitman / Autosize Bootstrap Textarea
Created June 12, 2019 22:49
Autosize Bootstrap Textarea
<style>
/* This solution was derived from: https://stackoverflow.com/questions/37629860/automatically-resizing-textarea-in-bootstrap */
textarea.textarea-autosize {
padding-top:10px;
padding-bottom:25px; /* increased! */
width:100%;
display:block;
}
</style>
@borisreitman
borisreitman / opaque_dh_oprf_gist.js
Last active December 18, 2020 23:59
OPAQUE DH-OPRF in Javascript
// This only shows the Essential DH-OPRF calculation
// Dependencies
// BigInteger: https://raw.githubusercontent.com/peterolson/BigInteger.js/master/BigInteger.js
// x25519: https://github.com/CryptoEsel/js-x25519/blob/master/lib/x25519.js
// sha256: https://github.com/geraintluff/sha256/blob/gh-pages/sha256.js
// My article that explains the math:
// https://medium.com/@borisreitman/protecting-passwords-from-eavesdroppers-2b7faa5891c0

Keybase proof

I hereby claim:

  • I am borisreitman on github.
  • I am boris2872 (https://keybase.io/boris2872) on keybase.
  • I have a public key ASBFrbmnkfOFlODo_1RKWhx_ZKozNd3WbZqQflbvQGBntQo

To claim this, I am signing this object: