Skip to content

Instantly share code, notes, and snippets.

View GiK's full-sized avatar

Gordon Hughes GiK

  • Truepic
View GitHub Profile
Alfred 2 Workflow - Open current selected URL in Chrome
Add a Hotkey Trigger
Hotkey - for example SHIFT-COMMAND-O
Action - Pass through to workflow
Argument - None
Add the Open URL Action
URL - type "{query}" minus the quote characters
Browser - select Chrome
@GiK
GiK / gist:3258527
Created August 4, 2012 15:57
Create a keyboard shortcut to open the current Safari page in Chrome

Useful for url-shortened links on Twitter which open up to "You're missing Adobe Flash Player 10 Plugin..."

If you haven't already, enable the Develop menu in Safari: Preferences > Advanced, check "Show Develop menu in menu bar".

Assuming you've got Chrome installed, navigate to Safari's "Develop > Open Page With" menu, and take a note of the exact menu title for Chrome. For example, "Google Chrome (21.0.1180.57)".

Open Keyboard Preferences and under the Keyboard Shortcuts tab, add a new shortcut to Application Shortcuts. Select Safari as the Application. Enter the Menu Title you noted above (minus the quotation marks). Finally, type your shortcut of choice - cmd-shift-O, for example.

Obviously this will break when Chrome updates, but change the build number in your shortcut, and you're all set.

@GiK
GiK / DetailViewController.m
Created October 5, 2011 19:37
Using gesture recognizers to dismiss a keyboard overlaying a UISplitViewController
/*
This sample uses your application's keyWindow - the window that all other views hang from. Since UIWindow is simply a subclass of UIView, we can add gesture recognizers to it.
No matter where you tap or scroll - the master view's table view, or a map in the detail view - the keyboard will be dismissed and your pan/tap gesture continues unhindered.
*/
// Adopt UIGestureRecognizerDelegate and UISearchBarDelegate protocols in .h