Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

xcatliu xcatliu

🎯
Focusing
View GitHub Profile
@xcatliu
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
xcatliu / get-changelist.sh
Created September 22, 2017 04:58
Get the change list when git push
View get-changelist.sh
# Find the common ancestor of current hash and origin/master
# https://stackoverflow.com/questions/1549146/find-common-ancestor-of-two-git-branches
# 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
xcatliu / run-period.sh
Created September 21, 2017 06:47
Run scripts in a period of history version of a repo
View run-period.sh
#!/bin/sh
start="2017-07-01"
end="2017-08-01"
endNextDay=`date -d "$end next-day" +%Y-%m-%d`
current=$start
while [ "$current" != "$endNextDay" ]
do
@xcatliu
xcatliu / auto-deploy.md
Created August 15, 2016 06:55 — forked from domenic/0-github-actions.md
Auto-deploying built products to gh-pages with Travis
View auto-deploy.md

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 compile.sh 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
xcatliu / MIT_LICENSE
Created June 27, 2015 01:48
MIT License for xcatliu
View MIT_LICENSE
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
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>` 再填手机号,居然就收到短信了。
后来有点不放心,还是给 https://github.com/contact 发了个反馈,然后收到回信说由于某些国家的短信发送成功率无法保证,所以没有开启两步验证功能。
不过在我这段时间的使用过程中,还是挺稳定的,每次都能收到短信。
大家如果也需要开启两步验证,最好把 Recover code 也记下来吧,避免以后短信收不到。