Skip to content

Instantly share code, notes, and snippets.

@fouber
fouber / shadowsocks-check.js
Created November 12, 2016 04:41
shadowsocks-check
var spawn = require('child_process').spawn;
var chalk = require('chalk');
function format(data){
var lost, rtt;
data.replace(/([\d.]+%) packet loss| = ([\d.]+)\/([\d.]+)\/([\d.]+)\/([\d.]+) ms/g, function(m, $1, $2, $3, $4, $5){
if($1){
lost = $1;
} else if($3) {
rtt = $3
(function() {
var I0 = void 0
, C0 = !0
, D0 = null
, A0 = !1
, x0 = encodeURIComponent
, w0 = window
, t0 = document
, B0 = Math
, s1 = navigator
(function(N, IA, JA, $, KA, hl, Dj, LA, Ej, MA, m, Sa, il, NA, Fj, vs, OA, PA, QA, RA, I, SA, TA, UA, va, VA, jl, WA, ff, XA, Ng, kl, YA, ZA, $A, aB, ws, xs, bB, ys, cB, dB, U, eB, Mo, fB, Kc, gB, zs, Lc, hB, ll, hd, iB, jB, id, kB, No, Wb, P, zd, lB, r, mB, As, Bs, Cs, Ds, Es, Aa, Mc, nB, R, yc, Nc, oB, Yh, pB, ml, qB, Gj, Hf, Fs, nl, Oa, Oo, If, Zh, Po, Gs, rB, sB, tB, uB, Eb, vB, Hs, Og, Is, wB, Qo, ol, pl, ql, xB, T, Hj, Jf, Pg, $h, yB, zB, V, Kf, Ij, Qg, Ro, AB, Js, BB, Lf, Ks, Mf, rl, CB, Rg, sl, DB, EB, FB, ue, Da, bc, tl, Fb, ul, Ls, Ms, lc, GB, ve, Ns, mc, Os, Ps, Qs, gf, ai, So, Ad, jd, Rs, Oc, HB, Nf, Ga, IB, Of, Ss, Ts, Us, JB, Ib, nc, Ab, KB, Vs,
Pc, Qc, Rc, we, bi, tb, vl, Ws, Xs, LB, Pf, MB, ha, To, Uo, Bd, NB, wl, OB, q, Ys, Zs, Vo, $s, xl, ci, at, Wo, bt, ct, di, Bb, dt, et, ft, gt, xe, Sg, Cd, yl, ye, Xo, ei, ht, Qf, Pb, Yo, Zo, cb, Tg, it, fi, Jj, zl, Al, Bl, Pa, Rf, Cl, Sf, $o, PB, Dl, wb, jt, gi, El, kt, Fl, Sc, cc, Tf, Gl, Dd, QB, ap, bp, Kj, ba, ub, lt, mt, nt, ot, pt, Hl, qt, Lj, E
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>hello world</title>
<script type="text/javascript">
//这里是防御用js,写在页面的最开始
//在这个js之后执行的任何addEventListener方法都将被监控
(function(){
var raw_fn = Element.prototype.addEventListener;
@fouber
fouber / fis-conf.js
Last active August 29, 2015 14:01
fis core
/*******************************************
* 实际使用展示,用户配置文件 fis-conf.js
*******************************************/
//后缀映射
fis.config.merge({
roadmap : {
ext : {
coffee : 'js',
less : 'css',
@fouber
fouber / ppt.md
Created March 29, 2014 05:40
ppt
  • fis-conf.js
    • version
    • name
  • index.js
    • express
  • package.json
  • views
    • index.html
    • index.js(uri, inline)
  • index.css(inline, livereload)
/*==========[ 构建工具核心逻辑 ]==========*/
//默认配置
var defaultConfig = {
plugins : [ 'parse', 'optimize', 'lint', 'test' ]
};
var sys = {
find : function(){/*查找所有项目文件*/},
get : function(key){/*获取配置*/},
@fouber
fouber / Resource.java
Last active January 2, 2016 19:09
static resource managment system
package com.baidu.fis;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
@fouber
fouber / install-php.sh
Last active December 29, 2015 01:39
install php-cgi
#!/bin/bash
echo
set -e
trap 'echo Error on line $BASH_SOURCE:$LINENO' ERR
trap 'rm -f $tmp' EXIT
if [ -z $2 ]
then