Skip to content

Instantly share code, notes, and snippets.

View daboross's full-sized avatar

Dabo daboross

View GitHub Profile
@daboross
daboross / GBC.java
Created March 22, 2014 15:57
GridBagConstraints helpful class
package net.daboross.util;
import java.awt.GridBagConstraints;
import java.awt.Insets;
public class GBC extends GridBagConstraints {
public GBC anchor(int anchor) {
this.anchor = anchor;
return this;
<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="WARN" packages="net.minecraft,com.mojang">
<Appenders>
<Console name="WINDOWS_COMPAT" target="SYSTEM_OUT"></Console>
<Queue name="TerminalConsole">
<PatternLayout pattern="[%d{HH:mm:ss} %level]: %msg%n" />
</Queue>
<RollingRandomAccessFile name="File" fileName="logs/latest.log" filePattern="logs/%d{yyyy-MM-dd}-%i.log.gz">
<PatternLayout pattern="[%d{HH:mm:ss}] [%t/%level]: %msg%n" />
<Policies>
/* NI-cRio NetConsole on node js -- Evin Ugur */
var dgram = require("dgram");
var listener = dgram.createSocket("udp4");
//ports used for NetConsole - it uses two: one for in and out, probably to avoid a race condition
var NETCONSOLE_PORT_IN = 6666;
//Server to listen for data on NetConsole
listener.on("message", function(msg, rinfo) {
/*
* Copyright (C) 2013-2014 Dabo Ross <http://www.daboross.net/>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
From ea8561655227b9513d2aa4cb058465d5aef961ce Mon Sep 17 00:00:00 2001
From: Dabo Ross <daboross@daboross.net>
Date: Wed, 27 Nov 2013 03:25:00 -0800
Subject: [PATCH] Somewhat nicer minecraft status message
---
plugins/minecraft_status.py | 40 +++++++++++++++++++++++++---------------
1 file changed, 25 insertions(+), 15 deletions(-)
diff --git a/plugins/minecraft_status.py b/plugins/minecraft_status.py
#!/usr/bin/env python3
import sys
size, every_x, current = [int(x) for x in sys.argv[1:]]
alive, till_kill = [True] * size, 0
while True:
if alive[current]:
if sum(alive) == 1:
break
elif till_kill == 0:
alive[current] = False
@daboross
daboross / ProxyPingEvent.java
Created November 8, 2013 06:39
Proxy ping event to persuade players to use new IP.
@EventHandler
public void onPing(ProxyPingEvent evt) {
ServerPing ping = evt.getResponse();
InetSocketAddress hostAddress = evt.getConnection().getVirtualHost();
String host = hostAddress == null ? null : hostAddress.getHostString();
if (host != null && !host.contains("the-ip-you-should-use.net")) {
ping.setDescription("You aren't using the new IP! Be gone!");
}
}
/*
* Author: Dabo Ross
* Website: www.daboross.net
* Email: daboross@daboross.net
*/
package ru.tehkode.modifyworld.bukkit;
import java.util.HashMap;
import java.util.Map;
import org.bukkit.Bukkit;
/*
* Author: Dabo Ross
* Website: www.daboross.net
* Email: daboross@daboross.net
*/
package ru.tehkode.modifyworld.bukkit;
import java.util.HashMap;
import java.util.Map;
import org.bukkit.Bukkit;
-modifyworld.items.(craft|throw|put|have|hold|use).(8|9|10|11|26|34|36|43|51|52|55|59|60|63|64|68|71|75|83|90|92|93|94|95|104|105|115|117|118|119|125|127|132|137|140|141|142|144|149|150)(|:*)