Skip to content

Instantly share code, notes, and snippets.

@scottopell
scottopell / mp3_archiving.md
Last active December 10, 2017 18:20
Audio archive/management/conversion for audiobooks/podcasts

Scenario

You have a large audio file that has been split into multiple mp3s.

Goal

You want to merge these and convert to a m4a (optional) so that you can use it with https://github.com/scottopell/audiobook-podcast

Steps:

# Combine MP3s
ffmpeg -i "concat:$(ls *.mp3 | tr '\n' '|')" -acodec copy out.mp3
var Benchmark = require('benchmark');
var suite = new Benchmark.Suite;
var createHash = require('crypto').createHash;
suite.add('md2', () => {
createHash('md2').update('HELLO WORLD').digest('hex');
})
.add('md4', () => {
@scottopell
scottopell / launch.json
Created March 31, 2018 15:27
How to debug jest tests with create-react-app-ts scripts
// This took me way too long to figure out.
// Needs node 8.4.0 or greater to work (I think, based on https://github.com/nodejs/node/issues/7593#issuecomment-322966866)
// The magic sauce here is that react-scripts-ts/scripts/test.js creates an inline jest config
// that it passes through. This does things like map css files properly, so if you try to use
// jest directly then it won't work.
{
"version": "0.2.0",
"configurations": [
{
@scottopell
scottopell / serversetup.md
Last active April 18, 2020 16:28
Just random shit that I always have to look up when I'm setting up a server
@scottopell
scottopell / simpleget.go
Last active September 1, 2022 15:50
Where does Go get its trusted CAs from?
package main
import (
"crypto/tls"
"fmt"
)
// go build && strace -o strace-out.txt -f -e trace=file ./simpleget
func main() {
conn, err := tls.Dial("tcp", "www.google.com:443", nil)
We couldn’t find that file to show.