Skip to content

Instantly share code, notes, and snippets.

View xcatliu's full-sized avatar

xcatliu xcatliu

View GitHub Profile
xcatliu / serialize.js
Last active June 28, 2023 01:47
Serialize any object, stringify it, print to console, and write to clipboard
* 序列化任意一个对象
function serialize(obj, options = {}) {
const {
xcatliu / keybindings.json
Last active September 27, 2017 11:09
Config Files
// 将键绑定放入此文件中以覆盖默认值
"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 March 7, 2024 02:53
(已失效)中国区用户在开启 GitHub 两步验证中遇到的问题
最新解决办法请参考此贴:[v2ex: 请问 github 的两步验证(two-factor authentication)大家是怎么做的?](