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
import React, {useEffect} from 'react'; | |
import { useCountUp } from 'react-countup'; | |
export default function AnimatedNumber({ value, decimals }){ | |
const { countUp, update } = useCountUp({ start:0, end: value, decimals, duration:1.5 }); | |
useEffect(() => { | |
update(value); | |
}, [value]) |
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
#!/bin/bash | |
# If you have nvidia-docker 1.0 installed: we need to remove it and all existing GPU containers | |
docker volume ls -q -f driver=nvidia-docker | xargs -r -I{} -n1 docker ps -q -a -f volume={} | xargs -r docker rm -f | |
sudo apt-get purge -y nvidia-docker | |
# Add the package repositories | |
curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | \ | |
sudo apt-key add - | |
distribution=$(. /etc/os-release;echo $ID$VERSION_ID) |
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
import React, { Component } from 'react' | |
import { BrowserRouter as Router, Route, Link, Match, Redirect, Switch } from 'react-router-dom' | |
import OverviewPage from './page/OverviewPage' | |
import AccountPage from './page/AccountPage' | |
/* | |
Layouts, inline define here for demo purpose | |
you may want to define in another file instead | |
*/ |
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
#!/bin/bash | |
CHANNEL="#general" | |
USERNAME="MyBot" | |
EMOJI=":ghost:" | |
MSG=$1 | |
PAYLOAD="payload={\"channel\": \"$CHANNEL\", \"username\": \"$USERNAME\", \"text\": \"$MSG\", \"icon_emoji\": \"$EMOJI\"}" | |
HOOK=https://hooks.slack.com/services/T00000000/XXXXYYYZ/XXXXXXXX |
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
#!/bin/sh | |
# arguments check | |
if [ -z "$1" ] | |
then | |
echo "Usage: sha1dir /path/to/directory" | |
exit 1 | |
fi | |
# run sha1sum on every file |
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
# Add this to your ~/.bash_profile and restart the Terminal | |
function android-screencap(){ | |
adb shell screencap -p /sdcard/screen.png | |
adb pull /sdcard/screen.png | |
adb shell rm /sdcard/screen.png | |
} |