Skip to content

Instantly share code, notes, and snippets.

@kepstin
kepstin / gist:1289876
Created October 15, 2011 17:46
Vala mb4 bindings demo
Vala code:
using Mb4;
public static void test(Annotation a) {
char[] s = new char[16];
Annotation b = a.clone();
b.get_name(s);
}
@kepstin
kepstin / gist:1291175
Created October 16, 2011 17:37
ExtAttributes/ExtElements API for Mb4Entity
typedef struct Mb4Entity Mb4Entity;
typedef struct Mb4ExtIterator Mb4ExtIterator;
typedef struct Mb4ExtEntry Mb4ExtEntry;
// Accessors for the Entity's ExtAttributes and ExtElements fields
const char *mb4_entity_ext_attributes_get(Mb4Entity *Entity, const char *Key);
Mb4ExtIterator *mb4_entity_ext_attributes_iterator(Mb4Entity *Entity);
@kepstin
kepstin / test.vala
Created October 21, 2011 00:53
Demonstration of the vala bindings to libmusicbrainz4
using Mb4;
public static int main(string[] args) {
Query query = new Query("Riker/0.1", "makoto.kepstin.ca", 8000);
query.username = "kepstin";
query.password = "notreallymypassword";
print("%s\n", query.lasterrormessage);
cwalton@makoto ~/Music $ ls Flac/ Mp3/ Vorbis/
Flac/:
brainz-flac
Mp3/:
brainz-mp3 brainz-mp3-onestarred brainz-only-mp3 brainz-only-mp3-onestarred
Vorbis/:
brainz-only-vorbis brainz-vorbis brainz-vorbis-onestarred
@kepstin
kepstin / gist:1446342
Created December 8, 2011 07:01
Acoustid lookup URL for PICARD-106
http://api.acoustid.org:80/v2/lookup?clientversion=0.16&format=xml&client=0zClDiGo&meta=recordings%20releasegroups%20releases%20tracks%20compress&fingerprint=AQADtAkjZuEUBX8H-R6aaUR_nFsI7RecIw-PL1OC4xOPfDU0krHQo-FOPAxROTvMC9pXPF2Oy3jxoz7E_ZgEnTkeTsgipoTL48R_mJiF0ClUhxZ-Gc2O6cEVXVAbcsIXpOTxo1xKND9xHUz0H7_xw0f1I8QPMR-uI-6H53AegE8P_8hzQjzihB--4j989HiO83jBSD0aycVX9IblIduhHS-H_ET_g_rRH3-CHg_yrfjhDwqu1Pjhy4P14LgP59GHHEf442ioHZU0oT9k-PgeKB7qDT8qHz6u7Ic3aDxu4cQD8sF9NL_wJRB_HH1QiYfRDk8O7fheHM8KbcKPHNfRPHvw1vCNHB5z6Mc1OCr6XHgO7QyaRYVOPGjSLDHxH4dXtDf0B0f4Hc2Y4z6OPkyRPgZ0HReo4Elx9YIf4UsP8Uee4_CNKy9e6ejBdike7rglNM_Rc8KTF5cRPoKVOzApCjf0BumJLzx66UW7KCH8FKW14dSC3oTzkLjgE7kgWkePf8ehT0e5wyruC9YclEcnXCN-aLiEPj18CdeOH-aRHz_-wn3hHeZRIx8uJTJ-aDn6LLjwEG00HYdfdBuuHOehHT7RxseJR6gdHM54ghlfnDpKq_Bz_KiFai--w8c5_HCElh_6Hj-c67iPm3BN8PiPuJpx5DN6XMcFTcePdsePniyaL8FzaEfDKniG6CIipapzVOqgPWgmEQcTRkfIIRd-jsRjqKOcIbR62NOH7_AMeN0PPhSuo6fwa0cfBf-OOCWScsT1A99pfEcvfGgsBZVOJJb1IpQveNuPH_6O9h_6nnhiHCZrox_uCSGhpmFGxN1lHB6zMGBadiibH-_gbsF5Dd-RNFETZkE0F5
@kepstin
kepstin / gist:1483955
Created December 16, 2011 01:23
Riker demo run
cwalton@ayu ~/Development/Riker/riker $ ./tagread file://'/home/cwalton/Music/Mp3/brainz-mp3/Primary/Rotate/06 - Primary - Discolor.mp3'
This is an UNINSTALLED build. Do not install it.
Using files from source directory: /home/cwalton/Development/Riker/riker
This version of Riker uses an unstable database schema. If you update Riker
you must delete the database file and either restore a backup from an older
stable version or rescan your music collection.
Database configuration not found, creating default DSN.
recording_mbid: eee623bb-ddb7-442c-ba99-f751a1289d7c
release_mbid: 80ad4261-957e-4a74-847f-ddde2e10f4b5
track_position: 6
@kepstin
kepstin / gist:1709317
Created January 31, 2012 07:04
Example rhythmbox DB entry
<entry type="song">
<title>&#x96E8;&#x306E;&#x6563;&#x6B69;&#x9053; (without vocal)</title>
<genre>Ookami Kakushi, Karaoke</genre>
<artist>&#x5C3E;&#x6FA4;&#x62D3;&#x5B9F;</artist>
<album>&#x6708;&#x5C0E; -Tsukishirube-</album>
<track-number>4</track-number>
<disc-number>1</disc-number>
<duration>285</duration>
<file-size>6745120</file-size>
<location>file:///home/cwalton/Music/Mp3/brainz-mp3/%E5%8D%97%E9%87%8C%E4%BE%91%E9%A6%99/%E6%9C%88%E5%B0%8E%20-Tsukishirube-/04%20-%20%E5%B0%BE%E6%BE%A4%E6%8B%93%E5%AE%9F%20-%20%E9%9B%A8%E3%81%AE%E6%95%A3%E6%AD%A9%E9%81%93%20(without%20vocal).mp3</location>
@kepstin
kepstin / ratelimit.js
Last active January 6, 2016 10:43
More accurate copyright date.
/*
* Copyright (c) 2012 Calvin Walton <calvin.walton@kepstin.ca>
*
* This program can be used under the terms of either of the two
* licenses below, at your option.
*
* The MIT License (MIT)
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
@kepstin
kepstin / gist:2597109
Created May 4, 2012 19:15
Trace of HTTP put to ew-stream-server
== Info: About to connect() to localhost port 8080 (#0)
== Info: Trying 127.0.0.1... == Info: connected
=> Send header, 250 bytes (0xfa)
0000: 50 55 54 20 2f 70 75 73 68 20 48 54 54 50 2f 31 PUT /push HTTP/1
0010: 2e 31 0d 0a 55 73 65 72 2d 41 67 65 6e 74 3a 20 .1..User-Agent:
0020: 63 75 72 6c 2f 37 2e 32 32 2e 30 20 28 78 38 36 curl/7.22.0 (x86
0030: 5f 36 34 2d 70 63 2d 6c 69 6e 75 78 2d 67 6e 75 _64-pc-linux-gnu
0040: 29 20 6c 69 62 63 75 72 6c 2f 37 2e 32 32 2e 30 ) libcurl/7.22.0
0050: 20 4f 70 65 6e 53 53 4c 2f 31 2e 30 2e 31 20 7a OpenSSL/1.0.1 z
0060: 6c 69 62 2f 31 2e 32 2e 33 2e 34 20 6c 69 62 69 lib/1.2.3.4 libi
@kepstin
kepstin / gist:2660431
Created May 11, 2012 15:23
Add 'POST' support to HTTP push stream.
From 560d117af2c88bc701cdc01a555de52e8a74527a Mon Sep 17 00:00:00 2001
From: Calvin Walton <calvin.walton@kepstin.ca>
Date: Fri, 11 May 2012 11:15:12 -0400
Subject: [PATCH] Add 'POST' support to HTTP push stream.
This allows ffmpeg's integral http support to be used to push streams
into the streaming server, with a command like:
ffmpeg -f alsa -i default -f v4l2 -s 640x360 -i /dev/video0 \
-c:v libvpx -b:v 500000 -c:a libvorbis -b:a 100000 -f webm \