Skip to content

Instantly share code, notes, and snippets.

View VincentCATILLON's full-sized avatar
🏠
<HelloWorld />

Vincent Catillon VincentCATILLON

🏠
<HelloWorld />
View GitHub Profile
@jonasgroendahl
jonasgroendahl / useWebSockets.tsx
Created October 29, 2020 21:48
useWebSockets()
import {useEffect, useRef, useState} from 'react';
import io from 'socket.io-client';
type Props = {
userId: number;
enabled: boolean;
onConnected?: () => void;
};
type Message = {
@sag333ar
sag333ar / script_1x2x3x.sh
Last active July 26, 2022 12:27
Generate 1x 2x 3x images from supplied 3x assets. Following shell-script can be used for iOS Asset catalogue.
for f in *.png
do
# Process to get File Name & 2x, 3x file names
xNAME=`echo "$f" | cut -d'.' -f1`
cp "$f" "$xNAME@3x.png"
cp "$f" "$xNAME@2x.png"
# Set proper resolution to original file
sips -s dpiHeight 72.0 -s dpiWidth 72.0 "$f"

Pre requisites

In order to work properly, it needs git, phpcs and phpcbf to be installed

Location of their bin can be provided with environment parameters (see source code)

To avoid committing code with check style issues, download the file and you can add a git hook on pre-commit:

ln -s /path/to/phpcs-pre-commit .git/hooks/pre-commit
@jfmengels
jfmengels / lodash-fp-documentation.md
Last active February 6, 2024 20:57
Generated docs for Lodash/fp. Help make them better at https://github.com/jfmengels/lodash-fp-docs