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).

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
<script id="jsbin-javascript">
console.clear();
@wujunchuan
wujunchuan / transaction.json
Created July 11, 2019 11:45
eos transaction result
{
"type": 0,
"data": {
"transaction_id": "82754ee125b14dc09295f455612a555e4613f05fbaa60ae6a3bba9cfd523fcf0",
"processed": {
"elapsed": 2265,
"receipt": {
"status": "executed",
"net_usage_words": 18,
"cpu_usage_us": 2265
@wujunchuan
wujunchuan / .zshrc
Last active May 6, 2023 13:26
My config files
# If you come from bash you might have to change your $PATH.
# Golang config
export GOPATH=$HOME/go
export PATH=$HOME/bin:/usr/local/bin:$PATH:$HOME/qiniu:/usr/local/opt/go/libexec/bin:$GOPATH/bin
export ARIA_PATH=$HOME/.aria2
export JAVA_HOME='/Library/Java/JavaVirtualMachines/jdk1.8.0_181.jdk/Contents/Home'
export CLASSPATH=$CLASSPATH:$JAVA_HOME/lib/algs4.jar
export ZPLUG_HOME=/usr/local/opt/zplug
source $ZPLUG_HOME/init.zsh
# export ANDROID_HOME=$HOME/Library/Android/sdk
@wujunchuan
wujunchuan / svimrc.js
Last active May 23, 2019 11:27
sVim config #config
hintcharacters = 'sadfjklewcmpgh';
let fullpagescrollpercent = 100
let lastactivetablimit = 50;
let lastclosedtablimit = 50;
let scrollduration = 25
let scrollstep = 65
let zoomstep = 15
let homeurl = "http://google.com";
let mapleader = ","
let newtaburl = "http://google.com"
@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 / dedupe.js
Last active May 10, 2019 09:18
数组去重 Array dedupe #js #util
// 利用ES6的Set数据结构来数组去重
// 方法1
let array = [1,2,2,2,1,2,2,3,4];
function dedupe(array) {
return Array.from(new Set(array));
}
var a = dedupe(array);
console.log(a);//[ 1, 2, 3, 4 ]
//方法二 利用语法糖 ...
// 其实就是内部的一个for..of 循环
@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("."),