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
with import <nixpkgs> {}; | |
let rubyenv = bundlerEnv { | |
name = "pygotham-2017-ruby-env"; | |
inherit ruby; | |
gemfile = ./Gemfile; | |
lockfile = ./Gemfile.lock; | |
# This can be generated using $(nix-build '<nixpkgs>' -A bundix)/bin/bundix | |
gemset = ./gemset.nix; |
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
{ | |
packageOverrides = pkgs_: with pkgs_;{ | |
vim = pkgs.vim_configurable.override { | |
python = python3; | |
pythonSupport = true; | |
rubySupport = true; | |
}; | |
all = with pkgs; buildEnv { | |
name = "all"; |
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
[MASTER] | |
# Specify a configuration file. | |
#rcfile= | |
# Python code to execute, usually for sys.path manipulation such as | |
# pygtk.require(). | |
#init-hook= | |
# Profiled execution. |
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
⋊> ~/s/i/Henson-MongoDB on initial-functionality ⨯ (Henson-MongoDB) python -m sphinx.ext.intersphinx "https://motor.readthedocs.io/en/stable/objects.inv" | |
py:attribute | |
motor.motor_tornado.MotorClient.document_class api/motor_client.html#motor.motor_tornado.MotorClient.document_class | |
motor.motor_tornado.MotorClient.host api/motor_client.html#motor.motor_tornado.MotorClient.host | |
motor.motor_tornado.MotorClient.is_mongos api/motor_client.html#motor.motor_tornado.MotorClient.is_mongos | |
motor.motor_tornado.MotorClient.is_primary api/motor_client.html#motor.motor_tornado.MotorClient.is_primary | |
motor.motor_tornado.MotorClient.max_bson_size api/motor_client.html#motor.motor_tornado.MotorClient.max_bson_size | |
motor.motor_tornado.MotorClient.max_message_size api/motor_client.html#motor.motor_tornado.MotorClient.max_message_size | |
motor.motor_tornado.MotorClient.max_pool_size api/motor_client.html#motor.motor_tornado.MotorClient.max_pool_size | |
motor.motor_tor |
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
"""Create a schedule from a spreadsheet.""" | |
import datetime | |
import os | |
import sqlalchemy | |
from sqlalchemy import ( | |
Column, Date, Enum, ForeignKey, Integer, String, Table, Text, Time, | |
) | |
from sqlalchemy.ext.declarative import declarative_base |
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 _split_args(f): | |
@wraps(f) | |
def dispatch(parsed_args, *args, **kwargs): | |
parsed_args = vars(parsed_args) | |
parsed_args.pop('_functions_stack', None) | |
return f(**parsed_args) | |
return dispatch | |
def register_commands(functions, namespace=None, namespace_kwargs=None, |
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 Range: | |
"""A validator to check if a value is within a range.""" | |
def __init__(self, start, stop=None, step=1): | |
# Do our best to match range's signature. | |
if stop is None: | |
# If there is no value for stop, use start as stop instead. | |
self.range = range(start) | |
else: | |
self.range = range(start, stop, step) |
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 direct_to_template(blueprint, rule, template, **kwargs): | |
"""Return a view rendered directly from a template.""" | |
def f(template, **kwargs): | |
return render_template(template, **kwargs) | |
endpoint = kwargs.pop('endpoint', None) | |
if not endpoint: | |
endpoint = os.path.basename(template).split('.')[0] | |
blueprint.add_url_rule( |
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 os | |
import re | |
import subprocess | |
import sys | |
modified = re.compile('^(?:M|A)(\s+)(?P<name>.*)') | |
CHECKS = [ |
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 flask import Flask, url_for | |
app = Flask(__name__) | |
@app.route('/') | |
def index(): | |
return url_for('view', id=5) | |
NewerOlder