Skip to content

Instantly share code, notes, and snippets.

Posting comics on my github site


Posting comics on my github site
View GitHub Profile

hi! this is my first gist! (and i still don't quite know what a gist is!)

funny, i have no idea what i'm doing!

LinuxRocks2000 / httpserver.hpp
Last active Jan 14, 2022
One-file threaded HTTP server in C++ with support for callbacks. Updated as I need it, so eventually will be state aware and etc.
View httpserver.hpp
// Socket includes
#include <sys/socket.h>
#include <arpa/inet.h>
#include <netinet/in.h>
#include <cstring>
#include <fcntl.h>
// STD includes
#include <thread>
#include <string>
View miniconsole.js
// Mini keyboard-activated console for Javascript
// Unobtrusive, comes with it's own CSS, appends to the html Body element. Configurable - change the password to whatever you want.
// Add new [method]s with miniConsole.methodTable[name] = your_function
// Made by Tyler Clarke circa 2022 A.D - use it however you want, but I'd be very disappointed if you avoided accrediting it ;)
let miniConsole = {
consoleEl: undefined,
password: "opensesame",
lock: "",
showed: false,