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
objects = $(wildcard *.in) | |
outputs = $(objects:.in=.txt) | |
sync-targets = $(objects:%.in=sync-%) | |
upgrade-targets = $(objects:%.in=upgrade-%) | |
.PHONY: all check clean $(sync-targets) $(upgrade-targets) | |
all: $(outputs) | |
%.txt: %.in |
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
{ | |
"keys": ["tab"], | |
"command": "move", | |
"args": {"by": "characters", "forward": true}, | |
"context": [{ | |
"key": "preceding_text", | |
"operator": "not_regex_match", | |
"operand": "^\\s*$", | |
"match_all": true, | |
}, { |
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
#!/usr/local/bin/python3 | |
import os | |
import signal | |
import time | |
import sys | |
PID_FILENAME = __file__.split("/")[-1] + ".pid" | |
def main(): |
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
def reduce(function, sequence, initial=None): | |
i = iter(sequence) | |
try: | |
initial = initial if initial is not None else next(i) | |
except StopIteration: | |
raise TypeError("reduce() of empty sequence with no initial value") | |
try: | |
return reduce(function, i, function(initial, next(i))) | |
except StopIteration: | |
return initial |
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
import functools | |
def staticmethod_(method): | |
class_name = method.__qualname__.split(".")[0] | |
@functools.wraps(method) | |
def wrapper(*args, **kwargs): | |
class_ = globals()[class_name] | |
if isinstance(args[0], class_): |
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
import functools | |
def classmethod_(method): | |
class_name = method.__qualname__.split(".")[0] | |
@functools.wraps(method) | |
def wrapper(*args, **kwargs): | |
class_ = globals()[class_name] | |
if isinstance(args[0], class_): |