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
version: '3' | |
services: | |
redis-0: | |
image: redis:6.2-bullseye | |
command: redis-server --cluster-enabled yes --port 7000 --requirepass "${REDIS_PASS}" --masterauth "${REDIS_PASS}" | |
ports: | |
- "7000:7000" | |
- "17000:17000" | |
expose: | |
- "7000" |
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
#!/usr/bin/env bash | |
# export http_proxy=http://##替换成自己的代理地址## | |
# export https_proxy=http://##替换成自己的代理地址## | |
# 使用官方源安装docker | |
apt update | |
apt install -y \ | |
ca-certificates \ | |
curl \ |
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
function get_timezone() | |
local now = os.time() | |
return os.difftime(now, os.time(os.date("!*t", now))) | |
end | |
local epoch = get_timezone() | |
function parse_json_date(json_date) | |
local year, month, day, hour, minute, seconds, offsetsign, offsethour, offsetmin = json_date:match("(%d+)%-(%d+)%-(%d+)%a(%d+)%:(%d+)%:([%d%.]+)([Z%+%- ])(%d?%d?)%:?(%d?%d?)") | |
local timestamp = os.time{year = year, month = month, day = day, hour = hour, min = minute, sec = math.floor(seconds)} + epoch | |
local offset = 0 |
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 UnityEditor; | |
public class ImageProcessor : AssetPostprocessor | |
{ | |
private void OnPreprocessTexture() | |
{ | |
var importer = assetImporter as TextureImporter; | |
if (null == importer) | |
{ | |
return; |
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
package Utils | |
import ( | |
"errors" | |
"io" | |
"math" | |
) | |
func WriteCSharpString(writer io.Writer, value string) error { | |
buffer := []byte(value) |
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
#!/usr/bin/env bash | |
# 安装docker(使用阿里云源) | |
yum install -y yum-utils device-mapper-persistent-data lvm2 | |
yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo | |
yum -y install docker-ce | |
systemctl start docker | |
# 迁移docker目录(可选) | |
systemctl stop docker docker.socket |
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 UnityEngine; | |
namespace Utils | |
{ | |
public class MonoSingleton<T> : MonoBehaviour where T : MonoSingleton<T> | |
{ | |
public static T Inst | |
{ | |
get | |
{ |
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 Http { | |
public static Inst(): Http { | |
if (null == Http._inst) { | |
Http._inst = new Http(); | |
} | |
return Http._inst; | |
} | |
private static _inst: Http; | |
public constructor() { |
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
export default class WSNet { | |
//单例,方便使用 | |
public static Inst(): WSNet { | |
if (null == WSNet._inst) { | |
WSNet._inst = new WSNet(); | |
} | |
return WSNet._inst; | |
} | |
private static _inst: WSNet; |
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 WSNet { | |
//单例,方便使用 | |
public static Inst(): WSNet { | |
if (null == WSNet._inst) { | |
WSNet._inst = new WSNet(); | |
} | |
return WSNet._inst; | |
} | |
private static _inst: WSNet; |
NewerOlder