Skip to content

Instantly share code, notes, and snippets.

View Evantm's full-sized avatar
⚙️
Eliminating Toil

Evan ™️ Evantm

⚙️
Eliminating Toil
View GitHub Profile
@Evantm
Evantm / books.md
Last active October 19, 2022 20:10
Books for learning a great good

With no particular ordering

  • The Principles of Scientific Management
  • Behind Human Error
  • Slack: Getting Past Burnout, Busywork, and the Myth of Total Efficiency
  • Smart and Gets Things Done
  • Kill It with Fire: Manage Aging Computer Systems (and Future Proof Modern Ones)
  • Accelerate
  • The Phoenix Project
  • The Unicorn Project
@Evantm
Evantm / fizzbuzz_five_ways.py
Last active June 26, 2019 21:05
Classic Fizzbuzz done 5 ways: Classic, dictionary, recursion, generators, closures Could be done more ways.
#fizz buzz 5 ways
def fizzbuzz_1(): #classic
for i in range(1,101):
if i % 15 == 0:
print('fizzbuzz')
elif i % 3 == 0:
print('fizz')
<html>
<head>
<style>
h1 {
font-family: Calibri;
}
</style>
</head>
<body>
<h1>Hello World!</h1>

Hello World

This is content converted from Markdown!

Here's a JSON sample:

{
  "foo": "bar"
}
@Evantm
Evantm / nussinov.py
Last active March 19, 2019 23:58
Nussinov algorithm for bioinformatics from pseudo code provided in class
grid = [
[0,None,None,None],
[0,0,None,None],
[-1,0,0,None],
[-1,-1,0,0],
]
seq = ['U','G','A','U']
def match(i,j):
@Evantm
Evantm / template.html
Created March 11, 2019 08:13
Automatic text templates from JSON. Version Alpha. Thoroughly untested
<!DOCTYPE html>
<html>
<head>
<title>Evan's Templating Site</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/js/bootstrap.min.js"></script>
<script id="json" src="template.json"></script>
</head>
<body>
@Evantm
Evantm / textbook.py
Created January 7, 2018 00:42
Command line python script that scrapes TRU Bookstore then searches Libgen for that book.
import sys
from requests import get
from bs4 import BeautifulSoup
# Put in your class details. It scans TRU bookstore to get ISBN
# It uses the ISBN to search Libgen to get MD5
# It then downloads from Libgen using the MD5
def make_request(url):
headers = {
'Host': 'thebookstore.tru.ca',
'Connection': 'keep-alive',
@Evantm
Evantm / PurpleParse.py
Created November 8, 2017 03:58
Script to parse Purple Air given search term
import requests
import urllib
import json
url = """ https://www.purpleair.com/json?&sensorsActive=168&orderby=L """
Search_Term = "Kamloops"
req = urllib.request.Request(
# meant to be run as a cronjob
# used to aggreagate data output from hoowmanypeople around and send to server
from datetime import datetime
import requests
def main(start,end):
now = datetime.now()
list_of_list_of_macs = []
@Evantm
Evantm / BCFerriesCLI.py
Last active September 2, 2017 17:24
CLI interface for BC Ferries
import click
import requests
from urllib.parse import urlparse,parse_qs
routes = {'TSA':['30','01','09'],'HSB':['02','03','08'],'LNG':['03'],'SWB':['01','04','05'],'DUK':['30'],'NAN':['02']}
url = 'http://orca.bcferries.com:8080/cc/marqui/sailingDetail.asp?route={0}&dept={1}'
@click.command()
@click.option('-d','--depart', type=click.Choice(['TSA', 'HSB','LNG','SWB','DUK','NAN']), prompt='Departure',
help='Where the ferry is departing.')