Skip to content

Instantly share code, notes, and snippets.

package main
import ( "net/http" )
func main() {
http.Handle("/", http.FileServer(http.Dir("./")))
http.ListenAndServe(":8099", nil)
}
@ljyf5593
ljyf5593 / email_validation
Created June 19, 2014 02:50
常用邮箱有效性正则规则
<?php
$reg_arr = array(
'^[0-9]{5,11}@qq\.com', // 以QQ号码为邮箱 5至11个数字
'^[a-z][a-z0-9.-_]{1,16}[a-z0-9]@(qq|foxmail)\.com', // QQ邮箱别名 3至18个英文、数字、点、减号、下划线,以英文字母开头,以英文数字结尾
'^[a-z0-9][a-z0-9_]{2,14}[a-z0-9]@sina\.(com|cn)', // 新浪 4至16个英文、数字、下划线,下划线不能在首尾
'^[a-z][a-z0-9_]{4,16}[a-z0-9]@(((163|126)\.com)|(yeah\.net))', // 网易字母邮箱,6-18字母、下划线、数字,字母开头,字母数字结尾
'^1[3|4|5|8][0-9]{9}@(163|139)\.com', // 网易手机邮箱和手机邮箱
'^[a-z0-9][a-z0-9.]{4,28}[a-z0-9]@gmail\.com', // gmail 6-30
'^[a-z][a-z0-9._]{6,30}[a-z0-9]@yahoo\.com', // 雅虎邮箱
'^[a-z][a-z0-9.-_]{3,15}@sohu.com', // 搜狐邮箱
@ljyf5593
ljyf5593 / gist:7018661
Created October 17, 2013 03:06
clearfix
.clearfix:before, .clearfix:after {
content:"";
display:table;
}
.clearfix:after{
clear:both;
}
.clearfix{
*zoom:1;/*ie6,7*/
}
@ljyf5593
ljyf5593 / string.php
Last active December 21, 2015 20:29
解决php无法解析中文引号的问题
<?php
str_replace(
array(' ','&nbsp;', '&amp;', '&quot;', '&#039;', '&ldquo;', '&rdquo;', '&mdash;', '&lt;', '&gt;', '&middot;', '&hellip;'),
array('∵',' ', '&', '"', "'", '“', '”', '—', '<', '>', '·', '…'),
$str);