Skip to content

Instantly share code, notes, and snippets.

Avatar
↗️

Kreijstal Kreijstal

↗️
View GitHub Profile
View installnumpy.log
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
View traceJS.js
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)
}
View enquirer.js
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;
View test.js
export const propertyA = "A";
export const propertyB = "B";
//export something lodash_mapvalues;
export default function( x ){ // <---- declared as a default function
return x * x;
}
View bfsdfsastar.js
// create a graph class
class Graph {
// defining vertex array and
// adjacent list
constructor()
{
this.AdjList = new Map();
}
@Kreijstal
Kreijstal / xpath.js
Last active Jan 13, 2021
Use xpath but without so much trash
View xpath.js
//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 Jul 8, 2020
Promises in Mathematica
View promises.m
(* ::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);
View pp.js
console.log("hello world")
View test.sh
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 \
View gist:d2a6a717e9f481eb61f56ef92077295e
https://web.archive.org/web/20200622213752if_/https://a.uguu.se/thJbKW17Mu6a_paint-over11.psd