Skip to content

Instantly share code, notes, and snippets.

View luosky's full-sized avatar

Luosky luosky

View GitHub Profile
@luosky
luosky / gist:c3108c3c949973fc8970
Created January 20, 2016 06:07 — forked from krzysztofzablocki/gist:4396302
Set symbol breakpoint on objc_msgSend then setup this debug command to log all methods called in iOS Simulator. If you want to do device debugging change esp+4 register to r0, esp+8 to r1 Found long ago somewhere on stackoverflow.
expr -- (void)printf("[%s, %s]\n",(char *) object_getClassName(*(long*)($esp+4)), (char *) *(long *)($esp+8) )
@luosky
luosky / 0_reuse_code.js
Created May 28, 2014 10:11
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@luosky
luosky / CopyLaunchedApplicationsInFrontToBackOrder.c
Created January 4, 2012 04:03 — forked from 0xced/CopyLaunchedApplicationsInFrontToBackOrder.c
Get an array of running applications ordered by last use
#import <Carbon/Carbon.h>
#import <dlfcn.h>
/*
* Returns an array of CFDictionaryRef types, each of which contains information about one of the processes.
* The processes are ordered in front to back, i.e. in the same order they appear when typing command + tab, from left to right.
* See the ProcessInformationCopyDictionary function documentation for the keys used in the dictionaries.
* If something goes wrong, then this function returns NULL.
*/
CFArrayRef CopyLaunchedApplicationsInFrontToBackOrder(void)