This file contains hidden or 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
/* | |
* 在Android4.x中,使用line-height = height,并不能将placeholder内容居中,需要是用line-height:normal,由系统自动计算 | |
*/ | |
input{ | |
line-height:normal; | |
} |
This file contains hidden or 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 path = '/js/' | |
var scripts = [ | |
'jQuery.min.js', | |
'common.js' | |
]; | |
var temp = []; | |
for (var i = 0; i < scripts.length; i ++) { |
This file contains hidden or 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
# 安全的鉴权方式 | |
_对appKey用时间戳进行加盐处理_ | |
``` | |
我们服务端目前支持一种新的 API 鉴权方式,用户仍然需要传递X-AVOSCloud-Application-Id的 http 头表示 App id,但是不需要再传递X-AVOSCloud-Application-Key。 | |
替代地,增加了新 HTTP 头部——X-AVOSCloud-Request-Sign头,它的值要求是一个形如sign,timestamp[,master]的字符串,其中: | |
timestamp(必须) - 客户端产生本次请求的 unix 时间戳,精确到毫秒。 |
This file contains hidden or 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
# 备份关联id | |
UPDATE `cats` SET temp_cat_id = cat_id | |
# 动态更新新关联id | |
UPDATE cats parent,cats child | |
SET child.parent_cat_id = parent.cat_id | |
WHERE child.parent_cat_id = parent.temp_cat_id | |
AND child.parent_cat_id <> 0 |
This file contains hidden or 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
@media all and (orientation: landscape) { | |
// style coding | |
} |
This file contains hidden or 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
$.ajax( 'api.demo.com/api' ,{ | |
type: 'POST', | |
data: { | |
dateType: hasDateType ? DateType : undefined | |
}, | |
dataType: 'json', | |
success: function(resp){ | |
} | |
}) |
This file contains hidden or 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 | |
function _countWorkDate(){ | |
$arrayDays = []; // 计算周期内总工作日 | |
$holiday = array( | |
'2013-01-01','2013-01-02','2013-01-03', | |
'2013-02-09','2013-02-10','2013-02-11','2013-02-12','2013-02-13','2013-02-14','2013-02-15', | |
'2013-04-04','2013-04-05','2013-04-06', | |
'2013-04-29','2013-04-30','2013-05-01', | |
'2013-06-10','2013-06-11','2013-06-12', | |
'2013-09-19','2013-09-20','2013-09-21', |
This file contains hidden or 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 | |
/* | |
* UserAgent 匹配Android和iOS,并获得对于的版本号 | |
*/ | |
function match($ua){ | |
if( strpos($ua, 'Android')){// 匹配 Android | |
preg_match('/(Android)[\/ ]([\d._]+)/', $ua, $match); | |
}else if( strpos($ua, 'Mobile')){// 匹配 iOS | |
preg_match('/(OS) ([\d._]+)/', $ua, $match); | |
}else{ |
This file contains hidden or 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
Array.prototype.unique = function(){ | |
var results=this.sort();/*排序*/ | |
for ( var i = 1; i < results.length; i++ ) { | |
if ( results[i] === results[ i - 1 ] ) { | |
results.splice( i--, 1 );/*删除相邻相同元素*/ | |
} | |
} | |
return results; | |
}; |
This file contains hidden or 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 loadScript (doc, type, src, callback) { | |
var script = doc.createElement('script'); | |
script.type = type ? type : 'application/javascript'; | |
script.onload = callback; | |
script.src = src; | |
doc.head.appendChild(script); | |
} |