Left-Aligned | Center Aligned | Right Aligned |
---|---|---|
col 3 is | some wordy text | $1600 |
col 2 is | centered | $12 |
zebra stripes | are neat | $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
from collections import defaultdict | |
from heapq import * | |
def dijkstra(edges, f, t): | |
g = defaultdict(list) | |
for l,r,c in edges: | |
g[l].append((c,r)) | |
# dist records the min value of each node in heap. | |
q, seen, dist = [(0,f,())], set(), {f: 0} |
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
# make brew link python workable https://github.com/Homebrew/homebrew-core/issues/20985 | |
sudo mkdir -p /usr/local/Frameworks | |
sudo chown -R $(whoami) /usr/local/* | |
brew link python3 |
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 threading import _Timer | |
class RepeatedTimer(_Timer): | |
""" | |
See: https://hg.python.org/cpython/file/2.7/Lib/threading.py#l1079 | |
""" | |
def run(self): | |
while not self.finished.is_set(): | |
self.finished.wait(self.interval) | |
self.function(*self.args, **self.kwargs) |
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
set nohud | |
map h J | |
map l K | |
map c x | |
map C X | |
set cncpcompletion | |
let barposition = "bottom" | |
set typelinkhints | |
set noautofocus |
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
class Context(object): | |
def __init__(self, name): | |
self.file = open(name) | |
def __enter__(self): | |
return self.file | |
def __exit__(self, ctx_type, ctx_value, ctx_traceback): | |
self.file.close() |
NewerOlder