Skip to content

Instantly share code, notes, and snippets.

View jlant's full-sized avatar

Jeremiah Lant jlant

  • Senior Analytics Developer at UPS
  • Louisville, Kentucky
View GitHub Profile
@jlant
jlant / states.py
Created February 27, 2020 18:38
Python - dictionary of state abbreviations and names.
abbrevations = [
"AL", "AK", "AZ", "AR", "CA", "CO", "CT", "DE", "FL", "GA",
"HI", "ID", "IL", "IN", "IA", "KS", "KY", "LA", "ME", "MD",
"MA", "MI", "MN", "MS", "MO", "MT", "NE", "NV", "NH", "NJ",
"NM", "NY", "NC", "ND", "OH", "OK", "OR", "PA", "RI", "SC",
"SD", "TN", "TX", "UT", "VT", "VA", "WA", "WV", "WI", "WY"
]
states = {
"AL": "Alabama",
@jlant
jlant / mpld3_mousepositiondateplugin.py
Last active March 13, 2021 18:45
Python - mpld3 mouse position plugin for plots with datetime axis.
import matplotlib.pyplot as plt
import mpld3
from datetime import datetime
class MousePositionDatePlugin(mpld3.plugins.PluginBase):
"""Plugin for displaying mouse position with a datetime x axis."""
JAVASCRIPT = """
mpld3.register_plugin("mousepositiondate", MousePositionDatePlugin);
@jlant
jlant / mpld3_htmltooltip.py
Last active May 23, 2024 18:05
Python - mpld3 html tooltip snippet.
import matplotlib.pyplot as plt
import mpld3
from datetime import datetime
css = """
text.mpld3-text, div.mpld3-tooltip {
font-family: Arial, Helvetica, sans-serif;
font-weight: bold;
color: black;
@jlant
jlant / revealjs-list.md
Last active November 1, 2016 03:34
List - list of information on using reveal.js presentation framework
@jlant
jlant / software-carpentry-list.md
Last active June 25, 2018 14:58
Notes - Software Carpentry information and notes for workshops

Software Carpentry Workshop Notes

The Unix Shell

Find "NaN" values in set of files:

$ find . -type f -name "WATER.txt" | xargs grep "NaN"
$ find . -type f | xargs grep "NaN"
@jlant
jlant / virtual-machine-tips-and-setup.md
Last active August 29, 2015 14:26
List - virtual machine tips and setup

Virtual machine tips and setup

Create a shared folder

  1. Create a directory on your host machine; i.e. shared
  2. In VirtualBox, click on Devices -> Shared Folders -> + button on right -> type or select path to shared folder on your host
  • make sure you select Auto mount and Make permanent
  1. In the virtual machine on the command prompt:
  • create a new directory in /mnt
  • give full access rights to directory
  • mount it with proper permissions
@jlant
jlant / git-reference.md
Last active November 28, 2016 21:48
Git - list of helpful commands

Git reference

Local config settings (just do not include the --global option)

$ git config user.name "your-name"
$ git config user.email "your-email"

Delete commits back to a specific commit

@jlant
jlant / tutorial-sublime-text-2.md
Last active March 14, 2018 03:18
Tutorial - Perfect Workflow in Sublime Text 2
@jlant
jlant / vim-commands.md
Last active August 29, 2015 14:23
Vim - some helpful commands.

Vim commands

Delete large sections of text

Go to first line to be deleted and type ma (mark a) Go to last line to be deleted and type d'a (delete to mark a)

Select and copy all text to a new file

ggVG - go to first row, first column, enter visual mode then go to last row, last column y - yank :e some-copy.txt - create a new file called some-copy.txt