Skip to content

Instantly share code, notes, and snippets.

View sthag's full-sized avatar

Stephan sthag

View GitHub Profile
@OrionReed
OrionReed / dom3d.js
Last active May 21, 2024 18:22
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; // ¯\\_(ツ)_/¯
@kiram9
kiram9 / gist:3a5415a015e7e70a4a8c2f9f3f4e623d
Created September 27, 2021 22:59
Framework Laptop port80 codes
//
// SEC Functionality
//
#define SEC_SYSTEM_POWER_ON 0x01 // CPU power on and switch to Protected mode
#define SEC_BEFORE_MICROCODE_PATCH 0x02 // Patching CPU microcode
#define SEC_AFTER_MICROCODE_PATCH 0x03 // Setup Cache as RAM
#define SEC_ACCESS_CSR 0x04 // PCIE MMIO Base Address initial
#define SEC_GENERIC_MSRINIT 0x05 // CPU Generic MSR initial
#define SEC_CPU_SPEEDCFG 0x06 // Setup CPU speed
#define SEC_SETUP_CAR_OK 0x07 // Cache as RAM test
@goodmami
goodmami / logging.bash
Last active May 6, 2024 18:24
Basic logging commands for Linux shell scripts
#!/bin/bash
##
## Simple logging mechanism for Bash
##
## Author: Michael Wayne Goodman <goodman.m.w@gmail.com>
## Thanks: Jul for the idea to add a datestring. See:
## http://www.goodmami.org/2011/07/simple-logging-in-bash-scripts/#comment-5854
## Thanks: @gffhcks for noting that inf() and debug() should be swapped,
## and that critical() used $2 instead of $1
//
// Regular Expression for URL validation
//
// Author: Diego Perini
// Created: 2010/12/05
// Updated: 2018/09/12
// License: MIT
//
// Copyright (c) 2010-2018 Diego Perini (http://www.iport.it)
//