Skip to content

Instantly share code, notes, and snippets.

@codesoap
codesoap / syncnotes
Last active December 13, 2020 22:39
Syncing with a remote dir, without overwriting newer files
#!/usr/bin/env sh
# Notice the trailing slash:
local=~/Notes/
remote='remote:~/Notes'
rsync -avzPuh "$local" "$remote"
rsync -avzPuh "$remote" "$local"
@codesoap
codesoap / covid19
Last active March 28, 2020 06:39
Quick and dirty displayer of COVID-19 statistics
#!/usr/bin/env sh
curl -s https://raw.githubusercontent.com/CSSEGISandData/COVID-19/master/csse_covid_19_data/csse_covid_19_time_series/time_series_covid19_confirmed_global.csv | \
awk -F, '
BEGIN {
meta_offset = 5
prev = 0
}
NR==1 {
cnt = NF - meta_offset + 1
@codesoap
codesoap / bench_test.go
Last active March 5, 2020 18:08
Benchmark for go's encoding/json (initially taken from https://github.com/json-iterator/go-benchmark/ )
package go_benchmark
import (
"encoding/json"
"testing"
)
/*
Small payload, http log like structure. Size: 190 bytes
*/
@codesoap
codesoap / kakrc
Created August 13, 2019 07:12
kak conf
# See autoload/my_config/ for more personal config.
set global tabstop 4
set global indentwidth 0 # Use tabs
#set global indentwidth 4 # Use spaces
set global grepcmd ag
alias global ag grep
# The mouse doesn't work for me anyways and with this mouse selection works: