Skip to content

Instantly share code, notes, and snippets.

View anna-is-cute's full-sized avatar

Anna anna-is-cute

View GitHub Profile
@EventHandler(priority = EventPriority.HIGH)
public void zombieIsMasterRace(CreatureSpawnEvent e) {
if (e.getEntityType() == EntityType.ZOMBIE) { // convert ALL zombies in ALL worlds
if (ZombieSpawner.getSurvivorsZombie((Zombie) e.getEntity()) == null) {
e.setCancelled(true);
ZombieSpawner.spawnLeveledZombie(e.getLocation());
}
return;
}
final Entity entity = e.getEntity();
@anna-is-cute
anna-is-cute / data.py
Created May 22, 2014 18:51
ten.java points stats
from json import loads
from urllib.request import urlopen
from statistics import mean, median, mode, stdev, variance
def getPointsList(transactions):
points = []
for transaction in transactions:
points.append(transaction["amount"])
return points
@anna-is-cute
anna-is-cute / google.py
Created May 27, 2014 05:00
Google Voice
from os import listdir
from urllib2 import urlopen
from sys import argv
from subprocess import call
if len(argv) < 2:
quit()
words = argv[1:]
for word in words:
files = listdir(".")
if ("%s.mp3" % word) in files: continue
/**
* ZNC Push Module
*
* Allows the user to enter a Push user and API token, and sends
* channel highlights and personal messages to Push.
*
* Copyright (c) 2011 John Reese
* Licensed under the MIT license
*/
// --- Expected behavior ---
// FROM PLAYER :
// /kh : Show kick history of self (first)
// /kh 2 : Show kick history of self (second)
// /kh person : Show kick history of person (first)
// /kh person 2 : Show kick history of person (second)
// FROM CONSOLE :
// /kh : Usage
// /kh 2 : Usage
private class Pair<T, U> {
private final T first;
private final U second;
private Pair(T first, U second) {
this.first = first;
this.second = second;
}
public T getFirst() {
@EventHandler
public void onFood(FoodLevelChangeEvent e) {
e.setFoodLevel(e.getFoodLevel() / 2);
}
public class APIAPI {
public static boolean isAPI() {
return APIAPI.isAPI();
}
}
public class Bicycle {
// code
}
public class CoolBike extends Bicycle {
// code
}
public void doSomething(Class<? extends Bicycle> bikeClass) {
new Runnable() {
final AbstractEventRegistrar aer = new AbstractEventRegistrar(this);
aer.registerAbstractListener(InventoryEvent.class, new Listener() {
@EventHandler
public <T extends InventoryEvent> void onInventoryEvent(T e) {
if (e instanceof Cancellable) {
final Cancellable c = (Cancellable) e;
c.setCancelled(true);
}
}
}, EventPriority.HIGHEST);