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
/* | |
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
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
//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
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
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
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): |
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: https://nodejs.org/api/net.html#net_net_createconnection_options_connectlistener */ | |
const net = require('net'); | |
const port = 3000; | |
const client = net.createConnection({ port: 3000 }, () => { | |
console.log('connected to server!'); | |
//pipe immediately something back | |
client.write('Hello from TCP client!\r\n'); | |
//send delayed data test |
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: https://nodejs.org/api/net.html#net_server_address */ | |
const net = require('net'); | |
const util = require('util'); | |
const port = 3000; | |
let server = net.createServer((socket) => { | |
//give it an id | |
socket.id = Math.floor(Math.random() * 1000); | |
//console.log(util.inspect(socket)); |
NewerOlder