Skip to content

Instantly share code, notes, and snippets.

View pwenzel's full-sized avatar

Paul Wenzel pwenzel

View GitHub Profile
@pwenzel
pwenzel / bulk_wave_to_raw.fish
Last active January 2, 2023 15:27
FFMPEG Convert Wave to Mono Raw Audio for Radio Music Eurorack Module. Test playback with ffplay.
# 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;
end;
@adamlutz
adamlutz / postgres rails config fix
Last active May 15, 2016 18:22
postgres rails config fix for postgres.app
gem install pg -v '0.18.4' -- --with-pg-config=/Applications/Postgres.app/Contents/Versions/latest/bin/pg_config
@simonista
simonista / .vimrc
Last active May 9, 2024 17:34
A basic .vimrc file that will serve as a good template on which to build.
" Don't try to be vi compatible
set nocompatible
" Helps force plugins to load correctly when it is turned back on below
filetype off
" TODO: Load plugins here (pathogen or vundle)
" Turn on syntax highlighting
syntax on
@ei-grad
ei-grad / trinkup
Last active August 5, 2018 23:26
TRivial INcremental bacKUP script (MOVED TO REPOSITORY)
#!/bin/bash
#
# trinkup - TRivial INcremental bacKUP script
#
# Уж 200 раз твердили Сене:
# Хардлинк спасет от удаленья!
# А кто создать его поможет?
# Crontab и man, тупая рожа!
#
# (c) linux.org.ru, no-dashi
@c99koder
c99koder / pebble.applescript
Last active December 7, 2017 21:25
Forward iMessges to Pebble using PushOver. Fill in your APP_TOKEN and USER_KEY. In the "Alerts" tab of Messages' settings, tell it to run this script for "Message Received" and "Text Invitation"
on push(title, message)
set APP_TOKEN to "..."
set USER_KEY to "..."
do shell script "curl -s -F token=" & APP_TOKEN & " -F user=" & USER_KEY & " -F title=\"" & title & "\" -F message=\"" & message & "\" https://api.pushover.net/1/messages.json"
return
end push
using terms from application "Messages"
on message received theMessage from theBuddy for theChat
@tskaggs
tskaggs / OSX-Convert-MOV-GIF.md
Last active May 6, 2024 13:07
Creating GIFs from .MOV files in OSX using FFmpeg and ImageMagick

Convert MOV to GIF using FFmpeg and ImageMagick

I tried a few different techniques to make a GIF via command-line and the following gives me the best control of quality and size. Once you're all setup, you'll be pumping out GIFs in no time!

Preparation

Install FFmpeg

  • $ brew install ffmpeg [all your options]
    • Example: $ brew install ffmpeg --with-fdk-aac --with-ffplay --with-freetype --with-frei0r --with-libass --with-libvo-aacenc --with-libvorbis --with-libvpx --with-opencore-amr --with-openjpeg --with-opus --with-rtmpdump --with-schroedinger --with-speex --with-theora --with-tools

Install ImageMagick

@capnslipp
capnslipp / When Song Finishes, Pause.applescript
Last active December 29, 2022 17:30
Pause Spotify after the current song finishes playing
(*
@author: Slipp Douglas Thompson
@purpose: Pauses Spotify after the current song finishes playing.
@todo: Optimize so it's more efficient.
@usage: Drop a compiled script (a .scpt file, converted with AppleScript Editor if this is a .applescript file) into ~/Library/Scripts/Applications/Spotify.
Ensure than “Show Script menu in menu bar” is enabled (which can be found in the AppleScript Editor preferences).
When playing a song in Spotify and wishing to stop the music when the track finished, choose “When Song Finishes, Pause” from the script menu, and then walk, walk away.
*)
tell application "Spotify"
log "“When Song Finishes, Pause”: player state is " & (player state)
@jterrace
jterrace / git-annex-gcs.sh
Last active September 8, 2021 22:09
An example of how to use Google Cloud Storage with git-annex
# Initialize git and git-annex
$ mkdir annex-gcs-test
$ cd annex-gcs-test/
$ git init
Initialized empty Git repository in /Users/jterrace/annex-gcs-test/.git/
$ git annex init "my machine"
init my machine ok
(Recording state in git...)
# Set up AWS credentials
@zigotica
zigotica / youtube-poster-frame.css
Last active July 8, 2023 10:12
Very simple method to add custom poster frame to youtube video without using youtube API. This code is also valid in browsers not supporting window.postMessage (API uses postMessage). The trick is adding the iframe in a comment. Javascript reads comment contents and saves iframe definition to a var. When JQuery (for the sake of brevity, not real…
.video { position: relative; padding-bottom: 56.25%; /* 16:9 */ height: 0; }
.video img { position: absolute; display: block; top: 0; left: 0; width: 100%; height: 100%; z-index: 20; cursor: pointer; }
.video:after { content: ""; position: absolute; display: block;
background: url(play-button.png) no-repeat 0 0;
top: 45%; left: 45%; width: 46px; height: 36px; z-index: 30; cursor: pointer; }
.video iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
/* image poster clicked, player class added using js */
.video.player img { display: none; }
.video.player:after { display: none; }
@jacroe
jacroe / pianobar_tls.sh
Created December 4, 2012 04:40
Appends the fingerprint to the end of Pianobar's config file
fingerprint=`openssl s_client -connect tuner.pandora.com:443 < /dev/null 2> /dev/null | openssl x509 -noout -fingerprint | tr -d ':' | cut -d'=' -f2` && echo tls_fingerprint = $fingerprint >> ~/.config/pianobar/config