Skip to content

Instantly share code, notes, and snippets.

View devwebcl's full-sized avatar

German Gonzalez-Morris devwebcl

View GitHub Profile
package cl.ejemplo.json.schema;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import org.everit.json.schema.Schema;
import org.everit.json.schema.loader.SchemaLoader;
import org.json.JSONObject;
import org.json.JSONTokener;
public static String refactoringJson(String body) {
// limpiar los valores nulos que con unirest kong se llaman nULLValue :/
Gson gson = new Gson();
Map<String, Map<String, String>> mapBody = gson.fromJson(body, Map.class);
Map<String, String> jsonLimpio = new HashMap();
// recorrer mapa y limpiar
for (Map.Entry entryBody : mapBody.entrySet()) {
#!/usr/bin/python
import sys
import os
import stashy
# http://bitbucket:7990/projects/TBP/
# python get.py TBP :
stash = stashy.connect("http://test.server.cl:7990/", "german.gonzalez", "welcome1")
for repo in stash.projects[sys.argv[1]].repos.list():
public interface Step<T> {
T process(T input) throws ExecutionException;
}
public class Pipeline<T> {
private final List<Step<T>> steps;
@devwebcl
devwebcl / TestMagicHeader.java
Last active September 22, 2020 22:04
Apache Tika sample
package cl.ejemplo.mimetypes;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.ArrayList;
import java.util.List;
   for(int i=0 ; i < 5 ; i++)
   {
      System.out.println("i is : " + i);
   }