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 / 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);
};
@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 / 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 / enduro_admin-master-enduro_admin-1.0.73.diff
Created February 2, 2018 14:13
Diff of enduro_admin master at db2d984 vs. enduro_admin 1.0.73 release package
Only in dev/enduro_admin/: .git
Only in dev/enduro_admin/_generated/assets/vendor/pickadate/tests: dev
Only in dev/enduro_admin/assets: vendor
Only in dev/enduro_admin/: node_modules
diff -U 2 -w -r dev/enduro_admin/package-lock.json Downloads/enduro_admin-1.0.73/package-lock.json
--- dev/enduro_admin/package-lock.json 2018-02-02 09:06:38.000000000 -0500
+++ Downloads/enduro_admin-1.0.73/package-lock.json 2018-01-06 18:51:41.000000000 -0500
@@ -1,5 +1,5 @@
{
"name": "enduro_admin",
@tekwiz
tekwiz / Enduro-master-Enduro-1.4.45.diff
Created February 2, 2018 13:59
Diff of Enduro master a0e2241 vs Enduro 1.4.45 release package
Only in dev/Enduro/: .git
diff -U 2 -w -r dev/Enduro/libs/bricks/brick_handler.js Downloads/Enduro-1.4.45/libs/bricks/brick_handler.js
--- dev/Enduro/libs/bricks/brick_handler.js 2018-01-30 12:49:35.000000000 -0500
+++ Downloads/Enduro-1.4.45/libs/bricks/brick_handler.js 2018-01-08 06:47:15.000000000 -0500
@@ -7,10 +7,11 @@
// * vendor dependencies
+const Promise = require('bluebird')
const path = require('path')
+const fs = Promise.promisifyAll(require('fs-extra'))
@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 / 00-README.md
Last active December 30, 2016 16:13
Node.js 6 global console scope issue

Node.js 6 global console scope issue

The assignment to console.debug on console-scope-test.js:13 seems to be overriding the assignment on console-scope-test2.js:9, but the strict-equals assertions seem inconsistent.

Run:

NODE_DEBUG=scope1,scope2 node console-scope-test.js

Outputs:

#!/bin/bash
group_name='<log-group-name>'
start_seconds_ago=3600
aws_cmd_opts= # e.g. "--profile <profile-name>"
# Usage: get_loglines "<log-group-name>" <start-time>
get_loglines() {
aws $aws_cmd_opts --output text logs filter-log-events \
--log-group-name "$1" \
@tekwiz
tekwiz / create_USB-CentOS_6.6.sh
Last active August 29, 2015 14:16
Create CentOS 6.6 Bootable USB Installer
#!/bin/bash
###
# Download the ISO if not already done:
# curl -o ~/Downloads/CentOS-6.6-x86_64-minimal.iso \
# http://mirror.lug.udel.edu/pub/centos/6.6/isos/x86_64/CentOS-6.6-x86_64-minimal.iso
#
# Verify the ISO:
# iso_sha256=` openssl sha256 -r ~/Downloads/CentOS-6.6-x86_64-minimal.iso | cut -d ' ' -f1`
# [[ $iso_sha256 != '5458f357e8a55e3a866dd856896c7e0ac88e7f9220a3dd74c58a3b0acede8e4d' ]] && echo "BAD: SHA256 is incorrect!" 1>&2
@tekwiz
tekwiz / save-fail.md
Created February 9, 2015 18:21
Saving advanced search on Twitter fails