This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import math | |
def distance_calculator(points): | |
""" Takes an ordered list of points (tuple), and returns the total path distance. | |
>>> points = [(-7,-3), (6,1), (4, 10), (2, -5), (-8, 5), (8, 3)] | |
>>> distance = distance_calculator(points) | |
>>> distance = round(distance, 2) | |
68.22 | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import music21 as m | |
import copy | |
# replace x.show('midi') with play(x) | |
# to solve problem of first note(s) not playing | |
# in many web browsers | |
def play(x): | |
"""Returns nothing. Outputs a midi realization of x, a note or stream. | |
Primarily for use in notebooks and web environments. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;;; amw_init --- Summary | |
;; My shit. | |
;;; Commentary: | |
;; This is all my things. | |
;;; Code: | |
(package-initialize) | |
(elpy-enable) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
class AMW_input(): | |
def __init__( | |
self, prompt, typ, constraint, constraint_msg, | |
default, feedback=None, before=lambda x: x.strip(), after=None | |
): | |
self.prompt = prompt | |
self.typ = typ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os, re | |
# make a dict of names:extensions | |
img_exts = dict() | |
for _,_,f in os.walk("img"): | |
for name in f: | |
n, x = name.split(".") | |
img_exts[n] = x |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import google | |
import time | |
import random | |
from bs4 import BeautifulSoup | |
import urllib.request | |
import http.cookiejar | |
from selenium import webdriver | |
import subprocess | |
import blessings |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import google | |
import time | |
import random | |
from bs4 import BeautifulSoup | |
import urllib.request | |
import http.cookiejar | |
from selenium import webdriver | |
import subprocess | |
import blessings |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export PATH=$PATH:~/bin | |
export PATH=/usr/local/bin:$PATH | |
alias rm='rm -i' | |
alias reset='source ~/.bash_profile' | |
md () { touch "$1.md" && atom "$1.md" ;} | |
trash () { command mv "$@" ~/.Trash ; } | |
gdir () { mkdir -p "$1" && echo "# $1" >> "$1/readme.md" ; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import blessings | |
import time | |
import random | |
t = blessings.Terminal() | |
name = input(t.yellow("What is your name? ")) | |
aff_prefix = "I, " + name + ", " |
NewerOlder