This file contains hidden or 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
package model | |
import ( | |
"fmt" | |
"html" | |
"log" | |
"net" | |
"net/http" | |
"os" | |
"os/exec" |
This file contains hidden or 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
totalEstablish="$(netstat -na|grep ESTABLISHED|wc -l)" | |
if [ $totalEstablish -gt 5000 ];then | |
basepath=$(cd `dirname $0`; pwd) | |
date +'%Y%m%d %H:%M:%S' >> ${basepath}/fix_tcp_issue.log | |
echo $totalEstablish >> ${basepath}/fix_tcp_issue.log | |
cd /data/grpc_server/cheyoo-app-api-server && ./cheyoo-app-api-server grpc -d stop 2> /dev/null | |
cd /data/grpc_server/cheyoo-app-api-server && ./cheyoo-app-api-server grpc -d start | |
cd /data/grpc_server && ./cheyoo_app grpc -d stop 2> /dev/null | |
cd /data/grpc_server && ./cheyoo_app grpc -d start |
This file contains hidden or 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
<div id="page4" class="hide"> | |
<?php | |
// 如果超过下午四点只能预约第二天 | |
if(date('G') >= 16){ | |
$j = 1; | |
}else{ | |
$j = 0; | |
} | |
$howmanyDays = 60; | |
$days = array(); |
This file contains hidden or 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
<?php | |
ini_set("memory_limit", "1024M"); | |
require dirname(__FILE__).'/../core/init.php'; | |
/* Do NOT delete this comment */ | |
/* 不要删除这段注释 */ | |
// 获取所有分类信息 | |
$allCates = db::get_all("SELECT ID,Title FROM web_ask_category WHERE ParentID !=0"); | |
$newAllCates = array(); |
This file contains hidden or 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
// snake string, XxYy to xx_yy , XxYY to xx_yy | |
func snakeString(s string) string { | |
data := make([]byte, 0, len(s)*2) | |
j := false | |
num := len(s) | |
for i := 0; i < num; i++ { | |
d := s[i] | |
if i > 0 && d >= 'A' && d <= 'Z' && j { | |
data = append(data, '_') | |
} |
This file contains hidden or 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
// main | |
package main | |
import ( | |
"fmt" | |
"reflect" | |
"strconv" | |
) | |
type MyType struct { |
This file contains hidden or 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
package main | |
import ( | |
"fmt" | |
"log" | |
"net/http" | |
"os" | |
"golang.org/x/net/html" | |
) |
This file contains hidden or 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
<?php | |
include(dirname(__FILE__) . '/SSDB.php'); | |
$host = '127.0.0.1'; | |
$port = 8888; | |
// 开启几个线程同时做数据的修改 | |
for($i = 0;$i < 100; $i++){ | |
$thread[$i] = new Handler($i); | |
$thread[$i]->start(); | |
} |
This file contains hidden or 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
<?php | |
error_reporting(E_ALL); | |
/* Allow the script to hang around waiting for connections. */ | |
set_time_limit(0); | |
/* Turn on implicit output flushing so we see what we're getting | |
* as it comes in. */ | |
ob_implicit_flush(); |
This file contains hidden or 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
<?php | |
$timeout = 5; | |
$errno = 0; | |
$errstr = “”; | |
$s = @stream_socket_client('127.0.0.1:100', $errno, $errstr, $timeout); | |
if($s){ | |
$stdin = fopen('php://stdin', 'r'); | |
do{ | |
$data = fread($s, 8192); | |
echo $data; |
NewerOlder