Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

String message = "This is a test message which should span a pretty bi§ag§2 line. If I keep going like this, maybe it will wrap onto the next one. This assumes that this works, it's possible that it doesn't.";
Pattern linePattern = Pattern.compile(".{1,50}\\b");
Pattern badEnd = Pattern.compile("§[0-F]^");
Matcher matcher = linePattern.matcher(message);
String buffer = "";
while (matcher.find()) {
String line = buffer + matcher.group(0);
Matcher end = badEnd.matcher(line);
if (end.matches()) {
buffer = end.group(0);
@Dinnerbone
Dinnerbone / GreetingPlugin.java
Created February 1, 2012 01:59
Might we have made plugins a little too easy? :(
package com.dinnerbone.plugins.greetings;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.plugin.java.JavaPlugin;
public class GreetingPluginextends JavaPlugin implements Listener {
@Override
public void onEnable() {
@Dinnerbone
Dinnerbone / gist:2362538
Created April 11, 2012 20:58
Minecraft new world save directory structure
data/
idcounts.dat
map_0.dat
players/
Dinnerbone.dat
cookie_monster.dat
worlds/
overworld/
regions/
r.0.0.mca
public class Foo {
public static void main(String[] args) {
String x = "This is weird: \u0022\u003B\u0069\u006E\u0074\u0020\u0079\u003D\u0031\u002F\u0030\u003B\u0078\u003D\u0022???";
System.out.println("x = " + x);
}
}
@Dinnerbone
Dinnerbone / guess_for_app.py
Last active September 6, 2017 06:54
Save all files (app list credit to xPaw). Run the solver with: `python guess_for_password.py xpaws_app_list.txt PASSWORD_TO_TRY` or `python guess_for_app.py APP_ID list_of_passwords_in_a_file.txt`
from twisted.internet import reactor, defer, threads
from twisted.logger import Logger, textFileLogObserver, globalLogPublisher
import time, sys, requests, random
log = Logger()
reactor.suggestThreadPoolSize(20)
def try_password(password, app, real):
try:
r = requests.get(

Keybase proof

I hereby claim:

  • I am Dinnerbone on github.
  • I am dinnerbone (https://keybase.io/dinnerbone) on keybase.
  • I have a public key whose fingerprint is 7FB0 57F8 7FA7 9A66 E8F3 A8DF 667C 41E9 8BC6 478A

To claim this, I am signing this object:

{
"rolls": {
"min": 2,
"max": 6
},
"items": [
{
"item": "minecraft:diamond",
"weight": 5,
"functions": [
package net.minecraft.launcher.authentication;
import net.minecraft.launcher.Http;
import java.io.IOException;
import java.net.Proxy;
import java.net.URL;
import java.util.HashMap;
import java.util.Map;
@Dinnerbone
Dinnerbone / banned-ips.txt
Created April 19, 2012 17:38
New file formats in 1.3
#Address, Date/Time, Banned By, Until, For
#Exactly the same as banned-players, but with IP addresses.
@Dinnerbone
Dinnerbone / GreetingPlugin.java
Created February 1, 2012 01:59
Might we have made plugins a little too easy? :(
package com.dinnerbone.plugins.greetings;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.plugin.java.JavaPlugin;
public class GreetingPlugin extends JavaPlugin implements Listener {
@Override
public void onEnable() {