Skip to content

Instantly share code, notes, and snippets.

View thomashibbard's full-sized avatar

Thomas Hibbard thomashibbard

  • Chicago
View GitHub Profile
@thomashibbard
thomashibbard / machine.js
Last active January 11, 2022 21:51
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
// - XState (all XState exports)
@thomashibbard
thomashibbard / README.md
Created March 13, 2018 23:50
decorated-logging

Decorated Logging

This logger decorates logging messages made to it with additional data in JSON format, and if instantiated will monitor long-running requests. To use it, require it, and provide it with the its context's filename if you would like that added to the logging object.

JSON is minified when NODE_ENV === 'production'

To run, clone this repo, npm i and npm start. See examples on localhost:3010

Without instantiation (eg const logger = require('./logger'), these console methods are supported, as they would normally be used:

const addPropToArrayOfObjectsRecursive = (prop, value, array, result = {}) =>
array.reduce((accum, object, index) =>
Object.hasOwnProperty.call(object, 'children') ? [
...accum,
{
...object,
[prop]: value,
children: addPropToArrayOfObjectsRecursive(
const path = require('path')
const chalk = require('chalk')
const fs = require('fs-extra')
const webpack = require('webpack')
const merge = require('webpack-merge')
const HtmlWebpackPlugin = require('html-webpack-plugin')
const UglifyJSPlugin = require('uglifyjs-webpack-plugin')
const ExtractTextPlugin = require('extract-text-webpack-plugin')
const CopyWebpackPlugin = require('copy-webpack-plugin')
console.log(chalk.yellow(`${'+'.repeat(70)}\n`))
@thomashibbard
thomashibbard / .block
Last active August 14, 2017 19:33
fresh block
license: mit
@thomashibbard
thomashibbard / .block
Created August 14, 2017 19:29
Urquhart Spider Web
license: gpl-3.0
@thomashibbard
thomashibbard / .block
Last active August 14, 2017 19:25
fresh block
license: mit