Skip to content

Instantly share code, notes, and snippets.


xcatliu xcatliu

View GitHub Profile
xcatliu / keybindings.json
Last active September 27, 2017 11:09
Config Files
View keybindings.json
// 将键绑定放入此文件中以覆盖默认值
"key": "alt+q",
"command": "macros.oneVar"
"key": "alt+a",
"command": "macros.oneVarLet"
xcatliu /
Created September 22, 2017 04:58
Get the change list when git push
# Find the common ancestor of current hash and origin/master
# Command inside `` will be executed and pass to the variable
common_ancestor=`git merge-base HEAD origin/master`
# --diff-filter=ACMRT Only show files which is appended, copied, modified, renamed or type-changed
changelist=`git diff $common_ancestor HEAD --name-only --diff-filter=ACMRT`
xcatliu /
Created September 21, 2017 06:47
Run scripts in a period of history version of a repo
endNextDay=`date -d "$end next-day" +%Y-%m-%d`
while [ "$current" != "$endNextDay" ]
xcatliu /
Created August 15, 2016 06:55 — forked from domenic/
Auto-deploying built products to gh-pages with Travis

Auto-deploying built products to gh-pages with Travis

This is a set up for projects which want to check in only their source files, but have their gh-pages branch automatically updated with some compiled output every time they push.

Create a compile script

You want a script that does a local compile to e.g. an out/ directory. Let's call this for our purposes, but for your project it might be npm build or gulp make-docs or anything similar.

The out/ directory should contain everything you want deployed to gh-pages. That almost always includes an index.html.

xcatliu / MIT_LICENSE
Created June 27, 2015 01:48
MIT License for xcatliu
The MIT License (MIT)
Copyright (c) 2015 Xcat Liu
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
xcatliu / 中国区用户在开启 GitHub 两步验证中遇到的问题
Last active December 31, 2022 09:07
The problem when Chinese user enabling GitHub two-factor authentication via SMS
View 中国区用户在开启 GitHub 两步验证中遇到的问题
今天发现 GitHub 有两步验证的功能,于是打算开启,可是悲剧的是,到了填写手机号的时候,发现没有 China 的选项。
于是我尝试了下修改网页源代码,添加了 `<option value="+86">China +86</option>` 再填手机号,居然就收到短信了。
后来有点不放心,还是给 发了个反馈,然后收到回信说由于某些国家的短信发送成功率无法保证,所以没有开启两步验证功能。
大家如果也需要开启两步验证,最好把 Recover code 也记下来吧,避免以后短信收不到。