Skip to content

Instantly share code, notes, and snippets.

Avatar
Welcome to the Thunder Dome

Frederik Krautwald Frikki

Welcome to the Thunder Dome
View GitHub Profile
View SketchSystems.spec
Cato*
Logged Out
log in -> Logged In
sign up -> User Registration
Logged In
log out -> Logged Out
Onboarding*
learn about Cato -> Documentation
View SketchSystems.spec
Cato*
Logged Out
log in -> Logged In
sign up -> User Registration
Logged In
log out -> Logged Out
onboard user -> Onboarding
Onboarding*
View SketchSystems.spec
Cato*
Logged Out*
log in -> Logged In
Logged In
log out -> Logged Out
Onboarding*
learn about Cato -> Documentation
@Frikki
Frikki / logger.js
Created Aug 15, 2019 — forked from solendil/logger.js
A simple Javascript logger with modules and levels that preserves line numbers
View logger.js
/*
* 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 — forked from briancavalier/typescript-strongly-typed-variadic-1.md
A technique for strongly-typed, heterogeneous variadic function types in Typescript
View typescript-strongly-typed-variadic-1.md

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 Oct 14, 2018 — forked from RadValentin/yarn.unlock.md
Solve `yarn.lock` or `package.json` conflicts without losing your mind
View yarn.unlock.md

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 Jul 17, 2018
Monorepo setup with yarn + lerna
View learn.json
{
"lerna": "2.11.0",
"version": "independent",
"npmClient": "yarn",
"useWorkspaces": true,
"command": {
"publish": {
"allowBranch": "master"
}
}
@Frikki
Frikki / functional-typescript-naming-convention.md
Last active Mar 18, 2018
Functional TypeScript naming convention.
View functional-typescript-naming-convention.md

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.