Skip to content

Instantly share code, notes, and snippets.

View Aaronphy's full-sized avatar
🏀
Focusing

Aaronphy Aaronphy

🏀
Focusing
View GitHub Profile
@akai
akai / vscode.settings.json
Created November 22, 2021 06:14
vscode.settings
{
"editor.fontSize": 16,
"editor.fontFamily": "'Fira Code'",
"editor.tabSize": 2,
"editor.fontLigatures": true,
"editor.rulers": [
80,
100
],
"editor.accessibilitySupport": "off",
@wheelo
wheelo / useAppSelector.ts
Created March 24, 2022 10:20 — forked from justblender/useAppSelector.ts
Custom Redux.useSelector() hook for React Native apps
import { useEffect, useReducer, useRef } from 'react';
import { useNavigation } from '@react-navigation/native';
import { useSelector } from 'react-redux';
const undefinedRef = Symbol();
const refEquality = (a: Object, b: Object) => a === b;
export function useAppSelector<Selected = unknown>(
@iwill
iwill / semverCompare.js
Last active October 2, 2024 09:14
JavaScript - Comparison of Semantic Versioning
/**
* Semantic Versioning Comparing
* #see https://semver.org/
* #see https://stackoverflow.com/a/65687141/456536
* #see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator/Collator#options
*/
function semverCompare(a, b) {
if (a.startsWith(b + "-")) return -1
if (b.startsWith(a + "-")) return 1
return a.localeCompare(b, undefined, { numeric: true, sensitivity: "case", caseFirst: "upper" })
@OrionReed
OrionReed / dom3d.js
Last active April 19, 2025 12:06
3D DOM viewer, copy-paste this into your console to visualise the DOM topographically.
// 3D Dom viewer, copy-paste this into your console to visualise the DOM as a stack of solid blocks.
// You can also minify and save it as a bookmarklet (https://www.freecodecamp.org/news/what-are-bookmarklets/)
(() => {
const SHOW_SIDES = false; // color sides of DOM nodes?
const COLOR_SURFACE = true; // color tops of DOM nodes?
const COLOR_RANDOM = false; // randomise color?
const COLOR_HUE = 190; // hue in HSL (https://hslpicker.com)
const MAX_ROTATION = 180; // set to 360 to rotate all the way round
const THICKNESS = 20; // thickness of layers
const DISTANCE = 10000; // ¯\\_(ツ)_/¯