Skip to content

Instantly share code, notes, and snippets.

View Wyn-Price's full-sized avatar
🏠
Working from home

Wyn Price Wyn-Price

🏠
Working from home
View GitHub Profile
local internet = require("internet")
local M = {};
function M.sendMetric(metric, tags, values)
local handle = internet.request(
"http://localhost:8086/api/v2/write?org=netblock&bucket=minecraft",
lineProtocol(metric, tags, values),
{ Authorization = "Token <redacted>" },
"POST"
)
//This is a normal jar with no classifier
function normalJar(r) {
//Getting the maven artifacts from the url. Note for this code to be even run in the first place,
//the url has to match a regex pattern, meaning I don't need to worry about index out of bound issues.
var split = r.uri.split('\/')
var identifier = split[3]
var id = split[4]
var lastIdx = identifier.lastIndexOf('-');
@Wyn-Price
Wyn-Price / build.gradle
Created July 4, 2020 23:54
Using the cursemaven site
dependencies {
compile "curse.maven:jei:2724420"
}
@Wyn-Price
Wyn-Price / build.gradle
Created July 4, 2020 23:52
Applying the cursemaven website
repositories {
maven {
url = "https://www.cursemaven.com"
}
}
@Wyn-Price
Wyn-Price / pg2tsrg.py
Last active September 12, 2019 15:34
import os
import re
filename = "client"
data = open(filename + ".txt").read() #Or server.txt
lines = data.splitlines()
current_line, counter, deobf2obf = 0, 0, {}
out = ""
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.BufferBuilder;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
import net.minecraft.entity.Entity;
import net.minecraftforge.client.event.RenderWorldLastEvent;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import org.lwjgl.opengl.GL11;
extern crate array_init;
use std::*;
static SEPARATOR: &str = "----|";
fn main() {
let mut reader = InputReader::new(String::from("(2+1)*3"));
let t = Expression::new(&mut reader, false);
println!("{}", t.get_value())
extern crate piston_window;
extern crate rand;
extern crate array_init;
extern crate hsl;
use piston_window::*;
use rand::Rng;
use hsl::*;
const CUBE_SIZE: i32 = 100;
extern crate piston_window;
extern crate rand;
extern crate array_init;
use piston_window::*;
use rand::Rng;
const CUBE_SIZE: i32 = 100;
const NUM_CUBES: usize = 8;
private void drawBox(int x, int y, int width, int height, int borderSize, int insideColor, int borderColor) {
Gui.drawRect(x, y, x + width, y + height, insideColor);
Gui.drawRect(x, y, x + width, y + borderSize, borderColor);//Top
Gui.drawRect(x, y + height, x + width, y + height - borderSize, borderColor);//Bottom
Gui.drawRect(x, y, x + borderSize, y + height, borderColor);//Left
Gui.drawRect(x + width, y, x + width - borderSize, y + height, borderColor);//Right
}