Skip to content

Instantly share code, notes, and snippets.

TL;DR

Looks like a race condition, but I can't prove it.

Fixed Code

// scroll to current item
if (typeof currentWordId !== "undefined") {
@joshuabremer
joshuabremer / convert-cert-to-decimal.md
Last active February 20, 2019 19:18
Convert Cert to Modulus, Exponent

Convert Certificate to Modulus, Exponent

The process for taking a certificate or a public key and turning it into integers is a surprisingly tough task as first glance. There's a long chain of decoding and encoding to various format that this page will describe.

1. Certificate to Public Key

$ CERTIFICATE_PATH=/path/to/file.cer
$ OUTPUT_PUBLIC_KEY_PATH=public_key.pem
$ openssl x509 -pubkey -noout -in $CERTIFICATE_PATH > $OUTPUT_PUBLIC_KEY_PATH
@joshuabremer
joshuabremer / Firefox
Created December 30, 2017 05:55
Firefox Can't Print This Content On Subsequent Pages
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Print bug</title>
<style>
report-page {
height: 1230px;
display: block;
@joshuabremer
joshuabremer / gist:a944edc6aa8bd6ddd9ee
Created July 6, 2015 21:51
Javascript pre-commit hook
#!/bin/sh
red="\033[1;31m"
color_end="\033[0m"
pass=true
echo "\nValidating JavaScript:\n"
/*!
* jQuery Largest In Set- v0.1 - 7/1/2013
*
*/
(function(a){a.fn.TallestInSet=function(c){var b={};if(c){a.extend(b,c)}var e=0;var d=0;this.each(function(){e=(a(this).height()>e?a(this).height():e);d=(a(this).width()>d?a(this).width():d)});return e};a.fn.UniformHeight=function(c){var b={};if(c){a.extend(b,c)}this.css("height",this.TallestInSet())}})(jQuery);