Skip to content

Instantly share code, notes, and snippets.

View menzen's full-sized avatar

menzen menzen

  • Dresden
View GitHub Profile
@casperin
casperin / func.js
Last active July 9, 2020 07:12
Some examples of currying and composing functions in javascript
var log = console.log.bind(console);
// Core component (not curried).
// compose(g, f) === function (x) { return g(f(x)); }
// Takes any number of functions as arguments
// from underscore.js
function compose (/* fn1, fn2, ... */) {
var funcs = arguments;
return function() {
var args = arguments;
@Frikki
Frikki / dialogue.js
Last active October 3, 2017 08:34
Simple Cycle.js (Nested) Dialogue with MVI Example
/** @jsx hJSX */
import {hJSX} from '@cycle/dom';
const DIALOGUE_NAME = `dialogue`;
let idSuffix = 0;
function makeCycleId() {
return `${DIALOGUE_NAME}-${idSuffix++}`;

op-1 keys

tape mode

cmd desc
shift + help set date - time
shift + tempo detune notes - cents
shift + tape erase tape
shift + synth undo edits and revert to the preset
@Peredery
Peredery / Fix_gpg_Mac_OS_error.md
Last active May 19, 2024 08:36
FIX - gpg failed to sign the data fatal: failed to write commit object
@coodoo
coodoo / statechart-xstate.md
Last active May 26, 2022 20:00
Extensive research of statecharts with a focus on front-end development.

The case for statechart and xstate -- why it matters and how we can benefit from it

Bottom line up front

  • redux is a global data management tool, not a proper state management tool, hence causing a lot of troubles

  • statecharts is an extension to Finite State Machine (FSM) which provides explicit and safe state management capabilities, perfectly fit for front-end development

  • statecharts had been used intensivelly in all industries (be it embedded systems, hardware, electronics, aeronautics, automotive, game development and more), it's us front-end developers late to the party

@sindresorhus
sindresorhus / esm-package.md
Last active July 27, 2024 02:58
Pure ESM package

Pure ESM package

The package that linked you here is now pure ESM. It cannot be require()'d from CommonJS.

This means you have the following choices:

  1. Use ESM yourself. (preferred)
    Use import foo from 'foo' instead of const foo = require('foo') to import the package. You also need to put "type": "module" in your package.json and more. Follow the below guide.
  2. If the package is used in an async context, you could use await import(…) from CommonJS instead of require(…).
  3. Stay on the existing version of the package until you can move to ESM.