Skip to content

Instantly share code, notes, and snippets.

Greg Meece GLMeece

Block or report user

Report or block GLMeece

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
GLMeece /
Last active Oct 24, 2019
Steps to Terminal Enlightenment on a Mac (tweaking your terminal for fun and profit)
GLMeece / .zshrc
Created Sep 5, 2019
Z-shell Resource File PowerLevel9K Example
View .zshrc
# zmodload zsh/zprof # <-- enable for shell profiling
# Note: for more options info, see:
# Autoload info:
# With the -U flag, alias expansion is suppressed when the function is loaded.
# -z mark the function to be autoloaded using the zsh style
autoload -Uz compinit
GLMeece /
Last active Mar 19, 2019
Exporting INI file values as Environmental Variables
# It is assumed that $HOME is already defined and exported...
# Assuming within our home directory,
# we have a hidden directory called '.env'
# ...and within that directory we had a file named 'secret_vars.ini'...
# ...we'd build the path
def nice_title_case(str_in):
"""Converts a string to Title Case, with conventional exceptions which
need not be capitalized if they are not the first word in the title.
exceptions_to_title_casing = (
"a", "an", "and", "at",
"but", "by", "for", "in",
"nor", "of", "on", "or",
"so", "the", "to", "up", "yet"
GLMeece /
Created Mar 15, 2019
HTTP Bad Return Codes (as Python Dictionary)
http_bad_codes = {
"400": "Bad Request",
"401": "Unauthorized",
"402": "Payment Required",
"403": "Forbidden",
"404": "Not Found",
"405": "Method Not Allowed",
"406": "Not Acceptable",
"407": "Proxy Authentication Required",
"408": "Request Timeout",
GLMeece /
Last active Oct 2, 2018
Using PanDoc to Convert Word to Markdown
pandoc -f docx -t markdown -o my_example_input.docx
GLMeece /
Last active Jul 14, 2019
Setting up a Virtual Environment for Python using VirtualEnvWrapper

Virtual Environments

  1. Before beginning, you should have a version of pip installed. If you don't, it is recommended you install it universally via the Terminal: sudo easy_install pip
  2. Once you do, install virtualenvwrapper: sudo pip install virtualenvwrapper. More information can be found in Read the Docs
  3. Change into the directory where your new project is; e.g., cd ~/Documents/Repos/my_new_project
  4. Create your new environment in this directory, automatically giving it the name of the current directory: thisdir=${PWD##*/};mkvirtualenv -a . -r requirements.txt $thisdir

Using Your Virtual Environment

  • To make sure you remember what your virtual environment is named (and, indeed - all you have created), execute lsvirtualenv which lists all virtual environments.
GLMeece /
Last active Apr 4, 2019
Setting up Sphinx for generating documentation from DocStrings, leveraging the Napoleon extension.

Sphinx Setup for autodoc

Sphinx is a documentation generator that is the de facto standard for Python projects. The official documentation can be a bit daunting as it includes so many options, it's hard to know where to start.

Note: This Gist was updated on 04/04/2019 to accomodate a newer version of Sphinx, as well as Python 3.7. YMMV!

This document is written with the following presuppositions:

View reStructuredText_testing.rst

Testing reST Code Blocks

Code Block (Python):

jnk_instance = ""
jnk_user = 'myusername'
jnk_pass = 'mypassword'
my_test_run = JenkinsJobTestRunRetrieval(jnk_instance, jnk_user, jnk_pass)
GLMeece /
Created Oct 21, 2017 — forked from kevinSuttle/
List of Usable HTML Meta and Link Tags

Copied from

Basic HTML Meta Tags

<meta charset='UTF-8'>
<meta name='keywords' content='your, tags'>
<meta name='description' content='150 words'>
<meta name='subject' content='your website's subject'>
<meta name='copyright' content='company name'>
You can’t perform that action at this time.