Skip to content

Instantly share code, notes, and snippets.

View njo's full-sized avatar
💭
just setting up my gthb

Nathan Oorloff njo

💭
just setting up my gthb
View GitHub Profile
@njo
njo / settings->keybindings
Created October 17, 2023 20:29
Sublime Text Keybinds
[
{ "keys": ["home"], "command": "move_to", "args": {"to": "bol"} },
{ "keys": ["end"], "command": "move_to", "args": {"to": "eol"} },
{ "keys": ["shift+end"], "command": "move_to", "args": {"to": "eol", "extend": true} },
{ "keys": ["shift+home"], "command": "move_to", "args": {"to": "bol", "extend": true } },
{ "keys": ["command+home"], "command": "move_to", "args": {"to": "bof" } },
{ "keys": ["command+end"], "command": "move_to", "args": {"to": "eof" } },
{ "keys": ["shift+command+home"], "command": "move_to", "args": {"to": "bof", "extend": true } },
{ "keys": ["shift+command+end"], "command": "move_to", "args": {"to": "eof", "extend": true } },
]

Keybase proof

I hereby claim:

To claim this, I am signing this object:

### Keybase proof
I hereby claim:
* I am preds on github.
* I am nathanoorloff (https://keybase.io/nathanoorloff) on keybase.
* I have a public key ASBHR0DDT6veaqEPno10DAHBBsqPQq5Rp_kk1FkVI1L5FQo
To claim this, I am signing this object:
@njo
njo / subsets.py
Created May 2, 2013 22:28
Subset generator
def subsets(mylist):
if len(mylist) == 0:
yield []
else:
for subset in subsets(mylist[ 1: ]):
yield mylist[:1] + subset
yield subset
print [l for l in subsets([1,2,3]) if l]
@njo
njo / perms.py
Created May 1, 2013 08:31
Python permutation generator
def perms(arr):
if len(arr) == 1:
return [arr]
ret = []
head = arr[:1]
for tail in perms(arr[1:]):
for i in range(len(arr)):
ret.append(tail[i:] + head + tail[:i])
return ret