Skip to content

Instantly share code, notes, and snippets.

⚡️
.

Taylor D. Edmiston tedmiston

View GitHub Profile
@tedmiston
tedmiston / GenerateMITLicense.py
Last active May 9, 2018
Fetch GitHub's MIT license template, populating this year and your name
View GenerateMITLicense.py
"""
Fetch GitHub's MIT license template, populating this year and your name.
"""
import getpass
import pwd
from datetime import date
import requests
View keybase.md

Keybase proof

I hereby claim:

  • I am tedmiston on github.
  • I am tedmiston (https://keybase.io/tedmiston) on keybase.
  • I have a public key ASDcS_0ErBLjbjPfvkCIwRXWIuHJaUCvFhvs1JZ7qltKzAo

To claim this, I am signing this object:

@tedmiston
tedmiston / _.ipynb
Created Jul 24, 2017
massive destruct-ion
View _.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View astro_metal_name_stylizer.py
#!/usr/bin/env python3
"""
A style-izer / PascalCase-r / opinionated capitalizer for the docs site.
Capitalize the names of companies, services, etc as used on various generated
list pages on the Astronomer docs site <https://docs.astronomer.io/>, such as
Sources, Destinations, Transforms, Clickstream Collectors, and Clickstream
Connectors.
@tedmiston
tedmiston / ordinal.py
Last active Apr 4, 2017
Generate all ordinal days for a given year.
View ordinal.py
"""
Generate ordinal days for a given year.
January 1st, January 2nd, January 3rd ... December 31st.
"""
import calendar
import datetime
def suffix(day):
@tedmiston
tedmiston / join_plus.py
Created Apr 4, 2016
Concatenate a list of items with more advanced separator control
View join_plus.py
def join_plus(items, separator, final_separator=None, pair_separator=None):
"""Concatenate a list of items with more advanced separator control.
Example 1 - You have a list of names = [Tom, Jeff, Sally] and want them
combined as a string. There are a few possible desired outputs:
(1-1) Tom, Jeff, Sally # join_plus(names, ', ')
(1-2) Tom, Jeff, and Sally # join_plus(names, ', ', final_separator=', and ')
Example 2 - Same but with two names = [Tom, Jeff]. This creates a third
@tedmiston
tedmiston / cream.ipynb
Last active Jun 10, 2016
High-yield checking analysis
View cream.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@tedmiston
tedmiston / profile.sh
Created Nov 13, 2015
Python profiling
View profile.sh
python -m cProfile -s tottime foo.py
@tedmiston
tedmiston / fizz_buzz.py
Last active Nov 10, 2015
Fizz buzz one-liner
View fizz_buzz.py
"""
Fizz buzz "one liner".
Disclaimer: I don't write code like this for real. Python 2/3.
"""
from __future__ import print_function
def fizz_buzz(start=1, end=100, word1='Fizz', word2='Buzz'): [print(' '.join([word1, word2]) if i % 3 == 0 and i % 5 == 0 else (word1 if i % 3 == 0 else (word2 if i % 5 == 0 else i))) for i in range(start, end + 1)]
if __name__ == '__main__':
You can’t perform that action at this time.