层叠选择器:
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
String.prototype.repeat = function(count) { | |
// Go for it | |
var a = ""; | |
for (var i = count; i > 0; i--) { | |
a += this.valueOf(); | |
} | |
return a; | |
}; | |
//nice | |
String.prototype.repeat = function(count) { |
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 checkBOM ($filename) { | |
global $auto; | |
$contents = file_get_contents($filename); | |
$charset[1] = substr($contents, 0, 1); | |
$charset[2] = substr($contents, 1, 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
var mode="zhuan"; | |
function encode(obj,btn){ | |
if(mode=="zhuan"){ | |
obj.value=obj.value.replace(/[^\u0000-\u00FF]/g,function($0){return escape($0).replace(/(%u)(\w{4})/gi,"\\u$2")}); | |
btn.value="还原"; | |
mode="huan"; | |
}else{ | |
obj.value=unescape(obj.value.replace(/\\u/g,'%u').replace(/;/g,'')); | |
btn.value="转化"; | |
mode="zhuan"; |
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
class Test{ | |
public $a; | |
public $b; | |
public function __construct($a) { | |
$this->a = $a; | |
} | |
} | |
//对象转数组,使用get_object_vars返回对象属性组成的数组 | |
function objectToArray($obj){ | |
$arr = is_object($obj) ? get_object_vars($obj) : $obj;print_r($arr); |
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 | |
/** | |
* 检验药品本位码 | |
* 规则: | |
* 全国产品与服务统一代码由 13位数字本体代码和 1位数字校验码组成 | |
* 第一步:按照由右至左的顺序,确定代码中包括校验码在内的各位代码的代码位置序号(校验码的GB 18937- 2003 | |
* 代码位置序号为 1,其他由右至左依次为 2,3,4,14) ; | |
* 第二步:从代码位置序号为2的位置开始,求所有偶数位代码的和; | |
* 第三步:将第二步的和乘以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
if (isset($_GET['dir'])){ //config the basedir | |
$basedir=$_GET['dir']; | |
}else{ | |
$basedir = '.'; | |
} | |
$auto = 1; | |
//把以下代码保存为:killbom.php,放在要转换的文件根目录下执行即可 | |
checkdir($basedir); | |
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 areaData={"请选择":{val:"",items:{"---":{val:"",items:{"---":""}}}},"北京":{val:"2",items:{"北京":{val:"36",items:{"东城区":"501","西城区":"502","海淀区":"503","朝阳区":"504","崇文区":"505","宣武区":"506","丰台区":"507","石景山区":"508","房山区":"509","门头沟区":"510","通州区":"511","顺义区":"512","昌平区":"513","怀柔区":"514","平谷区":"515","大兴区":"516","密云县":"517","延庆县":"518"}}}},"安徽":{val:"3",items:{"安庆":{val:"37",items:{"迎江区":"399","大观区":"400","宜秀区":"401","桐城市":"402","怀宁县":"403","枞阳县":"404","潜山县":"405","太湖县":"406","宿松县":"407","望江县":"408","岳西县":"409"}},"蚌埠":{val:"38",items:{"中市区":"410","东市区":"411","西市区":"412","郊区":"413","怀远县":"414","五河县":"415","固镇县":"416"}},"巢湖":{val:"39",items:{"居巢区":"417","庐江县":"418","无为县":"419","含山县":"420","和县":"421"}},"池州":{val:"40",items:{"贵池区":"422","东至县":"423","石台县":"424","青阳县":"425"}},"滁州":{val:"41",items:{"琅琊区":"426","南谯区":"427","天长市":"428","明光市":"429","来安县":"430","全椒县":"431","定远县":"432","凤阳县":"433"}},"阜阳":{val:"42",items:{"蚌山区":"434","龙子湖区":"435","禹会区":"436","淮上区":"437","颍州区":"438","颍东区":"439","颍泉区":"440","界首市":"441","临泉县":"442", |
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
/* NAVBAR */ | |
/* !CPU HIGH, fix for IE6 shake when scroll */ | |
* html,* html body { | |
_background-image:url(about:blank); | |
_background-attachment:fixed; | |
} | |
/* !CPU HIGH, fix for IE6 not support fixed position */ | |
.navbar-fixed-top { | |
_position:absolute; |
OlderNewer