Skip to content

Instantly share code, notes, and snippets.

View tassioauad's full-sized avatar
:octocat:

Tássio Auad tassioauad

:octocat:
View GitHub Profile
@tassioauad
tassioauad / pom.xml
Last active April 4, 2018 02:15
simples pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>br.com.tassioauad</groupId>
<artifactId>myrest</artifactId>
<version>0.1</version>
<packaging>jar</packaging>
@tassioauad
tassioauad / HTML1.html
Created August 4, 2017 20:06
HTML Ana
<!DOCTYPE html>
<html lang="pt">
<head>
<meta charset="UTF-8">
<title>Real Detective</title>
</head>
<body>
<header>
<h1>Real Detective</h1>
</header>
Gson gson = gsonBuilder.registerTypeAdapter(Date.class, new DateSerializer()).create();
Gson gson = gsonBuilder.registerTypeAdapter(Date.class, new DateDeserializer()).create();
public class DateSerializer implements JsonSerializer {
@Override
public JsonElement serialize(Date date, Type typeOfSrc, JsonSerializationContext context) {
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss");
return context.serialize(formatter.format(date));
}
}
public class DateDeserializer implements JsonDeserializer {
@Override
public Date deserialize(JsonElement element, Type arg1, JsonDeserializationContext arg2) throws JsonParseException {
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss");
try {
return formatter.parse(element.getAsString());
} catch (ParseException e) {
return null;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.lang.annotation.Annotation;
import java.lang.reflect.Type;
import javax.ws.rs.Consumes;
import javax.ws.rs.Produces;
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
buildTypes {
release {
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
public View getView(int position, View convertView, ViewGroup parent) {
return null;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
if(convertView == null) {
LayoutInflater inflater = (LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
convertView = inflater.inflate(R.layout.child, parent);
}
TextView textView = (TextView) convertView.findViewById(R.id.textView);
Object object = getItem(position);
convertView.setText(object.toString());
return convertView;