Skip to content

Instantly share code, notes, and snippets.

View XANOZOID's full-sized avatar
♾️
You can not win.

Xanozoid XANOZOID

♾️
You can not win.
  • The machine
View GitHub Profile
@XANOZOID
XANOZOID / comparison.txt
Created January 21, 2024 01:45
Super realistic and useful comparison between go and c++ performance
# Go:
iterations: 283694453
collisions: 1508042
passes: 283698
iterations: 281346118
collisions: 1360134
passes: 281349
iterations: 282386123
collisions: 1224686
@XANOZOID
XANOZOID / main.c
Created January 15, 2024 13:36
Very bad benchmark
#include "vector_lib.h"
#include <stdio.h>
#include <time.h>
#include <windows.h>
int main() {
struct timespec start, end;
@XANOZOID
XANOZOID / game_script_lang.js
Last active August 12, 2023 16:16
New Lang (basically: Go but dynamic)
// script with an amount and rest argument
script move_right_rest(amount, ...rest) {
// the "times" loop
(amount) times x ++;
// standard for each loop (i is scoped to this block)
for (var i = 0; i < rest; i ++) // ++i will not be added
x += rest[i];
}
// scripts can't be passed around, events can be passed around in variables
@XANOZOID
XANOZOID / interpeter.js
Created December 26, 2022 10:15
interpreter for my language in progress
/// from StackOverflow
function isNumeric(str) {
if (typeof str != "string") return false // we only process strings!
return !isNaN(str) && // use type coercion to parse the _entirety_ of the string (`parseFloat` alone does not do this)...
!isNaN(parseFloat(str)) // ...and ensure strings of whitespace fail
}
const types = {
STRING: "string",
NUMBER: "number",
template do_draw(w:int, color:uint, body:untyped) =
kinc_g4_begin(w)
body
kinc_g4_end(w)
kinc_g4_swap_buffers()
proc nim_update() {.exportc.} =
do_draw 0, 0:
nimPipeline.kinc_g4_set_pipeline()
var matrix:KincMatrix3x3 = kinc_matrix3x3_identity()
@XANOZOID
XANOZOID / what-is-svelte.md
Created November 18, 2019 06:23 — forked from Rich-Harris/what-is-svelte.md
The truth about Svelte

I've been deceiving you all. I had you believe that Svelte was a UI framework — unlike React and Vue etc, because it shifts work out of the client and into the compiler, but a framework nonetheless.

But that's not exactly accurate. In my defense, I didn't realise it myself until very recently. But with Svelte 3 around the corner, it's time to come clean about what Svelte really is.

Svelte is a language.

Specifically, Svelte is an attempt to answer a question that many people have asked, and a few have answered: what would it look like if we had a language for describing reactive user interfaces?

A few projects that have answered this question:

@XANOZOID
XANOZOID / MakeConvex.monkey2
Last active March 15, 2019 07:15
Monkey2 Polygon Decomposition
Namespace polygonmath
#Import "<std>"
Using std..
#rem Decomposes counter-clockwise simple polygons into convex polygons in under-quadratic time.
@author Matrefeytontias
@engine HaxePunk
@XANOZOID
XANOZOID / NetClient.cc
Created December 15, 2017 00:58 — forked from floooh/NetClient.cc
NetClient.h (emscripten/osx/win)
//------------------------------------------------------------------------------
// NetClient.cc
//------------------------------------------------------------------------------
#if ORYOL_WINDOWS
#define _WINSOCK_DEPRECATED_NO_WARNINGS (1)
#include <WinSock2.h>
typedef int ssize_t;
#endif
#if ORYOL_POSIX
-cp ..
-cp src
-main TestMain
-lib munit
-lib hamcrest
--no-inline
--each
-D unit_test
@XANOZOID
XANOZOID / extension_fixer.js
Last active October 31, 2017 07:16
Fixes incorrect, specified, file extensions in a specified directory
/* usage: `node extension_fixer.js ext-name (/)sub-folder */
/* sub folder is optional. */
/**
* Goes over all files in the current directory
* - checks if they have an incorrect extension name
* - prints out the conflict
* - changes their file name.
* --- Limitations:
* Only fixes letter-case conflicts.
*/