Skip to content

Instantly share code, notes, and snippets.

View vgvgvvv's full-sized avatar
:octocat:
Keep Learning

Dong Chen vgvgvvv

:octocat:
Keep Learning
View GitHub Profile
@vgvgvvv
vgvgvvv / npm-taobao-setup.sh
Created February 19, 2022 13:57 — forked from fanyang89/npm-taobao-setup.sh
设置淘宝npm
npm config set registry https://registry.npm.taobao.org # 注册模块镜像
npm config set disturl https://npm.taobao.org/dist # node-gyp 编译依赖的 node 源码镜像
npm config set sass_binary_site https://npm.taobao.org/mirrors/node-sass # node-sass 二进制包镜像
npm config set electron_mirror https://npm.taobao.org/mirrors/electron/ # electron 二进制包镜像
npm config set puppeteer_download_host https://npm.taobao.org/mirrors # puppeteer 二进制包镜像
npm config set chromedriver_cdnurl https://npm.taobao.org/mirrors/chromedriver # chromedriver 二进制包镜像
npm config set operadriver_cdnurl https://npm.taobao.org/mirrors/operadriver # operadriver 二进制包镜像
npm config set phantomjs_cdnurl https://npm.taobao.org/mirrors/phantomjs # phantomjs 二进制包镜像
npm config set selenium_cdnurl https://npm.taobao.org/mirrors/selenium # selenium 二进制包镜像
npm config set node_inspector_cdnurl https://npm.taobao.org/mirrors/node-inspector # node-inspector 二进制包镜像
#include "ActionConsumeTickManager.h"
#include "DynamicStats.h"
FConsumable* FConsumable::AddAction(TFunction<void()> InFunc)
{
Parent->AddAction(InFunc);
return this;
}
void FConsumable::ConsumeAction(float DeltaTime)
@vgvgvvv
vgvgvvv / ActionQueue.cpp
Created December 2, 2021 15:18
ActionQueue For Unreal Engine
#include "ActionQueue.h"
#include "TimerManager.h"
#include "Engine/World.h"
DEFINE_STAT(STAT_NumActionQueue);
int GUseActionQueue = 1;
static FAutoConsoleVariableRef CVarGUseActionQueue(
TEXT("actionqueue.UseActionQueue"),
GUseActionQueue,
@vgvgvvv
vgvgvvv / Examples.cpp
Created January 19, 2021 07:29 — forked from getnamo/Examples.cpp
Long Running Async Lambdas, lock-free (UE4)
//Convenience Wrapper functions
//Using TaskGraph
FGraphEventRef RunLambdaOnGameThread(TFunction< void()> InFunction)
{
return FFunctionGraphTask::CreateAndDispatchWhenReady(InFunction, TStatId(), nullptr, ENamedThreads::GameThread);
}
FGraphEventRef RunLambdaOnAnyThread(TFunction< void()> InFunction)
{
@vgvgvvv
vgvgvvv / RunAndroidCommand.go
Created January 8, 2021 10:09
Run Android Command By Go
package main
import (
"log"
"os"
"os/exec"
)
func main() {
log.Println("logcat")
@vgvgvvv
vgvgvvv / BuildAndroid.sh
Created January 7, 2021 23:25
Build Android Binary By Golang
ADB=adb
DEST="/data/local/tmp/reautomatic-agent"
OUTPUT="output/main"
echo "Build binary for arm ..."
go generate
GOOS=linux GOARCH=arm go build -o $OUTPUT -tags vfs
@vgvgvvv
vgvgvvv / Client.cs
Created January 4, 2021 16:22
Simple C# Server/Client
using System;
using System.Net;
using System.Net.Sockets;
using TestServer;
namespace TestClient
{
public class Client
{
public void ConnectToServer()
@vgvgvvv
vgvgvvv / TDefault.h
Created May 9, 2020 16:17
基于UE4的默认值模板
#pragma once
template<typename T>
class TDefaultValue
{
public:
static T value;
};
template<typename T>
@vgvgvvv
vgvgvvv / Linq.h
Created May 9, 2020 16:17
基于UE4的Linq
#pragma once
#include "DefaultValue.h"
#include "Array.h"
#include "Set.h"
#include "Map.h"
namespace Linq
{
template<typename T>
@vgvgvvv
vgvgvvv / DynamicStats.h
Last active November 23, 2021 03:20
UE4动态stats
//DynamicStats.h
# pragma once
# if STATS
DECLARE_STATS_GROUP(TEXT("Dynamic"), STATGROUP_Dynamic, STATCAT_Advanced);
class FDynamicScopeCycleStatIdContainer : public TThreadSingleton<FDynamicScopeCycleStatIdContainer>
{
public: