Skip to content

Instantly share code, notes, and snippets.

View libo1106's full-sized avatar

libo libo1106

View GitHub Profile
@libo1106
libo1106 / landscape.css
Created February 8, 2014 08:04
横屏样式
@media all and (orientation: landscape) {
// style coding
}
@libo1106
libo1106 / transfer.sql
Last active August 29, 2015 13:56
数据库迁移,关联ID处理
# 备份关联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
@libo1106
libo1106 / gist:9192057
Created February 24, 2014 16:50
安全的HTTP鉴权方式
# 安全的鉴权方式
_对appKey用时间戳进行加盐处理_
```
我们服务端目前支持一种新的 API 鉴权方式,用户仍然需要传递X-AVOSCloud-Application-Id的 http 头表示 App id,但是不需要再传递X-AVOSCloud-Application-Key。
替代地,增加了新 HTTP 头部——X-AVOSCloud-Request-Sign头,它的值要求是一个形如sign,timestamp[,master]的字符串,其中:
timestamp(必须) - 客户端产生本次请求的 unix 时间戳,精确到毫秒。
@libo1106
libo1106 / gist:9243272
Created February 27, 2014 02:38
all.min.js
(function(){
var path = '/js/'
var scripts = [
'jQuery.min.js',
'common.js'
];
var temp = [];
for (var i = 0; i < scripts.length; i ++) {
@libo1106
libo1106 / gist:9458641
Created March 10, 2014 02:46
Android 4.x placeholder line-height 对齐问题
/*
* 在Android4.x中,使用line-height = height,并不能将placeholder内容居中,需要是用line-height:normal,由系统自动计算
*/
input{
line-height:normal;
}
@libo1106
libo1106 / gist:9734344
Last active August 29, 2015 13:57
BattleCamp平均值计算
function bc($doms){
var result = {
pr:0,
hp:0,
attack:0,
recovery:0,
feed:0
}
var length = 0;
@libo1106
libo1106 / gist:9778670
Last active August 29, 2015 13:57
$HTTP_RAW_POST_DATA
<?php
$array_temp = explode( '&', $HTTP_RAW_POST_DATA);
$array_post = [];
if(isset($_REQUEST['mood'])){
$mood = $_REQUEST['mood'];
}else{
// 构造原始POST数组
foreach($array_temp as $val){
@libo1106
libo1106 / gist:9888697
Created March 31, 2014 09:29
SecureCRT 大文件上传
rz -be
@libo1106
libo1106 / gist:10438066
Created April 11, 2014 02:38
绝对定位元素水平垂直居中
.element {
width: 600px; height: 400px;
position: absolute; left: 0; top: 0; right: 0; bottom: 0;
margin: auto; /* 有了这个就自动居中了 */
}
@libo1106
libo1106 / gist:11206721
Created April 23, 2014 08:17
去除IE6\IE7 input button元素value值两边留白
input,button{overflow:visible;}