Skip to content

Instantly share code, notes, and snippets.

View LordSputnik's full-sized avatar

Ben Ockmore LordSputnik

View GitHub Profile

Documentation Guidelines

Purpose

This guideline is designed to help people write pages of documentation that fit in well with the rest of the BookBrainz user guide. A section on general documentation guidelines is followed by advice for writing specific types of documents. It is hoped that through this guideline, the BookBrainz documentation can remain more consistent and easier to use.

General Guidelines

This section describes general guidelines you should follow when writing any type of documentation.

  • Titles - Try not to use more than the three levels of headings. Text with lots of levels can be hard to understand, and generally covers too much material. Headings should be capitalized just like an Edition alias in BookBrainz - generally, first letters of words should be capitalized, apart from for specific words.
  • Clarity - Documentation should be very easy to understand, so sections should be as simple as possible. If a section becomes too long, move it to a new page and leave a shor
@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'
}
});
@LordSputnik
LordSputnik / MassTagger
Created November 19, 2012 00:03
The current output of MassTagger
ben@Mithrandir:~/Music/FLAC/CDs$ ./MassTagger
Boost Version: 1_49
Last Req: 1353686977
Returning from MB
D�cal�|Décalé!
Last Req: 1353686978
Returning from MB
Last Req: 1353686980
Returning from MB
You're Not the First|You’re Not the First!
@LordSputnik
LordSputnik / MassTagger Wishlist
Created November 19, 2012 00:30
Core stuff MusicBrainz MassTagger (MBMT) should update in songs
/* So, what stuff regularly needs updating in my library? Everything? No...
* Recording
* Artist Name
* Album Name
* Release
* Album Art -> libcoverart
* Release Date
* Original Release Date
* Track Number/Total
* Disc Number/Total
function getWikiText(o, callback) {
if (!o['relations']) {
callback('');
return;
}
var wikiLink;
for (var i = 0; i < o['relations'].length; ++i) {
if (o['relations'][i]['type'] == 'wikipedia') {
wikiLink = parseURL(o['relations'][i]['url']);
@LordSputnik
LordSputnik / gist:2f6165141698dd766349
Created October 24, 2015 19:02
Blockchain verification
Verifying that +benockmore is my blockchain ID. https://onename.com/benockmore
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 / 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,
}
def client_authentication_required(self, request, *args, **kwargs):
return False