Skip to content

Instantly share code, notes, and snippets.

View Frikki's full-sized avatar
Welcome to the Thunder Dome

Frederik Krautwald Frikki

Welcome to the Thunder Dome
View GitHub Profile
@Frikki
Frikki / learn.json
Last active July 17, 2018 12:58
Monorepo setup with yarn + lerna
{
"lerna": "2.11.0",
"version": "independent",
"npmClient": "yarn",
"useWorkspaces": true,
"command": {
"publish": {
"allowBranch": "master"
}
}
@Frikki
Frikki / yarn.unlock.md
Created October 14, 2018 08:54 — forked from RadValentin/yarn.unlock.md
Solve `yarn.lock` or `package.json` conflicts without losing your mind

NOTE: This guide is ONLY for devs who don't want to edit their yarn.lock file by hand. If you don't care about that please carry on.


So you've pulled the latest master

git checkout master
git pull
@Frikki
Frikki / typescript-strongly-typed-variadic-1.md
Last active May 6, 2019 07:55 — forked from briancavalier/typescript-strongly-typed-variadic-1.md
A technique for strongly-typed, heterogeneous variadic function types in Typescript

Simpler Variadic Function Types in TypeScript (part 1)

Variadic functions, such as the common zip function on arrays, are convenient and remove the need for lots of specific arity-function variants, e.g., zip2, zip3, zip4, etc. However, they can be difficult and tedious to type correctly in TypeScript when the return type depends on the parameter types, and the parameter types are heterogeneous.

Zip Example

Given a typical zip on arrays:

const a: number[] = [1, 2, 3]
@Frikki
Frikki / logger.js
Created August 15, 2019 18:00 — forked from solendil/logger.js
A simple Javascript logger with modules and levels that preserves line numbers
/*
* Copyright 2016, Matthieu Dumas
* This work is licensed under the Creative Commons Attribution 4.0 International License.
* To view a copy of this license, visit http://creativecommons.org/licenses/by/4.0/
*/
/* Usage :
* var log = Logger.get("myModule") // .level(Logger.ALL) implicit
* log.info("always a string as first argument", then, other, stuff)
* log.level(Logger.WARN) // or ALL, DEBUG, INFO, WARN, ERROR, OFF
Cato*
Logged Out*
log in -> Logged In
Logged In
log out -> Logged Out
Onboarding*
learn about Cato -> Documentation
Cato*
Logged Out
log in -> Logged In
sign up -> User Registration
Logged In
log out -> Logged Out
onboard user -> Onboarding
Onboarding*
Cato*
Logged Out
log in -> Logged In
sign up -> User Registration
Logged In
log out -> Logged Out
Onboarding*
learn about Cato -> Documentation