Skip to content

Instantly share code, notes, and snippets.

View tunesmith's full-sized avatar

Curt Siffert tunesmith

View GitHub Profile
@tunesmith
tunesmith / machine.js
Last active April 26, 2021 00:33
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@tunesmith
tunesmith / machine.js
Created February 1, 2021 21:31
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@tunesmith
tunesmith / sortIps.scala
Last active May 16, 2016 23:35 — forked from gclaramunt/sortIps.scala
Sort a list of ips in Scala
List("129.95.30.40","5.24.69.2","19.20.203.5","1.2.3.4","19.20.21.22","5.220.100.50").
map(_.split('.').map(_.toInt)).
map( { case Array(x1,x2,x3,x4) => (x1,x2,x3,x4) } ).sorted.
map { case (x1,x2,x3,x4) => "%s.%s.%s.%s".format(x1,x2,x3,x4)}