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
//Convenience Wrapper functions | |
//Using TaskGraph | |
FGraphEventRef RunLambdaOnGameThread(TFunction< void()> InFunction) | |
{ | |
return FFunctionGraphTask::CreateAndDispatchWhenReady(InFunction, TStatId(), nullptr, ENamedThreads::GameThread); | |
} | |
FGraphEventRef RunLambdaOnAnyThread(TFunction< void()> InFunction) | |
{ |
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
//assuming you're using https://www.npmjs.com/package/mysql | |
const mysql = require('mysql'); | |
const con = mysql.createConnection({ | |
host: "localhost", | |
user: "yourusername", | |
password: "yourpassword", | |
database: "mydb" | |
}); | |
socket.on('sqlQuery', function(queryData, callback){ |
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
//FCoreDelegates | |
EndDelegate = FCoreDelegates::OnPreExit.AddLambda([&] | |
{ | |
UE_LOG(LogTemp, Log, TEXT("OnPreExit")); | |
}); | |
//Cleanup | |
FCoreDelegates::OnPreExit.Remove(EndDelegate); | |
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
const fs = require("fs"); | |
const http = require("http"); | |
const https = require("https"); | |
const { Server } = require("socket.io"); | |
const express = require("express"); | |
//defaults | |
const tlsEnabled = true; | |
const port = 3000; |
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
const RECEIVE_PORT = 3001; | |
const SEND_PORT = 3002; | |
const dgram = require('dgram'); | |
const server = dgram.createSocket('udp4'); | |
server.on('listening', function () { | |
let address = server.address(); | |
console.log(`UDP server listening on ${address.address}:${address.port}`); | |
}); |
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
/* | |
Delta Compression by Glenn Fiedler. | |
This source code is placed in the public domain. | |
http://gafferongames.com/2015/03/14/the-networked-physics-data-compression-challenge/ | |
*/ | |
#include <stdint.h> | |
#include <stdio.h> | |
#include <assert.h> | |
#include <string.h> |
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
import requests | |
def download_file_from_google_drive(id, destination): | |
def get_confirm_token(response): | |
for key, value in response.cookies.items(): | |
if key.startswith('download_warning'): | |
return value | |
return None |
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
const express = require('express') | |
const app = express() | |
app.use(express.json()) | |
app.post( | |
'/', | |
(req, res) => { | |
console.log(req.body); | |
let resObj = { replyType:"echo", content: req.body}; |
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
let from = 80; | |
let to = 8080; | |
const httpProxy = require('http-proxy'); | |
if(process.argv.length != 4){ | |
console.log('Did not supply from/to params, remapping ' + from + ' to ' + to); | |
} | |
else{ | |
from = Number(process.argv[2]); | |
to = Number(process.argv[3]); |
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
from aiohttp import web | |
import socketio | |
from colorama import init, Fore | |
init(autoreset=True) | |
sio = socketio.AsyncServer() | |
app = web.Application() | |
sio.attach(app) | |
async def index(request): |
NewerOlder