Skip to content

Instantly share code, notes, and snippets.

View renoirb's full-sized avatar

Renoir Boulanger renoirb

View GitHub Profile
@renoirb
renoirb / 0README.md
Last active May 5, 2021 18:52
Example components Single SPA

Example using Single SPA

Serve as is

npx serve --cors

Then make reference to the main.mjs in an import statement

@renoirb
renoirb / .editorconfig
Last active April 15, 2021 22:08
Type Guarded limited Map of named Data Transfer Object
# http://editorconfig.org
# Match with prettier.config.js AND .gitattributes
root = true
[*]
charset = utf-8
end_of_line = lf
indent_size = 2
indent_style = space
@renoirb
renoirb / README.md
Last active February 11, 2021 17:08
Chained Keyboard Key combination Event handler
@renoirb
renoirb / config.ts
Created January 27, 2021 21:24
Convict example setup
// config.ts
import { join, resolve } from 'path'
import { default as convictFactory, Schema } from 'convict'
import dotenv from 'dotenv'
import { AppConfigSchema } from './types'
import { convict, maybeFilePath } from './utils'
@renoirb
renoirb / README.md
Last active April 7, 2022 06:04
Renoir's references to books and chapters

ECMAScript

Async/Await

We should not forget await

Quoting [We should not forget the await (Exploring ECMASCript 2016-2017; 5.3.1 Don’t forget await][public-book-exploring2016-17-async-do-not-forget-await])

[out value] is set to a Promise, which is usually not what you want in async functions. await can even make sense if an async function doesn’t return anything.

@renoirb
renoirb / index.ts
Created December 3, 2020 14:36
TypeORM Only MySQL database handler
/**
* EXTRA:
* Étant donné que et que la question demande une "solution idiomatique" et
* que je crains que je n'ai aucune expérience avec les langages donnés et
* que je me sens limité à exprimer avec la bonne syntaxe ma réponse,
* j'ai décidé d'ajouter cet extra.
*
* Je me permet donc ici de fournir une version sommaire d'un gestionnaire de
* connection qui permet de supporter plus d'un vendeur.
*
@renoirb
renoirb / playing-with-mjs.patch
Last active June 5, 2020 13:49
Attempt at using an ESM/MJS in TypeScript
From dd22508d45c9a839d26a090bba05e62abe41e492 Mon Sep 17 00:00:00 2001
From: Renoir Boulanger <contribs@renoirboulanger.com>
Date: Thu, 4 Jun 2020 10:25:15 -0400
Subject: [PATCH] Just-a-Demo
---
.gitignore | 2 ++
package.json | 39 +++++++++++++++++++++++++++++++++++++++
src/index.ts | 25 +++++++++++++++++++++++++
tsconfig.json | 14 ++++++++++++++
/* eslint-disable @typescript-eslint/ban-ts-ignore */
/**
* File: src/tokenizer.ts
*/
import co from 'co'
const TOKENIZER_END = Symbol('TOKENIZER_END')
@renoirb
renoirb / example.patch
Created February 28, 2020 21:39
Example using self-contained published package
From 4a22bd3338241b30edddb0bffab035b0b1ba3a99 Mon Sep 17 00:00:00 2001
From: Renoir Boulanger <hello@renoirboulanger.com>
Date: Fri, 28 Feb 2020 16:37:39 -0500
Subject: [PATCH] Example
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..239ecff
--- /dev/null