Skip to content

Instantly share code, notes, and snippets.

View Kreijstal's full-sized avatar

Kreijstal Kreijstal

View GitHub Profile
Kreijstal / binaryparsercombinator.js
Last active April 30, 2024 22:20
binary parser combinator js
function Result(tag, value) {
this.tag = tag;
this.value = value;
Result.ok = function(value) {
return new Result("ok", value);
(function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){
(function (global){(function (){
'use strict';
var possibleNames = require('possible-typed-array-names');
var g = typeof globalThis === 'undefined' ? global : globalThis;
/** @type {import('.')} */
module.exports = function availableTypedArrays() {
Kreijstal /
Created April 10, 2024 11:15
something minimal I took ir from another website and expanded from there
import typing as tp
import operator
# Defining the basic parser structure
ParserP = tp.Callable[[str], tp.Tuple[tp.Any, str]]
# Defining the ParserError for exception handling
class ParserError(Exception):
def __init__(self, msg, content):
super().__init__(f"{msg}: {content}")
Kreijstal /
Last active March 10, 2024 23:56
can link
Kreijstal / llmbenchmarks.txt
Created March 4, 2024 15:43
trying to make my own test set to check how good llms are
The motion of a robot with a single prismatic joint can be modeled as: mq̈ + bq̇ + kq = f,
which depends on mass m = 2, stiffness k = 4, and friction b = 4.
We want to set the control force f = -kpx - kvẋ so that the controlled system is critically damped and has a closed-loop stiffness of k' = 8.
(Hint: a natural system is critically damped when b = 2√(mk.))
Kreijstal /
Last active January 27, 2024 15:15
State Machine and automata, enjoy
class NDTreeNode:
def __init__(self, state, tapes, head_positions, parent=None):
self.state = state
self.tapes = tapes
self.head_positions = head_positions
self.parent = parent
self.children = []
class NDTapeTuringMachine:
def __init__(self, states, transitions, start_state, accept_state, blank_symbol, num_tapes):
Kreijstal /
Created April 4, 2023 16:31
Difference between rust winapi and windows-rs
use std::ptr::null_mut;
use winapi::shared::{
windef::{HWND, POINT, RECT},
use std::ffi::CString;
use winapi::shared::basetsd::LONG_PTR;
use winapi::um::wingdi::GetStockObject;
use winapi::um::wingdi::SYSTEM_FONT;

Input:Bescheribt mal Köln auf Kölsch. Schreib es im Kölsch Dialekt.
Output:Kölle es en jode Stadt. Do es dat Rhing met de Dom un de Böög, un vill schöne Pläz met Jroeß un Veedel. Do es och vill Museeje un Gallereje, un en de Altstadt es immer jot beschäftich. Et es immer spannend, wann et Käävvejööch es, un et kütt noch janz vill Leute, för de Kölsche Dääch un de fööne Mädcher. Et es en jode Stadt för Lebensfreude un Kultur.

Input: Was bedeutet "Käävvejööch"?
Output:"Käävvejööch" ist ein Wort, das im Kölsch Dialekt verwendet wird und das Karneval bedeutet. Der Karneval ist ein Fest, das in Köln und anderen Städten im Rheinland jedes Jahr im Februar stattfindet. Es ist eine Zeit der Feiern, des Tanzens und der Kostüme, und es werden viele Straßenumzüge und Paraden veranstaltet. Der Karneval in Köln ist besonders bekannt und beliebt und zieht viele Besucher aus der ganzen

(function () { /*
Copyright The Closure Library Authors.
SPDX-License-Identifier: Apache-2.0
'use strict';
var q,
aa = 'function' == typeof Object.defineProperties ? Object.defineProperty : function (a, b, c) {
if (a == Array.prototype || a == Object.prototype) return a;
a[b] = c.value;
Kreijstal / bootstrap.ps1
Last active February 12, 2024 23:47
install msys2, nvim and comfortable configuration
Set-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize -Name AppsUseLightTheme -Value 0
Set-ExecutionPolicy Bypass -scope Process -Force
Set-ExecutionPolicy RemoteSigned -Scope CurrentUser -Force
irm | iex
scoop install msys2
ucrt64 -c "yes|pacman -Syuu"
ucrt64 -c "yes|pacman -Syuu"
ucrt64 -c "pacman -S pactoys openssh curl --noconfirm git vim"
ucrt64 -c (@"