Skip to content

Instantly share code, notes, and snippets.

View Spacerat's full-sized avatar

Joseph Atkins-Turkish Spacerat

View GitHub Profile
#!/usr/bin/env python
# Quick and dirty script to scrub pip requirements files of duplicate requirements
import sys
import fileinput
from requirements.requirement import Requirement
seen = set()
@Spacerat
Spacerat / delete_orphans.scpt
Last active March 23, 2016 16:28
AppleScript to remove items from iTunes whose files have been deleted
tell application "iTunes"
set selectedTracks to selection
repeat with i from 1 to (length of selectedTracks)
if class of item i of selectedTracks is not shared track then
tell item i of selectedTracks to set {loc} to {get location}
if loc is missing value then
tell application "iTunes"
delete item i of selectedTracks
end tell
end if
@Spacerat
Spacerat / ML.ipynb
Last active August 29, 2015 14:17
Machine Learning Algorithms
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Spacerat
Spacerat / ml.ipynb
Created February 28, 2015 17:55
Machine Learning Examples
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Spacerat
Spacerat / GLDM.ipynb
Created February 22, 2015 21:37
GLDM for texture classification
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Spacerat
Spacerat / siecherman.ipynb
Created April 15, 2014 00:25
Basic brute-force solution of solution to Siecherman Dice problem
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Spacerat
Spacerat / e.ipynb
Created April 12, 2014 20:21
Eeeeeee
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Spacerat
Spacerat / circuits.ipynb
Last active August 29, 2015 13:58
Circuit tree calculator
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Spacerat
Spacerat / rand.ipynb
Last active August 29, 2015 13:56
Uniform distribution as building block for other distributions
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Spacerat
Spacerat / delete_duplicates.py
Created February 2, 2014 19:04
Delete the newest of files with the same name except for different extensions.
import os, time
import os.path
for path, dirs, files in os.walk('./'):
dups = {}
for x in files:
name, ext = os.path.splitext(x)
fullpath = path+'/'+x
(mode, ino, dev, nlink, uid, gid, size, atime, mtime, ctime) = os.stat(fullpath)
if not name in dups: