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
| [General] | |
| loglevel = notify | |
| skip-proxy = 192.168.0.0/16, 10.0.0.0/8, 172.16.0.0/12,127.0.0.0/24,100.64.0.0/10 | |
| bypass-tun = 192.168.0.0/16, 10.0.0.0/8, 172.16.0.0/12,127.0.0.0/24,100.64.0.0/10 | |
| // DNS OVERRIDE, REMOVE # IF YOU NEED | |
| # dns-server = 223.6.6.6,223.5.5.5,114.114.114.114,114.114.115.115 | |
| [Rule] |
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 output(inp) { | |
| document.body.appendChild(document.createElement('pre')).innerHTML = inp; | |
| } | |
| function syntaxHighlight(json) { | |
| json = json.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>'); | |
| return json.replace(/("(\\u[a-zA-Z0-9]{4}|\\[^u]|[^\\"])*"(\s*:)?|\b(true|false|null)\b|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?)/g, function (match) { | |
| var cls = 'number'; | |
| if (/^"/.test(match)) { | |
| if (/:$/.test(match)) { |
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(window, document, undefined) { | |
| var middle = {}, r = 60, | |
| R = 50, | |
| ctx = (function getContext(width, height) { | |
| var c = document.createElement('canvas'); | |
| c.width = width; | |
| c.height = height; | |
| middle.x = width / 2; | |
| middle.y = height / 2; |
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
| <!--[if IE 6]> | |
| <script type="text/javascript"> | |
| document.execCommand("BackgroundImageCache",false,true); | |
| </script> | |
| <![endif]--> |
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 addFavorite() { | |
| if(document.all) { | |
| try { | |
| window.external.addFavorite(window.location.href, document.title); | |
| } catch(e) { | |
| alert("加入收藏失败,请使用Ctrl+D进行添加"); | |
| } | |
| } else if(window.sidebar) { | |
| window.sidebar.addPanel(document.title, window.location.href, ""); |
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
| <!doctype html> | |
| <html lang="zh-CN"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <title>JavaScript实现图片等比缩放</title> | |
| </head> | |
| <body> | |
| <script type="text/javascript"> | |
| function resize(element, maxWidth, maxHeight){ | |
| if(element.width > maxWidth || element.height > maxHeight){ |
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
| // 防止外部undefined被修改 | |
| // 方法1 | |
| var undefined = 123; | |
| (function(something, foo, undefined) { | |
| // 局部作用域里的 undefined 变量重新获得了 `undefined` 值 | |
| })('Hello World', 42); | |
| // 方法2 | |
| var undefined = 123; | |
| (function(something, foo) { |
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
| // Copyright 2013 The Chromium Authors. All rights reserved. | |
| // Use of this source code is governed by a BSD-style license that can be | |
| // found in the LICENSE file. | |
| /** | |
| * @fileoverview Utilities for rendering most visited thumbnails and titles. | |
| */ | |
| // Copyright 2013 The Chromium Authors. All rights reserved. | |
| // Use of this source code is governed by a BSD-style license that can be |
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 S4() { | |
| return (((1+Math.random())*0x10000)|0).toString(16).substring(1); | |
| } | |
| function NewGuid() { | |
| return (S4()+S4()+"-"+S4()+"-"+S4()+"-"+S4()+"-"+S4()+S4()+S4()); | |
| } |
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 repeat(fn, times, delay) { | |
| return function() { | |
| if(times-- > 0) { | |
| fn.apply(null, arguments); | |
| var args = Array.prototype.slice.call(arguments); | |
| var self = arguments.callee; | |
| setTimeout(function(){self.apply(null,args)}, delay); | |
| } | |
| }; | |
| } |
NewerOlder