Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am captainbern on github.
  • I am captainbern (https://keybase.io/captainbern) on keybase.
  • I have a public key ASBiQiTRfYd5eviRKsI6G2NiaK_5khrgwDe1dYAKy5_iHAo

To claim this, I am signing this object:

@CaptainBern
CaptainBern / haste.sh
Last active August 29, 2015 14:22
Little shell script to upload stuff to hastebin easier
#!/bin/bash
HASTE_URL="http://hastebin.com/"
HASTE_UPLOAD_URL=$HASTE_URL'documents/'
raw=false
noclip=false
function help() {
echo ""
@CaptainBern
CaptainBern / haste.go
Last active May 18, 2016 16:24
Little program written in Go to upload stuff to hastebin.com
package main
import (
"bytes"
"encoding/json"
"errors"
"flag"
"fmt"
"io/ioutil"
"net/http"
package test;
import com.captainbern.reflection.ClassTemplate;
import com.captainbern.reflection.Reflection;
import com.captainbern.reflection.accessor.FieldAccessor;
import com.captainbern.reflection.accessor.MethodAccessor;
import net.minecraft.server.v1_7_R3.ChunkCoordIntPair;
import net.minecraft.server.v1_7_R3.PacketPlayOutMultiBlockChange;
import org.bukkit.Chunk;
import org.bukkit.Location;
public String format(List<String> list){
boolean isFirst = false;
StringBuilder sb = new StringBuilder();
for(String entry : list) {
if (isFirst) {
isFirst = false;
} else {
sb.append(",");
}
public class EntityUtil {
public static PacketPlayOutAttachEntity craftAttachPacket(int that, int to) {
PacketPlayOutAttachEntity packet = new PacketPlayOutAttachEntity();
setField(getField(packet.getClass(), "a"), that);
setField(getField(packet.getClass(), "b"), to);
setField(getField(packet.getClass(), "c"), 0);
}
public static PacketPlayOutSpawnEntityLiving craftSlimeSpawnPacket(int entityType, int id, Location location, int size) {
@CaptainBern
CaptainBern / PastebinReporter.java
Last active June 18, 2022 18:04
A little class which allows one to easily create pastes on Pastebin.
import java.io.*;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.*;
public class PastebinReporter {