Skip to content

Instantly share code, notes, and snippets.

@mammothbane
mammothbane / MyList.java
Last active December 12, 2015 05:48
successful List<E> implementation in half an hour
import java.util.*;
public class MyList<E> implements List<E> {
public boolean add(E e) {
throw new UnsupportedOperationException();
}
public void add(int index, E element) {
throw new UnsupportedOperationException();
}
@mammothbane
mammothbane / guess.py
Created August 30, 2015 11:57
mmr guesser for DotA 2, based on /u/Erolon's original java implementation
__author__ = 'mammothbane'
import sys
import requests
from bs4 import BeautifulSoup
import logging
logging.basicConfig(level=logging.DEBUG, filename='guess.log')
dotabuff_url = 'http://www.dotabuff.com/players/'
for x in range(1, len(sys.argv)):
@mammothbane
mammothbane / defines.lua
Created December 18, 2014 04:34
Europa Universalis IV modified defines file (common/defines.lua) - remove colonial nations
NDefines = {
NGame = {
START_DATE = "1444.11.11",
END_DATE = "1821.1.2",
MAX_RANDOM_NEW_WORLD = "1492.1.1"
},
NDiplomacy = {
MAX_CLIENT_STATES = 10, -- Max client states for one country
@mammothbane
mammothbane / woodo.c
Last active August 29, 2015 14:10
sudo woodo
#include <unistd.h>
#include <stdio.h>
int main(int argc, char **argv) {
uid_t uid = geteuid();
if (uid) {
printf("It's a weird tree.\n");
} else {
printf(" _ __\n");
printf(" / `\\ (~._ ./ )\n");