This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# -*- coding: utf-8 -*- | |
"""readme | |
this script is python 3 only | |
please config your own appid and secretKey, refer link: http://api.fanyi.baidu.com/api/trans/product/index | |
usage command: python translate-baidu-api.py word.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Catch fn-h and convert it to a left arrow key. | |
function catcher(event) | |
if event:getFlags()['fn'] and event:getCharacters() == "h" then | |
print("fn-h!") | |
return true, {hs.eventtap.event.newKeyEvent({}, "left", true)} | |
end | |
return false | |
end | |
local tapper=hs.eventtap.new({hs.eventtap.event.types.keyDown}, catcher):start() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* email: [email protected] | |
* update: 2013/3/9 | |
*/ | |
;常用快捷命令 | |
:://cmd:: ;打开命令行 | |
Run cmd | |
return |