Skip to content

Instantly share code, notes, and snippets.

View TeamDman's full-sized avatar
🌜
o/

TeamDman

🌜
o/
View GitHub Profile
@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 / 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 / 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 `
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 / 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 {
@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 / WorldFlowView.java
Created May 3, 2020 22:09
BlockModelRenderer::renderModel test
package ca.teamdman.sfm.client.gui;
import ca.teamdman.sfm.client.gui.core.BaseScreen;
import ca.teamdman.sfm.client.gui.core.IFlowView;
import net.minecraft.block.BlockState;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.BlockRendererDispatcher;
import net.minecraft.client.renderer.BufferBuilder;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.model.IBakedModel;
@TeamDman
TeamDman / forgeevents.html
Created February 25, 2020 01:26
List of many Minecraft Forge events
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de" lang="de">
<head>
<title>Forge Events</title>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" />
<meta name="description" content="" />
<meta name="author" content="Vic" />
<meta name="keywords" content="" />
@TeamDman
TeamDman / .eslintrc
Last active March 2, 2020 16:13
ESLint + Prettier + Typescript setup
{
"env": {
"commonjs": true,
"es6": true,
"node": true
},
"extends": [
"plugin:vue/base",
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
@TeamDman
TeamDman / behind.js
Created December 19, 2019 06:11
Query what manga you are behind on reading
delete get;
delete myId;
delete manga;
delete mangaIdList;
delete socials;
delete i;
delete socialPosts;
delete latestChapters;
const myId = 122045;
const get = (operation, append) => fetch("https://graphql.anilist.co/", {