Skip to content

Instantly share code, notes, and snippets.

View Kreijstal's full-sized avatar
🚭

Kreijstal Kreijstal

🚭
View GitHub Profile
(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
Kreijstal / bootstrap.ps1
Last active March 8, 2026 00:50
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 get.scoop.sh | iex
#http://helloworldproject.blogspot.com/2021/01/setting-up-rust-on-windows-10-with.html
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 (@"
u@LAPTOP-31E3HV7R MINGW64 /c/u/ok/groses-projekt-mdt
$ python -m venv test
Looking in links: c:\Users\u\AppData\Local\Temp\tmp0yr8vk15
Processing c:\users\u\appdata\local\temp\tmp0yr8vk15\setuptools-58.1.0-py3-none-any.whl
Processing c:\users\u\appdata\local\temp\tmp0yr8vk15\pip-22.0.4-py3-none-any.whl
Installing collected packages: setuptools, pip
Successfully installed pip-22.0.4 setuptools-58.1.0
u@LAPTOP-31E3HV7R MINGW64 /c/u/ok/groses-projekt-mdt
$ source test/bin/activate
function traceMethodCalls(obj) {
const handler = {
get(target, propKey, receiver) {
console.log('GET', propKey);
const targetValue = target[propKey]; // Reflect.get(target, propKey, receiver);
if (typeof targetValue === 'function') {
return function(...args) {
console.log('CALL', propKey, args);
return targetValue.apply(target, args); // (A)
}
import colors from "https://cdn.skypack.dev/ansi-colors@v4.1.1";
import * as readline from "./readline.js";
;
var global$1 = typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {};
var lookup = [];
var revLookup = [];
var Arr = typeof Uint8Array !== "undefined" ? Uint8Array : Array;
var inited = false;
function init() {
inited = true;
export const propertyA = "A";
export const propertyB = "B";
//export something lodash_mapvalues;
export default function( x ){ // <---- declared as a default function
return x * x;
}
// create a graph class
class Graph {
// defining vertex array and
// adjacent list
constructor()
{
this.AdjList = new Map();
}
@Kreijstal
Kreijstal / xpath.js
Last active March 8, 2026 00:49
Use xpath but without so much trash
//sersly
((a)=>{let xPathResult = document.evaluate(a, document, null, XPathResult.UNORDERED_NODE_ITERATOR_TYPE, null );
const nodes = [];
let node = xPathResult.iterateNext();
while (node) {
nodes.push(node);
node = xPathResult.iterateNext();
};
return nodes})('//input')
@Kreijstal
Kreijstal / promises.m
Last active March 8, 2026 00:49
Promises in Mathematica
(* ::Package:: *)
(*Import like Import["https://gist.githubusercontent.com/Kreijstal/\
2a34158a1cf159b4ddc5ab3460f6efd0/raw/\
6bfc3328d9538844fabbbce9691fb3c63824ed9f/promises.m"]*)
Promise::usage="Promise[Function[{accept,reject},CustomLogic[accept[\"Success!\"],reject[\"Oh no! Error!\"]]]]"
Promise :=
Module[{local, success, failure, listen, counter = 0, Promise},
success[x_] := (local["s"] = x;(*Print[{"I've been executed",x,
local}];*)Through[local["t"][local["s"]]]; local["t"] = {};
local["resolved"] = True);
console.log("hello world")