This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Helpers to define enumeration classes. | |
An enumeration is a "namespace" or "class" of constants that define a number | |
of values within that namespace that are canonical or descriptive, and usually | |
represent the full range of possible values within that realm. This allows for | |
having more descriptive and clear code and also helps prevent errors due to | |
mis-spelling of constants. | |
Simple Example:: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MyPlugin { | |
public boolean onCommand(CommandSender sender, Command cmd, | |
String commandLabel, String[] args) { | |
if (args[0].equals("eat")) { | |
// do something | |
return false; // wait is it false or true? | |
} else if (args[0].equals("sleep")) { | |
// do something else | |
} else if (args[0].equals("code")) { | |
// I'm getting tired of else ifs :( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package org.bukkit.craftbukkit.metadata; | |
import java.util.ArrayList; | |
import java.util.Collection; | |
import java.util.HashMap; | |
import java.util.Iterator; | |
import java.util.List; | |
import java.util.Map; | |
import org.apache.commons.lang.Validate; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class CraftServer { | |
/** etc */ | |
public boolean registerPlayerMetadataProvider(String metadataKey, MetadataProvider<OfflinePlayer> provider) { | |
return playerMetadata.registerProvider(metadataKey, provider); | |
} | |
public boolean registerWorldMetadataProvider(String metadataKey, MetadataProvider<World> provider) { | |
return worldMetadata.registerProvider(metadataKey, provider); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package us.crast.mondochest; | |
import java.util.ArrayList; | |
import java.util.Collections; | |
import java.util.Map; | |
import org.bukkit.util.BlockVector; | |
import us.crast.utils.CollectionUtil; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FixedMetadataValue: | |
phase1: 143 MB | |
phase2: 214 MB | |
StaticMetadataValue: | |
phase1: 70 MB | |
phase2: 70 MB | |
Testing value FixedMetadataValue: 10000000 iterations |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public @interface Sub { | |
String name(); | |
String description(); | |
String usage(); | |
int minArgs() default 0; | |
boolean allowConsole() default true; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
######### MineralManager 2.1 config | |
# The DEFAULT section sets the defaults for the application. | |
DEFAULT: | |
# If true, only applies to blocks which were there, not placed. | |
mineOriginalOnly: false | |
# If true, you need the MineralManager.User permission for mining | |
# to cause respawn. | |
usePermissions: false |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Form(object): | |
def __init__(self): | |
print "Form init called" | |
class SessionSecureForm(Form): | |
def __init__(self): | |
print "SessionSecureForm about to call super" | |
super(SessionSecureForm, self).__init__() | |
print "SessionSecureForm returned from super" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Test Edit | |
# Builds and installs the python bindings for protobuf | |
# If $INSTALL_PROTOC is set, also installs the protobuf lib and | |
# The protobuf tools. Set $PROTOC_PREFIX to customise that. | |
# | |
# To install to a virtualenv, pass the path to the virtualenv as | |
# the first argument to this script: | |
# $ install_protobuf.sh $HOME/live/python_env |
NewerOlder