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 /
Last active Feb 12, 2019 — forked from gregferrell/
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 Aug 25, 2019
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 Aug 7, 2019
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});
View Spot the Hijack
* Script to record and tag spotify tracks, by Lloyd Moore *)
(* Make sure you are already recording in Audio Hijack Pro with a session called 'spotifySession' *)
tell application "Spotify"
set currentTrack to (current track)
set trackName to (name of currentTrack)
tell application "Audio Hijack Pro"
set theSession to my getSession()
end tell
View trinkup
# trinkup - TRivial INcremental bacKUP script
# Licensed under DWTFYWWI license, but recommended to be used before drinkup.
set -e
if ! which rsync >/dev/null; then
You can’t perform that action at this time.