Skip to content

Instantly share code, notes, and snippets.

View MrDwarf7's full-sized avatar
👀
Open to freelance work & collaborations!

Blake B. MrDwarf7

👀
Open to freelance work & collaborations!
  • East-Coast, Aus
  • 15:35 (UTC +11:00)
View GitHub Profile
@jacob-acusensus
jacob-acusensus / TestFunction.cpp
Last active September 10, 2025 00:14
Acusensus Graduate Application Question
std::string TestFunction()
{
std::string result;
char c1 = 'a' + 125 % 50 - 1;
char c2 = 'a' + 0b0101 - 1; // 0b == binary literal
char c3 = 't' - 1;
result.push_back(c1);
result.push_back(c2);
result.push_back(c3);
result.insert(0, 1, toupper(c2));
@ClarkeRemy
ClarkeRemy / multiplate.rs
Created April 28, 2025 04:22
Multiplate Rust
//! this library is largely "incorrect" in the sense that projectors should be exitentials and not part of type arguments
// https://hackage.haskell.org/package/multiplate-0.0.3/docs/src/Data-Generics-Multiplate.html
use std::{marker::PhantomData};
pub trait Funct {
type F<T>;
}
@Csqhi515
Csqhi515 / CompactWSL.bat
Created October 18, 2024 17:35
Script to help compact WSL and vhdx.
@echo off
net session >nul 2>&1
if %errorlevel% neq 0 (
echo Requesting administrative privileges...
powershell -Command "Start-Process '%~f0' -Verb RunAs"
exit /b
)
wsl sudo fstrim --all; echo "Exit status: $?";
@ungeskriptet
ungeskriptet / archinstall.md
Last active February 3, 2026 12:18
My personal Arch Linux installation guide for an UEFI install with UKI and optionally secure boot (archinstall.md)

David's personal Arch Linux installation guide

Note

This guide is meant for my personal use. If you're installing Arch Linux for the first time, please follow the official installation guide instead.

1. Flashing the ISO

  1. Download the latest ISO file from https://ftp.halifax.rwth-aachen.de/archlinux/iso/latest/archlinux-x86_64.iso
    • $ curl https://ftp.halifax.rwth-aachen.de/archlinux/iso/latest/archlinux-x86_64.iso -O
  2. Flash the ISO
    • $ cat archlinux-x86_64.iso | sudo tee /dev/sdX > /dev/null
  3. Verify the flashed image on the USB drive (optional)
@AntonC9018
AntonC9018 / .wezterm.lua
Last active September 1, 2024 14:54
Wezterm config
local wezterm = require 'wezterm'
local act = wezterm.action
local config = wezterm.config_builder()
config.use_dead_keys = false
-- https://github.com/wez/wezterm/discussions/5102
config.enable_kitty_keyboard = true
config.allow_win32_input_mode = false
@denji
denji / 01-nvidia.conf
Last active February 27, 2026 22:29
/etc/modprobe.d/nvidia.conf
# /etc/modprobe.d/nvidia.conf
# NVIDIA Linux modprobe.d Configuration
#
# Memory and Performance Enhancements:
#
# - NVreg_UsePageAttributeTable=1 (Default: 0)
# Activates the Page Attribute Table (PAT) for improved memory management.
# PAT creates a partition table at a fixed register-mapped address, potentially enhancing CPU performance.
#
@pablomdo
pablomdo / Dockerfile
Created April 7, 2023 19:58
Docker Squid proxy server example
# Use the official Ubuntu 20.04 image as the base
FROM ubuntu:20.04
# Set environment variables to avoid interactive installation
ENV DEBIAN_FRONTEND=noninteractive
# Update package list and install Squid
RUN apt-get update && \
apt-get install -y squid
@david-a-perez
david-a-perez / fastest_day6_part2.rs
Last active January 22, 2026 11:23
Advent of Code 2023 Day 6 Optimizations
// time: [1.8843 µs 1.8897 µs 1.8955 µs]
pub fn original(input: &[u8]) -> Option<usize> {
let mut idx = 0;
'outer: while idx + 13 < input.len() {
let mut state = 0;
for (next_idx, byte) in input[idx..idx + 14].iter().enumerate().rev() {
let bit_idx = byte % 32;
if state & (1 << bit_idx) != 0 {
idx += next_idx + 1;
continue 'outer;
@marvinlehmann
marvinlehmann / powershell-wol.md
Created October 26, 2022 14:58
How to enable Wake-On-Lan on Windows 10 using PowerShell

Settings for Wake-On-Lan

0. Enabling it in BIOS/UEFI

1. Disabling fast startup and/or hibernation

Turning off fast startup:

New-ItemProperty "HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\Power" -Name HiberbootEnabled -PropertyType DWord -Value 0 -Force

Disabling hibernation, which disables fast startup too (?): POWERCFG /HIBERNATE OFF