Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am fulminmaxi on github.
  • I am fulminmaxi (https://keybase.io/fulminmaxi) on keybase.
  • I have a public key ASBDdpQXiaDVHfKAOI2Nqz7zFuUbSw__cGm-_I-vEtBJXQo

To claim this, I am signing this object:

@fulminmaxi
fulminmaxi / snippets.json
Created August 11, 2020 07:15
JS and TS snippets for VSCode
{
// Place your global snippets here. Each snippet is defined under a snippet name and has a scope, prefix, body and
// description. Add comma separated ids of the languages where the snippet is applicable in the scope field. If scope
// is left empty or omitted, the snippet gets applied to all languages. The prefix is what is
// used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders.
// Placeholders with the same ids are connected.
// Example:
// "Print to console": {
// "scope": "javascript,typescript",
const Reducer = (run) => ({
run,
concat: (other) => Reducer((acc, x) => other.run(run(acc, x), x)),
map: (f) => Reducer((acc, x) => f(run(acc, x))),
contramap: (f) => Reducer((acc, x) => run(acc, f(x))),
});
const baseStyles = () => ({
backgroundColor: theme.backgroundColors.primary,
color: 'white'
@fulminmaxi
fulminmaxi / example.js
Created May 9, 2020 20:17
Async Constructor Helper in JavaScript
function WillBe(Class){
return class AsyncConstructor extends Class {
constructor(...values) {
super(...values);
this.willBe = (async () => {
let resolvedThis = await promiseAllObj(this);
//Remove this.willBe to avoid circular promises
return Object.keys(resolvedThis)
.reduce((acc,key) => (key === 'willBe'
? acc
@fulminmaxi
fulminmaxi / keybase.md
Last active April 1, 2020 07:47
Keybase

Keybase proof

I hereby claim:

  • I am gamaranto on github.
  • I am gamaranto (https://keybase.io/gamaranto) on keybase.
  • I have a public key ASDZ6bM7SdLKORSGoe9BmxwCbAAXqvbmqFqJEtOAtNFEuwo

To claim this, I am signing this object: