Skip to content

Instantly share code, notes, and snippets.

View fengmk2's full-sized avatar
🐢
Coding for fun

MK (fengmk2) fengmk2

🐢
Coding for fun
View GitHub Profile
@fengmk2
fengmk2 / test.html
Created June 13, 2015 03:15
test html
<!DOCTYPE html> <html> <head> <meta charset="gb2312"> <meta http-equiv="X-UA-Compatible" content="IE=edge" /> <title>支付宝 知托付!</title> <meta name="keywords" content="支付宝,电子支付/网上支付/安全支付/手机支付,安全购物/网络购物付款/付款/收款,水电煤缴费/信用卡还款/AA收款,支付宝网站"> <meta name="description" content="支付宝,全球领先的独立第三方支付平台,致力于为广大用户提供安全快速的电子支付/网上支付/安全支付/手机支付体验,及转账收款/水电煤缴费/信用卡还款/AA收款等生活服务应用。"> <!--[if lte IE 7]>
<script type="text/javascript">
window.location.href = 'https://www.alipay.com/x/kill-ie.htm';
</script>
<![endif]--> <link href="https://a.alipayobjects.com" rel="dns-prefetch" /> <link href="https://app.alipay.com" rel="dns-prefetch" /> <link href="https://my.alipay.com" rel="dns-prefetch" /> <link href="https://lab.alipay.com" rel="dns-prefetch" /> <link href="https://cashier.alipay.com" rel="dns-prefetch" /> <link href="https://financeprod.alipay.com" rel="dns-prefetch" /> <link href="https://shenghuo.alipay.com" rel="dns-prefetch" /> <script type="text/javascript">
window._to = { start: new Date() };
</script> <script typ
$ cat mirrors/nodejs_stdout.log
[Tue Jan 20 2015 13:48:58 GMT+0800 (CST)] [worker:22680] new worker start
[Tue Jan 20 2015 13:49:01 GMT+0800 (CST)] [worker:22680] Server started, dist server listen at 127.0.0.1:7003, cluster: true
Error: read ECONNRESET
at exports._errnoException (util.js:742:11)
at TCP.onread (net.js:535:26)
[error] 2015-01-21 08:32:51.981 nodejs.ECONNRESETErrorException: Error: read ECONNRESET
at exports._errnoException (util.js:742:11)
at TCP.onread (net.js:535:26)
pid: 22680
@fengmk2
fengmk2 / co-leak.js
Last active February 19, 2016 19:30
co memory leak again
// "co": "~4.1.0",
var co = require('co');
var urllib = require('urllib');
var count = 0;
co(function* () {
while (true) {
try {
yield urllib.request('http://cnpmjs.org/mirrors/apis/iojs');
} catch (err) {
console.error(err);
@fengmk2
fengmk2 / getqujing.md
Last active August 29, 2015 14:13
my qujing proxy sites
//
// Regular Expression for URL validation
//
// Author: Diego Perini
// Updated: 2010/12/05
// License: MIT
//
// Copyright (c) 2010-2013 Diego Perini (http://www.iport.it)
//
// Permission is hereby granted, free of charge, to any person
@fengmk2
fengmk2 / http-errors-bench.js
Last active August 29, 2015 14:13
http-errors benchmark
var createError = require('http-errors');
var start = Date.now();
var count = 100000;
for (var i = 0; i < count; i++) {
createError(401, 'Please login to view this page.', {
stat: 'foo error',
errors: [
{
foo: 'bar',
@fengmk2
fengmk2 / vpnup-aws.sh
Created December 29, 2014 10:53
小米 vpn 翻墙自动路由记录
# for instagram, Amazon EC2
# https://forums.aws.amazon.com/ann.jspa?annID=1701
# US East (Northern Virginia):
route add -net 72.44.32.0/19 gw $VPNGW
route add -net 67.202.0.0/18 gw $VPNGW
route add -net 75.101.128.0/17 gw $VPNGW
route add -net 174.129.0.0/16 gw $VPNGW
route add -net 204.236.192.0/18 gw $VPNGW
route add -net 184.73.0.0/16 gw $VPNGW
route add -net 184.72.128.0/17 gw $VPNGW
@fengmk2
fengmk2 / oss.js
Created September 19, 2014 07:22
var ots = require('ots');
var client = ots.createClient({
accessID: 'your accessID',
accessKey: 'your accessKey'
});
// create a table
client.createTable({
TableName: 'testdemo',
PrimaryKey: [
@fengmk2
fengmk2 / agenthttps.js
Created August 28, 2014 11:07
agent https keepalive
/*!
* agentkeepalive - test/https_agent.test.js
*
* Copyright(c) 2012 - 2013 fengmk2 <fengmk2@gmail.com>
* MIT Licensed
*/
"use strict";
/**
@fengmk2
fengmk2 / totoro.puml
Last active August 29, 2015 14:03
How totoro work
@startuml
node "totoro users" {
[totoro cli]
}
node "browsers" {
[chrome]
[firefox]
[phantomjs]