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/bin/env bash | |
set -euo pipefail | |
if [ -z ${1+x} ] | |
then | |
echo "Usage: $(basename $0) project-name" | |
exit 1 | |
fi |
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/bin/env python | |
import sys | |
def main(): | |
try: | |
filename = sys.argv[1] | |
except IndexError: | |
filename = '' | |
if filename.startswith('src/'): |
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
#!/bin/bash | |
trap "exit" INT TERM ERR | |
trap "kill 0" EXIT | |
python ps.py , & | |
python ps.py . & | |
wait |
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 re | |
import sys | |
def finder(sourcelines): | |
result = [] | |
inside = False | |
for line in sourcelines: | |
match = re.match(r"""(\w+) = patterns\(""", line) |
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 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 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 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
(function() { | |
var Perf = React.addons.Perf; | |
var is_active = window.reactProfileActive || false; | |
if (!is_active) { | |
Perf.start(); | |
} | |
else { | |
Perf.start(); | |
measurements = Perf.getLastMeasurements(); | |
Perf.printInclusive(measurements); |
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 inspect | |
from nameko.extensions import ENTRYPOINT_EXTENSIONS_ATTR | |
from nameko.rpc import rpc, RpcProxy, Rpc | |
from nameko.web.handlers import http | |
import requests | |
class HelloService(object): | |
name = "greeting_service" |
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 django.core.management import call_command | |
from django.core.management.commands.makemigrations import Command | |
from django.db.migrations.writer import MigrationWriter | |
import mock | |
import pytest | |
def test_migrations_up_to_date(): | |
# --exit exits if there are _no_ changes, which is what we are looking for | |
with pytest.raises(SystemExit): |
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
# https://s3.amazonaws.com/archive.travis-ci.org/jobs/127208999/log.txt | |
Using worker: worker-linux-docker-f359b10b.prod.travis-ci.org:travis-linux-4 | |
travis_fold:start:system_info | |
[0K[33;1mBuild system information[0m | |
Build language: python | |
Build group: stable | |
Build dist: precise | |
[34m[1mBuild image provisioning date and time[0m |
NewerOlder