Skip to content

Instantly share code, notes, and snippets.

View mattbasta's full-sized avatar
🌭
Still writing JavaScript

Matt Basta mattbasta

🌭
Still writing JavaScript
View GitHub Profile
@mattbasta
mattbasta / idb-file-storage.d.ts
Created June 10, 2023 01:39
TypeScript typings for idb-file-storage
export function waitForDOMRequest<T>(
req: IDBRequest<T>,
onSuccess: () => void,
): Promise<T>;
type Mode = 'readonly' | 'readwrite' | 'writeonly';
export class IDBPromisedFileHandle {
get mode(): Mode;
get active(): boolean;
const n = Symbol('n');
const length = Symbol('length');
const data = Symbol('data');
module.exports = class UintNArray {
constructor(...args) {
if (args[0] instanceof Uint8Array) {
this[data] = args[0];
this[n] = args[1];
this[length] = args[2];
<iframe src="https://pinecast.com/embed/player_latest/the-audio-guide-to-the-galaxy?theme=thick" seamless height="200" style="border:0" class="pinecast-embed" frameborder="0" width="100%"></iframe>
@mattbasta
mattbasta / inliner.js
Created January 4, 2021 00:27
Cloudflare worker to inline scripts
addEventListener('fetch', event => {
event.respondWith(handleRequest(event.request))
})
/**
* Respond to the request
* @param {Request} request
*/
async function handleRequest(request) {
const resp = await fetch(request);
const fs = require("fs");
const inquirer = require("inquirer");
async function main() {
console.log("Ready");
const answers = await inquirer.prompt([
{
type: "input",
filter: parseFloat,
I appreciate your response, though I'm trying to find concrete data to support the claims that VBR encoding is not viable. In an analysis of the top one hundred podcasts from the iTunes charts, fifteen percent are using VBR. Surely a volume of podcasts amounting to tens of millions of weekly listens can't be making such a terrible choice? Jeff Atwood extolled the benefits of VBR in a 2005 blog post [1]. Marco Arment also praised it for its quality and size, with the caveat that seeking is inaccurate on Apple products [2]. For a "dead" encoding, it has substantial adoption and certain undeniable benefits.
My intent is to collect the arguments for and against VBR encoding, most of which were made over a decade ago, and verify them. Some arguments against VBR, for instance, are long obsolete: Firefox and Flash support are commonly cited as a reason to not use VBR, but Flash has supported VBR correctly since before Macromedia was acquired by Adobe and Firefox has supported VBR correctly for over half a decade. O
Thanks for your quick response, Rob. I'd like to bring up a few things about it, if you don't mind indulging me. The goal of my post is to challenge claims and assumptions about VBR, and I hope to either reinforce or disprove these. Essentially, I hope to put citations on the arguments for and against VBR.
The post you linked to states that some devices do not support VBR, and substantiates that with quotes from the ISO/IEC standard for MPEG. The quotes that it cites--to show that VBR is not a required feature of MP3--actually seem to confirm that VBR is in fact a standard feature of MP3. The statement in question:
Layer III supports variable bitrate by switching the bitrate index.
Layer III, in the context of this quote, refers to MPEG-2 Audio Layer 3, which is itself MP3. Layer 1 and Layer 2 refer to MPEG-1/2 Audio Layer 1 and Audio Layer 2 (MP1 and MP2 respectively), both of which are separate audio codecs that are unrelated to MP3 as it's used today. ISO/IEC 11172-3:1993 and ISO/IEC 13818-3:1995 both s
@mattbasta
mattbasta / custom-css.css
Created May 3, 2017 15:13
Put this in the custom CSS section of your site's configuration
.episode > img {
width: 250px;
margin-left: auto;
margin-right: auto;
}
import hashlib
ADJECTIVES = {
'0': 'Ancient',
'1': 'Breezy',
'2': 'Charming',
'3': 'Delightful',
'4': 'Exuberant',
'5': 'Fantastic',
'6': 'Jolly',