Skip to content

Instantly share code, notes, and snippets.

@EliteMasterEric
EliteMasterEric / SourceMemory.js
Created May 8, 2015 22:16
Source Memory for Screeps
/* This module allows you to store memory in energy sources,
similarly to other objects like spawns and creeps.
It can even by accessed by the source.memory alias!
To use this in your code, add this line to the top of main:
var SourceMemory = require("SourceMemory");
*/
//Creating source memory...
console.log("Creating source memory...");
@EliteMasterEric
EliteMasterEric / FlairAccessor.py
Last active August 29, 2015 14:21
Reddit PRAW Flair Statistics
import datetime
import time
import random
import os
import requests.exceptions
import re
import praw
from traceback import format_exc
'''
// ==UserScript==
// @name AutoLogin
// @namespace MasterEric
// @include http://1.1.1.1/login.html*
// @description Automatically login to OCSGuest.
// @version 1
// @grant none
// ==/UserScript==
setTimeout(function() { submitAction(); }, 1000);
// ==UserScript==
// @name AutoUsernameMCVote
// @namespace AutoUsernameMCVote
// @include http://minecraft-mp.com/server/*/vote/
// @include http://minecraft-server-list.com/server/*/vote/
// @include http://minecraftservers.org/vote/*
// @include http://topg.org/Minecraft/in-*
// @description Insert Username into fields on Minecraft Voting Sites
// @version 1
// @grant none
// ==UserScript==
// @name AutoSkipAdfly (*BROKEN*)
// @namespace MasterEric
// @include http://adfoc.us/serve/?id=*
// @include http://adf.ly/*
// @description Automatically skip ads on adf.ly and adfoc.us
// @version 1
// @grant none
// ==/UserScript==
@EliteMasterEric
EliteMasterEric / hash.py
Created November 6, 2016 22:00
Simple perceptual hashing in Python.
# Import the Python Image Library.
from PIL import Image
# Constant values for image locations, etc.
IMAGE_INPUT = "Square.png"
IMAGE_OUTPUT_GRAY = "Gray.png"
IMAGE_OUTPUT_SCALED = "Scaled.png"
IMAGE_OUTPUT_HASH = "Hashed.png"
# The size of the scaled image used for hashing, in pixels.
@EliteMasterEric
EliteMasterEric / meta.json
Last active March 16, 2017 01:43
Forge Update Checker For M.E.T.A.
{
"homepage": "https://minecraft.curseforge.com/projects/m-e-t-a",
"promos": {
"1.11.2-latest": "1.1.3",
"1.11.2-recommended": "1.1.3",
"1.10.2-latest": "1.1.3",
"1.10.2-recommended": "1.1.3",
},
"1.11.2": {
"1.1.3": "Minor crash fix to resolve a config crash.",
@EliteMasterEric
EliteMasterEric / flair_statistics.py
Created November 16, 2017 23:25
Excerpt of moderator bot detailing how to retrieve flair statistics
for subreddit_name in config["flair_statistics_subreddits"]:
log.info("Retrieving flair statistics for subreddit: " + subreddit_name)
# Get the list of users and what flair they've selected.
# reddit is an instance of praw.Reddit.
reddit_flair_actual_list = reddit.subreddit(subreddit_name).flair(limit=None)
reddit_flair_possible_list = reddit.subreddit(subreddit_name).flair.link_templates
# Create variables in preparation for counting usage for each flair in a loop.
reddit_flair_current_choices = {}
reddit_flair_total_users = 0;
@EliteMasterEric
EliteMasterEric / RubyAnimalFarm.rb
Created November 17, 2017 14:57
First version, basic program
#---------------------------------------------------------
#
# Script Name: RubyAnimalFarm.rb
# Version: 1.0
# Author: Eric Myllyoja
# Date: November 2017
#
# Description: This Ruby program uses animals to demonstrate
# concepts of object oriented programming
#
@EliteMasterEric
EliteMasterEric / perfect2.java
Created April 14, 2018 15:18
Battle Cats Seed Calculator
public class perfect2 {
// ===== CHANGE THIS DATA BASED ON YOUR CURRENT GATCHA
// Number of different Uber-Super-Rares in this set.
public static final int UBER_COUNT = 61;
// Number of different Super-Rares in this set, 16 normally 23 limited.
public static final int SUPER_COUNT = 23;
// Number of different Rares in this set, usually 23.
public static final int RARE_COUNT = 23;