Skip to content

Instantly share code, notes, and snippets.

View luosky's full-sized avatar

Luosky luosky

View GitHub Profile
@luosky
luosky / karabiner.json
Last active June 14, 2017 03:39
Hyper + arrow key (Karabiner Element 0.91.2)
{
"global": {
"check_for_updates_on_startup": true,
"show_in_menu_bar": false,
"show_profile_name_in_menu_bar": false
},
"profiles": [
{
"complex_modifications": {
"rules": [
@luosky
luosky / init.lua
Last active December 20, 2021 14:20
Hammerspoon config
local alert = require("hs.alert") -- http://www.hammerspoon.org/docs/hs.alert.html
local pasteboard = require("hs.pasteboard") -- http://www.hammerspoon.org/docs/hs.pasteboard.html
local settings = require("hs.settings") -- http://www.hammerspoon.org/docs/hs.settings.html
-- http://www.hammerspoon.org/docs/hs.chooser.html
------------------------
-- default config
------------------------
-- screen name can use hs.screen.allScreens()[1]:name() to see
local laptop = "Color LCD"
@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 / private.xml
Last active December 21, 2015 10:39
KeyRemap4MacBook 配置文件 private.xml
<?xml version="1.0"?>
<root>
<item>
<name>HHKB adopt Hyper settings</name>
<identifier>luosky.hhkb_hyper</identifier>
<appendix>Option_R / TAB to Hyper (ctrl+shift+cmd+opt), press only once, send escape</appendix>
<appendix>Shift_L + DELETE => ForwardDelete</appendix>
<devicevendordef>
<vendorname>TOPRE</vendorname>
<vendorid>0x0853</vendorid>
@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)