Skip to content

Instantly share code, notes, and snippets.

View pschichtel's full-sized avatar

Phillip Schichtel pschichtel

View GitHub Profile
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;
@pschichtel
pschichtel / gist:2795651
Created May 26, 2012 23:50
full annotated command
@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
public static String getModuleFromStacktrace()
{
final String className = Thread.currentThread().getStackTrace()[2].getClassName();
return className.substring(0, className.indexOf(".", 0));
}
<?php
class TestController implements Controller
{
/**
* @validate id numeric
* @validate message maxlen(300)
* @method post
* @ajax false
*/
public interface Converter<T>
{
public Object from(T object);
public T to(Object object);
}
name: test
revision: 1
description: I am a boring description
dependencies:
- 'other module'
soft-dependencies:
- 'other module'
@pschichtel
pschichtel / gist:3690895
Created September 10, 2012 13:27
thank you Bukkit...
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");
#!/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
@pschichtel
pschichtel / gist:4019519
Created November 5, 2012 18:43
example permissions definition
permissions:
essentials:
heal:
- create
- remove
sell:
- create
commands:
- *
@pschichtel
pschichtel / Redmine installation
Last active December 20, 2015 00:39 — forked from thanhhh/Redmine installation
How to configuration Redmine with puma and running on nginx (based on Gitlab's installation)
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):