Skip to content

Instantly share code, notes, and snippets.

View TeamDman's full-sized avatar
🌜
Ahoy!

TeamDman

🌜
Ahoy!
View GitHub Profile
@TeamDman
TeamDman / BaseScreen.java
Created August 18, 2020 03:53
Drawing transparent textures that are otherwise opqaue
public void drawTextureRaw(
MatrixStack matrixStack, int x, int y,
int srcX, int srcY, int w, int h, int r, int g, int b, int a
) {
RenderSystem.enableBlend();
RenderSystem.disableAlphaTest();
Matrix4f matrix = matrixStack.getLast().getMatrix();
int blitOffset = getBlitOffset();
BufferBuilder bufferbuilder = Tessellator.getInstance().getBuffer();
bufferbuilder.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_COLOR_TEX);
@TeamDman
TeamDman / Packets.java
Created December 27, 2020 22:29
Minecraft 1.16 packet handler exmaple
import ca.teamdman.sfm.SFM;
import java.util.function.Supplier;
import net.minecraft.network.PacketBuffer;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fml.network.NetworkEvent.Context;
import net.minecraftforge.fml.network.NetworkRegistry;
import net.minecraftforge.fml.network.simple.SimpleChannel;
class Scratch {
import java.util.Optional;
import java.util.Random;
import java.util.stream.IntStream;
import net.minecraft.util.Util;
import org.junit.jupiter.api.RepeatedTest;
import org.junit.jupiter.api.Test;
public class StreamOptionalTest {
private static final Random rand = new Random(42);
@TeamDman
TeamDman / beans.ps1
Created July 6, 2022 16:08
Creating a self signed cert with root CA
#!/bin/pwsh
openssl req -x509 `
-sha256 `
-days 365 `
-newkey rsa:2048 `
-subj "/CN=BEANS" `
-keyout rootCA.key `
-nodes `
-out rootCA.crt
# -pass pass:beans `
@TeamDman
TeamDman / selfsignedcerts.ps1
Created July 13, 2022 17:47
Create a self signed cert and authority
#!/bin/pwsh
openssl req -x509 `
-sha256 `
-days 365 `
-newkey rsa:2048 `
-subj "/CN=ME" `
-keyout rootCA.key `
-nodes `
-out rootCA.crt
# -pass pass:beans `
@TeamDman
TeamDman / find-rg-owners.ps1
Last active August 30, 2023 13:13
Find the owners of an Azure resource group by looking at assigned roles, tags, and the activity log
#!/usr/bin/env pwsh
[CmdletBinding()]
param(
[Parameter(Mandatory = $true)][string]$ResourceGroup,
[Parameter(Mandatory = $false)][string]$Subscription
);
function Format-TableHighlight($data) {
$data | Format-Table @{
@TeamDman
TeamDman / ask.ps1
Created March 12, 2025 20:51
A PowerShell function that lets you use Ollama with piped content `echo "25*25" | ask "What numbers are present in the expression?"`
function ask {
[CmdletBinding()]
param(
# We expect pipeline input to be strings (lines)
[Parameter(ValueFromPipeline)]
[string]
$StdinContent,
[Parameter(Mandatory, Position=0)]
[string]
@TeamDman
TeamDman / README.md
Last active March 20, 2025 16:36
Addressing CVE-2025-30258 on Windows, Gpg4Win
@TeamDman
TeamDman / response.md
Last active April 16, 2025 06:40
Asking GPT4.1 about SFM

Response from GPT 4.1 on 2025-04-16

Absolutely! Here’s a comprehensive demonstration of my understanding of Super Factory Manager (SFM), based on your documentation, examples, and test code.


Super Factory Manager: Comprehension Overview

1. What is Super Factory Manager?

@TeamDman
TeamDman / Install-Torch.ps1
Last active May 1, 2025 22:26
Behold, a consistent way to install PyTorch on Windows using uv
# https://gist.github.com/TeamDman/f05ec9944b956e21fd1ec120af6adbad
uv sync
$index_url = "https://download.pytorch.org/whl/cu128"
$packages = @(
"torch",
"torchvision",
"torchaudio"
)
$to_add = @(
"markupsafe<3.0.2" # fuck python package management, windows fails without this