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
set target_folder to POSIX file "/Users/gavin/Desktop/iTunesOut/" | |
set the_playlist_name to "Music Only" | |
tell application "iTunes" | |
set the_playlist to playlist the_playlist_name | |
repeat with i from 1 to (number of file tracks in the_playlist) | |
set the_track to file track i of the_playlist | |
set the_location to (location of the_track) | |
tell application "Finder" | |
copy file the_location to folder (target_folder) |
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
# | |
# Assuming your address book entries have a URL field 'twitter' containing either their full Twitter URL, or just | |
# their username, go fetch the image and drop it into the addressbook. | |
# | |
# Works for me, but your milage may vary. | |
# | |
require 'rubygems' | |
require 'twitter' | |
require 'open-uri' |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>AbandonProcessGroup</key> | |
<true/> | |
<key>Label</key> | |
<string>uk.co.leftbrained.iteleport_watcher</string> | |
<key>ProgramArguments</key> | |
<array> |
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
set thefolder to choose folder with prompt "Pick a folder..." | |
tell application "Finder" to set filelist to every file of thefolder | |
repeat with currentFile in filelist | |
tell application "Pages" | |
open currentFile | |
activate | |
save front document in (name of currentFile) & ".pdf" | |
close front document without saving |
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
Taken from http://en.wikipedia.org/wiki/Hanlon's_razor | |
A practical observation on the risks of stupidity was made by the German General Kurt von Hammerstein-Equord | |
in Truppenführung, 1933: "I divide my officers into four classes; the clever, the lazy, the industrious, and | |
the stupid. Each officer possesses at least two of these qualities. Those who are clever and industrious are | |
fitted for the highest staff appointments. Use can be made of those who are stupid and lazy. The man who is | |
clever and lazy however is for the very highest command; he has the temperament and nerves to deal with all | |
situations. But whoever is stupid and industrious is a menace and must be removed immediately!" |
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 | |
ssh -nNT -R 1100:localhost:22 fake-remote.leftbrained.co.uk -p 2712 -i /Users/gavin/Dropbox/bin/reverse-tunnel.d/tunnel-key -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null | |
# Script above opens a reverse tunnel from laptop to fake-remote.leftbrained.co.uk | |
# from fake-remote.leftbrained.co.uk (a VPS I use for general cruft work) I can do... | |
$ ssh localhost -p1100 | |
# That uses the outbound tunnel from laptop to fake-remote to go from fake-remote to laptop. |
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
setw -g xterm-keys on | |
set -g default-terminal "xterm-color" | |
# https://github.com/ChrisJohnsen/tmux-MacOSX-pasteboard/ | |
set-option -g default-command "reattach-to-user-namespace -l bash" | |
# default statusbar colors | |
set-option -g status-bg colour235 #base02 | |
set-option -g status-fg colour136 #yellow | |
set-option -g status-attr default |
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
cd ~; | |
apt-get install git; | |
git clone git://github.com/opscode/chef-repo.git; | |
mv chef-repo workstation; | |
cd workstation; | |
mkdir .chef; | |
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
/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -kill -r -domain local -domain system -domain user |
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
class User | |
has_many :group_roles | |
has_many :groups, :through=>:group_roles | |
end | |
class GroupRole | |
belongs_to :user | |
belongs_to :group | |
end |
OlderNewer