This document has now been incorporated into the uWSGI documentation:
http://uwsgi-docs.readthedocs.org/en/latest/tutorials/Django_and_nginx.html
Steps with explanations to set up a server using:
func TestClient_RenameFile(t *testing.T) { | |
// 定义类型 | |
var sc *stdsftp.Client | |
// 给方法打桩,相当于使用反射将对应的方法实现给替换了 | |
patch := gomonkey.ApplyMethod(reflect.TypeOf(sc), "Rename", func(_ *stdsftp.Client, _, _ string) error { | |
return errors.New(" some err") | |
}) | |
// 确保执行完会重置回去 | |
defer patch.Reset() |
package main | |
import "fmt" | |
import "time" | |
func main() { | |
tLen(10) | |
tLen(100) | |
tLen(1000) | |
tLen(10000) |
package models | |
import ( | |
"container/list" | |
"git.vpgame.cn/sh-team/das-ag-dota2/utils" | |
"go.uber.org/zap" | |
"sync" | |
"time" | |
) |
#!/bin/bash | |
# ============================================================ | |
# Filename: install.sh | |
# Created By: Geoffrey Xia | |
# Created On: 2017-09-25 20:53:43 | |
# ============================================================ | |
yum -y install python-pip vim | |
pip install --upgrade pip | |
pip install shadowsocks | |
mkdir -p /data |
cmake_minimum_required(VERSION 2.8) | |
project(testapp) | |
set(CMAKE_BUILD_TYPE Debug CACHE STRING "set build type to debug") | |
set(CMAKE_VERBOSE_MAKEFILE true) | |
add_custom_command( | |
OUTPUT testapp |
var _ = require('lodash'); | |
function validateString(val, rule) { | |
// 判断是不是 String | |
if (!_.isString(val)) { | |
return 'INVALID_STRING'; | |
} | |
// 如果有正则,判断是否符合正则表达式 | |
if (rule.regex && !rule.regex.test(val)) { |
#!/bin/bash | |
#set -x | |
# check input parameter first | |
TAR_REL_PATH='' | |
if [ $# -eq 1 ] ; then | |
TAR_REL_PATH="$1" | |
else | |
echo "Wrong parameter" | |
exit 2 |
(function () { | |
var usingMobile = false, | |
userAgent = window.navigator.userAgent; | |
if (/Mobile|iP(hone|od|ad)|Android|BlackBerry|IEMobile|Kindle|NetFront|Silk-Accelerated|(hpw|web)OS|Fennec|Minimo|Opera M(obi|ini)|Blazer|Dolfin|Dolphin|Skyfire|Zune/.test(userAgent)) { | |
usingMobile = !/iPad/.test(userAgent); //specail for iPad | |
} | |
var sourceData = usingMobile ? RESOURCES.mobile : RESOURCES.desktop, | |
head = document.getElementsByTagName('head')[0]; |