Skip to content

Instantly share code, notes, and snippets.

@parksoy
parksoy / tmux_cheatsheet.markdown
Created September 11, 2019 21:49 — forked from henrik/tmux_cheatsheet.markdown
tmux cheatsheet

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

@parksoy
parksoy / dict_namedtuple.py
Created March 18, 2019 23:00 — forked from href/dict_namedtuple.py
Convert any dictionary to a named tuple
from collections import namedtuple
def convert(dictionary):
return namedtuple('GenericDict', dictionary.keys())(**dictionary)
"""
>>> d = dictionary(a=1, b='b', c=[3])
>>> named = convert(d)
>>> named.a == d.a
True
>>> named.b == d.b
@parksoy
parksoy / tmux-cheatsheet.markdown
Created August 28, 2018 17:31 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@parksoy
parksoy / gzip_files_in_python.md
Created May 16, 2018 19:53 — forked from john-science/gzip_files_in_python.md
Reading & Writing GZIP Files Faster in Python

Reading & Writing GZIP Files in Python

I have been testing various ways to read and write text files with GZIP in Python. There were a lot of uninteresting results, but there were two I thought were worth sharing.

Writing GZIP files

If you have a big list of strings to write to a file, you might be tempted to do:

f = gzip.open(out_path, 'wb')

for line in lines: