Skip to content

Instantly share code, notes, and snippets.

@prkstaff
prkstaff / gist:fb31847922acfbed29dcfc523c2e8fdd
Last active March 9, 2026 14:30
Karabiner capslock/ctrl/escape/ vim + hjkl arrows touchtyping improvement
{
"description": "CapsLock ctrl layer + hjkl arrows",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "caps_lock",
"modifiers": { "optional": ["any"] }
},
"to": [{ "key_code": "left_control" }],
@prkstaff
prkstaff / init.vim
Last active December 14, 2023 17:34
" close buffer without closing window using leader q
map <leader>q :bp<bar>sp<bar>bn<bar>bd<CR>
" nice indent for yaml files:
autocmd FileType yaml setlocal ts=2 sts=2 sw=2 expandtab
"
" nice indent for html files:
autocmd FileType html setlocal ts=2 sts=2 sw=2 expandtab
@prkstaff
prkstaff / solution.py
Created June 6, 2017 19:23
longest subsequence printing a sequence given a tuple of number
class Solution:
def get_longest_subsequence(self, tupl):
sequence_counter = []
longest_sequence = 1;
for i,ivalue in enumerate(tupl):
sequence_counter.insert(i,1)
for j in reversed(range(i)):
print "============"
print "Turn: I {0} and J {1}".format(tupl[i],tupl[j])
print "I has index {0}".format(sequence_counter[i])