Skip to content

Instantly share code, notes, and snippets.

@yyq
yyq / translate-baidu-api.py
Last active December 4, 2019 07:50
百度翻译api示例代码
#!/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
@ashfinal
ashfinal / catch_fn.lua
Created June 3, 2017 07:53 — forked from zzamboni/catch_fn.lua
How to catch the fn key using Hammerspoon
-- 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()
@babyking
babyking / autohotkey.ahk
Last active December 18, 2019 03:01
自己使用的Autohotkey 脚本 绝大多数的习惯与我的MAC上定义快捷键是一致的. mac上实现此脚本中快捷键主要是通过 keyremap4macbook来实现的.大部分定义受vi以及unix的一些快捷键影响,另外,刚刚买了一个hhkb键盘,部分定义也受其启发.
/*
* email: babyking1949@gmail.com
* update: 2013/3/9
*/
;常用快捷命令
:://cmd:: ;打开命令行
Run cmd
return