Skip to content

Instantly share code, notes, and snippets.

View t56k's full-sized avatar

thomas t56k

  • 16:22 (UTC +10:00)
View GitHub Profile
@timClicks
timClicks / bfs.rs
Created February 15, 2022 03:19
Breadth-first search in Rust
// watch the video if you would like an explanation of this code
// https://youtu.be/FoNJ5zhL6bQ
use std::collections::{HashSet, VecDeque};
use std::hash::Hash;
trait Graph {
type Node: Hash + Eq + Clone + std::fmt::Debug;
fn neighbours(&self, node: &Self::Node) -> Vec<Self::Node>;
@forresto
forresto / tiptap-lite-youtube.ts
Last active February 25, 2024 18:24
tiptap-lite-youtube node type
// Registers the lite-youtube custom element
import "@justinribeiro/lite-youtube";
import { Node, mergeAttributes } from "@tiptap/core";
import { Plugin, PluginKey } from "prosemirror-state";
// Captures the YouTube ID as the first matching group.
// Vendored 2021-10-07 from https://github.com/micnews/youtube-url/blob/master/index.js
const youtubeRegExp =
/^(?:(?:https?:)?\/\/)?(?:www\.)?(?:m\.)?(?:youtu(?:be)?\.com\/(?:v\/|embed\/|watch(?:\/|\?v=))|youtu\.be\/)((?:\w|-){11})(?:\S+)?$/;
@bitonic
bitonic / configuration.nix
Last active May 8, 2024 22:38
NixOS configuration for a remote ZFS server on Hetzner
# Full NixOS configuration for a ZFS server with full disk encryption hosted on Hetzner.
# See <https://mazzo.li/posts/hetzner-zfs.html> for more information.
{ config, pkgs, ... }:
let
# Deployment-specific parameters -- you need to fill these in where the ... are
hostName = "...";
publicKey = "...";
# From `ls -lh /dev/disk/by-id`
@munrocket
munrocket / wgsl_3d_sdf.md
Last active September 15, 2024 15:11
WGSL 3D SDF Primitives

WGSL 3D SDF Primitives

Revision: 06.08.2023, https://compute.toys/view/407

Sphere - exact

fn sdSphere(p: vec3f, r: f32) -> f32 {
  return length(p) - r;
}
@Zenithar
Zenithar / Archlinux-EFI-LUKS2-LVM2-BTRFS-Systemd.md
Last active November 16, 2022 12:52
Tutorial d'installation Archlinux sur un SSD (NVMe) avec EFI / LUKS2 / LVM2 / BTRFS et systemd-boot comme chargeur de démarrage.

section: post date: "2020-04-12" title: "Archlinux sur un SSD avec EFI / LUKS2 / LVM2 / BTRFS" description: "Procédure d'installation d'Archlinux mise à jour et modernisée" slug: archlinux-efi-ssd-luks2-lvm2-btrfs tags:

  • linux
  • devops
  • luks2
@gbrow004
gbrow004 / ubuntu-MBP-16.md
Last active July 12, 2024 21:40
Ubuntu on Apple Macbook Pro 16-inch (2019)

Update!

This gist is out of date and I can no longer help much, as I got rid of my Mac.

Please visit T2 Linux website for more and better information:

https://t2linux.org/

Acknowledgements

This gist is just a compilation of the hard work that others have put in. I'm not a software developer, so if there are any mistakes or better ways of doing things, I'd appreciate any suggestions. Here's a list of the real heroes who made this possible:

@rickmark
rickmark / clean_t2_restore.sh
Last active March 15, 2024 20:18
Perform a FOSS restore of an Apple T2 processor
#!/bin/bash
WORKING_DIRECTORY=`pwd`
repo_list=(libimobiledevice idevicerestore libplist libusbmuxd usbmuxd libirecovery)
for repo in ${repo_list[@]}; do
directory="$WORKING_DIRECTORY/$repo"
if [ -d "$directory" ]; then
rm -rf "$directory"
fi
@emptyflask
emptyflask / config.nix
Created October 29, 2019 20:34
ruby nix shell
import ( builtins.fetchGit {
name = "nixpkgs-2019-08-25";
url = https://github.com/nixos/nixpkgs/;
rev = "8d1510abfb592339e13ce8f6db6f29c1f8b72924";
}) {
config = {
allowUnfree = true;
};
}
@Neo23x0
Neo23x0 / Base64_CheatSheet.md
Last active August 26, 2024 21:26
Learning Aid - Top Base64 Encodings Table

Base64 Patterns - Learning Aid

Base64 Code Mnemonic Aid Decoded* Description
JAB 🗣 Jabber $. Variable declaration (UTF-16), e.g. JABlAG4AdgA for $env:
TVq 📺 Television MZ MZ header
SUVY 🚙 SUV IEX PowerShell Invoke Expression
SQBFAF 🐣 Squab favorite I.E. PowerShell Invoke Expression (UTF-16)
SQBuAH 🐣 Squab uahhh I.n. PowerShell Invoke string (UTF-16) e.g. Invoke-Mimikatz
PAA 💪 "Pah!" &lt;. Often used by Emotet (UTF-16)
@CMCDragonkai
CMCDragonkai / linux_kernel_modules_nixos.md
Last active July 16, 2024 22:22
Linux Kernel Modules for NixOS #linux #nixos

Linux Kernel Modules for NixOS

You can find what kernel modules are loaded using lsmod.

However some kernel modules are required at stage 1 boot. Basically preloaded in the initial ram disk before switching to the root filesystem. These kernel modules are mostly needed to deal with peripherals, storage devices, filesystems and network devices. You may need to be wary of these required modules:

  • sd_mod - SCSI, SATA, and PATA (IDE) devices