Skip to content

Instantly share code, notes, and snippets.

View wujunchuan's full-sized avatar
:octocat:
Focusing

John Trump wujunchuan

:octocat:
Focusing
View GitHub Profile
@wujunchuan
wujunchuan / gh-pages-deploy.md
Created March 22, 2021 09:46 — forked from cobyism/gh-pages-deploy.md
Deploy to `gh-pages` from a `dist` folder on the master branch. Useful for use with [yeoman](http://yeoman.io).

Deploying a subfolder to GitHub Pages

Sometimes you want to have a subdirectory on the master branch be the root directory of a repository’s gh-pages branch. This is useful for things like sites developed with Yeoman, or if you have a Jekyll site contained in the master branch alongside the rest of your code.

For the sake of this example, let’s pretend the subfolder containing your site is named dist.

Step 1

Remove the dist directory from the project’s .gitignore file (it’s ignored by default by Yeoman).

@wujunchuan
wujunchuan / tmux-cheatsheet.markdown
Last active May 10, 2019 09:23 — forked from ryerh/tmux-cheatsheet.markdown
Tmux 快捷键 & 速查表 #docs

注意:本文内容适用于 Tmux 2.3 及以上的版本,但是绝大部分的特性低版本也都适用,鼠标支持、VI 模式、插件管理在低版本可能会与本文不兼容。

Tmux 快捷键 & 速查表

启动新会话:

tmux [new -s 会话名 -n 窗口名]

恢复会话:

@wujunchuan
wujunchuan / compare_version.js
Last active May 10, 2019 09:19 — forked from puterjam/compare_version.js
判断版本号大小 #js #util
/**
* 判断两个版本字符串的大小
* @param {string} v1 原始版本
* @param {string} v2 目标版本
* @return {number} 如果原始版本大于目标版本,则返回大于0的数值, 如果原始小于目标版本则返回小于0的数值。0当然是两个版本都相等拉。
*/
function compareVersion(v1, v2) {
var _v1 = v1.split("."),
_v2 = v2.split("."),