mkdir toto && cd toto
az storage blob download-batch --account-name account_name --account-key account_key --source bucket_name --destination . --pattern "*"
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Désactive toutes les restrictions de copier-coller | |
document.addEventListener('copy', function(e) { | |
e.stopPropagation(); | |
}, true); | |
document.addEventListener('paste', function(e) { | |
e.stopPropagation(); | |
}, true); | |
document.addEventListener('cut', function(e) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export enum EventType { | |
SEND_RESULT_EVENT = "sendResultEvent", | |
SEND_RANDOM_ITEM = "sendRandomItem", | |
} | |
export type CallbackEventType = { | |
[EventType.SEND_RESULT_EVENT]: (isEligible: boolean) => void; | |
[EventType.SEND_RANDOM_ITEM]: (valueA: string, valueB: number) => void; | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export ZSH="/Users/max/.oh-my-zsh" | |
ZSH_THEME="robbyrussell" | |
plugins=(git | |
zsh-autosuggestions | |
zsh-syntax-highlighting | |
) | |
source $ZSH/oh-my-zsh.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export type CamelCase<S extends string> = | |
S extends `${infer P1}_${infer P2}${infer P3}` | |
? `${Lowercase<P1>}${Uppercase<P2>}${CamelCase<P3>}` | |
: Lowercase<S>; | |
export type KeysToCamelCase<T> = { | |
[K in keyof T as CamelCase<string & K>]: T[K] extends {} | |
? KeysToCamelCase<T[K]> | |
: T[K]; | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const getValue = <TObj, Tkey extends keyof TObj> (obj: TObj, key: Tkey) => obj[key] | |
const result = getValue({a: "hello", b: 2, c: true}, "a") | |
console.log(result) // defined as string | |
const result2 = getValue({a: "hello", b: 2, c: true}, "b") | |
console.log(result2) // defined as number |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { forwardRef } from "react"; | |
// Declare a type that works with | |
// generic components | |
type FixedForwardRef = <T, P = {}>( | |
render: (props: P, ref: React.Ref<T>) => React.ReactNode | |
) => (props: P & React.RefAttributes<T>) => React.ReactNode; | |
// Cast the old forwardRef to the new one | |
export const fixedForwardRef = |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type Vehicule = "Voiture" | "Camion"; | |
class Voiture { | |
public taille = "2m" | |
constructor() { | |
console.log("Je suis une voiture"); | |
} | |
} | |
class Camion { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MultiSingletonHelper { | |
private static readonly instances: MultiSingletonHelper[] = []; | |
private readonly param1: string; | |
private readonly param2?: string; | |
private constructor(param1: string, param2?: string) { | |
this.param1 = param1; | |
this.param2 = param2; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = { | |
root: true, | |
extends: [ | |
'eslint:recommended', | |
'plugin:react/recommended', | |
'plugin:react-hooks/recommended', | |
'plugin:react/jsx-runtime', | |
'plugin:storybook/recommended', | |
'plugin:import/recommended', | |
'plugin:jsx-a11y/recommended', |
NewerOlder