Skip to content

Instantly share code, notes, and snippets.

View t56k's full-sized avatar

thomas t56k

  • 18:50 (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 2, 2024 23:24
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`
@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 April 19, 2024 11: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 March 10, 2024 09:15
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)
@TRPB
TRPB / arch-macbook2018.md
Last active November 20, 2023 13:21
Guide: Running Arch on a 2018 MacBook Pro

Hardware Prerequisites

You'll need at least the following hardware:

  • At least 3 USB-A to USB-C converters or hub with enough ports for at least 3 USB devices if all your devices are USB-A then:
  • A USB drive
  • A USB keyboard
  • USB to Ethernet adapter, compatible USB dongle or USB tethering on a phone
@mikowl
mikowl / nord-vimium.css
Created July 5, 2019 19:07
Nord Vimium Theme
/* Nord Vomnibar CSS */
/* Installation: Open Vimium Options -> Click "Show Advanced Options" and paste this into the CSS for Vimium UI text area. */
#vomnibar ol, #vomnibar ul {
list-style: none;
display: none;
}
#vomnibar {
background: rgba(46, 52, 68, 0.9);