Skip to content

Instantly share code, notes, and snippets.

😅
I may be slow to respond.

Chris Tabor christabor

😅
I may be slow to respond.
Block or report user

Report or block christabor

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
@christabor
christabor / linting_to_check.md
Last active Mar 9, 2019
Python linting - maybe this will become a utility... probably not.
View linting_to_check.md

Using class Foo() is not necessary in 3.x

class [a-zA-Z]+\(\):

@christabor
christabor / pkgutil_analysis.py
Last active Jan 29, 2019
A quick script to analyze python package code structure
View pkgutil_analysis.py
"""Generate a report about the meta information of a pckage.
This includes its children modules,
functions, classes, arg/kwarg count, etc.
"""
import ast
import inspect
import os
import pkgutil
import sys
@christabor
christabor / graph_gist_template.adoc
Last active Apr 7, 2018 — forked from jexp/graph_gist_template.adoc
CHANGEME: GraphGist Template. Fork to make your own, view source to see instruction comments
View graph_gist_template.adoc

Plant database schema

Introduction

@christabor
christabor / plant_reproduction_exp.py
Created Feb 26, 2018
plant type reproduction automata experiment
View plant_reproduction_exp.py
from random import choice
types = ['sporophyte', 'gametophyte']
class Plant(object):
def __init__(self, type=None):
self.type = type or choice(types)
View wrapped_ctxmgr.py
from contextlib import contextmanager
def to_mgr(fn):
fn.__converted__ = True
@contextmanager
def fn2(*args, **kwargs):
try:
fn(*args, **kwargs)
@christabor
christabor / Principles.md
Last active Mar 9, 2019
Bret Victor principles
View Principles.md

Articles and their respective points

GLOBAL

  • Interactivity
  • Direct manipulation
  • Intuition
  • See the data, see the changes

===============================================================================

@christabor
christabor / fields_science_combinatorics.py
Last active Jun 19, 2019
generated-scientifc-fields-results
View fields_science_combinatorics.py
# -*- coding: UTF-8 -*-
"""Scientific branches."""
from itertools import permutations
from random import choice
branches = {
"Acarology": "study of mites",
"Aceology": "science of remedies, or of therapeutics; iamatology.",
"Acology": "study of medical remedies",
@christabor
christabor / flask_fsm.py
Created Jul 12, 2017
Flask Finite State Machine PoC
View flask_fsm.py
"""FSM abstraction in python for flask.
==========================
Requirements:
1. Transition from/to steps
2. Only allow certain transitions
3. Reset FSM once in a certain position (stopping state)
E.g. a form that may then save to a DB and then
@christabor
christabor / bmarks_iidex.py
Created Jun 14, 2017
Make your chrome bookmarks into a searchable, tokenized inverted index
View bmarks_iidex.py
"""Tokenize bookmark titles and create an inverted index."""
import re
import os
import sys
from pprint import pprint as ppr
from collections import Counter, defaultdict
from pyquery import PyQuery as pq
@christabor
christabor / advanced_decorators.py
Created Jun 9, 2017
Advanced decorator builder / customization
View advanced_decorators.py
"""
Exploring some ideas around customizable decorators that derive default
values from a config or instance.
"""
from functools import wraps
# Simple customizable decorator.
You can’t perform that action at this time.