Skip to content

Instantly share code, notes, and snippets.

View roablep's full-sized avatar

Peter Elbaor roablep

View GitHub Profile
@roablep
roablep / pipenv.sh
Created March 5, 2018 01:54 — forked from rosswd/pipenv.sh
Using pip, virtualenv and/or virtualenvwrapper to manage packages and environments in python.
# know what version of python you have
python # os (2.7.10)
python2 # homebrew python 2 (2.7.14)
python3 # homebrew python 3 (3.6.2)
# install pipenv
pip3 install pipenv
export PATH=$PATH:$HOME/Library/Python/3.6/bin >> ~/.bash_exports
# use
@roablep
roablep / services.md
Created August 2, 2017 13:26 — forked from bf4/services.md
Analytics, Metrics and Error monitoring services (and roll your own via logging, etc)
import os
# Assign your top level directory to home
home = "/Users/rhancock"
for dirpath, dirs, files in os.walk(home, topdown=True):
for dr in dirs:
fullpath_d = os.path.join(dirpath, dr)
for fname in os.listdir(fullpath_d):
<snippet>
<content><![CDATA[
"""
Module: $1
Description: $2
Minimum Python Required: $3
Changelog:
<snippet>
<content><![CDATA[
"""
${1:Description of why the classes and functions in this file are bundled together.}
"""
__author__ = "$2"
]]></content>
<snippet>
<content><![CDATA[
Class $1(object):
""" ${2:A comprehensible explanation of the purpose of the class
that a non-programmer can understand along with advice on sub-classing.""}
Attributes:
${3/, ?/:\n\t/g}:
"""
def __init__(self, $3):
<snippet>
<content><![CDATA[
def $1($2):
""" ${3:Description}
Args:
${2/, ?/:\n\t/g}:
Returns:
$4