Skip to content

Instantly share code, notes, and snippets.

View Cadiducho's full-sized avatar
🏠
Working from home

Dani Matilla Cadiducho

🏠
Working from home
View GitHub Profile
@Cadiducho
Cadiducho / Example.java
Last active November 7, 2017 17:24 — forked from saguinav/Example.java
Polymorphic deserialization with Moshi
package com.square.moshi.example;
import com.squareup.moshi.RuntimeTypeJsonAdapterFactory.RuntimeType;
public class Example {
static class Animal {
String type;
String name;

Keybase proof

I hereby claim:

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

To claim this, I am signing this object:

@Cadiducho
Cadiducho / Converter.java
Created October 20, 2015 20:16
Conversor de authme.db (flatfile) a SQL
package com.cadiducho;
import java.io.*;
/**
* @author Cadiducho
* Uso:
* new Converter().run();
*/
public class Converter implements Runnable {
@Cadiducho
Cadiducho / Pom.xml
Created September 14, 2015 12:05
Argumentos del pom para una mejor organización de Maven orientada a Bukkit
<build>
<sourceDirectory>src</sourceDirectory>
<resources>
<resource>
<targetPath>.</targetPath>
<filtering>true</filtering>
<directory>src</directory>
<includes>
<include>*.yml</include>
</includes>
public static void unloadMap(String mapa){
if(Bukkit.getServer().unloadWorld(Bukkit.getServer().getWorld(mapa), false)){
plugin.getLogger().info("Mapa descargado: " + mapa);
} else {
plugin.getLogger().severe("No se ha podido descargar " + mapa + ". Te toca hacer rollback a mano");
}
}
@Cadiducho
Cadiducho / ProgressBar
Created April 16, 2014 16:54
Simple ProgressBar para consola de C#
private static void progreso(int progreso, int total=100) //Default 100
{
//Dibujar la barra vacia
Console.CursorLeft = 0;
Console.Write("["); //inicio
Console.CursorLeft = 32;
Console.Write("]"); //fin
Console.CursorLeft = 1; //Colocar el cursor al inicio
float onechunk = 30.0f / total;