Skip to content

Instantly share code, notes, and snippets.

View TeamDman's full-sized avatar
🌜
o/

TeamDman

🌜
o/
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 @{