Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View fancyremarker's full-sized avatar

Frank Macreery fancyremarker

  • Aptible
  • Catskill Mountains
View GitHub Profile
@fancyremarker
fancyremarker / enable_google_keyboard_shortcuts.sh
Created September 29, 2011 22:26
Re-enable Google Keyboard Shortcuts in Chrome on OS X, by editing cookie database directly
#!/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';"
@fancyremarker
fancyremarker / Send IM to Contact.scpt
Last active June 8, 2016 22:01
Quicksilver Plugin to send an IM to an Adium contact
# 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
@fancyremarker
fancyremarker / local.quicksilver.startAtLogin.plist
Created January 27, 2012 19:48
Quicksilver ß63 Launch Fix for OS 10.7.2
<?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>
@fancyremarker
fancyremarker / idlequit
Created February 17, 2012 02:31
Set of scripts to kill Things after 5 minutes of keyboard/mouse idle
#!/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
@fancyremarker
fancyremarker / gist:2493262
Last active December 12, 2017 02:27
List MongoDB collections in order of size on disk (for collection and indexes)
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
@fancyremarker
fancyremarker / heroku.rake
Created July 9, 2012 12:55
Heroku::Rake::Task wrapper to work around exit status issue in `heroku run`
module Heroku
module Rake
class Task
attr_accessor :name
def initialize(name)
@name = name
end
def self.[](name)
Heroku::Rake::Task.new(name)
@fancyremarker
fancyremarker / .bash_login.jenkins
Last active March 6, 2023 19:21
[A.] Scripts related to Jenkins client setup
# if running bash
if [ -n "$BASH_VERSION" ]; then
# include .bashrc if it exists
if [ -f "$HOME/.bashrc" ]; then
. "$HOME/.bashrc"
fi
fi
@fancyremarker
fancyremarker / post-checkout
Created July 25, 2012 19:37
Sane Git hooks for projects with submodules
#!/bin/sh
# Check if this is a branch checkout
if [ "${3}" -eq "1" ] ; then
git submodule update --init
fi
@fancyremarker
fancyremarker / gist:4136584
Created November 23, 2012 17:33
Blazingly fast key repeat in OS X
#!/bin/sh
defaults write -g KeyRepeat -int 0 # <- 0 ms
defaults write -g InitialKeyRepeat -int 10 # <- 100 ms
defaults write -g ApplePressAndHoldEnabled -bool false
@fancyremarker
fancyremarker / background.js
Created December 26, 2012 04:51
Instapaper Chrome extension converted from bookmarklet via @peterlegierski's plugin
chrome.browserAction.onClicked.addListener(function(tab) {
chrome.tabs.executeScript(tab.id, {file: "bookmarklet.js"})
});