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
// (!) Approximate behavior | |
function useEvent(handler) { | |
const handlerRef = useRef(null); | |
// In a real implementation, this would run before layout effects | |
useLayoutEffect(() => { | |
handlerRef.current = handler; | |
}); |
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
# 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 |
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
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); |