Skip to content

Instantly share code, notes, and snippets.

View fakefish's full-sized avatar
🍎
Focusing

王佳裕 fakefish

🍎
Focusing
View GitHub Profile
# 规则配置仅供参考,适用于 1.2.0 (476) 及其后续版本;
# 包含 Proxy Group、URL Rewrite 特性;
# 包含 Reject 规则,用于拦截广告、行为分析、数据统计;
# 屏蔽 Hao123、百度搜索,放行百度地图、百度外卖、百度音乐、百度云盘、百度百科。
[General]
# warning, notify, info, verbose
skip-proxy = 192.168.0.0/16, 10.0.0.0/8, 172.16.0.0/12, 100.64.0.0/10, localhost, *.local
bypass-tun = 0.0.0.0/8, 192.168.0.0/16, 10.0.0.0/8, 172.16.0.0/12
loglevel = notify
@fakefish
fakefish / byteLen.js
Created June 13, 2014 09:26
取得一个字符串所有字节的长度
function byteLen(target) {
var byteLength = target.length, i = 0;
for (; i < target.length; i++) {
if (target.charCodeAt(i) > 255) {
byteLength++;
}
}
return byteLength;
}
@fakefish
fakefish / repeat.js
Created June 13, 2014 08:31
将一个字符串重复自身N次
// repeat string like repeat('ruby',2) get rubyruby
// version 1
function repeat(target, n) {
return (new Array(n+1)).join(target);
}
// version 2
function repeat(target, n) {
return Array.pototype.join.call({
length: n + 1
@fakefish
fakefish / learn.swift
Last active August 29, 2015 14:02
some code of swift
var myVariable = 42
let myVariable = 42
let explicitDouble: Double = 70
let lable = "The width is "
let width = 94
let widthLable = label + String(width)
let apples = 3
let oranges = 5
@fakefish
fakefish / 1.2对象拓展.js
Last active August 29, 2015 14:00
javascript框架设计 读书笔记
// a simple object extend function
function extend(destination, source) {
for (var property in source) {
destination[property] = source[property];
return destination;
}
}
// emulation Object.keys
Object.keys = Object.keys || function(obj) {
[
{
name:"HTML5",
uri:"http://www.w3.org/TR/html5/single-page.html",
category:"markup"
},
{
name:"HTML 5.1",
uri:"http://www.w3.org/TR/html51/single-page.html",
category:"markup"
data:text/html,
<style type="text/css">
#e {
position:absolute;
top:0;
right:0;
bottom:0;
left:0;
font-size:16px;
}