Skip to content

Instantly share code, notes, and snippets.

@mrabbitt
mrabbitt / gist:1545455
Created December 31, 2011 21:53 — forked from anonymous/gist:1545449
Narrow Google's New Top Bar
#gb,
#gbqlw {
height: 42px !important;
}
#gbv,
#gbn,
#gbx1,
#gbx2 {
height: 41px !important;
@mrabbitt
mrabbitt / get_keychain_pass.py
Created April 16, 2012 01:25
Command line access to the Mac OS X Keychain (based on post: http://blog.macromates.com/2006/keychain-access-from-shell/#comment-979)
#!/usr/bin/env python
import sys
import subprocess
import re
import logging
import argparse
# https://github.com/wooster/biplist (pip install biplist)
import biplist
@mrabbitt
mrabbitt / stree-wrapper.bash
Created July 5, 2012 03:41
Wrapper for SourceTree "stree" command which works on any file or directory nested inside inside a Git or Mercurial repo.
#!/bin/bash -e
getRepoRoot()
{
local target=$1
if [ -d "${target}" ] ; then
cd "${target}"
elif [ -f "${target}" ] ; then
cd "$(dirname ${target})"
fi
@mrabbitt
mrabbitt / gist:3789992
Created September 26, 2012 19:22
Update GrowlMail.plugin for compatibility with the latest version of Mail and Message framework
defaults write ~/Library/Mail/Bundles/GrowlMail.mailbundle/Contents/Info.plist SupportedPluginCompatibilityUUIDs -array-add $(defaults read /System/Library/Frameworks/Message.framework/Versions/Current/Resources/Info.plist PluginCompatibilityUUID)
defaults write ~/Library/Mail/Bundles/GrowlMail.mailbundle/Contents/Info.plist SupportedPluginCompatibilityUUIDs -array-add $(defaults read /Applications/Mail.app/Contents/Info.plist PluginCompatibilityUUID)
@mrabbitt
mrabbitt / download_splunk_pdf_docs.py
Created November 20, 2012 21:26
Script to download all PDF files for a particular version of Splunk documentation.
#!/usr/bin/env python
'''
Script to download all PDF files for a particular version of Splunk documentation.
Requirements:
requests: http://docs.python-requests.org
beautifulsoup4: http://www.crummy.com/software/BeautifulSoup/
(pip install -U requests beautifulsoup4)
@mrabbitt
mrabbitt / gist:4180565
Created December 1, 2012 04:33
Backup iTunes 10.x before upgrading to iTunes 11 (Mac OS X)
tar czvf ~/Desktop/iTunes-backup-$(date +%Y%m%d_%H%M%S).tgz -C / \
/System/Library/PrivateFrameworks/CoreFP.framework \
/Applications/iTunes.app \
/Library/Documentation/Applications/iTunes \
/Library/Documentation/iPod \
/Library/Frameworks/iTunesLibrary.framework \
/System/Library/PrivateFrameworks/iTunesAccess.framework
(function() {
function addSectionNumber (elem, sectionNumber, parentSection, level) {
var sectionNumberStr = '';
var sectionSpan;
if (level > 1) {
sectionNumberStr = parentSection + '.' + sectionNumber;
} else if (level > 0) {
sectionNumberStr = sectionNumber.toString();
}
import this
@mrabbitt
mrabbitt / mdx_gist.py
Last active December 14, 2015 11:38
Extension to Python Markdown for Embedded Gists
# -*- coding: utf-8 -*-
#
# Copyright (c) 2013 Michael Rabbitt.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to
@mrabbitt
mrabbitt / gist.py
Created September 16, 2013 02:19 — forked from brianhsu/gist.py
class GitHubGist(Directive):
""" Embed GitHub Gist.
Usage:
.. gist:: GIST_ID
"""
required_arguments = 1
optional_arguments = 1