Skip to content

Instantly share code, notes, and snippets.

Avatar
:shipit:
Why is this a thing

Matthew Precious mattprecious

:shipit:
Why is this a thing
  • Square, Inc.
  • Kitchener, ON
View GitHub Profile
View keybase.md

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 Nov 18, 2015
Generate a P90X3 schedule in iCalendar format.
View x3-calendar.py
#!/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 Oct 7, 2015
Rename iOS asset drops to match Android conventions. Deisgners, AMIRITE!?
View camel-to-snake.py
#!/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: