Skip to content

Instantly share code, notes, and snippets.

View dstockto's full-sized avatar
💭
Learning Go and Rust

David Stockton dstockto

💭
Learning Go and Rust
View GitHub Profile
@dstockto
dstockto / machine.js
Last active July 9, 2020 23:06
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@dstockto
dstockto / machine.js
Last active July 9, 2020 19:28
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@dstockto
dstockto / machine.js
Last active July 9, 2020 03:53
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@dstockto
dstockto / machine.js
Created July 9, 2020 03:30
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@dstockto
dstockto / machine.js
Last active July 9, 2020 03:49
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@dstockto
dstockto / Autoloader.php
Last active April 4, 2018 07:55
Error is Warning: Cannot bind an instance to a static closure followed by Fatal error: Using $this when not in object context If the autoloader is just a regular function, the code works as expected. If the executable code in ClosureBug is moved to the bottom of the Autoloader file (with the public static autoloader) everything works as expected.
<?php
class Autoloader
{
// If this is a regular global function instead of public static, everything works
// (with corresponding change to spl_autoloadregister). If it's a non-static, it works
// with the corresponding change to the spl_autoload_register call below as well.
public static function autoload($className)
{
require_once $className . '.php';
}