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 tornado.web | |
from tornado.platform.asyncio import AsyncIOMainLoop | |
import asyncio | |
class MainHandler(tornado.web.RequestHandler): | |
def get(self): | |
self.write("Hello") | |
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 logging | |
import asyncio | |
from aiohttp.wsgi import WSGIServerHttpProtocol | |
logger = logging.getLogger(__name__) | |
def index(environ, start_response): | |
logger.info("GET") | |
start_response("200 OK", | |
[('Content-type', 'text/plain')]) |
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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Web; | |
using System.Threading.Tasks; | |
using System.IO; | |
using System.Text; | |
namespace OwinSample | |
{ |
We can make this file beautiful and searchable if this error is corrected: It looks like row 4 should actually have 8 columns, instead of 7. in line 3.
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
1,none,none,none,taro,tokyo,man,22 | |
2,none,none,none,hanako,kyoto,woman,56 | |
3,none,none,none,satoru,kagoshima,man,18 | |
4,miyoko,none,none,none,fukuoka,45 | |
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
language: python | |
python: 3.3 | |
env: | |
matrix: | |
- TOXENV=py26 | |
- TOXENV=py27 | |
- TOXENV=pypy | |
- TOXENV=py33 | |
- TOXENV=py34 | |
- TOXENV=coverage |
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
pip freeze | |
python get-pip.py -f wheelhouse --use-wheel | |
pip install -U setuptools -f wheelhouse --use-wheel | |
pip install -r requirements.txt -f wheelhouse --use-wheel | |
pip install -e . | |
psql -c 'create database sns_test;' -U postgres | |
alembic -n drone upgrade head | |
flake8 sns | |
py.test sns | |
py.test tests |
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 testfixtures import compare | |
from inspirated import testcase_config, test_config | |
@testcase_config(target='your.product.Foo') | |
class TestFoo(object): | |
@test_config(params=[({'var': 1}, 4)]) | |
def test_it(self, target, var, expected): | |
foo = target() |
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 python3.3 | |
import sys | |
import os | |
import re | |
import argparse | |
import distlib.wheel | |
import subprocess | |
import distlib.metadata | |
import distlib.locators |
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 pyramid.config import Configurator | |
from pyramid.view import view_config | |
import waitress | |
@view_config(renderer='index.html') | |
def index(request): | |
return dict(message='Hello, jinja!') | |
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
#!/bin/sh | |
# -*- mode:sh -*- | |
version=$1 | |
if [ "x$1" = "x" ] ; then | |
exit 1 | |
fi | |
major=$(echo $version | awk -F "." '{print $1}') | |
minor=$(echo $version | awk -F "." '{print $2}') | |
micro=$(echo $version | awk -F "." '{print $3}') |
OlderNewer