Skip to content

Instantly share code, notes, and snippets.

View gvkhna's full-sized avatar

Gaurav Khanna gvkhna

View GitHub Profile
@gvkhna
gvkhna / objcmethodswap
Last active August 29, 2015 14:03
objc Method Swap
@implementation _IDESwipeAnimationHostView (OverrideRightClick)
+ (void)load
{
// The "+ load" method is called once, very early in the application life-cycle.
// It's called even before the "main" function is called. Beware: there's no
// autorelease pool at this point, so avoid Objective-C calls.
SEL originalSEL = NULL;
SEL swapSEL = NULL;
Method originalMethod = NULL;
@gvkhna
gvkhna / AppleMediaKeyController.h
Created August 23, 2010 20:51
Apple Media Key hotkey override
//
// AppleMediaKeyController.h
//
// Modified by Gaurav Khanna on 8/17/10.
// SOURCE: http://github.com/sweetfm/SweetFM/blob/master/Source/HMediaKeys.h
//
//
// 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,
<span style="font-size:10pt;">▶</span><span style="letter-spacing:2px;">❙❙</span>
<span style="font-size:10pt;letter-spacing:-2px;">▶▶</span>
<span style="display:inline;margin-left:-1px;font-size:10pt;letter-spacing:-4px;">◀◀</span>