项目支持,让sublime支持项目本身的pkg库提示,有两种基本的实现
一种为设定 gosublime 插件的 Setting - user
配置
{
//"env": { "GOPATH": "$HOME/golang:$GS_GOPATH" }
// 留空即可
"env":{}
}
package main | |
import ( | |
"io" | |
"log" | |
"net/http" | |
"os" | |
) | |
func Hello(w http.ResponseWriter, r *http.Request) { |
package verify | |
import ( | |
"regexp" | |
) | |
// 验证年龄是为数字 | |
func Is_age(s string) bool { | |
if m, _ := regexp.MatchString("^[0-9]+$", s); !m { | |
return false |
项目支持,让sublime支持项目本身的pkg库提示,有两种基本的实现
一种为设定 gosublime 插件的 Setting - user
配置
{
//"env": { "GOPATH": "$HOME/golang:$GS_GOPATH" }
// 留空即可
"env":{}
}
一、在php.ini里面设置 max_execution_time = 1800; | |
二、通过PHP的ini_set 函数设置 ini_set("max_execution_time", "1800"); | |
三、通过set_time_limit 函数设置 set_time_limit(1800) ; |
<?php | |
// 打包 | |
$zipfile = 'zipByPhp.zip'; | |
$zip = new ZipArchive();//使用本类,linux需开启zlib,windows需取消php_zip.dll前的注释 | |
if($zip->open($zipfile, ZIPARCHIVE::CREATE)!==TRUE){ | |
exit('create zip file error'); | |
} | |
$files = array('queryimg.php', 'multicurl.php'); |
<?php | |
//func 1. 将数组序列化后用iconv函数转换编码,之后再反序列化 | |
unserialize(iconv('gbk','utf-8',serialize($array))); // 貌似经常报错 | |
//func 2. 用构建数组原型的序列化方法,借助var_export函数,最终函数如下: | |
function array_iconv($in_charset,$out_charset,$arr){ | |
return eval('return '.iconv($in_charset,$out_charset,var_export($arr,true).';')); | |
} |
<?php | |
function microtime_float() | |
{ | |
list($usec, $sec) = explode(" ", microtime()); | |
return ((float)$usec + (float)$sec); | |
} | |
echo microtime_float(); |
import_path = time | |
[Time_Format] | |
// 当前时间 | |
fmt.Printf("%v", time.Now().Format("2006-01-02 15:04:05")) |
var timeout = time.Duration(2 * time.Second) | |
func dialTimeout(network, addr string) (net.Conn, error) { | |
return net.DialTimeout(network, addr, timeout) | |
} | |
func main() { | |
transport := http.Transport{ | |
Dial: dialTimeout, | |
} |
" hSATAC's vimrc | |
" Ash Wu (aka. cAt) <hsatac@gmail.com> | |
" Fork me on GITHUB https://github.com/hSATAC/vimrc | |
" read https://github.com/hSATAC/vimrc/blob/master/README.md for more info | |
" cd ~; mkdir -p ~/.vim/bundle/; cd ~/.vim/bundle/; git clone https://github.com/gmarik/vundle.git; cd ~/.vim/; | |
set rtp+=~/.vim/bundle/vundle/ | |
call vundle#rc() |