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
// Simple JavaScript Templating | |
// John Resig - http://ejohn.org/ - MIT Licensed | |
(function(){ | |
var cache = {}; | |
this.tmpl = function tmpl(str, data){ | |
// Figure out if we're getting a template, or if we need to | |
// load the template - and be sure to cache the result. | |
var fn = !/\W/.test(str) ? | |
cache[str] = cache[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
/* | |
* 频率控制 返回函数连续调用时,fn 执行频率限定为每多少时间执行一次 | |
* @param fn {function} 需要调用的函数 | |
* @param delay {number} 延迟时间,单位毫秒 | |
* @param immediate {bool} 给 immediate参数传递false 绑定的函数先执行,而不是delay后后执行。 | |
* @return {function} 实际调用函数 | |
*/ | |
var throttle = function (fn,delay, immediate, debounce) { | |
var curr = +new Date(),//当前时间 | |
last_call = 0, |
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
@echo off | |
for /l %%i in (1,1,115) do ( | |
@echo %%i... | |
copy sourceFile Path/%%i_DesinationFile | |
) | |
pause |
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
/* | |
list: the array | |
fn: sort fn | |
start: the start index of the sorted range, included | |
end: the end index of the sorted range, excluded | |
means range: [start, end) | |
modify the array itself and return nothing | |
*/ |
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
// http://msdn.microsoft.com/zh-cn/library/ie/bg124132(v=vs.85).aspx | |
epx = window.epx || {}, epx.library = window.epx.library || {}, epx.library.tocFixedModule = function(w, d) { | |
function init() { | |
epx.topic && epx.topic.isPrintExperience() === !0 || ($leftNav = $("#leftNav"), $toc = $("#tocnav"), $footer = $("#ux-footer"), w && d && $leftNav.length !== 0 && $toc.length !== 0 && $footer.length !== 0) && ($(w).scroll(function() { | |
setPosition() | |
}), $(w).resize(function() { | |
setPosition() | |
})) | |
} |
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 _ = function(obj) { | |
if (obj instanceof _) return obj; | |
if (!(this instanceof _)) return new _(obj); | |
this._wrapped = obj; | |
}; |
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
#!/bin/sh | |
# | |
# An example hook script to verify what is about to be committed. | |
# Called by "git commit" with no arguments. The hook should | |
# exit with non-zero status after issuing an appropriate message if | |
# it wants to stop the commit. | |
# | |
# To enable this hook, rename this file to "pre-commit". | |
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
/* from http://www.alloyteam.com/wp-content/themes/alloyteam/style.css */ | |
::-webkit-scrollbar-track-piece { | |
background-color:#f5f5f5; | |
border-left:1px solid #d2d2d2; | |
} | |
::-webkit-scrollbar { | |
width:13px; | |
height:13px; | |
} | |
::-webkit-scrollbar-thumb { |
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 isIE6() { | |
return strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE 6.0'); | |
} | |
# ie6's UA example | |
# Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 6.1; QQDownload 731; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; .NET4.0C; .NET4.0E)3 |
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
$.ui.intersect = function(draggable, droppable, toleranceMode) { | |
if (!droppable.offset) return false; | |
var x1 = (draggable.positionAbs || draggable.position.absolute).left, x2 = x1 + draggable.helperProportions.width, | |
y1 = (draggable.positionAbs || draggable.position.absolute).top, y2 = y1 + draggable.helperProportions.height; | |
var l = droppable.offset.left, r = l + droppable.proportions.width, | |
t = droppable.offset.top, b = t + droppable.proportions.height; | |
switch (toleranceMode) { |