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
#!/usr/bin/env bash | |
( | |
NOTES_REPO=~/.notes | |
FILE_PATH=$1 | |
DIR_PATH=$(dirname $FILE_PATH) | |
cd $NOTES_REPO | |
if [ ! -d $DIR_PATH ]; then | |
mkdir -p $(dirname $DIR_PATH) | |
fi |
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
protocol Identifiable { | |
var id: String { get } | |
} | |
struct Settings: Codable, Identifiable { | |
var id: String = "44" | |
var name: String = "test" | |
} | |
extension Settings: UserDefaultsStoring {} |
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
#!/usr/bin/env python3 | |
from math import * | |
import sys | |
if __name__ == '__main__': | |
script = ' '.join(sys.argv[1:]).strip() | |
if len(script) > 0: | |
print(script, '=', end='') | |
result = eval(script) |
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
MAX = 50 | |
def solve(val: int, op: str) -> int: | |
if op == '+': | |
a = random.randint(0, val) | |
return val - a, a | |
elif op == '-': | |
a = random.randint(0, MAX - val) | |
return val + a, a | |
else: |
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
Get-WinUserLanguageList | |
$1=New-WinUserLanguageList en-US | |
Set-WinUserLanguageList $1 |
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
" WSL yank support | |
let s:clip = '/mnt/c/Windows/System32/clip.exe' " change this path according to your mount point | |
if executable(s:clip) | |
augroup WSLYank | |
autocmd! | |
autocmd TextYankPost * if v:event.operator ==# 'y' | call system(s:clip, @0) | endif | |
augroup END | |
endif |
OlderNewer