Skip to content

Instantly share code, notes, and snippets.

local function Chinese()
hs.keycodes.currentSourceID("com.sogou.inputmethod.sogou.pinyin")
end
local function English()
hs.keycodes.currentSourceID("com.apple.keylayout.ABC")
end
-- app to expected ime config
local app2Ime = {

xz文件 xz -d file.xz tar文件 tar -xvf file.tar tar.gz 文件 tar zxvf tar.gz

location / {
add_header Access-Control-Allow-Origin *;
add_header Access-Control-Allow-Methods 'GET, POST, OPTIONS';
add_header Access-Control-Allow-Headers 'DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Authorization';
if ($request_method = 'OPTIONS') {
return 204;
}
}
.textarea-at-wrap .input-wrap[contenteditable=true]:empty:before{
    content: attr(placeholder);
    display: block;
}
@lirongfei123
lirongfei123 / 反馈渠道
Created March 15, 2019 04:04
产品经验 #产品经验
不管做任何系统,以下的功能必不可少:
埋点系统
反馈系统
BUG修复记录
版本发布记录,都是不能少的
就设置一个初始化的值
以及设置为空的值
@lirongfei123
lirongfei123 / where 操作符.md
Last active March 9, 2019 13:55
sequelize #sequelize
$and: {a: 5}           // AND (a = 5)
$or: [{a: 5}, {a: 6}]  // (a = 5 OR a = 6)
$gt: 6,                // > 6
$gte: 6,               // >= 6
$lt: 10,               // < 10
$lte: 10,              // <= 10
$ne: 20,               // != 20
$not: true,            // IS NOT TRUE
$between: [6, 10],     // BETWEEN 6 AND 10
var range = window.getSelection().getRangeAt(0);
var preCaretRange = range.cloneRange();
// console.log(range.startOffset);
const startOffset = range.startOffset;
preCaretRange.setStart(range.startContainer, startOffset);
preCaretRange.setEnd(range.endContainer, startOffset + 1);
const caretOffset = preCaretRange.toString();
console.log(caretOffset);

git log --format='%aN' | sort -u | while read name; do echo -en "$name\t"; git log --author="$name" --pretty=tformat: --numstat | awk '{ add += $1; subs += $2; loc += $1 - $2 } END { printf "added lines: %s, removed lines: %s, total lines: %s\n", add, subs, loc }' -; done

@lirongfei123
lirongfei123 / request.md
Created February 28, 2019 11:52
node #node
request.post({
            url: 'http://localhost:8000/oauth/user',
            form: {
                mes: "heydude"
            }
        }, function (error, response, body) {

        });