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;
We can make this file beautiful and searchable if this error is corrected: Unclosed quoted field in line 6.
Post name,Flair,author,# comments,Link
"[H] $25 Amazon Gift Card [W] 11 CSGO Keys or $17 BTC","","thelazybrowndog","0","https://www.reddit.com/r/giftcardexchange/comments/3xrxsw/h_25_amazon_gift_card_w_11_csgo_keys_or_17_btc/?ref=search_posts"
"[H]$8 amazon gift card [W] $10 Nintendo eshop gift card or 85% bitcoin","","supersonic23","1","https://www.reddit.com/r/giftcardexchange/comments/3xqzbg/h8_amazon_gift_card_w_10_nintendo_eshop_gift_card/?ref=search_posts"
"[H] $50 Amazon GC [W] Paypal, Bitcoin","CLOSED","gumpmeister","1","https://www.reddit.com/r/giftcardexchange/comments/3xpvt6/h_50_amazon_gc_w_paypal_bitcoin/?ref=search_posts"
"[H] $14 iTunes (Canada) [W] Bitcoin, CSGO Skins, Steam Wallet, Amazon GC CHEAP!","","ZephyrPro","0","https://www.reddit.com/r/giftcardexchange/comments/3xnohb/h_14_itunes_canada_w_bitcoin_csgo_skins_steam/?ref=search_posts"
"[H] $20 Best Buy Saving Code [W] $15 Amazon or $13 PayPal/bitcoin","CLOSED","matchqq","1","https://www.reddit.com/r/giftcardexchange/comments/3xnc1n/h_20_
@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 / 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 / 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 / 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