Skip to content

Instantly share code, notes, and snippets.

View mattprecious's full-sized avatar
:shipit:
Why is this a thing

Matthew Precious mattprecious

:shipit:
Why is this a thing
View GitHub Profile

Keybase proof

I hereby claim:

  • I am mattprecious on github.
  • I am mattprecious (https://keybase.io/mattprecious) on keybase.
  • I have a public key ASCmyN9F2j0UwMNzaPKKAkdfYe80fFEPR0jRKm-h2J1kNwo

To claim this, I am signing this object:

@mattprecious
mattprecious / x3-calendar.py
Created November 18, 2015 03:18
Generate a P90X3 schedule in iCalendar format.
#!/usr/bin/python
import argparse, datetime
def date(s):
try:
return datetime.datetime.strptime(s, "%Y-%m-%d")
except ValueError:
raise argparse.ArgumentTypeError("Not a valid date: '{0}'. Date must be in format 'YYYY-MM-DD'".format(s))
@mattprecious
mattprecious / camel-to-snake.py
Created October 7, 2015 20:11
Rename iOS asset drops to match Android conventions. Deisgners, AMIRITE!?
#!/usr/bin/python
import sys, re
def convert(s):
s1 = re.sub('(.)([A-Z][a-z]+)', r'\1_\2', s)
return re.sub('([a-z0-9])([A-Z])', r'\1_\2', s1).lower()
if __name__ == '__main__':
if len(sys.argv) == 1: