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/sh | |
for i in $( (echo 'ibase=16;obase=2;'; hexdump -v -e '/1 "%02X\n"' $@) | bc); do \ | |
printf '%08i\n' $i | rev | |
done |
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
sed 's/.\{80\}/\0\n/g' |
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
" Command mode aliases | |
function! SetupCommandAlias(from, to) | |
exec 'cnoreabbrev <expr> ' . a:from | |
\ . ' ((getcmdtype() is# ":" && getcmdline() is# "' . a:from . '")' | |
\ . '? ("' . a:to . '") : ("' . a:from . '"))' | |
endfunction | |
command! -nargs=* Calias call SetupCommandAlias([<f-args>][0], join([<f-args>][1:])) | |
Calias calias Calias | |
Calias nvim visual | |
Calias W! w! |
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
" Vim syntax file | |
if !exists("main_syntax") | |
if version < 600 | |
syntax clear | |
elseif exists("b:current_syntax") | |
finish | |
endif | |
let main_syntax = 'lambda' | |
endif |
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
function! s:read_gemini(url) | |
call s:init_go_url() | |
function! s:init_go_url() | |
endfunction | |
let l:svpos = winsaveview() | |
setlocal bl ro noswapfile | |
if &ft == '' | |
setlocal ft=gmi | |
else | |
let &ft=&ft |
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
function! s:color_to_ansi(cstr, is_bg) | |
let l:car=a:is_bg ? 40 : 30 | |
let l:cdr=[] | |
if a:cstr[0] == '#' | |
let l:car+=8 | |
let l:cdr=[2] + map(split(a:cstr[1:], '\v..\zs'), 'str2nr(v:val, 16)') | |
elseif a:cstr > 15 | |
let l:car+=8 | |
let l:cdr=[5, a:cstr] | |
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
from fractions import Fraction, gcd | |
from itertools import product as cartprod | |
def memo(f): | |
cache = {} | |
def g(*argv, **kwargs): | |
args = (argv, tuple(sorted(kwargs.items()))) | |
if args in cache: | |
#print("Using {0} |-> {1}".format(args, cache[args])) | |
return cache[args] | |
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
Key | Old Code | New Code | |
---|---|---|---|
BUTTON0 | -100 | key.mouse.left | |
BUTTON1 | -99 | key.mouse.right | |
BUTTON2 | -98 | key.mouse.middle | |
BUTTON3 | -97 | key.mouse.4 | |
BUTTON4 | -96 | key.mouse.5 | |
BUTTON5 | -95 | key.mouse.6 | |
BUTTON6 | -94 | key.mouse.7 | |
BUTTON7 | -93 | key.mouse.8 | |
NONE | 0 | key.keyboard.unknown |
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 | |
curl `mcskinurl $1` --create-dirs -o ~/mcskins/$1.png |
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/sh | |
for i in $(seq 32); do \ | |
cat > /var/lib/AccountsService/users/nixbld"$i" <<EOF | |
[User] | |
SystemAccount=true | |
EOF | |
done |