Skip to content

Instantly share code, notes, and snippets.

View FormerlyZeroCool's full-sized avatar
💭
Back on the grind!

Drew FormerlyZeroCool

💭
Back on the grind!
View GitHub Profile
@FormerlyZeroCool
FormerlyZeroCool / LICENSE
Last active February 15, 2023 04:29
String view header only library for c++ std replacement
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
/*
* list.c
*/
#include <stdio.h>
#include <stdlib.h>
#include "list.h"
struct Node *addFront(struct List *list, void *data)
/*
* stringview.cpp
*
* Created on: Jan 6, 2021
* Author: andrewrubinstein
*/
#include "string_view.hpp"
#include "SubStr.hpp"
function logToServer(data, path) {
fetch(path, {
method: "POST",
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify(data)
}).then(res => { console.log("Request complete! response:", data); });
}
async function readFromServer(path) {
class GuiTextBox implements GuiElement {
text:string;
asNumber:Optional<number>;
rows:TextRow[];
canvas:HTMLCanvasElement;
ctx:CanvasRenderingContext2D;
cursor:number;
scaledCursorPos:number[];
cursorPos:number[];
#include <iostream>
template <typename T>
class vector {
private:
int size;
int internal_size;
T *data;
void printRecursive(std::ostream &o, int index) const
{
#pragma once
/*
* HashMap.hpp
*
* Created on: Mar 31, 2022
* Author: andrewrubinstein
*/
#include <memory>
template <typename t, typename u>
class FlatMap {
#include <cmath>
#include <iostream>
#include <string>
#include <cinttypes>
#include <stdexcept>
bool isdigit(uint8_t c)
{
return c - 48 < 10;
}
/*
* Map.h
*
* Created on: Mar 31 2022
* Author: andrew
*/
#ifndef Map_H_
#define Map_H_
#include <stack>
/*
* StackSegment.h
*
* Created on: Mar 1, 2021
* Author: andrewrubinstein
*/
#ifndef STACKSEGMENT_HPP_
#define STACKSEGMENT_HPP_
#include "stack.hpp"