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 | |
# Force Google Keyboard Shortcuts experimental search in Chrome | |
COOKIEJAR=~/Library/Application\ Support/Google/Chrome/Default/Cookies | |
OLDCOOKIEVAL=$(sqlite3 "$COOKIEJAR" "select value from cookies where host_key = '.google.com' and name = 'PREF';") | |
NEWCOOKIEVAL=$(echo $OLDCOOKIEVAL | sed 's/:GM=[^:]*:/:/' | sed 's/:ES=[^:]*:/:/' | sed 's/:S=/:GM=1:ES=WBS:S=/') | |
sqlite3 "$COOKIEJAR" "update cookies set value = '$NEWCOOKIEVAL' where host_key = '.google.com' and name = 'PREF';" |
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
# Adds "Send IM to Contact" action to any text in Quicksilver. | |
# Requires: Adium >= 1.4.0. | |
# Type a friend's display name or IM handle, press Tab to bring up action list, | |
# and select or type to autocomplet "Send IM to Contact." | |
using terms from application "Quicksilver" | |
on process text im_name | |
tell application "Adium" | |
set theContact to the (first contact whose (display name contains im_name) or (name is equal to im_name)) | |
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
<?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>Label</key> | |
<string>local.quicksilver.startAtLogin</string> | |
<key>ProgramArguments</key> | |
<array> | |
<string>/bin/sh</string> | |
<string>/usr/local/bin/qsapp</string> |
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 | |
# idlequit <application name> <timeout> | |
# Quits application if system has been idle for greater than timeout. | |
if [ $# -ne 2 ]; then | |
echo "Usage: idlequit <application name> <timeout>" >&2 | |
exit 1 | |
fi | |
if [ `/usr/local/bin/idletime` -gt ${2} ]; then |
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
DB=your_mongo_database | |
for coll in `mongo ${DB} --quiet --eval "db.getCollectionNames()" | tr ',' ' '`; do | |
echo -n `mongo ${DB} --quiet --eval "db['${coll}'].stats(1024)['size'] + db['${coll}'].stats(1024)['totalIndexSize']"` | |
echo ": ${coll}" | |
done | sort -n -r |
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
module Heroku | |
module Rake | |
class Task | |
attr_accessor :name | |
def initialize(name) | |
@name = name | |
end | |
def self.[](name) | |
Heroku::Rake::Task.new(name) |
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
# if running bash | |
if [ -n "$BASH_VERSION" ]; then | |
# include .bashrc if it exists | |
if [ -f "$HOME/.bashrc" ]; then | |
. "$HOME/.bashrc" | |
fi | |
fi |
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 | |
# Check if this is a branch checkout | |
if [ "${3}" -eq "1" ] ; then | |
git submodule update --init | |
fi |
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 | |
defaults write -g KeyRepeat -int 0 # <- 0 ms | |
defaults write -g InitialKeyRepeat -int 10 # <- 100 ms | |
defaults write -g ApplePressAndHoldEnabled -bool false |
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
chrome.browserAction.onClicked.addListener(function(tab) { | |
chrome.tabs.executeScript(tab.id, {file: "bookmarklet.js"}) | |
}); |
OlderNewer