Skip to content

Instantly share code, notes, and snippets.

View pwenzel's full-sized avatar

Paul Wenzel pwenzel

View GitHub Profile
@markjaquith
markjaquith / disable-plugins-when-doing-local-dev.php
Created June 24, 2011 10:24
Disables specified WordPress plugins when doing local development
<?php
/*
Plugin Name: Disable plugins when doing local dev
Description: If the WP_LOCAL_DEV constant is true, disables plugins that you specify
Version: 0.1
License: GPL version 2 or any later version
Author: Mark Jaquith
Author URI: http://coveredwebservices.com/
*/
@jeremyboggs
jeremyboggs / filter_collections_alphabetically.php
Created September 20, 2011 02:12
Filter the collections browse SQL to sort records alphabetically by name.
<?php
/**
* Filter the collections browse SQL to sort records alphabetically by name.
*/
function filter_collections_alphabetically($select, $params)
{
if (!array_key_exists('sort_field', $params)) {
$select->order('c.name ASC');
}
@ptitov
ptitov / backup.sh
Created November 26, 2011 19:37
MacOS user data rsync backup script with openssl encryption
NUMSECTORS=600000 #300mb
URL=rsync://HOSTNAME/DIRECTORY/
EXCLUDE=Evernote
BACKUP="\"Library/Application Support\" Documents"
PASSWORD=
# create ramdisk
RAMDISK=`hdid -nomount ram://$NUMSECTORS`
newfs_hfs $RAMDISK
RDPATH=/tmp/ramdisk.backup
@erikh
erikh / hack.sh
Created March 31, 2012 07:02 — forked from DAddYE/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
@iolloyd
iolloyd / Spot the Hijack
Created September 2, 2012 20:09
Use Audio Hijack Pro to record Spotify tracks while you listen
* 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
@dmp1ce
dmp1ce / duplicity_backup.sh
Created September 15, 2012 01:44
Duplicity backup script
#!/bin/bash
# Backup all important files on my computer using Duplicity
# Folders to include
include_directories=(/home/me /etc)
# Folders to exclude
exclude_directories=()
@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
@zigotica
zigotica / youtube-poster-frame.css
Last active August 8, 2024 22:50
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; }
@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
@capnslipp
capnslipp / When Song Finishes, Pause.applescript
Last active January 28, 2025 22:51
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)