Skip to content

Instantly share code, notes, and snippets.

View chebotaevroman's full-sized avatar

Roman Chebotaev chebotaevroman

View GitHub Profile
// (!) Approximate behavior
function useEvent(handler) {
const handlerRef = useRef(null);
// In a real implementation, this would run before layout effects
useLayoutEffect(() => {
handlerRef.current = handler;
});
# HomeBrew
export PATH=$PATH:/opt/homebrew/bin
# Nvm
export NVM_DIR="$HOME/.nvm"
[ -s "$(brew --prefix)/opt/nvm/nvm.sh" ] && \. "$(brew --prefix)/opt/nvm/nvm.sh" # This loads nvm
[ -s "$(brew --prefix)/opt/nvm/etc/bash_completion.d/nvm" ] && \. "$(brew --prefix)/opt/nvm/etc/bash_completion.d/nvm" # This loads nvm bash_completion
#Ssh
ssh-add -A 2>/dev/null
let array1 = ['all', 'video', 'image', 'text'];
let array2 = ['all', 'video', 'footprints', 'photo'];
let data = {};
array1.concat(array2).forEach(function(item) {
data[item] = true;
});
let result = Object.keys(data);