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 | |
## Fix OneDrive for Mac CPU usage | |
## | |
## Seems this is still a problem 5 years later after I created this little gist. | |
## I have long since stopped using OneDrive (luckily), but according to | |
## comments below, I have added the new path for OfficeFileCache for macOS | |
## Mojave (10.14) and Catalina (10.15). | |
## Run this on macOS Mojave (10.14) and Catalina (10.15) | |
find ~/Library/Containers/ -type d -name OfficeFileCache -exec rm -r {} + |
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
brew install zplug | |
vi ~/.zshrc | |
source ~/.zshrc |
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
# Clean, simple, compatible and meaningful. | |
# Tested on Linux, Unix and Windows under ANSI colors. | |
# It is recommended to use with a dark background. | |
# Colors: black, red, green, yellow, *blue, magenta, cyan, and white. | |
# | |
# Mar 2020 Krast | |
# E-mail: [email protected] | |
# logo gnerv | |
gnerv="$FG[238] |
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
TCPKeepAlive yes | |
ServerAliveInterval 60 | |
ServerAliveCountMax 10 | |
StrictHostKeyChecking no | |
UserKnownHostsFile /dev/null | |
Host jumpserver | |
User krast | |
Hostname jumpserver.krast.net | |
Port 6666 |
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 | |
CLEAR='\033[0m' | |
RED='\033[0;31m' | |
function usage() { | |
if [ -n "$1" ]; then | |
echo -e "${RED}👉 $1${CLEAR}\n"; | |
fi | |
echo "Usage: $0 [-n number-of-people] [-s section-id] [-c cache-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
参考链接 | |
======== | |
https://projectlombok.org/features/delombok | |
https://awhitford.github.io/lombok.maven/lombok-maven-plugin/usage.html | |
为什么需要查看lombok生成的源码? | |
=============================== | |
主要原因有二: |
Snake is a fun game to make as it doesn't require a lot of code (less than 100 lines with all comments removed). This is a basic implementation of the snake game, but it's missing a few things intentionally and they're left as further exploration for the reader.
- Score
- When the snake eats an apple, the score should increase by one. Use context.fillText() to display the score to the screen
- Mobile and touchscreen support
- Allow the game to be scalled down to a phone size. See https://codepen.io/straker/pen/VazMaL
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
Latency Comparison Numbers (~2012) | |
---------------------------------- | |
L1 cache reference 0.5 ns | |
Branch mispredict 5 ns | |
L2 cache reference 7 ns 14x L1 cache | |
Mutex lock/unlock 25 ns | |
Main memory reference 100 ns 20x L2 cache, 200x L1 cache | |
Compress 1K bytes with Zippy 3,000 ns 3 us | |
Send 1K bytes over 1 Gbps network 10,000 ns 10 us | |
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD |
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 | |
zypper addrepo https://download.opensuse.org/repositories/home:/so_it_team:/12.x/SLE_12_SP3/home:so_it_team:12.x.repo | |
zypper addrepo https://download.opensuse.org/repositories/network:utilities/SLE_12_SP3/network:utilities.repo | |
zypper refresh | |
zypper install -y iperf tmux |
NewerOlder