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
import asyncio | |
from typing import Annotated | |
from fastapi import Body, FastAPI | |
from gradio_client import Client | |
app = FastAPI() | |
@app.post("/gradio_proxy/{api_name}") | |
async def proxy(api_name: str, parameters: Annotated[dict, Body()]): |
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
using System.Collections.Generic; | |
using System.Linq; | |
using UnityEditor; | |
using UnityEngine; | |
[InitializeOnLoad] | |
public class SelectionHistory | |
{ | |
private const int MAX_HISTORY_COUNT = 10; |
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
public class CharacterFSM : FsmBehaviour<CharacterFSM> | |
{ | |
public float variable = 1f; | |
protected override State<CharacterFSM> InitState() | |
{ | |
return new Natural(); | |
} | |
class Natural : State<CharacterFSM>, ITickable |
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
#!/usr/bin/env python | |
import math | |
import os | |
import shutil | |
import time | |
TODAY_DIR = r'F:\fences-portals\today' | |
WEEK_DIR = r'F:\fences-portals\this-week' | |
ARCHIVES_DIR = r'F:\fences-portals\archives' |
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
using UnityEngine; | |
public class Gun : MonoBehaviour | |
{ | |
public GameObject shotPrefab; | |
public Transform[] gunPoints; | |
public float fireRate; | |
bool firing; |
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
patch: | |
punctuator/half_shape/+: | |
# 半角西文,方便写文档时加 markdown 符号 | |
"#": "#" | |
"[": "[" | |
"]": "]" | |
"*": "*" | |
"$": "$" | |
"@": "@" | |
"~": "~" |
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
#!/bin/sh | |
set -e | |
echo === configure openwrt version 21.02.0 === | |
# override shadowsocks server config | |
SERVER_NAME=lightsail-tokyo | |
METHOD=xchacha20-ietf-poly1305 | |
HOST= |
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
using UnityEditor; | |
using UnityEngine; | |
public class Turret : MonoBehaviour | |
{ | |
[Range(0, 180f)] public float angle = 45f; | |
public float maxTurnSpeed = 90f; |
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
#!/bin/bash | |
apt-get update && apt-get upgrade -y && apt-get install -y socat ebtables docker.io nfs-common | |
# enable modules | |
echo ip_vs_rr >> /etc/modules-load.d/modules.conf | |
echo ip_vs_wrr >> /etc/modules-load.d/modules.conf | |
echo ip_vs_sh >> /etc/modules-load.d/modules.conf | |
echo ip_vs >> /etc/modules-load.d/modules.conf |
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
#!/bin/bash | |
apt-get update | |
apt-get install -y docker.io docker-compose | |
apt-get install -y linux-image-4.15.0-39-lowlatency linux-modules-4.15.0-39-lowlatency | |
echo "tcp_bbr" >> /etc/modules-load.d/modules.conf | |
echo "net.core.default_qdisc=fq" >> /etc/sysctl.conf | |
echo "net.ipv4.tcp_congestion_control=bbr" >> /etc/sysctl.conf | |
echo "net.ipv4.tcp_fastopen=3" >> /etc/sysctl.conf | |
cat > docker-compose.yaml << EOF |
NewerOlder