Skip to content

Instantly share code, notes, and snippets.

View knowsuchagency's full-sized avatar
💭
hustlin'

Stephan Fitzpatrick knowsuchagency

💭
hustlin'
View GitHub Profile
@knowsuchagency
knowsuchagency / vcard.sh
Created December 9, 2016 01:42
vcard example
#!/usr/bin/env bash
# vcard generation utility
# first argument is the file to be written to. It will be appended to with each new write.
# ex: $./vcard card
printWrite() {
# Take printf formatted string, append newline, and write to stdout and stderr
printf "$1\n" | tee /dev/fd/2
@knowsuchagency
knowsuchagency / shwifty.swift
Created December 17, 2016 00:51
code for initial view controller
//
// VotesTableViewController.swift
// Voting
//
// Created by Stephan Fitzpatrick on 12/16/16.
// Copyright © 2016 Stephan Fitzpatrick. All rights reserved.
//
import UIKit
@knowsuchagency
knowsuchagency / integrals.ipynb
Last active May 1, 2017 00:30
right hand sum, left hand sum, and integration example in Python
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@knowsuchagency
knowsuchagency / Untitled142.ipynb
Created May 17, 2017 06:55
consumer_producer_stuff
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@knowsuchagency
knowsuchagency / Untitled146.ipynb
Last active May 23, 2017 22:11
Single dispatch context manager recipe
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@knowsuchagency
knowsuchagency / delicious_recipe.py
Last active May 23, 2017 23:27
transaction manager recipe for pyramid sqlalchemy session
from contextlib import contextmanager
from functools import singledispatch, partial
from pathlib import Path
import pkg_resources
# development config uri for base distribution
DEVELOPMENT_CONFIG_URI = pkg_resources. \
get_distribution('distribution_package_name').get_resource_filename(
@knowsuchagency
knowsuchagency / zodb experimentation.ipynb
Created May 24, 2017 04:32
zodb experimentation.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@knowsuchagency
knowsuchagency / scopes and reference semantics things.ipynb
Created May 24, 2017 18:20
scopes_and_reference_semantics.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@knowsuchagency
knowsuchagency / __init__.py
Created June 8, 2017 23:44
Pyramid zappa recipe (Python 3.6)
from pyramid.config import Configurator
from configparser import ConfigParser # This will be different in Python 2.7
from functools import partial
import os
def main(global_config, **settings):
""" This function returns a Pyramid WSGI application.
"""
config = Configurator(settings=settings)
@knowsuchagency
knowsuchagency / layout.pug
Created June 15, 2017 23:13
pug template version of Pyramid layout
//
Created by stephanfitzpatrick on 6/15/17.
doctype html
html(lang= "#{ request.locale_name }")
head
meta(charset="utf-8")
meta(http-equiv="X-UA-Compatible", content="IE=edge")
meta(name="viewport", content="width=device-width, initial-scale=1.0")
meta(name="description", content="pyramid web application")
meta(name="author", content="Pylons Project")