Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View ryanfb's full-sized avatar

Ryan Baumann ryanfb

View GitHub Profile
@ryanfb
ryanfb / blender_compress_mesh.py
Created May 21, 2020 12:48
Blender Python script for converting a mesh to GLB with Draco compression
# Blender Python script for converting a mesh to GLB with Draco compression.
# Tested on Blender 2.82
# Usage:
# blender --background --factory-startup --addons io_scene_gltf2 --python blender_compress_mesh.py -- -i #{source_path} -o #{out_path}
from os import path
from contextlib import redirect_stdout
from sys import argv
import argparse
import io
import bpy
@ryanfb
ryanfb / last-modified.js
Created April 27, 2020 15:39
snippet for setting the last modified date on a GitHub Pages post using the GitHub API
function setModifiedDate() {
if (document.getElementById('last-modified')) {
fetch("https://api.github.com/repos/{{ site.github.owner_name }}/{{ site.github.repository_name }}/commits?path={{ page.path }}")
.then((response) => {
return response.json();
})
.then((commits) => {
var modified = commits[0]['commit']['committer']['date'].slice(0,10);
if(modified != "{{ page.date | date: "%Y-%m-%d" }}") {
document.getElementById('last-modified').textContent = "Last Modified: " + modified;
@ryanfb
ryanfb / fusion-tables-migration.md
Created November 26, 2019 15:23
Fusion Tables Migration Alternatives
  • Datasette on Heroku
  • Heroku Postgres
  • Google Bigtable - $.65/hr
  • Google BigQuery - $5/TB of queried data, $.02/GB/mo stored
  • Google Cloud Datastore - 1GB free, .18GB/month above
  • Google Cloud Firestore - similar to Datastore
  • Google Sheets
  • Google Cloud SQL (MySQL/PostgreSQL)
  • AWS DynamoDB - NoSQL, 25GB free, $0.25/1M read request units
  • AWS Athena - costs per TB scanned, reads data from S3 buckets
#!/usr/bin/env ruby
Encoding.default_external = Encoding::UTF_8
Encoding.default_internal = Encoding::UTF_8
require 'nokogiri'
pdf_filename = ARGV[0]
xml_filename = File.basename(pdf_filename,'.pdf') + '.xml'
@ryanfb
ryanfb / ancientgreekspeak.rb
Last active May 9, 2019 18:26
Ruby script for transliterating Ancient Greek to Apple phonemes for text-to-speech synthesis - updates at https://github.com/ryanfb/ancientgreekspeak/
#!/usr/bin/env ruby
require 'i18n'
Encoding.default_external = Encoding::UTF_8
# Usage: Takes Unicode Polytonic Greek on STDIN or as arguments, outputs
# phonetic pronunciation on STDOUT designed to be piped into the Mac `say` command.
# e.g.:
# echo 'ἄγω ἄξω ἤγαγον ἦχα ἤγμαι ἤχθην' | ./ancientgreekspeak.rb | say
@ryanfb
ryanfb / test_a1.txt
Last active August 10, 2018 19:35
dhSegment MicroPasts train/val/test split
DSC_0484.png
IMG_0989.jpg
IMG_6717.jpg
IMG_1511.jpg
IMG_7308.jpg
IMG_1344.jpg
IMG_3407.jpg
IMG_3661.jpg
IMG_8855.jpg
IMG_3205.jpg

Geocollider

Ryan Baumann

@ryanfb
ryanfb / georgeblood.m3u
Last active October 16, 2023 12:11
An M3U playlist of items in the Internet Archive 78rpm collection: https://archive.org/details/georgeblood
This file has been truncated, but you can view the full file.
https://archive.org/download/78_.-tam-za-vahom-2.-horicka-zelena_andrej-gellert_gbia0001742a/!.%20Tam%20Za%20Vahom;%202.%20Horicka%20Zelena%20-%20Andrej%20Gellert.mp3
https://archive.org/download/78_1-a-dew-drop-2-rain-song_elizabeth-wheeler-sherman-gilchrist-smith_gbia0013545a/(1)%20A%20Dew%20Drop;%20(2)%20Rain%20Song%20-%20Elizabeth%20Wheeler.mp3
https://archive.org/download/78_...must-suffer-for-the-one-mistake-i-made_peppermint-harris_gbia0001396b/...Must%20Suffer%20(For%20The%20One%20Mistake%20I%20Made)%20-%20Peppermint%20Harris.mp3
https://archive.org/download/78_-and-mimi_art-lund-kennedy-simon-johnny-thompson_gbia0012786b/-And%20Mimi%20-%20Art%20Lund%20-%20Kennedy%20-%20Simon%20-%20Johnny%20Thompson.mp3
https://archive.org/download/78_-tramp-along-the-highway_nelson-eddy-nathaniel-shilkret-and-orchestra-rida-johnson_gbia0011035b/…%20Tramp%20Along%20the%20Highway%20-%20Nelson%20Eddy%20-%20Nathaniel%20Shilkret%20and%20Orchestra.mp3
https://archive.org/download/78_--and-mimi_frankie-carle-and-his-orchest
@ryanfb
ryanfb / midi_synthesis.md
Created February 24, 2017 17:01
MIDI Synthesis / DeepBach notes