I hereby claim:
- I am juliencrn on github.
- I am juliencrn (https://keybase.io/juliencrn) on keybase.
- I have a public key ASD2CEsmK_N5f6bcWRI9C4eEvXm2btLMzsXqtG57X7oEwAo
To claim this, I am signing this object:
| /** | |
| * Extends a type recursively. | |
| * | |
| * @template T - The base recursive type to be extended. | |
| * @template Ext - An additional set of properties to be merged into the type. | |
| * @template Key - The key of the recursive property in T. | |
| * | |
| * @example | |
| * ```ts | |
| * type Node = { |
| // https://egghead.io/blog/using-branded-types-in-typescript | |
| // In its own module (file) to keep `Brand` private | |
| declare const __brand: unique symbol | |
| type Brand<B> = { [__brand]: B } | |
| export type Branded<T, B> = T & Brand<B> |
| import React from 'react' | |
| import { useTernaryDarkMode } from 'usehooks-ts' | |
| export default function Component() { | |
| const { | |
| isDarkMode, | |
| useSystemPrefers, | |
| setTernaryMode, | |
| toggleSystemPrefers, |
| // ES6 Generators | |
| // @See: https://medium.com/dailyjs/a-simple-guide-to-understanding-javascript-es6-generators-d1c350551950 | |
| function* gChild() { | |
| yield 2; | |
| yield 3; | |
| } | |
| function* gMain() { | |
| yield 1; |
| // Pipe in JS | |
| // @see | |
| // - https://www.freecodecamp.org/news/pipe-and-compose-in-javascript-5b04004ac937/ | |
| // - https://medium.com/javascript-scene/reduce-composing-software-fe22f0c39a1d | |
| // Utility functions for example | |
| const getName = (person) => person.name | |
| const uppercase = (string) => string.toUpperCase() |
I hereby claim:
To claim this, I am signing this object:
| # Remove the file from the repository | |
| git rm --cached .idea/ | |
| # now update your gitignore file to ignore this folder | |
| echo '.idea' >> .gitignore | |
| # add the .gitignore file | |
| git add .gitignore | |
| git commit -m "Removed .idea files" |
| // Assuming "?post=1234&action=edit" | |
| const urlParams = new URLSearchParams(window.location.search); | |
| console.log(urlParams.has('post')); // true | |
| console.log(urlParams.get('action')); // "edit" | |
| console.log(urlParams.getAll('action')); // ["edit"] | |
| console.log(urlParams.toString()); // "?post=1234&action=edit" | |
| console.log(urlParams.append('active', '1')); // "?post=1234&action=edit&active=1" |