This file contains 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
var some = Array.prototype.some; | |
function hasClass1(name){ | |
if (!name) { | |
return false | |
} | |
return some.call(this, function(el){ | |
return this.test(el.className) | |
}, new RegExp('(^|\\s)' + name + '(\\s|$)')); |
This file contains 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(document) { // title提示 | |
var titleTime; | |
var oldTitle = document.title; | |
var shortcut = document.getElementById('shortcut'); | |
document.addEventListener('visibilitychange', function() { | |
if (document.hidden) { | |
document.title = '(●—●)咦,去哪儿啊?'; | |
clearTimeout(titleTime); | |
shortcut.href = 'images/fail.ico'; |
This file contains 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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Test Suite</title> | |
<style> | |
#results li.pass {color: green;} | |
#results li.fail {color: red;} | |
</style> | |
</head> |
This file contains 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
var nodes = document.getElementsByTagName("*"); | |
var events = []; | |
ev = lookEvents(document); | |
if (ev) { | |
events.push({el: document, ev: ev}); | |
} | |
for (var i=0, l=nodes.length; i<l; i++) { | |
var ev = lookEvents(nodes[i]); |
This file contains 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
<?php | |
$headers = [ // 构造IP | |
'CLIENT-IP: 8.8.8.8', | |
'X-FORWARDED-FOR: 8.8.8.8', | |
]; | |
$ch = curl_init(); | |
curl_setopt($ch, CURLOPT_URL, 'http://127.0.0.1:8000/server.php'); | |
curl_setopt($ch, CURLOPT_REFERER, 'http://www.baidu.com/'); // 构造来路 |
This file contains 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
// 源: https://sf-static.b0.upaiyun.com/v-5703995e/global/js/debug.js | |
/* | |
监控js错误并上报 | |
wtser@sf.gg | |
*/ | |
window.onerror = function(msg, url, line, col, error) { | |
if (msg !== "Script error." && !url) { | |
return true; | |
} |
This file contains 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
<img src="data:image/gif;base64,R0lGODlhAQABAIAAAAUEBAAAACwAAAAAAQABAAACAkQBADs="> |
This file contains 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
# Ignore all test and documentation for archive | |
/.gitattributes export-ignore | |
/.gitignore export-ignore | |
/.travis.yml export-ignore | |
/tests export-ignore | |
/docs export-ignore |
This file contains 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(window, undefined) { | |
// 编码 | |
function encode(str) { | |
return encodeURIComponent(JSON.stringify(str)); | |
} | |
// 解码 | |
function decode(str) { | |
if (undefined == str) { |
This file contains 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
var s = performance.now(); | |
/** | |
* Copyright (c) 2014-2015, Facebook, Inc. | |
* All rights reserved. | |
* | |
* This source code is licensed under the BSD-style license found in the | |
* LICENSE file in the root directory of this source tree. An additional grant | |
* of patent rights can be found in the PATENTS file in the same directory. | |
*/ | |
(function () { 'use strict';var SLICE$0 = Array.prototype.slice; |
OlderNewer