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() { | |
var cache = {}; | |
this.tmpl = function(str, data) { | |
cache[str] = cache[str] || | |
new Function('data', [ | |
'var _p="";\nwith(arguments[0]||{}){\n_p+="', | |
str.replace(/"/g, '\\$&') | |
.replace(/[\r\n]/g, '') | |
.replace(/<%([^\w\s\}\)]*)\s*(.*?)\s*%>/g, function(match, mark, code) { | |
if (mark === '=') return '"+(' + code + ')+"'; |
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 StartTagToken(){ | |
} | |
function EndTagToken(){ | |
} | |
function Attribute(){ | |
} | |
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 randomColor(){ | |
return "rgb("+Math.floor(Math.random()*255)+","+Math.floor(Math.random()*255)+","+Math.floor(Math.random()*255)+")"; | |
} | |
function showBoxes(window) { | |
var rects = []; | |
function getRects(node){ | |
var range = window.document.createRange(); | |
range.setStartBefore(node); | |
range.setEndAfter(node); |
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
p:nth-child(1) { | |
font-size: 12px; | |
margin: 20px; | |
width: 200px; | |
height: 150px; | |
-webkit-hyphens: auto; | |
-webkit-shape-inside: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%); | |
overflow: hidden; | |
} |
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
data:text/html, <style type="text/css">#e{position:absolute;top:0;right:0;bottom:0;left:0;}</style><div id="e"></div><script src="http://d1n0x3qji82z53.cloudfront.net/src-min-noconflict/ace.js" type="text/javascript" charset="utf-8"></script><script>var e=ace.edit("e");e.setTheme("ace/theme/monokai");e.getSession().setMode("ace/mode/ruby");</script> |
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 config = require('./config.js'), | |
xml2js = require('xml2js'), | |
http = require('http'); | |
var baiduZm = function() { | |
this.root = "box.zhangmen.baidu.com"; | |
}; | |
baiduZm.prototype = { | |
constructor: baiduZm, |
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 foreRequire(module) { | |
delete require.cache[path.resolve(module)]; | |
return require(module); | |
} |
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
/* | |
* @name:LevenshteinDistance.js | |
* @description: | |
* @author:[email protected] | |
* @date:2012-04-17 | |
* @param: | |
* @todo: | |
* @changelog: | |
*/ | |
var LevenshteinDistance = { |
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
/** | |
* Enable route to __noSuchMethod__ when unknown method calling. | |
* | |
* @param {Object} obj Target object. | |
* @return {Object} | |
*/ | |
function enableMethodMissing(obj) { | |
var functionHandler = createBaseHandler({}); | |
functionHandler.get = function(receiver, name) { |