- Note: If any links are broken or you know of any more useful guides, please contact me with any suggestions.
- Last Updated: 2020Sep28
- Markdown and white version available here, alternative, click on "Raw".
This file contains hidden or 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
#!/usr/bin/env bash | |
# fetch_nike_puls_all_activities.bash | |
# A simple bash script to fetch all activities and metrics from NikePlus. | |
# See `nike_plus_api.md` for the API details. | |
readonly bearer_token="$1" | |
if [[ -z "$bearer_token" ]]; then | |
echo "Usage: $0 bearer_token" | |
exit |
This file contains hidden or 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
#!/usr/bin/env python3 | |
import libtorrent as lt | |
import time | |
import json | |
import os | |
def write_json(path, contents): | |
with open(path, 'w', encoding='utf-8') as f: | |
json.dump(contents, f, default=str, indent=4, sort_keys=True) |
This file contains hidden or 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 show_git_branch() | |
for line in io.popen("git branch 2>nul"):lines() do | |
local m = line:match("%* (.+)$") | |
local b = "\x1b[32;22;49m".."("..m..")".."\x1b[39;22;49m" | |
if m then | |
clink.prompt.value = clink.prompt.value:gsub(">"," "..b.." >") | |
break | |
end | |
end | |
return false |
This file contains hidden or 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
[merge] | |
tool = vimdiff | |
[mergetool] | |
keepBackup = false | |
[mergetool "vimdiff"] | |
cmd = nvim -d $LOCAL $REMOTE $MERGED -c '$wincmd w' -c 'wincmd J' |
This file contains hidden or 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
from pdfminer.pdfparser import PDFParser | |
from pdfminer.pdfdocument import PDFDocument | |
from pdfminer.pdftypes import resolve1 | |
# I exported the comments I had made in an Adobe Reader DC document to f:temp/stn.fdf. | |
# Now I wanted to access those comments outside of the Adobe Reader. Here is how I extracted the comments. | |
fdf_file = open("F:/temp/stn.fdf", 'rb') |
Reference https://stackoverflow.com/a/34407620/13287790
$ printf %s 'encode this'|jq -sRr @uri
encode%20this
$ jq -rn --arg x 'encode this' '$x|@uri'
encode%20this
# -r (--raw-output) outputs the raw contents of strings instead of JSON string literals. -n (--null-input) doesn't read input from STDIN.