This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ffmpeg -loop 1 -i image.jpg -i audio.m4a -c:v libx264 -tune stillimage -c:a aac -b:a 192k -shortest output.mp4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Generate reels | |
for dir in (ls); mgreel --out "$dir reel.wav" $dir/*.wav; end | |
# check durations (should be 2.9 minutes or less, (e.g. 174 seconds or 2 minutes and 53 seconds) | |
for file in (ls *.wav); echo $file; afinfo $file | grep duration; end | |
# rename files mg0.wav, mg1.wav, mg2.wav, etc. | |
num=0; for i in *; do mv "$i" "mg$(printf '%01d' $num).${i#*.}"; ((num++)); done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(* | |
@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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for file in *.avi; ffmpeg -n -i $file -strict -2 $file.mp4; end; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For use within OsciStudio by Jerobeam Fenderson | |
#include <OsciText.h> | |
SLIDER(which,0..37); | |
// Letters | |
OsciText text1("A"); | |
OsciText text2("B"); | |
OsciText text3("C"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ~/.config/fish/functions/unserialize_clipboard.fish | |
# unserialize PHP from the clipboard | |
# based on https://gist.github.com/gregferrell/747642 | |
function unserialize_clipboard | |
set STRING (pbpaste) | |
php -r "echo var_dump(unserialize('$STRING'));" | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ping -q -c 1 bogus.local; and echo "pinging the host worked"; or echo "pinging the host didn't work" | |
ping -q -c 1 google.com; and echo "pinging the host worked"; or echo "pinging the host didn't work" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Concatenate CSV files to all.csv in parent directory | |
# Assumes they all have the same CSV header | |
# https://stackoverflow.com/questions/9633114/unix-script-to-remove-the-first-line-of-a-csv-file/9633203#9633203 | |
sed 1q *.csv > ../all.csv | |
sed 1d *.csv >> ../all.csv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# 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. |
NewerOlder