Skip to content

Instantly share code, notes, and snippets.

View pwenzel's full-sized avatar

Paul Wenzel pwenzel

View GitHub Profile
@pwenzel
pwenzel / When Song Finishes, Pause.applescript
Created September 23, 2021 17:11 — forked from capnslipp/When Song Finishes, Pause.applescript
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)
@pwenzel
pwenzel / unserialize_clipboard.fish
Last active February 12, 2019 16:11
Fish shell function to unserialize php from the OSX clipboard.
# ~/.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
* 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
repeat
@pwenzel
pwenzel / trinkup
Last active August 29, 2015 14:11 — forked from ei-grad/trinkup
#!/bin/bash
#
# trinkup - TRivial INcremental bacKUP script
#
# Licensed under DWTFYWWI license, but recommended to be used before drinkup.
#
set -e
if ! which rsync >/dev/null; then
@pwenzel
pwenzel / README.md
Last active December 14, 2015 20:28
Set site/plugin options for all blogs in a network [WordPress Multisite] [WordPress]

Set options for all the blogs on a WordPress Multisite installation