Skip to content

Instantly share code, notes, and snippets.

View Pokechu22's full-sized avatar

Pokechu22 Pokechu22

View GitHub Profile
/// <summary>
/// Encode a string to a json string.
/// Will convert special chars to \u0000 unicode escape sequences.
/// </summary>
/// <param name="text">Source text</param>
/// <returns>Encoded text</returns>
private static string jsonEncode(string text)
{
@Pokechu22
Pokechu22 / midi.xml
Created August 24, 2015 17:20
Alternative midi.xml for Banjo's Backpack (banjosbackpack.com)
<?xml version="1.0" encoding="utf-8" ?>
<!-- Midi list updated by pokechu22 to use official names -->
<midis>
<midi id="00" name="Nothing" pointer="10748" />
<midi id="01" name="Final Battle with Grunty" pointer="10750" />
<midi id="02" name="Mumbo's Mountain" pointer="10758" />
<midi id="03" name="Freezeezy Peak" pointer="10760" />
<midi id="04" name="Mad Monster Mansion - Church door opens" pointer="10768" /> <!-- or is it closes? -->
<midi id="05" name="Treasure Trove Cove" pointer="10770" />
<midi id="06" name="Bubblegloop Swamp" pointer="10778" />
@Pokechu22
Pokechu22 / GBCFilterer.cs
Created September 7, 2015 22:29
GBC-Filters an image
using System;
using System.Drawing;
using System.Windows.Forms;
namespace FilterImage
{
/// <summary>
/// GBC-Filters an image.
/// </summary>
class Program
@Pokechu22
Pokechu22 / spamsubmissions.py
Created September 13, 2015 19:01
Gets a list of submissions to /r/spam that were not actioned upon
# Get a list of submissions to /r/spam where the user was not banned
import praw
import praw.errors
import re
import time
SUBREDDIT_NAME = 'spam'
USER_NAME = 'pokechu22'
@Pokechu22
Pokechu22 / SRBack.java
Created September 25, 2015 05:50
Backup all of the images in a set of subreddits (not user friendly at all) (https://www.reddit.com/r/modtalk/comments/3mamsp/rspace_was_hacked/cvdhjoo)
import java.io.File;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.io.PrintWriter;
import java.net.URL;
import java.net.URLConnection;
import java.util.Scanner;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
@Pokechu22
Pokechu22 / minecraft_1.8_1.8.9_1.9-pre2.json
Created February 23, 2016 03:19
Minecraft 1.8, 1.8.9, and 1.9-pre2 -- generated via http://github.com/pokechu22/Burger
This file has been truncated, but you can view the full file.
[
{
"achievements": {
"acquireIron": {
"desc": "Smelt an iron ingot",
"name": "Acquire Hardware"
},
"bakeCake": {
"desc": "Wheat, sugar, milk and eggs!",
"name": "The Lie"
@Pokechu22
Pokechu22 / 1.9-pre3_16w04a_diff.json
Created February 25, 2016 21:32
Minecraft 16w04a and 1.9-pre3 differences in packets (generated via burger and hamburglar)
{
"packets": {
"packet": {
"PLAY_CLIENTBOUND_0": [
{
"class": "fj.class",
"direction": "CLIENTBOUND",
"from_client": false,
"from_server": true,
"id": 0,
@Pokechu22
Pokechu22 / minecraft_1.9-pre3_packetinstructions.json
Last active March 25, 2016 18:25
Packet instructions for 1.9-pre3
[
{
"__coment": "The values here, especially for instructions, may be wrong - burger's still a work in progress! Use caution with them... They may be missing chat components, NBT tags, and a few similar things (or may be flat-out wrong)",
"classes": {
"biome.superclass": "aig",
"block.list": "aju",
"block.superclass": "ajt",
"entity.list": "rt",
"item.list": "ads",
"item.superclass": "ado",
@Pokechu22
Pokechu22 / portalpatcher.py
Created March 26, 2016 00:03
Patches a craftbukkit or spigot jar to allow portals to spawn above y=128 in the nether
from jawa.cf import ClassFile
from zipfile import ZipFile
import re
try:
from cStringIO import StringIO
except ImportError:
from StringIO import StringIO
from jawa.assemble import assemble
import tempfile
import zipfile
@Pokechu22
Pokechu22 / Protocol19x.cpp.patch
Created April 9, 2016 22:31
Changes between Protocol18x.cpp and Protocol19x.cpp
diff --git a/src/protocol/protocol18x.cpp b/src/protocol/protocol19x.cpp
index ae9571f..8ee10d5 100644
--- a/src/protocol/protocol18x.cpp
+++ b/src/protocol/protocol19x.cpp
@@ -1,16 +1,20 @@
-// Protocol18x.cpp
+// Protocol19x.cpp
/*