Skip to content

Instantly share code, notes, and snippets.

View codebucketdev's full-sized avatar

Codebucket codebucketdev

View GitHub Profile
@christianroman
christianroman / OCR.java
Created May 15, 2012 01:59
Captcha OCR + Tesseract
public class OCR {
private static final String INPUT = "C:/captcha/ex.png";
private static final String OUTPUT = "C:/captcha/captcha-out.png";
private static final String TESSERACT_BIN = "C:/Program Files/Tesseract-OCR/tesseract.exe";
private static final String TESSERACT_OUTPUT = "C:/captcha/out.txt";
private static final int WHITE = 0x00FFFFFF, BLACK = 0x00000000;
public static void main(String... args) throws Exception {
BufferedImage image = ImageIO.read(new FileInputStream(INPUT));
int average = 0;
@codebucketdev
codebucketdev / gist:7144068
Last active December 26, 2015 11:29
With this snippet, you can send to all Operators a Information about a task...
public void alertOperators(org.bukkit.command.CommandSender sender, String alert)
{
for(Player player : Bukkit.getOnlinePlayers())
{
if(player.isOp())
{
if(!sender.getName().equals(player.getName()))
{
player.sendMessage("§7§o["+sender.getName()+": "+alert+"]");
}
package de.zh32.slp;
import com.google.gson.Gson;
import java.io.ByteArrayOutputStream;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
@codebucketdev
codebucketdev / gist:7711362
Created November 29, 2013 20:17
With this snippet, you can pull a player to a location...
private void pullPlayer(Player player, Location location)
{
Location playerLoc = player.getLocation();
playerLoc.setY(playerLoc.getY() + 0.5D);
player.teleport(playerLoc);
double g = -0.08D;
double d = location.distance(playerLoc);
double t = d;
@codebucketdev
codebucketdev / Shifting.java
Created September 25, 2014 19:45
With this class you can calculate the square roots of a number/value :)
package de.codebucket.math;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
import java.util.concurrent.atomic.AtomicBoolean;