Skip to content

Instantly share code, notes, and snippets.

View maxpowa's full-sized avatar
💻
DATABASE DATABASE JUST LIVING IN THE DATABASE WOW WOW

Max Gurela maxpowa

💻
DATABASE DATABASE JUST LIVING IN THE DATABASE WOW WOW
  • ServiceMax
  • Bay Area, California
View GitHub Profile
@maxpowa
maxpowa / dice.cs
Created March 6, 2014 23:29
Dice!
using System;
public enum Die { one = 1, two, three, four, five, six }
public struct Dice
{
static Random rand = new Random();
Die firstDie;
Die secondDie;
@maxpowa
maxpowa / SaveController.java
Created April 16, 2014 00:06
An NBT save/load class
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.FilenameFilter;
import java.io.IOException;
import net.minecraft.client.Minecraft;
import net.minecraft.crash.CrashReport;
import net.minecraft.nbt.CompressedStreamTools;
import net.minecraft.nbt.NBTTagCompound;
@maxpowa
maxpowa / sdfadt
Last active August 29, 2015 14:00
Super-duper-file-age-deletion-tool or SDFADT for short, deletes files recursively in the running directory if their properties indicate that they are older than the user-provided date, and they match the user-provided filter.
@ECHO OFF
ECHO Welcome to the super-duper-file-age-deletion-tool, written by Max Gurela!
ECHO Simply follow through the prompts and you'll be set!
ECHO.
SET /p fileFilter=Please enter a file filter (name.type): %=%
SET /p varDays=Enter maximum age of files (days): %=%
ECHO.>>log.txt
ECHO Starting new file deletion run! %date% - %time%>>log.txt
ECHO ---------------------------------------------------------------->>log.txt
ECHO.
@maxpowa
maxpowa / effect.java
Created August 21, 2014 22:46
2d end void effect - credit to @chylex for inspiration
private static final ResourceLocation texPortalSky = new ResourceLocation("textures/environment/end_sky.png");
private static final ResourceLocation texPortal = new ResourceLocation("textures/entity/end_portal.png");
private static final Random consistentRandom = new Random(31100L);
public void drawCenteredEndEffect(int x, int y, int width, int height, float scale) {
drawEndEffect(x-(width/2), y-(height/2), width, height, scale);
}
public void drawEndEffect(int x, int y, int width, int height, float scale) {
consistentRandom.setSeed(31100L);
@maxpowa
maxpowa / simple_disconnect.cpp
Last active August 8, 2022 22:30
simple_disconnect module for znc 1.6+
/*
* Copyright (C) 2004-2015 ZNC, see the NOTICE file for details.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@maxpowa
maxpowa / factorio-init
Last active September 16, 2017 15:08
Factorio initialization script
#!/bin/bash
# Modified version of https://github.com/Bisa/factorio-init
# Check/load defaults for backwards compatible config options
if [ -z "${PACKAGE_DIR_NAME}" ]; then
PACKAGE_DIR_NAME=factorio
fi
if [ -z "${USERNAME}" ]; then
USERNAME=`whoami`
fi

Keybase proof

I hereby claim:

  • I am maxpowa on github.
  • I am maxpowa (https://keybase.io/maxpowa) on keybase.
  • I have a public key whose fingerprint is 30C1 5A50 F328 C543 8FD8 5C05 413C 9D33 048F 35EE

To claim this, I am signing this object:

# coding=utf-8
"""
repeat_msg.py - Example interval module
Licensed under WTFPL (https://en.wikipedia.org/wiki/WTFPL)
"""
from sopel.module import interval
@interval(60) # Every 60 seconds
def do_the_thing(bot):
@maxpowa
maxpowa / rss.py
Created January 25, 2016 18:35
Port credit to rinzes, I just removed the tinyurl part
# coding=utf8
from __future__ import unicode_literals
from datetime import datetime
import time
import re
import socket
import feedparser
require "../flag.cr"
class ExecuteFlag < Blerp::CommandFlag
def name
:execute
end
def key
"-e"