Skip to content

Instantly share code, notes, and snippets.

View Waxolunist's full-sized avatar

Christian Sterzl Waxolunist

View GitHub Profile
@Waxolunist
Waxolunist / machine.js
Last active October 19, 2020 11:46
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@Waxolunist
Waxolunist / machine.js
Last active October 16, 2020 06:05
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
crypto.subtle.digest('SHA-1', new TextEncoder().encode('sfdfsdfdsfdfsdfdsfsdfdsfssfdsfds')).then(b => btoa(String.fromCharCode(...new Uint8Array(b)))).then(console.log);
@Waxolunist
Waxolunist / machine.js
Created November 20, 2019 07:50
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions

Answer to SO question 48693420

Demonstrates substitution in properties file with system variables.

Execute with

username=user1 password=pass1 mvn resources:resources && cat target/classes/development.properties

Expected output:

@Waxolunist
Waxolunist / 960.styl
Created May 23, 2013 12:49
960.gs stylus port
cols = 12
colwidth = 60px
colmargin-right = 12px
colmargin-left = 13px
gridarray = ()
pusharray = ()
pullarray = ()
for i in (1..cols)
push(gridarray, '.grid_' + i)
@Waxolunist
Waxolunist / delete_except_newest.bat
Created February 22, 2012 15:23
Delete all files in a directory except the n newest on Windows
:: ****************************************************************************
:: Delete all files except the n newest
:: ****************************************************************************
:: ----------------------------------------------------------------------------
:: Usage: delete_except_newest.bat DIR N FILTER
:: Example: delete_except_newest.bat C:\tmp 10 *.txt
:: ----------------------------------------------------------------------------
:: ****************************************************************************
:: ****************************************************************************