Skip to content

Instantly share code, notes, and snippets.

View tesla3327's full-sized avatar

Michael Thiessen tesla3327

View GitHub Profile
const rand = (min, max) => min + Math.floor(Math.random() * max);
class Dots {
static get inputProperties() {
return [
'--bg-color',
'--dot-color',
'--mouse-x',
'--mouse-y',
];
/**
* Run in the console to inline all code block styles before
* copy + pasting into ConvertKit in HTML mode
*/
const CSS_PROPERTIES = [
'background-color',
'font-size',
'color',
];
@tesla3327
tesla3327 / stats.sh
Created November 12, 2019 21:44
Node script for generating stats on how components in Construction Yard are used.
#!/usr/bin/env node
// Script that consumers of CY can run to obtain stats on
// how they are using CY components in their project.
const glob = require('glob');
const fs = require('fs');
// List of components re-generated on every build
const { components } = require('./components.json');
@tesla3327
tesla3327 / promises.re
Last active May 14, 2018 18:20 — forked from lilactown/promises.re
Notes on using JavaScript Promises in ReasonML/BuckleScript
/**
* Making promises
*/
let okPromise = Js.Promise.make((~resolve, ~reject as _) => [@bs] resolve("ok"));
/* Simpler promise creation for static values */
Js.Promise.resolve("easy");
Js.Promise.reject(Invalid_argument("too easy"));