Skip to content

Instantly share code, notes, and snippets.

View aizigao's full-sized avatar
😎

aizigao

😎
View GitHub Profile
@aizigao
aizigao / README.md
Created November 18, 2020 15:50 — forked from chuyik/README.md
macOS 给 Git(Github) 设置代理(HTTP/SSH)
@aizigao
aizigao / lodashGetAlternative.js
Created June 11, 2018 01:37 — forked from jeneg/lodashGetAlternative.js
Alternative to lodash get method _.get()
function get(obj, path, def) {
var fullPath = path
.replace(/\[/g, '.')
.replace(/]/g, '')
.split('.')
.filter(Boolean);
return fullPath.every(everyFunc) ? obj : def;
function everyFunc(step) {
@aizigao
aizigao / version.js
Created January 9, 2018 05:39
js 对比版本号
const isNewVersion = (oldStr, newStr, contrastIdx = 0) => {
const oldArr = [0, 0, 0]
const newArr = [0, 0, 0]
oldArr.splice(0, oldStr.split('.').length, ...oldStr.split('.'))
newArr.splice(0, newStr.split('.').length, ...newStr.split('.'))
const oldTag = parseInt(newArr[contrastIdx], 10)
const newTag = parseInt(oldArr[contrastIdx], 10)
if (oldTag === newTag) {
if (contrastIdx === 2) {
@aizigao
aizigao / gist:98daabc43c93db7414a7c4af30a1a36c
Last active January 9, 2018 05:37
生成测试用https 的ssl,chrome 57版本之后版本

生成https 的ssl

  • shell
openssl req \
    -newkey rsa:2048 \
    -x509 \
    -nodes \
 -keyout server.key \
@aizigao
aizigao / gist:5fc41d1eebbffc137b3d57581b224d87
Created January 9, 2018 05:37
生成测试用https 的ssl,chrome 57版本之后版本
# 生成https 的ssl
* shell
```
openssl req \
-newkey rsa:2048 \
-x509 \
-nodes \
-keyout server.key \
@aizigao
aizigao / 0_reuse_code.js
Created February 7, 2017 08:14
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console