Skip to content

Instantly share code, notes, and snippets.

@tonybruess
tonybruess / log4j2.xml
Last active August 29, 2015 14:03
Overcast's custom log4j2 config
<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="WARN" packages="net.minecraft,com.mojang.util">
<Appenders>
<Console name="WINDOWS_COMPAT" target="SYSTEM_OUT"></Console>
<Queue name="TerminalConsole">
<PatternLayout pattern="%d{yyyy-MM-dd HH:mm:ss} [%level] %msg%n"/>
</Queue>
<RollingRandomAccessFile name="Server" fileName="/minecraft/logs/alpha/server.log" filePattern="/minecraft/logs/alpha/server-%d{yyyy-MM-dd}-%i.log.gz">
<PatternLayout pattern="%d{yyyy-MM-dd HH:mm:ss} [%level] %msg%n"/>
<Policies>
@tonybruess
tonybruess / chat_color.rb
Created June 29, 2014 18:33
Bukkit's ChatColor implementation in ruby
class ChatColor
@@color_char = "\u00A7"
def initialize(code)
@code = code
end
def +(str)
to_str + str
end
@tonybruess
tonybruess / jdom2.md
Created June 30, 2014 16:18
How to add jdom2 to a maven repo

jdom

There's a fun dependency called jdom2. It is currenty located in our repository. If it ever gets removed, this is how you readd it.

mvn deploy:deploy-file -Dfile=jdom-2.0.5-contrib.jar -DgroupId=org.jdom -DartifactId=jdom2-contrib -Dversion=2.0.5 -Dpackaging=jar -DrepositoryId=overcast-deployment -Durl=https://repo.oc.tc/content/repositories/releases

mvn deploy:deploy-file -Dfile=jdom-2.0.5.jar -DgroupId=org.jdom -DartifactId=jdom2 -Dversion=2.0.5 -Dpackaging=jar -DrepositoryId=overcast-deployment -Durl=https://repo.oc.tc/content/repositories/releases
@tonybruess
tonybruess / autoreply.applescript
Last active August 29, 2015 14:08
AppleScript workflow for canned responses
on run {input, parameters}
tell application "System Events"
set frontmost of process "Automator Runner" to true
end tell
set the_path to "Macintosh HD:Users:tony:Desktop:Overcast:Replys"
set the_files to list folder the_path
set the_file to {choose from list the_files}
set input to (do shell script "cat " & quoted form of (POSIX path of (the_path & ":" & the_file)))
<?php
while($i < 1000000)
{
echo $i . ' ';
$i++;
}
?>
package org.kodejava.example.util;
import java.util.Calendar;
public class DateDifferenceExample
{
public static void main(String[] args)
{
// Creates two calendars instances
Calendar cal1 = Calendar.getInstance();
r.exists(key, function(err, obj) {
var total;
if (obj !== 1) return;
total = 0;
r.llen(key, function(err, obj) {
return total = parseInt(obj);
});
return r.lrange(key, 1, -1, function(err, checks) {
var check, good, _fn, _i, _len;
good = 0;
@tonybruess
tonybruess / gist:3117912
Created July 15, 2012 17:57 — forked from ajvpot/gist:3115176
Minecraft Migrated Account Session Vulnerability
                  ████▓               
               ▓█▓▓▓▓▓██▒              
             ▒██▒▒▒▒▒▒▒▓█▓             
            ▓█▓▒▒▒▒▒▒▒▒▒▒██            
           ██▒▒▒▒▓███▓▒▒▒▒▓█▒          
         ▒█▓▒▓▓▓██▓░▓█▓▓▓▓▓▓█▓         
        ▓█▓▓▓▓▓██▓   ▒██▓▓▓▓▓██▒       
      ▒██▓▓▓▓███       ███▓▓▓▓██▓      
     ▓██▓█████▒         ▒█████████     

▒█████████ ▒▓▓▓▓▓▓▓▓▒▓█████████▒

@tonybruess
tonybruess / jenkins.css
Last active December 16, 2015 00:59
Jenkins Theme
/*
* Bootstrap v2.3.0
*
* Copyright 2012 Twitter, Inc
* Licensed under the Apache License v2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Designed and built with all the love in the world @twitter by @mdo and @fat.
*/
article,
@tonybruess
tonybruess / gist:5417058
Created April 18, 2013 23:41
redis-rb.rb
require "rubygems"
require "redis"
REDIS = Redis.new(:host => "localhost")