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 relative($from, $to, $ps=DIRECTORY_SEPARATOR){ | |
$arFrom = explode($ps, rtrim($from, $ps)); | |
$arTo = explode($ps, rtrim($to, $ps)); | |
while(count($arFrom) && count($arTo) && ($arFrom[0] == $arTo[0])) | |
{ | |
array_shift($arFrom); | |
array_shift($arTo); | |
} | |
return str_pad("", count($arFrom) * 3, '..'.$ps).implode($ps, $arTo); | |
} |
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
/* | |
* this series is write like the title | |
*/ |
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
{ | |
"db":{ | |
"host":"127.0.0.1", | |
"port":3306, | |
"user":"root", | |
"password":"", | |
"database":"crawler" | |
}, | |
"baseSite":"http://s3131212.com/links/" | |
} |
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
$('#loading').ajaxStart(function () { | |
$(this).show(); | |
}); | |
$('#loading').ajaxStop(function () { | |
$(this).hide(); | |
}); | |
$('#send').click(function () { | |
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 drag(o){ | |
var params = { | |
startLeft: 0, | |
startTop: 0, | |
_x: | |
_y: | |
isDrag: false | |
}; | |
params.startLeft = o.currentLeft; |
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 slideshow = { | |
context: false, | |
tabs: false, | |
timeout: 1000, | |
slideSpeed: 1000, | |
tabSpeed: 300, | |
fx: 'scrollLeft' | |
init: function () { | |
this.context = $('#slideshow'); |
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
$('#timer').focus(function(){ | |
// turn on timer | |
startTimer(); | |
}).blur(function(){ | |
// turn off timer | |
endTimer(); | |
}); | |
var lastValue = "", |
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
// ECMAScript 5 | |
function isEmpty(obj){ | |
return Object.getOwnPropertyNames(obj).length === 0; | |
} | |
function isEmpty(obj){ | |
return Object.keys(obj).length === 0; | |
} | |
// compitable |
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 uniqueId = function () { | |
var idCounter = 0; | |
return function(prefix){ | |
var id = ++idCounter + ''; | |
return prefix ? prefix + id : id; | |
} | |
}(); | |
var cid = uniqueId(); // 1 |
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 global = this; | |
})(); |
OlderNewer