Skip to content

Instantly share code, notes, and snippets.

@bdchauvette
bdchauvette / machine.js
Created February 1, 2021 18:03
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@bdchauvette
bdchauvette / index.js
Created December 13, 2016 17:31
mithril-node-render: components with children
global.window = require('mithril/test-utils/browserMock')()
global.document = window.document
const m = require('mithril')
const o = require('mithril/ospec/ospec')
const renderToString = require('mithril-node-render')
const ParentComponent = {
view(node) {
return m('div', node.children)
@bdchauvette
bdchauvette / .babelrc
Last active June 21, 2021 17:44
Minimal babel boilerplate
{
"presets": [ "es2015" ]
}
@bdchauvette
bdchauvette / distance.js
Last active November 14, 2021 15:29
Code Sample
/** Converts degrees to radians */
function toRadians(degrees) {
return degrees * Math.PI / 180;
}
/** Converts DMS coordinate to decimal coordinate */
function toDecimalDegrees(coord) {
/** Extracts the digits from an arc unit containing punctuation */
function getDigits(unit) {