Skip to content

Instantly share code, notes, and snippets.

View pieh's full-sized avatar

Michal Piechowiak pieh

  • Wroclaw, Poland
View GitHub Profile
@pieh
pieh / machine.js
Created July 7, 2020 11:38
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@pieh
pieh / machine.js
Last active May 22, 2020 22:37
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@pieh
pieh / index.js
Created January 19, 2020 17:06
Async/Await vs .then()/.catch() closures/garbage collection
// run with `--inspect(-brk)` and make Heap Snapshots whenever `debugger` breakpoint hits (will be 2 times)
// search for `TrackedObject` in constructor and see the difference when using async/await and .then()/.catch
class TrackedObject {
constructor(type, args) {
this.type = type;
this.args = args;
this.debugAnnotation = "New object";
}
@pieh
pieh / machine.js
Created November 19, 2019 12:49
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@pieh
pieh / SketchSystems.spec
Created April 5, 2019 01:11
My Awesome Sketch
My Awesome Sketch
First State
some event -> Second State
Second State
@pieh
pieh / gatsby-node.js
Last active December 13, 2018 12:21
Gatsby markdown layouts
const path = require(`path`)
exports.createPages = ({ graphql, actions }) => {
const { createPage } = actions
return graphql(`
{
allMarkdownRemark {
edges {
node {
# query for layout field