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 de.cubeisland.KeepAlive; | |
import java.util.List; | |
import java.util.Random; | |
import java.util.Timer; | |
import java.util.TimerTask; | |
import net.minecraft.server.EntityPlayer; | |
import net.minecraft.server.Packet0KeepAlive; | |
import net.minecraft.server.ServerConfigurationManager; | |
import org.bukkit.craftbukkit.CraftServer; |
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
@Alias( // specifies an alias command for this command | |
names = {"aliasCOmmand", "shorter"}, // the alias names, first is the main name | |
parentPath = {"root","sub", "subsub"} // optional: the command path under which the alias should be registered (default: root) | |
) | |
@Command( // annotates the method as a command and provides all needed information | |
names = {"mycommand", "myalias"}, // command names, first is the main name | |
min = 2, // optional: the minimum number of indexed parameters | |
max = 7, // optional: the maximum number of indexed parameters | |
permission = true, // optional: whether to check a permission (default: true) | |
permissionNode = "my.permission.node" // optional: the permission to check, will be generated if not given |
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 static String getModuleFromStacktrace() | |
{ | |
final String className = Thread.currentThread().getStackTrace()[2].getClassName(); | |
return className.substring(0, className.indexOf(".", 0)); | |
} |
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
<?php | |
class TestController implements Controller | |
{ | |
/** | |
* @validate id numeric | |
* @validate message maxlen(300) | |
* @method post | |
* @ajax 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
public interface Converter<T> | |
{ | |
public Object from(T object); | |
public T to(Object object); | |
} |
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
name: test | |
revision: 1 | |
description: I am a boring description | |
dependencies: | |
- 'other module' | |
soft-dependencies: | |
- 'other module' |
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
private static boolean languageWorkaroundInitialized; | |
private static Field localeStringField; | |
private static Field handleField; | |
private static Field localeField; | |
static | |
{ | |
try | |
{ | |
localeStringField = Class.forName("net.minecraft.server.LocaleLanguage").getDeclaredField("d"); |
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/sh | |
cd /dev | |
for i in `ls sd??` | |
do | |
echo "Mounting $i..." | |
mkdir /mnt/$i 2>/dev/null | |
if (mount /dev/$i /mnt/$i) | |
then |
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
permissions: | |
essentials: | |
heal: | |
- create | |
- remove | |
sell: | |
- create | |
commands: | |
- * |
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
Add config/puma.ruby | |
-------------------- | |
cd /home/redmine/redmine | |
sudo -u redmine -H curl --output config/puma.rb https://gist.github.com/quickwango/6043161/raw/fdfe2a865c3a0afe912c8784c971ea7ca3e64cfd/puma.rb | |
Install Init Script | |
-------------------- | |
Download the init script (will be /etc/init.d/redmine): | |
OlderNewer