Skip to content

Instantly share code, notes, and snippets.

View peterszerzo's full-sized avatar
🥝

Peter Szerzo peterszerzo

🥝
View GitHub Profile
@peterszerzo
peterszerzo / canvas-sketch-example.js
Created April 8, 2019 08:13
Looking at canvas-sketch frame rates
const canvasSketch = require("canvas-sketch");
const utils = require("./utils");
const dim = 1024;
const settings = {
dimensions: [dim, dim],
animate: true,
duration: 30
};
@peterszerzo
peterszerzo / nested-ternary.js
Created April 24, 2018 06:07
Functional alternative to nested ternaries
const cond = (condition, value) => (condition ?
{
state: value,
or(obj) {
return this
},
valueOr(defaultValue) {
return this.state
}
}