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
# Goes to iTunes or Spotify (in that order of priority), shows the currently playing track. | |
if appIsRunning("iTunes") then | |
tell application "iTunes" to activate | |
try | |
tell application "System Events" | |
tell process "iTunes" | |
tell menu bar 1 to pick menu item "Go to Current Song" of menu "Controls" | |
end tell | |
end tell | |
end try |
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
@tl;dr | |
5.3 months // how often 3 sparkling water drinkers will go through a 20 lbs CO2 tank | |
$90 // SodaStream | |
$29 // 20 lbs tank refill every 6 months, at Robert's Oxygen in Dulles, VA | |
$201 // initial investment in tank, refill attachments/adapter, first CO2 fill | |
5.4 months // time to recoup initial equipment investment (sans SodaStream) | |
@initial equipment costs (excluding SodaStream, which we got as a gift) | |
diy_tank_20lbs = $115 + $21.34 shipping // 20 lb CO2 tank | |
adapter_kit = $30 // kit to attach tank to sodastream bottle to refill (tubes, connectors, valves) |
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
# Use: rt test_file | |
# Use: rt test_file:test_name_regex | |
# Finds a file under test/* and runs it with -n /test_name_regex/ | |
function rt { | |
FILE_HINT=`echo $1 | cut -f1 -d:` | |
TEST_REGEX=`echo $1 | cut -f2 -d:` | |
FILE_PATH=`find test/* -maxdepth 3 -name ${FILE_HINT}_test.rb` | |
if [ -z $FILE_PATH ]; | |
then | |
echo Couldn\'t find file for $FILE_HINT |
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
Picture menu | |
Picture mode: Custom | |
Contrast: +90 | |
Brightness: +50 | |
Color: +44 | |
Tint: 0 | |
Sharpness: 0 | |
Color temp: Warm 1 | |
Color mgmt: Off [grayed out] | |
C.A.T.S.: Off |
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
require 'niftp' | |
class SomeObject | |
include NiFTP | |
def ftp_stuff | |
# get a file from an FTP Secure (FTPS) server | |
ftp("ftp.appareldownload.com", { username: "changeme", password: "changeme", ftps: true }) do |client| | |
p "Connected to Alpha! Buyakasha!" | |
files = client.list('s*') |
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 Computer//DTD PLIST 1.0//EN" | |
"http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>Label</key> | |
<string>com.rabbitmq</string> | |
<key>Program</key> | |
<string>/usr/local/sbin/rabbitmq-server</string> | |
<key>RunAtLoad</key> |
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
tell application "System Preferences" to activate | |
tell application "System Events" | |
tell process "System Preferences" | |
click menu item "Displays" of menu "View" of menu bar 1 | |
tell button "Detect Displays" of window 1 to click | |
end tell | |
end tell | |
delay 1 | |
tell application "System Preferences" to quit |
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
# See http://github.com/mynyml/watchr/ | |
# This script was modified from http://gist.github.com/raw/189052/1fd4faf0e9edab9d8e941fd21a1a9e7f70cf5aad/specs.watchr.rb | |
# | |
# Run me with: | |
# | |
# $ watchr ~/.rails.watchr.rb | |
# | |
# or alias me with: | |
# | |
# alias rw='watchr ~/.rails.watchr.rb' |
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
-- In Safari, this copies the Title and URL of the current tab to the clipboard. | |
-- Save the script in ~/Library/Scripts/Applications/Safari | |
-- Using QuickSilver, I assign a trigger to this script using the hotkey ⌥-C (option c), with the scope of the trigger limited to Safari. | |
-- Inspired by CopyURL + (http://copyurlplus.mozdev.org/) | |
-- Christopher R. Murphy | |
tell application "Safari" | |
set theURL to URL of front document | |
set theTitle to name of front document | |
set the clipboard to theTitle & return & theURL as string |