Skip to content

Instantly share code, notes, and snippets.

Avatar

Nathan Adams Dinnerbone

View GitHub Profile
View gist:712853
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 Feb 1, 2012
Might we have made plugins a little too easy? :(
View GreetingPlugin.java
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 Apr 11, 2012
Minecraft new world save directory structure
View gist:2362538
data/
idcounts.dat
map_0.dat
players/
Dinnerbone.dat
cookie_monster.dat
worlds/
overworld/
regions/
r.0.0.mca
View Foo.java
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 Sep 6, 2017
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`
View guess_for_app.py
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(
View keybase.md

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:

View end_city_treasure.json
{
"rolls": {
"min": 2,
"max": 6
},
"items": [
{
"item": "minecraft:diamond",
"weight": 5,
"functions": [
View OldAuthentication.java
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 Apr 19, 2012
New file formats in 1.3
View banned-ips.txt
#Address, Date/Time, Banned By, Until, For
#Exactly the same as banned-players, but with IP addresses.
@Dinnerbone
Dinnerbone / Since 1.2.3
Created Mar 4, 2012
Bugs I've fixed since 1.2.3!
View Since 1.2.3
Fixed:
- Fixed godmode exploit (Thanks md_5)
- Limit framerate on menu screens, no longer uses 100% cpu and make my computer melt
- Fixed fatal crash for converted worlds to anvil, when there's blocks at max height
- Fixed an old bug with signs clearing text while you're editing them in SMP
- Fixed incorrectly swapped en_GB and en_CA language details
- Fixed crash when logging in while there are blocks at maxheight at spawn
- Fixed TNT ghosts in multiplayer
- Fixed storage minecarts dropping enchanted items
- Fixed crashes on invalid server addresses when joining a server