Skip to content

Instantly share code, notes, and snippets.

🤔

Andy Dirnberger dirn

🤔
Block or report user

Report or block dirn

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@dirn
dirn / default.nix
Last active Jun 21, 2017
PyGotham nix
View default.nix
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;
View config.nix
{
packageOverrides = pkgs_: with pkgs_;{
vim = pkgs.vim_configurable.override {
python = python3;
pythonSupport = true;
rubySupport = true;
};
all = with pkgs; buildEnv {
name = "all";
View inventory
⋊> ~/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
View schedule.py
"""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
View cli.py
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,
@dirn
dirn / validators.py
Last active Jan 28, 2016
Validator for a range of values using Voluptuous
View validators.py
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)
View Dockerfile
FROM ubuntu:14.04
ENV DEBIAN_FRONTEND noninteractive
VOLUME ["/data/devpi"]
EXPOSE 3141
RUN apt-get update -q && apt-get install -y netbase python
ADD https://bootstrap.pypa.io/get-pip.py /get-pip.py
RUN python /get-pip.py
View pygotham.yml
- name: PyGotham
docker:
name: web
image: python:3.4.3
pull: always
state: reloaded
env:
PYTHONUNBUFFERED: 1
link:
- "db:db"
View home.py
"""The PyGotham home page."""
from flask import Blueprint, render_template
from pygotham.news import get_active
from pygotham.sponsors import get_accepted
__all__ = ('blueprint',)
blueprint = Blueprint(
View aliased_dict.py
class AliasedDict(dict):
def __init__(self, mapping):
self.mapping = mapping
def __getitem__(self, key):
if key in self.mapping:
key = self.mapping[key]
return super().__getitem__(key)
def __setitem__(self, key, value):
You can’t perform that action at this time.