Skip to content

Instantly share code, notes, and snippets.

View LordSputnik's full-sized avatar

Ben Ockmore LordSputnik

View GitHub Profile
{
aliasEditor: {},
buttonBar: {
aliasEditorVisible: false,
disambiguationVisible: false,
identifierEditorVisible: false
},
editionSection: {
depth: 21,
pages: 336,
@LordSputnik
LordSputnik / eac-cue-submit-isrc.py
Last active July 9, 2017 07:32
A quick little script I wrote for scanning all the EAC CUE files in a single directory, and uploading any contained ISRCs to MusicBrainz.
#!/usr/bin/env python
# -*- coding: utf8 -*-
# Copyright 2013 Ben Ockmore
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
@LordSputnik
LordSputnik / test_for_gist.py
Created March 1, 2016 21:31
Python Last.fm top tracks example
import pylast
API_KEY = '<ADD KEY HERE>'
API_SECRET = '<ADD SECRET HERE>'
username = "BenOckmore"
password_hash = pylast.md5("<ADD PASS HERE>")
network = pylast.LastFMNetwork(api_key = API_KEY)
@LordSputnik
LordSputnik / area_index_code.js
Created December 11, 2016 01:21
Area Indexing Code
Area.forge()
.where({type: 1})
.fetchAll()
.then((collection) => collection.toJSON())
.map(search.indexArea)
[Fri Dec 09 2016 00:14:27 GMT+0000 (GMT)] ERROR { Error
at NotFoundError.Error (native)
at NotFoundError.SiteError (/home/ben/Code/bookbrainz/site/src/server/helpers/error.js:27:23)
at new NotFoundError (/home/ben/Code/bookbrainz/site/src/server/helpers/error.js:156:123)
at /home/ben/Code/bookbrainz/site/src/server/app.js:128:7
at Layer.handle [as handle_request] (/home/ben/Code/bookbrainz/site/node_modules/express/lib/router/layer.js:95:5)
at trim_prefix (/home/ben/Code/bookbrainz/site/node_modules/express/lib/router/index.js:312:13)
at /home/ben/Code/bookbrainz/site/node_modules/express/lib/router/index.js:280:7
at Function.process_params (/home/ben/Code/bookbrainz/site/node_modules/express/lib/router/index.js:330:12)
at next (/home/ben/Code/bookbrainz/site/node_modules/express/lib/router/index.js:271:10)
@LordSputnik
LordSputnik / CHANGELOG.md
Last active September 7, 2016 21:05
BookBrainz Change Log

September 2016 (2016-09-07)

Bug

  • [BB-187] - BBID regex matches UUID in the middle of a string
  • [BB-189] - User can register a new user while logged in
  • [BB-195] - Entities with multiple of the same IDs have all of those IDs listed multiple times
  • [BB-197] - Clicking on the revisions tab of an editor while on it 404s

Improvement

  • [BB-190] - Convert React components to one-per-file ES6 classes
// ==UserScript==
// @name MusicBrainz Unicode Release Editor
// @namespace http://userscripts.org
// @description A script to add copyable unicode characters to the bottom of the release editor.
// @include http://musicbrainz.org/release/*
// @include http://*.musicbrainz.org/release/*
// @include https://musicbrainz.org/release/*
// @include https://*.musicbrainz.org/release/*
// @version 2
// @grant none
@LordSputnik
LordSputnik / gist:6771632
Created September 30, 2013 23:10
Python USB Device Code
import pywinusb.hid as hid
import time
import datetime
v_id = 0x04D8
p_id = 0x0042
all_devices = hid.HidDeviceFilter(vendor_id = v_id).get_devices()
target_usage= hid.get_full_usage_id(0xFF00, 0x01)
def client_authentication_required(self, request, *args, **kwargs):
return False
@LordSputnik
LordSputnik / Template Engine
Created July 8, 2013 18:33
Example of responding to a data request using a fixed template.
from collections import defaultdict
import copy
import json
simulated_release = {
"artist":"The Beatles",
"title":"Collection of Random Hits",
"mbid":3,
}