jq- Your own Spotify Client ID and Client Secret
Store your Client ID in ~/.config/spotify_client_creds.json. It should look like:
| // This may or may not help you understand what's going | |
| // on in week one of the Stanford Machine Learning course | |
| // particulary if you're coming from Javascript programming. | |
| // The lecture deals with linear regression. You may remember | |
| // a concept called "line of best fit" from middle school. | |
| // A refresher: you have a set of points with x and y co-ordinates | |
| // and you have to draw a straight line through them. It doesn't | |
| // have to intersect all (or any) of the points, but it does need | |
| // to represent the general layout of your dataset. The idea is |
| MediaElementAudioSource outputs zeroes due to CORS access restrictions for data:audio/wav;base64,UklGRiRwEgBXQVZFZm10IBAAAAABAAEARKwAAIhYAQACABAAZGF0YQBwEgDs/+//9P/x//b/8P/u//j/+v8AAAIACgACAAgABQAGAAMA/v/8//3/9v/2//L/9f/y//L/7v/w//L/+P8HAAsAFAAVABoAEAANAAcAAAACAAUADQAIAAsA///5//X/9//3//f/AAAEAAgABwABAP3/+v/7//v//f8BAAMABgADAAEA/P8AAAIAAQAJAAkACwAOAAgADQAEAAwABwAMAA0ADgAOAAkAEwANABMACgAJAAgAAQABAAAA+//9//3/+/8BAAYABQADAAIAAwACAAcAAwAMAAsACAALAAwABAAEAPr///////z/+v/8//j/+v/w//D/6f/v/+v/7//3//v/+//8//b////7/wEAAAAFAAMABAD9/wMA+v/2//X/9/////z/AwD7/wUA/P8CAAMABQAMAA8ACQAMAAoAAwD9//b/8f/t//H/6P/s/+//9v/8////9//+//n/AgD//wUABQAOAAwADwAHAAYA+f8AAPf/+//6/wAA+f8AAPn/AAD7/wEA+f/+//3/AQAAAP///f/6/wEA+v8AAPv//f/+//7//P/0//b/+//+//z////6//j/+f/1/wIAAgANAAoAEQAMAAYABAD//wEA9v/6//j/+f/7//r/+/8BAPz/AwD+/wEA/f/8/wQA//8HAAYADQARABAADwANABEACwAPAAkACgAAAP3/AAD7//v/+//8//r/AQD//wcABQAJAAUACQAHAAEA/P/2//v/8//6//L/9//1//b/8f/0/+//9//3/wAA/P8EAP//AgAEAAoAFAAUABQAEwAOAA4ABAAGAPr/AAD7/wIA//8CAPz/AgD+/wAAAwAGAAoADAAOABAAFgAQABAACgAGAP/ |
| def one_two_three(): | |
| if (one_two() == 1): | |
| if (one_two() == 1): | |
| return 1 | |
| else: | |
| return 2 | |
| else: | |
| if (one_two() == 1): | |
| return 3 | |
| else: |
| import re | |
| def is_valid_IP(strng): | |
| t = re.compile("^\d+$") | |
| try: | |
| return (lambda m: len(m) is 4 and reduce(lambda acc, el: acc and el, [True] + m))(map(lambda x: (lambda x: x < 256 and x >= 0)(int(x)) and (x[0] is not '0' if len(x) > 1 else True) and t.match(x) is not None, strng.split('.'))) | |
| except Exception: | |
| return False |
| request = requests.post( | |
| "https://accounts.spotify.com/api/token", | |
| data = json.dumps({ | |
| "grant_type": "client_credentials" | |
| }), | |
| headers = { | |
| "Authorization": "Basic " + str( | |
| base64.b64encode( | |
| (config.config["spotify"]["client_id"] + | |
| ":" + config.config["spotify"]["client_secret"] |
Here are the languages I've typed in over the years.
1 Arduino
1 CoffeeScript
1 Go
1 Rust
1 TeX
2 ChucK
2 Clojure
| #!/usr/bin/python | |
| from __future__ import print_function | |
| import httplib2 | |
| import os | |
| import base64 | |
| import sys | |
| from apiclient import discovery | |
| from oauth2client import client | |
| from oauth2client import tools |
| #!/bin/bash | |
| # spotify_platform_oauth.sh | |
| # | |
| # A script to quickly and easily generate Spotify oauth tokens given a client | |
| # id, secret, and scope. Will authenticate a user via the browser. | |
| # The app must have "http://localhost:8082/' as a redirect_uri | |
| # spotify_client_creds.json should contain a spotify client id and secret pair |
| var a = (keyCode)=>{ | |
| var keyEvent = document.createEvent("Events"); | |
| keyEvent.initEvent("keydown", true, true); | |
| keyEvent.keyCode = keyCode; | |
| keyEvent.which = keyCode; | |
| document.body.dispatchEvent(keyEvent); | |
| } | |
| const LEFT = 37; | |
| const UP = 38; |