Skip to content

Instantly share code, notes, and snippets.

View xcatliu's full-sized avatar
🎯
Focusing

xcatliu xcatliu

🎯
Focusing
View GitHub Profile
@xcatliu
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 {
space,
useCircularPath,
removeFunction,
removeCircular,
removeNull,
@xcatliu
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
xcatliu / get-changelist.sh
Created September 22, 2017 04:58
Get the change list when git push
# 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
#!/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

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
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 March 7, 2024 02:53
(已失效)中国区用户在开启 GitHub 两步验证中遇到的问题
2023.8.28
据多名网友回复,此方法已失效。
最新解决办法请参考此贴:[v2ex: 请问 github 的两步验证(two-factor authentication)大家是怎么做的?](https://www.v2ex.com/t/967533)
https://www.v2ex.com/t/967533
---