Skip to content

Instantly share code, notes, and snippets.

@fanch317
fanch317 / SnippetsJS.md
Last active February 10, 2022 07:50
Snippets

Snippets JS /TS

Extraits

Tri naturel (a1, b0, b01, b1, b10...)

const arraySorted = arrayUnsorted.sort((a: Object, b: Object) => {
  return ("" + a.name).localeCompare("" + a.name.toString(), undefined, {
    numeric: true,
@fanch317
fanch317 / .zshrc
Created March 9, 2020 07:47
End of .zshrc for h function
h_func(){
OLD_IFS=${IFS}; IFS="
";
if [ $1 ]; then
HOSTS=`cat /usr/local/etc/hosts.txt | grep $1`
RESULT=`cat /usr/local/etc/hosts.txt | grep $1 | wc -l`
if [ "$RESULT" = "1" ]; then
address=`echo $HOSTS | sed 's/\([^ #]*\) \?\([^ #]*\) \?#\?\(.*\)\?/\1/'`
@fanch317
fanch317 / .Xmodmap
Last active January 14, 2020 19:44
~/.Xmodmap pour Teclast F6 Pro (touche < déplacée sur ², touche maj+< déplacée sur maj+², touche ² déplacée sur alt+²). Ce fichier est automatiquement chargé à l'ouverture de session tty (et peut être X, sinon faut le charger avec "xmodmap ~/.Xmodmap")
keycode 8 =
keycode 9 = Escape NoSymbol Escape
keycode 10 = ampersand 1 ampersand 1 onesuperior exclamdown onesuperior
keycode 11 = eacute 2 eacute 2 asciitilde oneeighth asciitilde
keycode 12 = quotedbl 3 quotedbl 3 numbersign sterling numbersign
keycode 13 = apostrophe 4 apostrophe 4 braceleft dollar braceleft
keycode 14 = parenleft 5 parenleft 5 bracketleft threeeighths bracketleft
keycode 15 = minus 6 minus 6 bar fiveeighths bar
keycode 16 = egrave 7 egrave 7 grave seveneighths grave
keycode 17 = underscore 8 underscore 8 backslash trademark backslash

Keybase proof

I hereby claim:

  • I am fanch317 on github.
  • I am fanch (https://keybase.io/fanch) on keybase.
  • I have a public key ASDc7SSwJ_DRbP7K8ecdQLlYWeqgtPKXiT80D_wNoCtdJgo

To claim this, I am signing this object: