Skip to content

Instantly share code, notes, and snippets.

solace /
Last active January 1, 2023 01:56
DeepGram JSON to Descript transcript
# Warning: This is not a complete script.
# You may also need to edit the transcript text to fix speaker names
# and make minor corrections before importing into Descript.
cat deepgram.json | jq -r '
| ("SPEAKER_" + (.speaker|tostring)) + ": "
+ ([.sentences[].text] | join(" "))' > transcript.txt
solace /
Created November 3, 2022 15:32
Convert deepgram JSON to autoEdit transcript JSON
# WARNING: This is not a complete script.
# You could update the hardcoded values, but practically, it will need to
# be modified to programmatically process your source files and append the
# result to the autoEdit transcripts.json array.
# This is the internal autoEdit project ID.
# Once you've created the project in autoEdit you can get the ID from
# /path/to/digital-paper-edit-electron/db/projects.json
# on macOS this is /Users/username/Library/Application Support/digital-paper-edit-electron
solace / Component.stories.tsx
Created June 14, 2022 15:33
StorybookJS: Include line entry in Interactions tab that appears in Actions
View Component.stories.tsx
// Don't do this. This is awful.
// Documenting it because it works, but stinks to hell. = async () => {
const actionListener = jest.fn();
// Listen for events that log to the Actions tab.
const channel = addons.getChannel();
channel.addListener("storybook/actions/action-event", actionListener);
solace / post.js
Created March 18, 2022 06:16
Rendering Contentful embedded assets and entries in GatsbyJS
View post.js
import { documentToReactComponents } from '@contentful/rich-text-react-renderer';
import { graphql } from 'gatsby';
import React from 'react';
// Custom renderer for embedded content which accepts `body` / `references` from the graphql query.
// Search `references` for the embedded object ID for full access to nested content.
const rendererOptions = (references) => ({
renderNode: {
const imageID =;
solace /
Last active July 17, 2022 00:38
Bake-in captions into videos using srts and ffmpeg
# Check out STEAM Powered ( where I have conversations
# with women in STEAM to learn a bit about what they do and who they are.
# Usage
# =====
# Execute script in the directory containing the video and srts files, or modify to take
solace / plugins--gatsby-remark-cleaner--index.js
Last active October 20, 2021 12:43
gatsby remark transformer plugin that cleans up extraneous wrapper paragraph tags and table whitespace nodes that can raise errors/warnings.
View plugins--gatsby-remark-cleaner--index.js
const visit = require(`unist-util-visit`);
const remove = require(`unist-util-remove`);
const HTMLParser = require('node-html-parser');
const matches = (classes, value) => {
const fragment = HTMLParser.parse(value);
if (!fragment.firstChild.classList) {
return false;
solace / slurm.conf
Last active September 15, 2021 09:39
slurm.conf for 16.05.9-1+deb9u
View slurm.conf
# WARNING: This config is for development use only.
# It was created using and modified
# enough for use on Docker kaldiasr/kaldi with slurm 16.05.9-1+deb9u.
# slurm < 20.02.7 is no longer available due to a security vulnerability.
# See:
# Get the latest version and use the configurator from there.
solace /
Created January 3, 2021 08:09
django-addanother with django-autocomplete-light and GenericForeignKeys
# Source:
import json
from django.contrib import admin
from django.contrib.admin.options import IS_POPUP_VAR, TO_FIELD_VAR
from django.contrib.contenttypes.models import ContentType
from django.template.response import TemplateResponse
from .forms import TForm
solace /
Last active September 21, 2021 04:34
Google Cloud Speech-to-Text SRT Generator
Check out STEAM Powered ( where I have conversations
with women in STEAM to learn a bit about what they do and who they are.
solace /
Last active November 22, 2020 13:42
Django: augmented user_passes_test to accept params for test_func with matching template tag