Skip to content

Instantly share code, notes, and snippets.

@mingyun
mingyun / killbom.php
Created December 14, 2013 06:51
去除BOM头,UTF-8 BOM又叫UTF-8 签名,其实UTF-8 的BOM对UFT-8没有作用,是为了支援UTF-16,UTF-32才加上的BOM,BOM签名的意思就是告诉编辑器当前文件采用何种编码,方便编辑器识别,但是BOM虽然在编辑器中不显示,但是会产生输出,就像多了一个空行via:http://www.oschina.net/code/snippet_162279_10073
if (isset($_GET['dir'])){ //config the basedir
$basedir=$_GET['dir'];
}else{
$basedir = '.';
}
$auto = 1;
//把以下代码保存为:killbom.php,放在要转换的文件根目录下执行即可
checkdir($basedir);
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",
@mingyun
mingyun / bootstrap-ie6.css
Created December 22, 2013 03:06
bsie css 补丁文件
/*!
* Bootstrap v2.2.1
*
* Copyright 2012 Twitter, Inc
* Licensed under the Apache License v2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Designed and built with all the love in the world @twitter by @mdo and @fat.
*/
article,
/* 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;
(function($) {
$.eb = $.eb || {};
// $.eb.ie = function (min,max) {
// // return true;
// if ($.browser.msie) {
// var v = Math.floor($.browser.version);
// if (v >= min && v <= max) {
// return true;
// }
@mingyun
mingyun / underscore.php
Created December 24, 2013 01:03
源自undersocre.js
<?php
/**
* Underscore.php v1.3.1
* Copyright (c) 2011 Brian Haveri
* Underscore.php is licensed under the MIT license
* Underscore.php was inspired by and borrowed from Underscore.js
* For docs, license, tests, and downloads, see: http://brianhaveri.github.com/Underscore.php
*/
@mingyun
mingyun / pinyin.php
Created December 24, 2013 03:39
PHP获取可以用GBK编码的汉字拼音首字母
<?php
/**
* 中文拼音
* 目前仅支持可以以GBK编码的20902个汉字提取拼音首字母
*/
class Spell{
//当前字符
protected $word='';
//资源
protected $source = array();
@mingyun
mingyun / countdown.js
Created December 25, 2013 13:08
jquery倒计时插件
$(document).ready(function () {
/* 延迟函数 */
jQuery.fn.delay = function (time, func) {
return this.each(function () {
setTimeout(func, time);
});
};
jQuery.fn.countDown = function (settings, to) {
settings = jQuery.extend({
startFontSize: '36px',
@mingyun
mingyun / scrolltotop.js
Created December 28, 2013 06:16
to top
var scrolltotop={
setting: {startline:1, scrollto: 0, scrollduration:1000, fadeduration:[500, 100]},
controlHTML: '<img src="http://res.quxue.com/images/upTop.gif" style="width:23px; height:72px" />',
controlattrs: {offsetx:5, offsety:45},
anchorkeyword: '#top',
state: {isvisible:false, shouldvisible:false},
scrollup:function(){
if (!this.cssfixedsupport)
this.$control.css({opacity:0})
var dest=isNaN(this.setting.scrollto)? this.setting.scrollto : parseInt(this.setting.scrollto)