Skip to content

Instantly share code, notes, and snippets.

View hugo4715's full-sized avatar
😁
Always coding

hugo4715

😁
Always coding
View GitHub Profile
@stes
stes / LVQNetwork.java
Created December 25, 2011 19:33
A simple learning vector quantization (LVQ) neural network used to map datasets
/*
* A simple learning vector quantization (LVQ) neural network used to map datasets
* (right now, however, without a normalization of the input data)
*
* Copyright (c) stes 2011
*/
import java.io.IOException;
import java.util.ArrayList;
import java.util.Random;
@ajvpot
ajvpot / gist:3115176
Created July 15, 2012 05:35
Minecraft Migrated Account Session Vulnerability
                  ████▓               
               ▓█▓▓▓▓▓██▒              
             ▒██▒▒▒▒▒▒▒▓█▓             
            ▓█▓▒▒▒▒▒▒▒▒▒▒██            
           ██▒▒▒▒▓███▓▒▒▒▒▓█▒          
         ▒█▓▒▓▓▓██▓░▓█▓▓▓▓▓▓█▓         
        ▓█▓▓▓▓▓██▓   ▒██▓▓▓▓▓██▒       
      ▒██▓▓▓▓███       ███▓▓▓▓██▓      
     ▓██▓█████▒         ▒█████████     

▒█████████ ▒▓▓▓▓▓▓▓▓▒▓█████████▒

@aadnk
aadnk / MobSpawner.java
Created December 14, 2012 14:57
Spawn a fake mob using ProtocolLib
package com.comphenix.example;
import java.lang.reflect.InvocationTargetException;
import org.bukkit.ChatColor;
import org.bukkit.Location;
import org.bukkit.World;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Entity;
@DarkBlade12
DarkBlade12 / ParticleEffect.java
Last active December 23, 2023 16:20
This is a little library which allows you to display all possible particle effects in Minecraft with your plugin.
import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import org.bukkit.Bukkit;
/**
* Buzzer.java
*
* Buzzer
*/
package org.lexingtonma.lhs.nhb;
import java.awt.Color;
import java.awt.DefaultKeyboardFocusManager;
import java.awt.Font;
@fourohfour
fourohfour / gist:8243657
Created January 3, 2014 18:38
Get nearest player Bukkit.
double closest = Double.MAX_VALUE;
Player closestp = null;
for(Player i : Bukkit.getOnlinePlayers()){
double dist = i.getLocation().distance(event.getPlayer().getLocation());
if (closest == Double.MAX_VALUE || dist < closest){
closest = dist;
closestp = i;
}
}
if (closestp == null){
@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 {
@DarkSeraphim
DarkSeraphim / .LICENSE.TXT
Last active February 17, 2016 11:47
NPC library written for MC 1.8 - spawns and maintains human NPCs
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
import com.google.common.base.Charsets;
import com.google.common.base.Splitter;
import com.google.common.collect.Lists;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.OfflinePlayer;
import org.bukkit.entity.Player;
import org.bukkit.scoreboard.*;
import java.lang.reflect.Constructor;
@fernandezpablo85
fernandezpablo85 / git-maven-howto.md
Last active April 16, 2024 17:02
how to create your own maven repository on github

How to create a maven repository for your github project step by step

Clone your project in a separate folder

(note: replace ORGANIZATION and PROJECT)

git clone git clone git@github.com:ORGANIZATION/PROJECT.git my-repository

Cd into it