Skip to content

Instantly share code, notes, and snippets.

@joelstransky
joelstransky / custom-file-size-units.js
Last active March 28, 2024 14:42
Custom Intl.NumberFormat units
sizeFormatter = new Intl.NumberFormat([], {
style: "unit",
unit: "byte",
notation: "compact",
unitDisplay: "narrow",
});
(_bytes) => {
const units = { B: " bytes", KB: " kb", MB: " mb", GB: " gb", TB: " tb" };
const parts = sizeFormatter.formatToParts(_bytes);
@OrionReed
OrionReed / DOM3D.js
Last active March 28, 2024 14:41
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; // ¯\\_(ツ)_/¯

How to get @DevBlackOps Terminal-Icons module working in PowerShell on Windows

Note: since version 0.1.1 of the module this now works in Windows PowerShell or PowerShell Core.

  1. Download and install this version of Literation Mono Nerd Font which has been specifically fixed to be recognised as monospace on Windows:

https://github.com/haasosaurus/nerd-fonts/blob/regen-mono-font-fix/patched-fonts/LiberationMono/complete/Literation%20Mono%20Nerd%20Font%20Complete%20Mono%20Windows%20Compatible.ttf

(see this issue for more info: ryanoasis/nerd-fonts#269)

@cassidoo
cassidoo / base-css.md
Created May 4, 2022 06:37
Base CSS for a plain HTML document

If you don't want to deal with styling a mostly text-based HTML document, plop these lines in and it'll look good:

html {
  font-family: 'Helvetica Neue', 'Helvetica', 'Arial', sans-serif;
  font-size: 1.3em;
  max-width: 40rem;
  padding: 2rem;
  margin: auto;
 line-height: 1.5rem;
@fakhrullah
fakhrullah / list-of-hacking-games.md
Last active March 28, 2024 14:38
List of hacking game, wargame or capture the flag (CTF) for some one who want to learn hacking.
@Alee14
Alee14 / win-dism.md
Last active March 28, 2024 14:38
Installing Windows using CMD. (UEFI and BIOS Supported)

Installing Windows using CMD. (UEFI and BIOS Supported)

Guide created by Andrew Lee

Note that this guide does not go into detail, it's just providing the commands to install Windows.

Be cautions when doing this when dualbooting, please backup any existing data or you will lose them all.

Open CMD

First open CMD by pressing the following keys after booting into setup: Shift + F10

Creating Partition

@0xdevalias
0xdevalias / _deobfuscating-unminifying-obfuscated-web-app-code.md
Last active March 28, 2024 14:38
Some notes and tools for reverse engineering / deobfuscating / unminifying obfuscated web app code
@bublick
bublick / git-ssh-auth-win-setup.md
Created March 28, 2024 14:37 — forked from bsara/git-ssh-auth-win-setup.md
Setup SSH Authentication for Git Bash on Windows

Setup SSH Authentication for Git Bash on Windows

Prepararation

  1. Create a folder at the root of your user home folder (Example: C:/Users/uname/) called .ssh.
  2. Create the following files if they do not already exist (paths begin from the root of your user home folder):
  • .ssh/config
@alexeyknorre
alexeyknorre / stargazer_fix.r
Created May 31, 2022 04:50
Quick fix for stargazer <= 5.2.3 is.na() issue with long model names in R >= 4.2
## Quick fix for stargazer <= 5.2.3 is.na() issue with long model names in R >= 4.2
# Unload stargazer if loaded
detach("package:stargazer",unload=T)
# Delete it
remove.packages("stargazer")
# Download the source
download.file("https://cran.r-project.org/src/contrib/stargazer_5.2.3.tar.gz", destfile = "stargazer_5.2.3.tar.gz")
# Unpack
untar("stargazer_5.2.3.tar.gz")
# Read the sourcefile with .inside.bracket fun
@neilcsmith-net
neilcsmith-net / nb2appimage.sh
Last active March 28, 2024 14:36
Apache NetBeans AppImage creation script
#!/usr/bin/env bash
# Bash script to download Apache NetBeans and (optionally) a JDK, then package into an AppImage.
#
# Use at own risk! Will create a /build directory inside current directory for downloading and
# building. AppImage will be created in current directory.
#
# (c) 2020 Neil C Smith - neil@codelerity.com
shopt -s extglob