Skip to content

Instantly share code, notes, and snippets.

Avatar

boylea

  • Portland, OR
View GitHub Profile
@boylea
boylea / mosaic_builder.py
Last active May 8, 2017
Creates an photo mosaic out of a base image and a search term. For fun only, the downloaded images may not be licensed for re-use
View mosaic_builder.py
"""
Before running:
$ pip install pillow
$ pip install requests
Example usage:
$ python mosaic_builder.py puppies my_template_image.jpg
For optional arguments:
$ python mosaic_builder.py -h
@boylea
boylea / ugly_indentation.py
Created Oct 3, 2015
An example of abusing python indentation syntax. Python is enforces correct indentation at a block, but if you try (or are grossly negligent) you can make it look really bad.
View ugly_indentation.py
uglystick = True
def ugly_python():
if uglystick:
print "one space"
if uglystick:
print 'five space'
def more_uglyness():
if uglystick:
print 'two space x2'
@boylea
boylea / livespec.py
Created Jul 21, 2014
pyqtgraph live running spectrogram from microphone
View livespec.py
import numpy as np
import pyqtgraph as pg
import pyaudio
from PyQt4 import QtCore, QtGui
FS = 44100 #Hz
CHUNKSZ = 1024 #samples
class MicrophoneRecorder():
def __init__(self, signal):
You can’t perform that action at this time.