Skip to content

Instantly share code, notes, and snippets.

View jplesperance's full-sized avatar

Jesse Lesperance jplesperance

View GitHub Profile
@jplesperance
jplesperance / keybase.md
Created May 8, 2018 23:20
Keybase Verification

Keybase proof

I hereby claim:

  • I am jplesperance on github.
  • I am jplesperance (https://keybase.io/jplesperance) on keybase.
  • I have a public key whose fingerprint is A2BD 7BBD 1216 79CA AC0E FCC9 BEBD 1309 9D3D 81D2

To claim this, I am signing this object:

@jplesperance
jplesperance / security-group-cleanup.py
Created December 1, 2015 20:22 — forked from miketheman/security-group-cleanup.py
AWS EC2 Unused Security Group cleanup
#!/usr/bin/env python
import sys
import boto
import pprint
del_flag = ''
if len(sys.argv) > 1:
del_flag = sys.argv[1]
@jplesperance
jplesperance / gist:1874d4d435323181aab8
Created September 17, 2015 23:38
encode/decode unicode string to 8-bit values
def to_str(bytes_or_str):
if isinstance(bytes_or_str, bytes):
value = bytes_or_str.decode('utf-8')
else:
value = bytes_or_str
return value # Instance of str
def to_bytes(bytes_or_str):
if isinstance(bytes_or_str, str):
value = bytes_or_str.encode('utf-8')

Keybase proof

I hereby claim:

  • I am jplesperance on github.
  • I am jplesperance (https://keybase.io/jplesperance) on keybase.
  • I have a public key whose fingerprint is BCE8 D33A 1550 6FC2 5A45 A573 9FCB 5BF8 E307 5CEF

To claim this, I am signing this object:

GFORCE => git add -A && git commit --amend -C HEAD && git push -f
c => git_index
cbg => git rev-parse --verify HEAD | simple_clipboard
g => git
ga => git_add_shortcuts
gaa => git add -A
gap => git add -p
gash => git stash
gasha => git stash apply
gashl => git stash list
@jplesperance
jplesperance / pypi-stats.py
Created May 13, 2015 17:11
A file to get the download and version stats for pypi packages
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Calculates the total number of downloads that a particular PyPI package has
received across all versions tracked by PyPI
"""
from datetime import datetime
import locale
@jplesperance
jplesperance / pre-push
Created April 29, 2015 23:15
precommit hook to deny push to a branch
#!/bin/bash
protected_branch='master'
current_branch=$(git symbolic-ref HEAD | sed -e 's,.*/\(.*\),\1,')
if [ $protected_branch = $current_branch ]
then
read -p "You're about to push master, is that what you intended? [y|n] " -n 1 -r < /dev/tty
echo
if echo $REPLY | grep -E '^[Yy]$' > /dev/null