Skip to content

Instantly share code, notes, and snippets.

View langolf's full-sized avatar

Aleksandr Langolf langolf

View GitHub Profile
@langolf
langolf / merge.ts
Last active November 5, 2024 11:33
sort
const mergeSort = (arr: number[]): number[] => {
if (arr.length < 2) {
return arr;
}
const middle = Math.floor(arr.length / 2);
const left = arr.slice(0, middle);
const right = arr.slice(middle);
const sortedLeft = mergeSort(left);
{
"scripts": [],
"styles": []
}
@langolf
langolf / index.md
Last active March 6, 2024 22:16
Interview

JavaScript

Questions

  1. Explain event delegation
  2. Explain how this works in JavaScript

Answers

  1. Explain event delegation
@langolf
langolf / foo.md
Created June 17, 2022 21:06
sksk

sdf

@langolf
langolf / karabiner.json
Last active April 24, 2022 20:22
config
{
"rules": [
{
"description": "left_command alone -> ⌘ + tab to last app",
"manipulators": [
{
"from": {
"key_code": "left_command"
},
"to": [
@langolf
langolf / WebGL-WebGPU-frameworks-libraries.md
Created March 18, 2021 11:24 — forked from dmnsgn/WebGL-WebGPU-frameworks-libraries.md
A collection of WebGL and WebGPU frameworks and libraries

A non-exhaustive list of WebGL and WebGPU frameworks and libraries. It is mostly for learning purposes as some of the libraries listed are wip/outdated/not maintained anymore.

Engines and libraries

  • three.js: JavaScript 3D library
  • stack.gl: an open software ecosystem for WebGL, built on top of browserify and npm.
  • PixiJS: Super fast HTML 5 2D rendering engine that uses webGL with canvas fallback
  • Pex: Pex is a javascript 3d library / engine allowing for seamless development between Plask and WebGL in the browser.
  • Babylon.js: a complete JavaScript framework for building 3D games with HTML 5 and WebGL
  • Filament: Filament is a real-time physically based rendering engine for Android, iOS, Windows, Linux, macOS and WASM/WebGL
  • ClayGL: A WebGL graphic library
@langolf
langolf / index.md
Last active February 18, 2021 16:52
Disable letter keybinding with option

Save the following to ~/Library/KeyBindings/DefaultKeyBinding.dict (create if necessary).

{ "~a" = (); "~b" = (); "~c" = (); "~d" = (); "~e" = (); "~f" = (); "~g" = (); "~h" = (); "~i" = (); "~j" = (); "~k" = (); "~l" = (); "~m" = (); "~n" = (); "~o" = (); "~p" = (); "~q" = (); "~r" = (); "~s" = (); "~t" = (); "~u" = (); "~v" = (); "~w" = (); "~x" = (); "~y" = (); "~z" = (); } This disables all the ⌥ combinations. Restart apps to take effect.

The DefaultKeyBinding.dict above is an old-style property list1, defining key-value pairs using the syntax { key = value }. In this case, the keys are the key combinations to activate the method in the value.

Standard dictionary key symbols are used: ~ alt, ^ control, $ shift, @ command. Therefore ~a means ⌥A (alt-A) and ^$1 would be ⌃⇧1 (control-shift-1).

@langolf
langolf / git.sh
Last active June 14, 2020 09:56
Git maintenance
git fsck --full --unreachable
git repack -A -d
git gc --aggressive --prune=now
@langolf
langolf / monokai.js
Last active February 29, 2020 14:37
const colors = ["#00000000" "#000000aa" "#00bcf233" "#00bcf299" "#2d2a2e" "#4d4a4e" "#5b595c" "#5B595C" "#7abd7a4d" "#7c7c7c4d" "#8db9e2" "#78dce8" "#78DCE8" "#78DCE859" "#81b88b" "#221f22" "#221f22bf" "#264f78" "#403e41" "#4169e1" "#6796E6" "#19181a" "#355000" "#525252" "#585858" "#727072" "#939293" "#80808059" "#99999959" "#a0a0a0" "#a9dc76" "#A9DC76" "#a9dc7619" "#a9dc7626" "#A9DC7659" "#ab9df2" "#AB9DF2" "#AB9DF259" "#B267E6" "#bbbbbb" "#bebebe" "#c1c0c0" "#C1C0C0" "#c1c0c026" "#c5c5c5" "#c6c6c6" "#CD9731" "#d18616" "#F44747" "#fc9867" "#FC9867" "#FC986759" "#fcfcfa" "#FCFCFA" "#fcfcfa0c" "#fcfcfa09" "#fcfcfa12" "#fcfcfa19" "#fcfcfa26" "#ff6188" "#FF6188" "#ff618819" "#ff618826" "#FF618859" "#ffd866" "#FFD866" "#FFD86659" "#ffff0033" "#ffffff" "#FFFFFF" "#ffffff1a" "#ffffff13"]
@langolf
langolf / SketchSystems.spec
Created February 22, 2020 10:05
My Awesome Sketch
My Awesome Sketch
First State
some event -> Second State
Second State