Skip to content

Instantly share code, notes, and snippets.

@westrik
westrik / bench.sh
Last active January 26, 2020 10:22
bench
cd ~/Desktop
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source $HOME/.cargo/env
curl -L https://github.com/westrik/world/archive/master.zip -o master.zip
unzip master.zip
cd world-master/server/
time cargo build --release
cd ../../
rm -rf world-master master.zip
rm -rf ~/.cargo
@westrik
westrik / shell_colors.sh
Last active August 5, 2019 00:48
Add color control helpers to environment
# add "source path/to/shell_colors.sh" to ~/.zshrc
# unset format modifiers
UFALL="\e[0m"
UFBOLD="\e[21m"
UFDIM="\e[22m"
UFEMPH="\e[23m"
UFUNDER="\e[24m"
UFBLINK="\e[25m"
UFINVERT="\e[27m"
@westrik
westrik / fetch_github_repos.sh
Last active August 9, 2019 05:37
Shell script that queries GitHub's GraphQL API for a list of all of your repos, then clones them to a local directory. `--fetch-all` runs `git fetch --all` for every repository. Needs `GITHUB_API_TOKEN` to be set in the environment.
#!/bin/sh
# Sync all repositories in the account associated with a GitHub API token to a local folder.
# Expects $GITHUB_FOLDER and $GITHUB_API_TOKEN to be set.
GREEN='\033[0;32m'
NC='\033[0m'
CHUNK_SIZE=100
get_repo_data() {

Keybase proof

I hereby claim:

  • I am westrik on github.
  • I am mwestrik (https://keybase.io/mwestrik) on keybase.
  • I have a public key ASBuytufTAvs_gDyy70oRXy9JshAFWoSkWXzUxM0s20ddQo

To claim this, I am signing this object: