Skip to content

Instantly share code, notes, and snippets.

Paul Wenzel pwenzel

Block or report user

Report or block pwenzel

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
pwenzel / oscilloscope-letters-module.c
Created Oct 30, 2019
View oscilloscope-letters-module.c
// For use within OsciStudio by Jerobeam Fenderson
#include <OsciText.h>
// Letters
OsciText text1("A");
OsciText text2("B");
OsciText text3("C");
pwenzel /
Last active Oct 7, 2019
FFMPEG Convert Wave to Mono Raw Audio for Radio Music Eurorack Module
# Bulk convert wave to mono raw audio for Radio Music Eurorack module
# Uses FFMPEG and Fish Shell
for file in *.wav;
set basename (string match -r "(.*)\.[^\.]*\$" $file)[2]
ffmpeg -i $file -f s16le -acodec pcm_s16le -ac 1 $basename.raw;
pwenzel /
Last active Feb 12, 2019
Fish shell function to unserialize php from the OSX clipboard.
# ~/.config/fish/functions/
# unserialize PHP from the clipboard
# based on
function unserialize_clipboard
set STRING (pbpaste)
php -r "echo var_dump(unserialize('$STRING'));"
pwenzel /
Last active Nov 8, 2018
Ping host and do something if it's down. Example showing how to use and/or operator in Fish shell
ping -q -c 1 bogus.local; and echo "pinging the host worked"; or echo "pinging the host didn't work"
ping -q -c 1; and echo "pinging the host worked"; or echo "pinging the host didn't work"
pwenzel /
Created Jan 25, 2018
Concatenate CSV files with sed
# Concatenate CSV files to all.csv in parent directory
# Assumes they all have the same CSV header
sed 1q *.csv > ../all.csv
sed 1d *.csv >> ../all.csv
pwenzel /
Created May 22, 2016
Send iOS push notification when torrent is complete, via Pushover
# Send push notification to pushover device when a torrent is complete.
# Requires: Pushover account, Transmission torrent client and curl.
# Get the API token from the pushover website.
# Change text output below if you wish.
# Set Transmission to start script when torrent is complete.
pwenzel /
Last active Feb 15, 2020
MKV and AVI to MP4 Conversion for Apple TV
# See also
# direct copy
ffmpeg -i input.mkv -c:v copy -c:a copy output.mp4
# direct copy video, but convert audio to AAC with default variable bit rate
ffmpeg -i input.mkv -c:v copy -c:a aac -strict experimental output.mp4
# direct copy video, but convert audio to AAC with constant bit rate
ffmpeg -i input.mkv -c:v copy -c:a aac -strict experimental -b:a 320k output.mp4
pwenzel / firebase.json
Last active Dec 7, 2015
Possible to achieve wildcard redirects in Firebase? (Note: this does not actually work)
View firebase.json
"firebase": "example-site",
"public": "public",
"redirects": [
"source" : "/blog/**/**",
"destination" : "$1",
"type" : 302
pwenzel /
Last active Feb 17, 2020
Installing rbenv in a fish environment

Here we use Homebrew to install rbenv:

  1. brew update; and brew install rbenv ruby-build
  2. Add ~/.rbenv/shims to your PATH
  3. Include the contents of completions/ in your Fish config.
  4. Run rbenv install 2.2.2 and rbenv rehash
  5. Run rbenv global 2.2.2

Now you can run gem install bundler and bundle install within your Ruby project.

pwenzel / 404-error-tracking.html
Created Feb 20, 2015
Track 404 errors as events with Google Universal Analytics, capturing the referrer as well.
View 404-error-tracking.html
<script type="text/javascript">
// Track 404 errors with Universal Analytics
if($('body').hasClass('error404')) {
ga('send', 'event', 'error', '404', 'page: ' + document.location.pathname + + ' ref: ' + document.referrer, {'nonInteraction': 1});
You can’t perform that action at this time.