Skip to content

Instantly share code, notes, and snippets.

View plamere's full-sized avatar

Paul Lamere plamere

View GitHub Profile
@plamere
plamere / your_chill.yaml
Last active April 23, 2019 10:08
Example of a YAML for a simple chill mix
your_favorite_chill_tracks:
title: your favorite chill tracks
description: just your most chill tracks
main: sequencer
config:
max_tracks: 30
components:
my_liked_tracks:
@plamere
plamere / virtues.txt
Created March 31, 2019 17:30
a list of all virtues
ability abundance acceptance accountability accuracy achievement acknowledgement acting on convictions activism adaptability administration/control adoration adventure advice affection aging gracefully allowing altruism amazement ambition anger at injustice anticipation apology appeasement appreciation appreciation of appreciation of beauty approbation appropriate conduct appropriate knowledge approval art assertiveness assumptions atonement attention attitude austerity authenticity authority authority/honesty autonomy awareness awe b balance beauty being true to oneself belief benevolence benignity bliss bravery c candor capacity to be loved capacity to love care caring caution celebration celibacy certainty chance change chaos character charity charm chastity cheerfulness chivalry choice citizenship civility clarity class cleanliness coincidence collaboration commitment communication communication/info communion community community/personalist community/supportive companionship compassion competition comple
@plamere
plamere / goats.txt
Created January 2, 2017 22:41
title_chain.py
$ python title_chain.py goats
1 Goats On A Boat by The Devil Wears Prada
2 Boat To Nowhere by Anoushka Shankar
3 Nowhere Man by Bryce Vine
4 Man Down by Rihanna
5 Down Under by Men At Work
6 Under Cover of Darkness by The Strokes
7 Darkness Between the Fireflies by Mason Jennings
8 Fireflies Made Out Of Dust by Happy Jawbone Family Band
@plamere
plamere / Playlist starting with Goats
Created January 2, 2017 22:34
Some examples of title_chain.py output
$ python title_chain.py goats
1 Goats On A Boat by The Devil Wears Prada
2 Boat To Nowhere by Anoushka Shankar
3 Nowhere Man by Bryce Vine
4 Man Down by Rihanna
5 Down Under by Men At Work
6 Under Cover of Darkness by The Strokes
7 Darkness Between the Fireflies by Mason Jennings
8 Fireflies Made Out Of Dust by Happy Jawbone Family Band
9 Dust & Gold by OKBADLANDS
@plamere
plamere / webtools.py
Last active February 20, 2017 00:46
a grab bag of python stuff that my sever code uses sometimes.
import os
import os.path
import hashlib
from httplib import HTTP
from urlparse import urlparse
import urllib
import urllib2
import simplejson as json
def get_export_map_for_directory(path, prefix = "/"):
@plamere
plamere / cynical_radio.py
Created June 20, 2015 09:50
An example of using PBL to create a cynical radio station where every 4th song is by Sia or Katy Perry
from pbl import *
gold = Concatenate([ArtistTopTracks('Sia'), ArtistTopTracks('Katy Perry')])
norm = PlaylistSource("Today's Top Hits")
radio = Alternate([norm, norm, norm, Shuffler(gold)])
radio = PlaylistSave(radio, 'cynical radio', 'plamere', max_size=40)
@plamere
plamere / gist:e41f5a163566dddbeba4
Created August 3, 2014 16:27
iterating through artists with spotipy to get the top tracks
for start in xrange(0, 10000, page_size):
response = en.get('catalog/read', id=tpid, start=start,
results=page_size, bucket=['id:spotify'])
if len(response['catalog']['items']) == 0:
break
spaids = []
for item in response['catalog']['items']:
if 'artist_name' in item:
spid = item['request']['item_id']
@plamere
plamere / parse.py
Last active August 29, 2015 14:04
parses outside lands lineup and generates a json of artists along with Spotify, Echo Nest and Rdio IDs
import sys
from bs4 import BeautifulSoup
import json
import pyen
en = pyen.Pyen()
def get_fid(artist, idspace):
if 'foreign_ids' in artist and len(artist['foreign_ids']) > 0:
for fids in artist['foreign_ids']:
if fids['catalog'] == idspace:
@plamere
plamere / spotify_echonest_example
Last active August 29, 2015 14:02
Get Spotify images for the artists that are similar to weezer
import pyen
import spotipy
import sys
'''
get a set of images for artists that are similar to
the given seed artist
'''
en = pyen.Pyen()
@plamere
plamere / TrackUploadSample.m
Created April 14, 2014 11:02
Example of uploading a track to the Echo Nest for analysis without ENIOS
- (void) uploadTrack: (Track *) track {
NSDictionary *params = @{
@"filetype" : @"m4a",
@"api_key" : self.apiKey,
};
NSFileManager *fm = [NSFileManager defaultManager];
NSURL *audioPath = [self pathToAudio:track];
NSString *path = [audioPath path];
NSData *data = [fm contentsAtPath:path];