Skip to content

Instantly share code, notes, and snippets.

View jinwyp's full-sized avatar

Jin jinwyp

View GitHub Profile
@jinwyp
jinwyp / npm.taobao.sh
Created November 8, 2018 10:34 — forked from 52cik/npm.taobao.sh
npm 淘宝镜像配置
npm set registry https://registry.npm.taobao.org # 注册模块镜像
npm set disturl https://npm.taobao.org/dist # node-gyp 编译依赖的 node 源码镜像
## 以下选择添加
npm set sass_binary_site https://npm.taobao.org/mirrors/node-sass # node-sass 二进制包镜像
npm set electron_mirror https://npm.taobao.org/mirrors/electron/ # electron 二进制包镜像
npm set puppeteer_download_host https://npm.taobao.org/mirrors # puppeteer 二进制包镜像
npm set chromedriver_cdnurl https://npm.taobao.org/mirrors/chromedriver # chromedriver 二进制包镜像
npm set operadriver_cdnurl https://npm.taobao.org/mirrors/operadriver # operadriver 二进制包镜像
npm set phantomjs_cdnurl https://npm.taobao.org/mirrors/phantomjs # phantomjs 二进制包镜像
@jinwyp
jinwyp / regex.js
Created July 6, 2018 03:20 — forked from Integralist/regex.js
The difference between JavaScript's `exec` and `match` methods is subtle but important, and I always forget...
var str = "The quick brown fox jumped over the box like an ox with a sox in its mouth";
str.match(/\w(ox)/g); // ["fox", "box", "sox"]
// match (when used with a 'g' flag) returns an Array with all matches found
// if you don't use the 'g' flag then it acts the same as the 'exec' method.
str.match(/\w(ox)/); // ["fox", "ox"]
/\w(ox)/.exec(str); // ["fox", "ox"]
@jinwyp
jinwyp / quicksort
Created May 19, 2018 10:37 — forked from ideawu/quicksort
快速排序QuickSort算法JavaScript实现, 包括 Hoare 和 Lomuto 版本的实现,以及网友实现版本的对比
<html>
<body>
<script>
// @author: ideawu
// @link: http://www.ideawu.net/blog/archives/1021.html
var swap_count = 0;
var cmp_count = 0;
// https://gist.github.com/wintercn/c30464ed3732ee839c3eeed316d73253
function wintercn_qsort(arr, start, end){
@jinwyp
jinwyp / aa.js
Last active March 15, 2017 14:35
nodejs callback promise recursion
var bb = require('./bb.js');
var cc = require('./cc.js');
module.exports = function(){
console.log('-------- aa ----------')
};
@jinwyp
jinwyp / update_gfwlist.sh
Created August 4, 2016 14:33 — forked from VincentSit/update_gfwlist.sh
Automatically update the PAC for ShadowsocksX. Only tested on OS X.
#!/bin/bash
# update_gfwlist.sh
# Author : VincentSit
# Copyright (c) http://xuexuefeng.com
#
# Example usage
#
# ./whatever-you-name-this.sh
#
# Task Scheduling (Optional)
@jinwyp
jinwyp / firewall.sh
Created December 12, 2013 05:14 — forked from x1a0/firewall.sh
#! /bin/bash
# Set the default policies to allow everything while we set up new rules.
# Prevents cutting yourself off when running from remote SSH.
iptables -P INPUT ACCEPT
iptables -P FORWARD ACCEPT
iptables -P OUTPUT ACCEPT
# Flush any existing rules, leaving just the defaults
iptables -F

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
Binxing Fang, http://en.wikipedia.org/wiki/Fang_Binxing
方滨兴,中国工程院院士,北京邮电大学教授,中国科学院计算技术研究所网 络方向首席科学家。
Gang Xiong, http://rd.springer.com/search?facet-author=%22Gang+Xiong%22
熊刚, 高级工程师, 研究方向为信息安全。E-mail: xionggang@ict.ac.cn。
Weili Han, http://crypto.fudan.edu.cn/people/weili/
韩伟力, http://homepage.fudan.edu.cn/wlhan/en
This is just my personal gist clip.
@jinwyp
jinwyp / moment-holidays.js
Created November 25, 2015 09:04 — forked from jrhames/moment-holidays.js
Holidays plugin for Moment.JS
//## Moment.JS Holiday Plugin
//
//Usage:
// Call .holiday() from any moment object. If date is a US Federal Holiday, name of the holiday will be returned.
// Otherwise, return nothing.
//
// Example:
// `moment('12/25/2013').holiday()` will return "Christmas Day"
//
//Holidays: