Skip to content

Instantly share code, notes, and snippets.

View Jiang-Xuan's full-sized avatar
😀
Hi~ o(* ̄▽ ̄*)ブ

蒋璇 Jiang-Xuan

😀
Hi~ o(* ̄▽ ̄*)ブ
  • Hangzhou Zhejiang
View GitHub Profile
@Jiang-Xuan
Jiang-Xuan / select-sort.js
Last active June 16, 2017 03:13
JavaScript版本的选择排序算法
/**
* 选择排序算法
* <https://visualgo.net/en/sorting>
*/
let unsortedArray = []
let i = 10
while(i > 0) {
unsortedArray.push(Math.random() * 1000)
i--
@Jiang-Xuan
Jiang-Xuan / bubble-sort.js
Last active June 16, 2017 03:12
JavaScript版本的冒泡排序算法
let unsortedArray = [],
count = 3000
while (count > 0) {
unsortedArray.push(Math.random() * 1000)
count--
}
let swapped = false
@Jiang-Xuan
Jiang-Xuan / insert-sort.js
Last active June 16, 2017 03:12
JavaScript版本的插入排序算法
let unsortedArray = [],
count = 2000
while (count > 0) {
unsortedArray.push(Math.random() * 1000)
count--
}
console.log(unsortedArray)
console.time('insert osrt consume time')
@Jiang-Xuan
Jiang-Xuan / merge-sort.js
Last active June 22, 2017 08:52
Merge sort algorithm writed by JavaScript
let unsortedArray = []
let i = 10000
while(i > 0) {
unsortedArray.push(Math.random() * 1000)
i--
}
function mergeSort(array) {
let length = array.length
@Jiang-Xuan
Jiang-Xuan / quick-sort.js
Last active August 27, 2017 14:22
Quick sort algorithm writed by JavaScript
let unsortedArray = []
let i = 100000
while(i > 0) {
unsortedArray.push(Math.random() * 1000)
i--
}
function quickSort(array, left, right) {
let length = array.length
—– BEGIN LICENSE —–
TwitterInc
200 User License
EA7E-890007
1D77F72E 390CDD93 4DCBA022 FAF60790
61AA12C0 A37081C5 D0316412 4584D136
94D7F7D4 95BC8C1C 527DA828 560BB037
D1EDDD8C AE7B379F 50C9D69D B35179EF
2FE898C4 8E4277A8 555CE714 E1FB0E43

pm2 启动的时候 nodejs 的环境和当前的 nodejs 环境不一致

update                                               (alias) update in-memory PM2 with local PM2

需要用 pm2 update 来刷新内存里面的 pm2

这样的场景通常是因为用了低版本的 nodejs 启动程序, 改代码之后需要用到高版本的特性, 这时候不能用 pm2 restart process.yml 来重启程序.

Using ngrok

First, we'll install a program to expose our local host to the Internet. We'll use ngrok to do this. ngrok is a free download available for all major operating systems.

When you're done with that, you can expose your localhost by running ./ngrok http 4567 on the command line. You should see a line that looks something like this:

Forwarding    http://7e9ea9dc.ngrok.io -> 127.0.0.1:4567
@Jiang-Xuan
Jiang-Xuan / left-and-inline-block.md
Created November 15, 2017 10:09
float: left 和 display: inline-block

float: left 和 display: inline-block 的区别

场景一

最常见的导航栏用ul>li的结构

<ul>
  <li>一致性评价</li>
 申报进度
@Jiang-Xuan
Jiang-Xuan / upgradegit.sh
Created November 15, 2017 15:30
更新 centos 7 的 git 版本
# 安装源
yum install http://opensource.wandisco.com/centos/7/git/x86_64/wandisco-git-release-7-2.noarch.rpm
# 更新 或者是 install git
yum update git