Skip to content

Instantly share code, notes, and snippets.

View Fuwn's full-sized avatar
✒️
亀の甲より年の功

Fuwn Fuwn

✒️
亀の甲より年の功
View GitHub Profile
@Fuwn
Fuwn / rustfmt.toml
Created May 5, 2023 05:16
My current `rustfmt.toml`
edition = "2021"
enum_discrim_align_threshold = 40
error_on_line_overflow = true
error_on_unformatted = true
fn_single_line = true
format_code_in_doc_comments = true
format_macro_matchers = true
format_strings = true
inline_attribute_width = 80
match_arm_blocks = false
@Fuwn
Fuwn / List-External-Services.ps1
Last active December 18, 2022 22:48
A PowerShell script to list external services that have been installed separately from the base Windows experience. I.e., user-installed services.
foreach ($service in Get-Service | ForEach-Object { $_.Name }) {
$path = Get-ItemProperty -Path Registry::HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\$service | ForEach-Object { $_.ImagePath }
# Change this as you see fit, but it should catch most externally installed services.
if ($path -like "*C:\Windows*") {
continue
}
"{0}: {1}" -f $service, $path | Write-Output
}
User-agent: *
Disallow: /x
Disallow: /proxy
User-agent: DataForSeoBot
Disallow: /x
Disallow: /proxy
@Fuwn
Fuwn / image-to-bmp3.sh
Created January 14, 2022 06:54
Image to BMP3 Converter for Worlds
# Check if a filename was supplied
if ! test -n "${1}";
then
echo "bmp-to-bmp3.sh <file.bmp>"
exit 1
fi
# Check if ImageMagick is installed
if ! command -v mogrify &> /dev/null;
then
# Imports
import re
import requests
import sys
import time
# Constants
YOUTUBE_HEADER_IMAGE_START_URL: str = "yt3.ggpht.com/"
YOUTUBE_HEADER_IMAGE_END_URL: str = "-no-nd-rj"
@Fuwn
Fuwn / DD_RFC.md
Created May 27, 2021 06:14
Double dot operator for initializing vector with another vector's elements

I recently came across a situation where I had to push multiple vectors of thread handles to a central vector.

The first element that I was adding to the central thread comes as follows;

// This works.

// `example_crate::make()` returns a `std::thread::JoinHandle<()>`;
let mut threads = vec![example_crate::make()];
document.getElementsByName("image_width")[0].value = 1000;document.getElementsByName("image_height")[0].value = 1;
@Fuwn
Fuwn / build.bat
Last active June 22, 2021 21:24
RGBDS build script
rgbasm -o main.o main.asm
rgblink -o game.gb main.o
rgbfix -v -p 0 game.gb