Skip to content

Instantly share code, notes, and snippets.

View fuchao2012's full-sized avatar
🎯
Focusing

zheng fuchao2012

🎯
Focusing
View GitHub Profile
@fuchao2012
fuchao2012 / index.php
Created June 15, 2015 05:09
set the time zone to china
/*
* -------------------------------------------------------------------
* Set the time zone to china
* -------------------------------------------------------------------
*/
date_default_timezone_set('Asia/Shanghai');
@fuchao2012
fuchao2012 / FUCK
Created June 16, 2015 14:44
IMPORTENT
The most importent thing in develop is not git your code !
it's back up your database tables!!!!!
FUCK the windows system!
@fuchao2012
fuchao2012 / mobile design
Created June 21, 2015 06:43
mobile design cheetsheet
如果你是一名前端er,又想在移动设备上开发出自己的应用,那怎么实现呢?幸好,webkit内核的浏览器能帮助我们完成这一切。接触 webkit webApp的开发已经有一段时间了,现把一些技巧分享给大家 :
1. viewport:
也就是可视区域。对于桌面浏览器,我们都很清楚viewport是什么,就是出去了所有工具栏、状态栏、滚动条等等之后用于看网页的区域,
这是真正有效的区域。由于移动设备屏幕宽度不同于传统web,因此我们需要改变viewport;
实际上我们可以操作的属性有4 个:
width - // viewport 的宽度 (范围从200 到10,000,默认为980 像素)
height - // viewport 的高度 (范围从223 到10,000)
@fuchao2012
fuchao2012 / contract
Created June 26, 2015 03:49
contract string in excel
Excel 2013 单元格字符串连接需要用到「””」及「&」两个重要的符号运用,透过「””」将文字及特殊符号包起来,再用「&」串接单元格,即可进行基本的文字符串接工作。Excel 2013 单元格字符串连接需要用到「””」及「&」两个重要的符号运用,透过「””」将文字及特殊符号包起来,再用「&」串接单元格,即可进行基本的文字符串接工作。
="http://www.baidu.com"&K2&"?key=fuck";
notice:
公式里面不要出现空格
@fuchao2012
fuchao2012 / jump
Created June 26, 2015 04:40
jump from wechat into app store
//1. find out which device you are using:
var browser = {
versions: function () {
var u = navigator.userAgent, app = navigator.appVersion;
return { //移动终端浏览器版本信息
ios: !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/), //ios终端
android: u.indexOf('Android') > -1 || u.indexOf('Linux') > -1, //android终端或uc浏览器
iPhone: u.indexOf('iPhone') > -1, //是否为iPhone或者QQHD浏览器
iPad: u.indexOf('iPad') > -1, //是否iPad
};
@fuchao2012
fuchao2012 / echartsfilter
Created June 29, 2015 10:04
data filter for echarts maps
formatter:function(p){
var ass = p[0],add=p[1].split(' '),aqi=p[2];
if(ass){
return add[2] + ' AQI ' + aqi + '<br/>空气质量 ' + ass;
}else{
return String(p).replace(/,*-*/g,'');
}
}
@fuchao2012
fuchao2012 / alter table
Created July 1, 2015 04:49
alter table column type
ALTER TABLE apipic CHANGE text text VARCHAR(1024);
# desc:
# alter table <table name> change <column name> <column name> <new type>;
@fuchao2012
fuchao2012 / export
Created July 2, 2015 03:48
mysql export data or structures
mysqldump --opt -d 数据库名 -u root -p > xxx.sql
mysqldump -t 数据库名 -uroot -p > xxx.sql 
mysqldump 数据库名 -uroot -p > xxx.sql 
mysqldump -uroot -p -B 数据库名 --table 表名 > xxx.sql  
mysql 数据库名 < 文件名
source /tmp/xxx.sql 
@fuchao2012
fuchao2012 / gist:cc578be11d5dc0364cb6
Created July 2, 2015 06:04
aliyun install lamp script

===download the script===

http://market.aliyun.com/products/53690006/cmgj000262.html?spm=5176.775974333.2.4.WgIcs1

===install manual=== upload the package into your server then find it.

chmod –R 777 sh-1.5.0
cd sh-1.5.0 ./install.sh
@fuchao2012
fuchao2012 / def
Created July 3, 2015 06:52
model vs schema
a schema answers "what will the data in this collection look like?"
and a model provides functionality like "Are there any records matching this query?" or "Add a new document to the collection".