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
aws ec2 describe-instances --filters "Name=instance-state-name,Values=running" --query 'Reservations[*].Instances[*].[Tags[?Key==`Name`].Value,PrivateIpAddress,KeyName,`--------------------`]' --output table |
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
function debounce(func, timeINMS) { | |
let timeout; | |
return function () { | |
clearTimeout(timeout); | |
timeout = setTimeout(func, timeINMS); | |
}; | |
} | |
let debouncedHello = debounce(() => console.log("say hello", Date.now()), 1000); |
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
<View | |
onTouchStart={e=> this.touchY = e.nativeEvent.pageY} | |
onTouchEnd={e => { | |
if (this.touchY - e.nativeEvent.pageY > 20) | |
console.log('Swiped up') | |
}} | |
style={{height: 300, backgroundColor: '#ccc'}} | |
/> |
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
useEffect(() => { | |
window.addEventListener('offline', () => { | |
setOnlineStatus(false); | |
}); | |
window.addEventListener('online', () => { | |
setOnlineStatus(true); | |
}); | |
return () => { | |
window.removeEventListener('offline', () => { | |
setOnlineStatus(false); |