Skip to content

Instantly share code, notes, and snippets.

View charlieforward9's full-sized avatar
🌎
🔭

Charles Richardson charlieforward9

🌎
🔭
View GitHub Profile
@OrionReed
OrionReed / dom3d.js
Last active June 29, 2024 17:53
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; // ¯\\_(ツ)_/¯
@johannlilly
johannlilly / ui-architecture-compendium.md
Last active January 26, 2024 10:32
The purpose of this document is to articulate considerations, tools, and methodologies for UI architectures with regard to the code, UI design, and project management.
@greenstick
greenstick / print-progress-auto.py
Last active June 27, 2024 20:04
Python: printProgressBar function with autoresize option
# This version of the printProgressBar function implements an optional autoresize argument.
# It has been updated from a previous version to use the shutil Python module to determine
# the terminal size. This update should allow it to work on most operating systems and does
# speed up the autosize feature quite a bit – though it still slows things down quite a bit.
# For more robust features, it's recommended you use a progress bar library like tdqm (see: https://github.com/tqdm/tqdm)
def printProgressBar (iteration, total, prefix = '', suffix = '', decimals = 1, length = 100, fill = '█', autosize = False):
"""
Call in a loop to create terminal progress bar
@params:
@msrose
msrose / combining-git-repositories.md
Last active June 26, 2024 14:30
How to combine two git repositories.

Combining two git repositories

Use case: You have repository A with remote location rA, and repository B (which may or may not have remote location rB). You want to do one of two things:

  • preserve all commits of both repositories, but replace everything from A with the contents of B, and use rA as your remote location
  • actually combine the two repositories, as if they are two branches that you want to merge, using rA as the remote location

NB: Check out git subtree/git submodule and this Stack Overflow question before going through the steps below. This gist is just a record of how I solved this problem on my own one day.

Before starting, make sure your local and remote repositories are up-to-date with all changes you need. The following steps use the general idea of changing the remote origin and renaming the local master branch of one of the repos in order to combine the two master branches.

@Sumbera
Sumbera / README.md
Last active February 12, 2024 16:20
Many points with Leaflet WebGL

Leaflet and WebGL sample rendering 80T points for more info read blog post

inspired by this and by very nice WebGL tutorial here