Skip to content

Instantly share code, notes, and snippets.

View mmulich's full-sized avatar

Michael Mulich mmulich

View GitHub Profile
# Rough sketch of using hypothesis to make jsonschema schemas
from hypothesis.strategies import (
composite, dictionaries, fixed_dictionaries, sampled_from, text
)
JSON_SCHEMA_PRIMITIVES = ('array', 'boolean', 'integer', 'number', 'null',
'object', 'string')
MAX_SCHEMA_DEPTH = 2

What to do with triggers...

Our codebases use virtualenv installations, which helps to isolate the implemenation from external environmental factors.

Problems

  1. Installation of cnx-archive must happen globally and locally (virtualenv), which prone to errors due to two separate versions being installed. (*This does not include the need/want to allow for multiple versions of
From ff5714e6f56487cebe340590eaef5a2b1ba93282 Mon Sep 17 00:00:00 2001
From: Michael Mulich <michael.mulich@gmail.com>
Date: Thu, 25 Jun 2015 11:09:20 -0700
Subject: [PATCH] Use dbapi positional arguments for the tree query.
This change is necessary because plpydbapi does not implement
a way to translate mappings to plpy planned sql arguments.
---
cnxarchive/database.py | 2 +-
cnxarchive/sql/get-tree-by-uuid-n-version.sql | 4 ++--
@mmulich
mmulich / emoji.md
Created June 11, 2015 21:44
emoji

EMOJI CHEAT SHEET

People

:bowtie: 😄 😆 😊 😃 ☺️

Vagrant

Production dissection

/var/www/{files,files2,osc,specials} are static files service via /etc/nginx/sites-available/files.

varnish servers everything through port 80 (as configured in /etc/default/varnish) via configuration in /etc/varnish/varnish.vcl.

Phase One (codename: Cement Shoes)

This phase will involve setting up the foundation for transforms.

Tasks

  • Each dev should set up an instance of flower, which will help visualize/debug task processing.

  • Initialize Sphinx documentation for cnx-epub & cnx-transforms. Document the purpose and basic functionality of the two packages. Later you can document the parts you are working on and touching. Everything else can progressively be added over time.

@mmulich
mmulich / steps.md
Last active August 29, 2015 14:18
osc install

Install basic packages

sudo apt-get update
sudo apt-get install emacs
sudo apt-get install git libxml2-dev libxslt-dev

Install rbenv

# -*- coding: utf-8 -*-
"""\
Symbolically links a virtualenv's site-packages to
the globaly Python's user site-packages directory.
This should be run with the global Python.
"""
import os
import site

/api/user.json before editing title:

{
id: 40620,
username: "MichaelMulich",
first_name: "Michael",
last_name: "Mulich",
full_name: "Michael Mulich"
@mmulich
mmulich / testcase.py
Last active August 29, 2015 14:09
Non-conflicting pyramid applications using wsgi_intercept
from pyramid.config import (
global_registries,
ApplicationCreated,
Configurator as BaseConfigurator,
)
from pyramid.threadlocal import (
defaults as threadlocal_defaults,
manager as actual_threadlocal_manager,
ThreadLocalManager,
)