Skip to content

Instantly share code, notes, and snippets.

View tekwiz's full-sized avatar

Travis D. Warlick, Jr. tekwiz

View GitHub Profile
@tekwiz
tekwiz / update-clock.sh
Created April 11, 2017 17:48
Update clock (raspberry pi)
#!/bin/bash
SERVICE_TIMEOUT=5 # seconds
NTP_SERVER=time.nist.gov
NTPD_PIDFILE=/var/run/ntpd.pid
log() {
[ $# -lt 2 ] && echo "Invalid call to log(): too few arguments" 1>&2 && exit 1
local lev="$1" ; shift
local fmt="$1\n" ; shift
@tekwiz
tekwiz / README.md
Last active March 6, 2018 17:09
Web Font Conversion

Woff2

https://github.com/google/woff2

brew install brotli
curl -L -o /usr/local/src/woff2-1.0.2.tar.gz https://github.com/google/woff2/archive/v1.0.2.tar.gz
tar -C /usr/local/src -xzvf /usr/local/src/woff2-1.0.2.tar.gz
mkdir -vp /usr/local/src/woff2-1.0.2/out
cd /usr/local/src/woff2-1.0.2/out
@tekwiz
tekwiz / README.md
Created January 9, 2021 17:08
Node.js `debuglog` sections

Node.js [debuglog()][util-debuglog] sections

Available for NODE_DEBUG in [node.js master as of 2021 Jan 9][nodejs-head-20210109]:

  • esm
  • http
  • http2
  • https
  • module
  • net
@tekwiz
tekwiz / post-message-logger.js
Created July 24, 2024 19:43
Log messages sent/received
window.addEventListener('message', function MessageLogger (o) {
console.debug('Message Origin:%s Data:%o', o.origin, o.data);
});
window.__postMessage = Window.prototype.postMessage;
Window.prototype.postMessage = function _postMessage () {
console.debug('PostMessage %o', Array.from(arguments));
window.__postMessage.apply(this, arguments);
};