- 使用AdBlock去广告扩展的人,增加一条规则,变成多功能扩展,屏蔽香港域名跳转加入以下自订规则:
||google.com.hk$script
,这样点搜索结果时就不会自动在url里加入google的链接了。注意根据你的搜索引擎是否是hk来去掉规则里面的hk - 打开Chrome,在地址栏键入chrome://net-internals/,在HSTS选项卡下的Domain中输入你想要实现这个强制跳转的域名,例如你Chrome的默认搜索引擎是www.google.com,就在add domain里填写www.google.com,记得在下面的include subdomains打对勾,确保google的二级域名也是加密的,这样跳转结果页也是加密的,然后就可以打开结果页面了
- 将搜索引擎改为
googlestable.com
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 路径转换为标准路径 | |
* @param path | |
* @return {String|XML} | |
*/ | |
getRealPath: function (path) { | |
var DOT_RE = /\/\.\//g, | |
DOUBLE_DOT_RE = /\/[^\/]+\/\.\.\//; | |
// /a/b/./c/./d ==> /a/b/c/d |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Water Canvas by Almer Thie (http://code.almeros.com). | |
* Description: A realtime water ripple effect on an HTML5 canvas. | |
* Copyright 2010 Almer Thie. All rights reserved. | |
* | |
* Example: http://code.almeros.com/code-examples/water-effect-canvas/ | |
* Tutorial: http://code.almeros.com/water-ripple-canvas-and-javascript | |
*/ | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* USAGE: | |
* 外部定义全局变量 RSINFO = { 'path': 'version' } | |
*/ | |
(function (win) { | |
var rslist, | |
RSLIST_KEY = 'rslist', | |
RSINFO = win.RSINFO || {}, | |
isLocalStorageSupported = (function() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 查找当前文件夹及其子文件夹下包含某个字符串的某类型文件 | |
# From http://www.ai7.org/wp/html/653.html | |
find . -name "*.js"|xargs grep require |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// add this inlined to <head> and before all <links> | |
<script> | |
(function(document,navigator,standalone) { | |
// prevents links from apps from oppening in mobile safari | |
// this javascript must be the first script in your <head> | |
if ((standalone in navigator) && navigator[standalone]) { | |
var curnode, location=document.location, stop=/^(a|html)$/i; | |
document.addEventListener('click', function(e) { | |
curnode=e.target; | |
while (!(stop).test(curnode.nodeName)) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*jslint debug: true, | |
undef: false */ | |
;(function(win, doc){ | |
var localStorageName = 'localStorage'; | |
var _util = { | |
isLocalStorageNameSupported: function() { | |
// 加try{}catch(){}的为了防止Firefox浏览器改配置dom.Storage = false时crash掉 | |
try { return (localStorageName in win && win[localStorageName]) } | |
catch(err) { return false } | |
}, |
####stellar.js
代码简单,只有651行,依赖jQuery,配置简便
仓库地址:
https://github.com/markdalgleish/stellar.js
demo地址:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function throttle( fn, time ) { | |
var t = 0; | |
return function() { | |
var args = arguments, ctx = this; | |
clearTimeout(t); | |
t = setTimeout( function() { | |
fn.apply( ctx, args ); | |
}, time ); | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
define(['module'], function (module) { | |
'use strict'; | |
var storage = (function(){ | |
var uid = new Date, | |
result; | |
try { | |
localStorage.setItem(uid, uid); | |
result = localStorage.getItem(uid) == uid; | |
localStorage.removeItem(uid); |