Skip to content

Instantly share code, notes, and snippets.

Frederik “Freso” S. Olesen Freso

View GitHub Profile
# -*- coding: utf-8 -*-
PLUGIN_NAME = u"Add Track As Recording"
PLUGIN_AUTHOR = u"Freso, Lukáš Lalinský, Philip Jägenstedt"
from picard import log
#from picard.metadata import register_file_metadata_processor
Freso /
Created Nov 2, 2014
Script used to initiate `abzsubmit` before it was able to detect the extractor in `$PATH` and has other infancy issues. No longer needed, just uploaded for documentation and historical purpose.
cd $HOME/Development/AcousticBrainz/acousticbrainz-client
git pull
. ./venv/bin/activate
ls "$@" | parallel --eta python2 ./abzsubmit
View gist:4397332
{'attribs': {u'id': u'2c6c5a89-12c8-45ac-acc6-7c3dd46e3fdd'},
'children': {u'artist_credit': [{'attribs': {},
'children': {u'name_credit': [{'attribs': {},
'children': {u'artist': [{'attribs': {u'id': u'9bffb20c-dd17-4895-9fd1-4e73e888d799'},
'children': {u'name': [{'attribs': {},
'children': {},
'text': u'\u30e2\u30fc\u30cb\u30f3\u30b0\u5a18\u3002'}],
u'sort_name': [{'attribs': {},
View gist:4416300
# -*- coding: utf-8 -*-
"""Test coverage for MusicBottle."""
import musicbottle
from flask.ext.testing import TestCase
class MusicBottleTestCase(TestCase):
def create_app(self):['TESTING'] = True
View gist:4427854
[%- IF medium_edit.title && medium_edit.old == 'new' -%]
[%- l('Disc <span class="new">{new}</span>: {title} (new disc)',
new =>, title => medium_edit.title) -%]
[%- ELSIF medium_edit.title -%]
[%- l('Disc <span class="new">{new}</span>: {title} (moved from position <span class="old">{old}</span>)',
new =>, title => medium_edit.title, , old => medium_edit.old) -%]
[%- ELSIF medium_edit.old == 'new' -%]
[%- l('Disc <span class="new">{new}</span> (new disc)',
new => -%]
View gist:4428921

Hello all,

I've been missing a "language" attribute for URLs for a while, as I'm frequently adding e.g. Danish reviews of release groups. This post is to discuss the feature and try to convince all the rest of you that it'd be nifty to have as well. Please chime in with questions and comments and suggestions!


Some use cases I see for this could be, once we actually launch a localised, to only show URLs based on locale (e.g., show English language links for English language locales).

This would also be something I'd want for MusicBottle - to only display links relevant for the language the person is browsing in (probably like "eng+mul+$sessionlanguage"). If a user is browsing in Danish, it's unlikely they want to read a review in Greek.

Freso / Pocoo Styleguide
Last active Dec 10, 2015
Which of these are correct?
View Pocoo Styleguide
def spam(argument2):
'this is the first', 'set of items', 'with more items',
'to come in this line', 'like this'
], argument2)
def eggs(argument2):
'this is the first', 'set of items', 'with more items',
'to come in this line', 'like this'
View URLCleanup.js
otherdatabases: {
match: new RegExp("^(https?://)?(www\\.)?(rateyourmusic\\.com/|worldcat\\.org/|musicmoz\\.org/|45cat\\.com/|musik-sammler\\.de/|discografia\\.dds\\.it/|tallinn\\.ester\\.ee/|tartu\\.ester\\.ee/|encyclopedisque\\.fr/|discosdobrasil\\.com\\.br/|isrc\\.ncl\\.edu\\.tw/|rolldabeats\\.com/|psydb\\.net/|metal-archives\\.com/|spirit-of-metal\\.com/|ibdb\\.com/|lortel.\\org/|theatricalia\\.com/|ocremix\\.org/|trove\\.nla\\.gov\\.au/|(wiki\\.)?rockinchina\\.com|(www\\.)?dhhu\\.dk|thesession\\.org)", "i"),
type: MB.constants.LINK_TYPES.otherdatabases,
clean: function(url) {
//Removing cruft from Worldcat URLs
url = url.replace(/^(?:https?:\/\/)?(?:www\.)?worldcat\.org(?:\/title\/[a-zA-Z0-9_-]+)?\/oclc\/([^&?]+)(?:.*)$/, "$1");
//Standardising IBDb not to use www
url = url.replace(/^(https?:\/\/)?(www\.)?ibdb\.com/, "");
//Standardising ESTER to their default parameters
View gist:4469870
<tr class="addnew">
<td class="select">
<input class="newrecording recordingmatch" name="select-recording-0-3" id="select-recording-0-3-addnew" type="radio">
<td class="recording" colspan="3"><label for="select-recording-0-3-addnew">Add a new recording</label></td>
BACKUPDIR="$HOME/aticonfig-backup-`date --rfc-3339=sec --utc`"
mkdir "$BACKUPDIR"
mv -vi /etc/ati/amdpcsdb "$BACKUPDIR"
You can’t perform that action at this time.