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
/** | |
* Timespan | |
* | |
* 返回最高级别的时间差(年、月、日、时、分、秒) | |
* | |
* @access public | |
* @param integer a number of seconds | |
* @param integer Unix timestamp | |
* @return integer | |
*/ |
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
# 安装laravel 4.2.11 版本 | |
composer create-project "laravel/laravel:4.2.11" project_name --prefer-dist | |
# 以下这句则安装最新版,目前是5.0 | |
composer create-project laravel/laravel project_name --prefer-dist |
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
a, button, input{ | |
-webkit-tap-highlight-color:rgba(255,0,0,0); | |
} | |
/* | |
1.去除android a/button/input标签被点击时产生的边框 | |
2.去除ios a标签被点击时产生的半透明灰色背景 | |
*/ |
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 lt IE 8]> | |
<style type="text/css">html{overflow:hidden}body{height:100%;overflow:auto}#upgradeyoubrowser{position:fixed;height:100%;width:100%;top:0;left:0;bottom:0;right:0;z-index:9999;background:#fff;padding:30px}#upgradeyoubrowser h3{padding:30px}#upgradeyoubrowser a{color:#08c;text-decoration:underline}</style> | |
<div id="upgradeyoubrowser"> | |
<h1>是时候升级你的浏览器了</h1> | |
<h2>你正在使用过期的 Internet Explorer,请升级或更换后再访问。</h2> | |
<h3>建议你下载安装,以便更好地访问我们的网站 : )</h3> | |
<ul> | |
<li><a href="http://windows.microsoft.com/zh-cn/windows/upgrade-your-browser" target="_blank">Microsoft Internet Explorer 9</a></li> |
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
body { | |
font-family: "Helvetica Neue",Helvetica,"Hiragino Sans GB","STHeitiSC-Light","Microsoft YaHei","微软雅黑",Arial,sans-serif; | |
-webkit-font-smoothing: antialiased; | |
} | |
/* | |
参考:http://www.qianduan.net/mac-the-next-pages-of-chinese-fonts-optimized.html | |
*/ |
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 something = "http://www.baidu.com"; //任意同域资源,size越小越好 | |
var xmlhttp = new XMLHttpRequest(); | |
xmlhttp.open("GET", something, false); | |
xmlhttp.send(); | |
console.log("服务器时间:" + new Date(xmlhttp.getResponseHeader("date"))); //自己解析响应头,不一定是"date"的 | |
console.log("本机的时间:" + new Date()); |
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 INIClass | |
{ | |
public string inipath; | |
[DllImport("kernel32")] | |
private static extern long WritePrivateProfileString(string section, string key, string val, string filePath); | |
[DllImport("kernel32")] | |
private static extern int GetPrivateProfileString(string section, string key, string def, StringBuilder retVal, int size, string filePath); | |
/// <summary> |
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
TabPage[] tp=new TabPage[4]; | |
private void Form1_Load(object sender, EventArgs e) | |
{ | |
for (int i = 1; i < tabControl1.TabPages.Count; i++) | |
{ | |
tp[i] = tabControl1.TabPages[i]; | |
} | |
for (int i = 1; i < tp.Length; i++) | |
{ | |
tabControl1.TabPages.Remove(tp[i]); |
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
using System.Net; | |
try | |
{ | |
IPAddress ipTest = IPAddress.Parse(txtBox1.Text);//string转化为ip地址 | |
} | |
catch (Exception) | |
{ | |
toolTip1.Show("ip有误", txtBox1, 2000); //2000是提示显示的时间,单位毫秒 | |
} |
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
/// <summary> | |
/// 检查各个控件是否有空值 | |
/// </summary> | |
/// <returns>无空值返回true</returns> | |
private Boolean CheckEmpty() | |
{ | |
foreach (Control cur in this.Controls) | |
{ | |
//if (cur is TextBox && cur.Text == "") /*两种方式皆可,下面的更好*/ | |
if(cur is TextBox && string.IsNullOrEmpty(cur)) |