Skip to content

Instantly share code, notes, and snippets.

View Kreijstal's full-sized avatar
↗️

Kreijstal Kreijstal

↗️
View GitHub Profile
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;
@Kreijstal
Kreijstal / test.js
Last active February 14, 2022 19:05
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 January 13, 2021 14: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 July 8, 2020 21:38
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")
apt-get install -qqy --no-install-recommends \
apt-utils \
ffmpeg \
sox \
libcairo2-dev \
texlive \
texlive-fonts-extra \
texlive-latex-extra \
texlive-latex-recommended \
texlive-science \
https://web.archive.org/web/20200622213752if_/https://a.uguu.se/thJbKW17Mu6a_paint-over11.psd