View the commit history for a particular file with git on the command line: git log –follow -p — filename
Blog
Disable Full Screen Shortcut on Mac OSX 10.10 Yosemite
Full screen is super annoying on OS X lately. I use SizeUp which gives me a shortcut for expanding the windows instead of using the green button but i’m still having random encounters with full screen mode because of the shortcut ctrl+shift+f. So here’s how to disable that..or at least make it harder to do… Continue reading Disable Full Screen Shortcut on Mac OSX 10.10 Yosemite
Remove all images from JQuery UI CSS
/* remove all default background images from jquery ui */ .ui-icon,.ui-widget-content .ui-icon, .ui-state-active .ui-icon, .ui-state-active,.ui-widget-content .ui-state-active,.ui-widget-header .ui-state-active, .ui-state-default .ui-icon, .ui-state-default,.ui-widget-content .ui-state-default,.ui-widget-header .ui-state-default, .ui-state-error .ui-icon,.ui-state-error-text .ui-icon, .ui-state-error,.ui-widget-content .ui-state-error,.ui-widget-header .ui-state-error, .ui-state-highlight .ui-icon, .ui-state-highlight,.ui-widget-content .ui-state-highlight,.ui-widget-header .ui-state-highlight, .ui-state-hover .ui-icon,.ui-state-focus .ui-icon, .ui-state-hover,.ui-widget-content .ui-state-hover,.ui-widget-header .ui-state-hover,.ui-state-focus,.ui-widget-content .ui-state-focus,.ui-widget-header .ui-state-focus, .ui-widget-content, .ui-widget-header, .ui-widget-header .ui-icon, .ui-widget-overlay, .ui-widget-shadow { background-image: none; }
Updating git on OS X Mavericks
The easiest way to update git to 2.2.1 or higher is to use homebrew. brew install git If you get a command not found error, you can install homebrew from brew.sh (scroll down for a one liner, i won’t copy it here in case it updates). If you get a different error, check out Updating… Continue reading Updating git on OS X Mavericks
Updating Homebrew on Yosemite
The Error $ brew /usr/local/bin/brew: /usr/local/Library/brew.rb: /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby: bad interpreter: No such file or directory /usr/local/bin/brew: line 21: /usr/local/Library/brew.rb: Undefined error: 0 $ brew doctor /usr/local/bin/brew: /usr/local/Library/brew.rb: /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby: bad interpreter: No such file or directory /usr/local/bin/brew: line 21: /usr/local/Library/brew.rb: Undefined error: 0 The Fix Make homebrew think /System/Library/Frameworks/Ruby.framework/Versions/1.8 still exists until you successfully update: cd /System/Library/Frameworks/Ruby.framework/Versions… Continue reading Updating Homebrew on Yosemite
OS X pg gem install or bundle install issues
If you’re getting errors like: Building native extensions. This could take a while… ERROR: Error installing pg: ERROR: Failed to build gem native extension. /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby extconf.rb checking for pg_config… yes Using config values from /usr/local/bin/pg_config checking for libpq-fe.h… yes checking for libpq/libpq-fs.h… yes checking for pg_config_manual.h… yes checking for PQconnectdb() in -lpq… no checking for… Continue reading OS X pg gem install or bundle install issues
Quick Top Level Domain Lookup in Python
Python’s get_tld works very well but is slow if you’re looking up a batch of domain names. Here’s a faster version that falls back on get_tld: from tld import get_tld import re def quick_tld(url): tld_prog = re.compile(r'(?P<tld>[^./]+\.(com|net|org|co\.uk))($|/)’) ip_prog = re.compile(r’\b\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\b’) try: tld_match = tld_prog.search(url) if tld_match: return tld_match.group(‘tld’) elif ip_prog.match(article.url): return None else: return get_tld(url)… Continue reading Quick Top Level Domain Lookup in Python
Postgres Bytea Size
The octet_length function returns the length in bytes size of a bytea field. From the docs: “Number of bytes in binary string”. SELECT octet_length(the_data_field) FROM table_name; # byte size More binary string functions
Bonjour issues cause problems with teleport
Common issues caused by bonjour with Teleport: Teleport not connecting Teleport not showing the accept prompt Teleport only able to connect in one direction and not the other Teleport can’t reconnect Making sure Bonjour is working Messages.app > Preferences > Accounts > Bonjour > Enable Bonjour instant messaging (on both computers) Locate your other computer… Continue reading Bonjour issues cause problems with teleport
Better read-only view for google spreadsheets
If you need read only access to a google docs spreadsheet it’s much faster and easier to use an exported version. Just go to File > Download As > Web Page and it’ll open a new window with the fully loaded spreadsheet. Here’s a public spreadsheet if you want to try it out.