Skip to content

Instantly share code, notes, and snippets.

View jan-krueger's full-sized avatar
🐢
I am a turtle...

Jan Krüger jan-krueger

🐢
I am a turtle...
View GitHub Profile
package de.sweetcode.scmh;
import com.google.gson.Gson;
import com.google.gson.JsonArray;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import okhttp3.*;
import java.awt.*;
import java.io.IOException;
@jan-krueger
jan-krueger / Score.java
Last active December 8, 2017 15:46
Reddit's Score
import java.time.Instant;
import java.util.Date;
import java.util.concurrent.TimeUnit;
public class Score {
private final static Date epoch = Date.from(Instant.EPOCH);
private final Z z = Z.V_50;
private final int upvotes, downvotes;
@jan-krueger
jan-krueger / Parser.class.php
Created December 7, 2016 17:08
My first try to create a simple parser. It is not working, properly, but I know now how to start if I will ever to something compareable. Just archiving.
<?php
require_once 'ParserState.enum.php';
class Parser {
/**
* The JavaScript object.
*
* @var string
@jan-krueger
jan-krueger / Cipher.class.php
Last active May 4, 2016 11:17
Simple encryption class.
<?php
namespace SweetCode\Cipher;
class Cipher {
private $secureKey;
private $cryptCipher = MCRYPT_RIJNDAEL_256;
private $cryptMode = MCRYPT_MODE_ECB;
private $vectorSize;
@jan-krueger
jan-krueger / Debugger.java
Last active October 27, 2015 17:30
Simple Logger
package de.YonasCode.SweetUtils.Debugger;
import java.lang.reflect.*;
import java.util.concurrent.TimeUnit;
import java.util.regex.Pattern;
/**
* Created by Yonas on 21.06.2015.
*/
public class Debugger<T> implements InvocationHandler {
@jan-krueger
jan-krueger / Config.php
Last active August 29, 2015 14:01
Config-File based on arrays with endless levels.
<?php
class Config {
private $config;
private $DELIMITER = '.';
public function __construct($config, $delimiter = '.') {
if(is_null($config)) {
@jan-krueger
jan-krueger / ExplosionListener.java
Last active August 29, 2015 14:01
Regenerate Explosion
package <your-package>;
import java.util.ArrayList;
import java.util.List;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.entity.TNTPrimed;
import org.json.simple.JSONArray;
import org.json.simple.JSONObject;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.UUID;
/**
* Created by Yonas on 20.10.2015.
package <your-package>;
import java.util.HashMap;
import org.bukkit.entity.Player;
import com.google.code.chatterbotapi.ChatterBot;
import com.google.code.chatterbotapi.ChatterBotFactory;
import com.google.code.chatterbotapi.ChatterBotSession;
import com.google.code.chatterbotapi.ChatterBotType;
package de.YonasCode.TheCore.MultiMap;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.Set;
public class MultiMap<A, B, C> implements Cloneable, Iterable<A>, Serializable {