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 / 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 / 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)
def client_authentication_required(self, request, *args, **kwargs):
return False
mkdir calibre_build && cd calibre_build && wget https://github.com/stasszczesniak/CalibreBookBrainzPlugin/archive/master.zip && unzip master.zip && cd CalibreBookBrainzPlugin-master && zip -r calibre_test.zip ./ && mv calibre_test.zip ../../ && cd ../../ && rm -Rf calibre_build
@LordSputnik
LordSputnik / BBNewSchema.md
Last active December 15, 2015 23:01
How to do various things in the new schema

Using the "schema" of:

http://yuml.me/edit/86aaba0d

Entity

Creating an Entity

  1. Insert row into entity table ()
  2. Insert row into revision table ()
  3. Insert row into <entity>_data table (...data)
  4. Insert row into <entity>_header table (bbid)
@LordSputnik
LordSputnik / gist:2f6165141698dd766349
Created October 24, 2015 19:02
Blockchain verification
Verifying that +benockmore is my blockchain ID. https://onename.com/benockmore
@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
@LordSputnik
LordSputnik / sample_bookshelf_relation_error.js
Created September 1, 2015 07:07
Minimal code demonstrating issue with idAttribute and relations in bookshelf.js
var knex = require('knex')({
client: 'postgresql',
connection: {
host : '127.0.0.1',
user : 'username',
password : 'password',
database : 'database'
}
});