This file contains hidden or 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 psycopg2 | |
| original_connect = psycopg2.connect | |
| def connect_with_retry(*args, **kwargs): | |
| retries = 3 | |
| while True: | |
| retries -= 1 |
This file contains hidden or 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 ast | |
| import sys | |
| filename = sys.argv[1] | |
| with open(filename) as handle: | |
| source = handle.read() | |
| sourcelines = source.splitlines() | |
| tree = ast.parse(source) |
This file contains hidden or 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 re | |
| import sys | |
| def finder(sourcelines): | |
| result = [] | |
| inside = False | |
| for line in sourcelines: | |
| match = re.match(r"""(\w+) = patterns\(""", line) |
This file contains hidden or 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
| #!/bin/bash | |
| trap "exit" INT TERM ERR | |
| trap "kill 0" EXIT | |
| python ps.py , & | |
| python ps.py . & | |
| wait |
This file contains hidden or 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/bin/env python | |
| import sys | |
| def main(): | |
| try: | |
| filename = sys.argv[1] | |
| except IndexError: | |
| filename = '' | |
| if filename.startswith('src/'): |
This file contains hidden or 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/bin/env bash | |
| set -euo pipefail | |
| if [ -z ${1+x} ] | |
| then | |
| echo "Usage: $(basename $0) project-name" | |
| exit 1 | |
| fi |
OlderNewer