This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function replStart () { | |
/* | |
* this function will start repl-debugger | |
*/ | |
let that; | |
if (globalThis.utility2_repl1) { | |
return; | |
} | |
// start repl | |
that = require("repl").start({ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* chrome-devtools-client-example.js | |
* | |
* this zero-dependency nodejs-script demonstrates how to programmatically | |
* script chrome-browser to do tasks using chrome-devtools-protocol commands | |
* over websocket | |
* | |
* tldr - jump down to section "quickstart-example" to see an example task | |
* | |
* Chrome DevTools Protocol Documentation: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://tools.ietf.org/html/rfc7516#appendix-A.3 | |
(async function () { | |
"use strict"; | |
let aad; | |
let aal; | |
let assertJsonEqual; | |
let base64urlFromBuffer; | |
let base64urlToBuffer; | |
let cek; | |
let ciphertext; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ~/.bashrc: executed by bash(1) for non-login shells. | |
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc) | |
# for examples | |
# If not running interactively, don't do anything | |
case $- in | |
*i*) ;; | |
*) return;; | |
esac |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* webCrawl.js | |
* this program will recursively "wget" api-documentation | |
* from https://developer.github.com/v3/index.html to 2-level-depth | |
* | |
* example usage: | |
* $ node webCrawl.js eager # eager mkdirSync before writeFile | |
* $ node webCrawl.js lazy # lazy mkdirSync after writeFile failure | |
* | |
* example output: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script src="a00.js"></script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro&display=swap" rel="stylesheet"> | |
<style> | |
div { | |
font-family: 'Source Sans Pro'; | |
font-size: 80px; | |
font-weight: 700; | |
height: 132px; | |
line-height: 44.3636px; | |
background: #FFE70B; | |
width: 200px; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* jslint utility2:true */ | |
(function () { | |
/* | |
* this function will provide a binary-min-heap in javascript | |
*/ | |
"use strict"; | |
let heapCreate; | |
let heapDecreaseKey; | |
let heapDelete; | |
let heapHeapify; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
shScreencastToGif () {(set -e | |
# this function will convert quicktime.mov $1 to animated gif $2 | |
# https://gist.github.com/dergachev/4627207 | |
# https://gist.github.com/baumandm/1dba6a055356d183bbf7 | |
ffmpeg -y -i "$1" -vf fps=10,palettegen /tmp/palette.png | |
ffmpeg -i "$1" -i /tmp/palette.png -filter_complex "fps=10,paletteuse" "$2" | |
)} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*jslint devel*/ | |
function semverCompare(aa, bb) { | |
/* | |
* this function will compare semver versions aa ? bb and return | |
* -1 if aa < bb | |
* 0 if aa = bb | |
* 1 if aa > bb | |
* https://semver.org/#spec-item-11 | |
* example usage: | |
semverCompare("2.2.2", "10.2.2"); // -1 |