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
Cato*
Logged Out
log in -> Logged In
sign up -> User Registration
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
Logged In
log out -> Logged Out
Onboarding*
learn about Cato -> Documentation
@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
@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 / 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 / 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 / functional-typescript-naming-convention.md
Last active March 18, 2018 17:49
Functional TypeScript naming convention.

Functional TypeScript Naming Convention

Motivation

Giving names in a language that doesn't support function overloading is a challenging task. It is, however, important to follow some standards to avoid naming conflicts, misleading names, and also to maintain a unified style. The following rules were developed to encourage programming in a functional style in TypeScript, but can also be used anywhere else where it makes sense.

Disclaimer

The following rules are work in progress, and far from being complete, your questions and ideas are welcome. Please leave a comment.

Goals

  • Avoid naming conflicts and misleading names.
@Frikki
Frikki / esnextbin.md
Last active June 6, 2017 15:59
esnextbin sketch
@Frikki
Frikki / esnextbin.md
Last active May 1, 2017 15:53
esnextbin sketch