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
# coding: utf-8 | |
#!/usr/bin/env ruby | |
# | |
# Mutes Spotify ads by monitoring Growl's output in syslog, and changing the | |
# system-wide audio output to dummy output when an ad is detected. | |
# | |
# == Installation | |
# | |
# 1. Install Soundflower (http://code.google.com/p/soundflower/) | |
# 2. Run the following command in your home directory, or wherever you prefer. |
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
osascript <<'APPLESCRIPT' | |
tell application "iTerm" | |
activate | |
tell the first terminal | |
tell the current session | |
tell i term application "System Events" to keystroke (key code 126) | |
tell i term application "System Events" to keystroke (key code 36) | |
end tell | |
end tell | |
end tell |
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
osascript <<'APPLESCRIPT' | |
tell application "Terminal" | |
activate | |
tell front window | |
tell application "System Events" to keystroke (key code 126) | |
tell application "System Events" to keystroke (key code 36) | |
end tell | |
end tell | |
tell application "TextMate" |
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
alias gdc='git diff --cached' | |
alias gst='git status -s' # git >1.7.0 | |
alias glr='git pull --rebase' | |
alias gl='git pull' | |
alias gp='git push' | |
alias gd='git diff' | |
alias gc='git commit -v' | |
alias gca='git commit -v -a' | |
alias gb='git branch' |
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
RED="\[\033[0;31m\]" | |
YELLOW="\[\033[0;33m\]" | |
GREEN="\[\033[0;32m\]" | |
BLUE="\[\033[0;34m\]" | |
LIGHT_RED="\[\033[1;31m\]" | |
LIGHT_GREEN="\[\033[1;32m\]" | |
WHITE="\[\033[1;37m\]" | |
LIGHT_GRAY="\[\033[0;37m\]" | |
COLOR_NONE="\[\e[0m\]" |
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
alias gdc='git diff --cached' | |
alias gst='git status -s' # git >1.7.0 | |
alias glr='git pull --rebase' | |
alias gl='git pull' | |
alias gp='git push' | |
alias gd='git diff' | |
alias gc='git commit -v' | |
alias gca='git commit -v -a' | |
alias gb='git branch' |
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
#!/usr/bin/env ruby | |
require 'date' | |
log, file = ARGV | |
regex = Regexp.new("GET.*#{file}\s.*200\s") | |
lines = File.open(log).readlines | |
gets = lines.grep regex | |
totals = {} |
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
#!/usr/bin/env ruby | |
# | |
# NIEC BENCHMARKER: | |
# | |
# == Usage | |
# | |
# 1. Create a ruby source file containing methods with arbitrary names. | |
# Those are the methods that will be benchmarked. | |
# For example, contents of my-benchmarks.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
FOO |
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
RSpec::Matchers.define :respond_with_json do |expected| | |
match do |actual| | |
JSON.parse(actual.response.body) == expected | |
end | |
failure_message_for_should do |actual| | |
"expected the response #{actual.response.body} to be #{expected}" | |
end | |
end |
OlderNewer