Skip to content

Instantly share code, notes, and snippets.

View kylejeske's full-sized avatar
🐛
(!(while(succeed=try())));

kyle kylejeske

🐛
(!(while(succeed=try())));
  • Distributed
View GitHub Profile
@kylejeske
kylejeske / ecmascript-rs.md
Created May 2, 2024 18:22 — forked from pitaj/ecmascript-rs.md
ECMAScript/JavaScript tokenizers, lexers, parsers, tools, minifiers, compilers, etc in rust
  • spdy web compiler swc is rust port of babel and closure compiler.
  • ratel High performance JavaScript to JavaScript compiler with a Rust core
  • RESS Rusty EcmaScript Scanner
  • RESSA Rust EcmaScript Syntax Analyzer
  • rjs An implementation of ECMAScript 5.1, in Rust. Work in progress.
  • espadon EcmaScript parser writter in Rust (WIP)
  • tyrion EcmaScript 6 parser written in Rust.
  • esprit A JavaScript parser written in Rust
  • j8t
@kylejeske
kylejeske / RustJS.md
Created March 5, 2024 23:31 — forked from ulanda/RustJS.md
Rust Compile with asmjs target

You will need nightly Rust

  • Install Rust, se rustup.sh curl -sSf https://static.rust-lang.org/rustup.sh | sh
  • Update installaion with: rustup self update rustup self update-data
  • Install nightly Rust: rustup toolchain install nightly
  • Default to nightly: rustup default nightly
@kylejeske
kylejeske / console-log-format-timestamp.ts
Last active February 8, 2024 22:14 — forked from mikeatlas/console-log-format-timestamps.js
Overrides the console.log (specifically this is for node.js) with an ISO timestamp prefix and still handles string interpolation formats.
import { debuglog, format } from "util";
import { Console } from "console";
type LoggerOverrideFunction = (...args: any) => void;
type InjectedConsole = {
info: LoggerOverrideFunction;
log: LoggerOverrideFunction;
warn: LoggerOverrideFunction;
};
import * as fs from 'fs';
import * as path from 'path';
interface CPUMeasurements {
average_cpu_usage: number;
max_cpu_usage: number;
min_cpu_usage: number;
}
interface MemoryMeasurements {
@kylejeske
kylejeske / algos-sliding-window-techniques.md
Last active February 26, 2021 19:45
algos using Sliding Window Techniques

Sliding Window Problems (Types):

Fast / Slow

  • Start with a 'fast' pointer and a 'slow' pointer
  • Once you have a valid substring within the fast pointer then: you start shrinking the slow until you have a valid substring.
  1. BitFlip
  2. Min. Window Substring
  3. Consecutive Subarray Sum
@kylejeske
kylejeske / README.md
Last active June 23, 2023 15:09
Monad Composition to handle async ACL checks during a file upload

Monad Composition in JavaScript

Design Pattern: Inversion of control

References

  • Discrete Math
  • Decoupling Dependencies
  • Monad Transformers
  • Monad Functions
    • Closure operators on partially ordered sets
@kylejeske
kylejeske / gist:742775c9e259469f09582c2834ea3f53
Created December 4, 2019 15:06 — forked from billsinc/gist:4665346
Find Largest Files/Directories on Linux System
# 10 Largest Files
find . -type f -print0 | xargs -0 du -s | sort -n | tail -10 | cut -f2 | xargs -I{} du -sh {}
@kylejeske
kylejeske / find-max-stock-buy-self-profit-es6.js
Created October 18, 2019 14:57
Using points within a subset to find max/min and profits from sale of a stock
/**
// using built-in functions
*/
function findMaxStockProfit(arr1) {
if (arr1.length < 2) {
return 0;
}
let arr1Min = Math.min(...arr1);
let subset = arr1.slice(arr1.indexOf(arr1Min));
@kylejeske
kylejeske / population-on-earth.json
Created October 17, 2019 17:43
JSON file of Earth Population Figures
[["1990",[6,159,0.001,30,99,0.002,45,-109,0.000,42,115,0.007,4,-54,0.000,-16,-67,0.014,21,-103,0.006,-20,-64,0.004,-40,-69,0.001,32,64,0.001,28,67,0.006,8,22,0.000,-15,133,0.000,-16,20,0.000,55,42,0.006,32,-81,0.010,31,36,0.067,9,80,0.016,42,-91,0.006,19,54,0.001,21,111,0.163,-3,-51,0.001,33,119,0.150,65,21,0.002,46,49,0.015,43,77,0.043,45,130,0.018,4,119,0.006,22,59,0.002,9,-82,0.003,46,-60,0.002,-14,15,0.006,-15,-76,0.001,57,15,0.007,52,9,0.056,10,120,0.004,24,87,0.134,0,-51,0.005,-5,123,0.013,-24,-53,0.010,-28,-58,0.015,43,0,0.019,24,70,0.023,-9,33,0.012,20,73,0.037,13,104,0.034,43,41,0.012,23,78,0.095,20,-72,0.001,38,-4,0.006,0,-77,0.016,-9,-35,0.056,25,109,0.034,-13,34,0.013,61,18,0.001,58,40,0.002,34,50,0.027,49,88,0.000,48,-99,0.001,-42,176,0.002,20,86,0.156,-18,30,0.007,53,44,0.006,29,18,0.001,5,16,0.003,49,-74,0.000,48,131,0.006,14,121,0.210,63,19,0.001,40,54,0.001,36,57,0.005,16,52,0.000,50,128,0.010,39,30,0.021,54,12,0.006,16,-61,0.011,27,80,0.196,29,101,0.001,14,78,0.067,7,13,0.003,41,125,0.026,-1
@kylejeske
kylejeske / examples.md
Last active September 29, 2019 19:53
hello world using LLVM: clang

LLVM: Hello-World.c - Example

Assumes

  1. Clang & LLVM have been installed on $PATH.

Execution

clang hello-world.c