Skip to content

Instantly share code, notes, and snippets.

View Felipe00's full-sized avatar
😤
Banzai!

Felipe Costa Felipe00

😤
Banzai!
  • SulAmérica
  • Brazil - PI
View GitHub Profile
@Felipe00
Felipe00 / FlatMap.kt
Created September 17, 2019 19:23
Example of Flatmap function.
/**
* You can edit, run, and share this code.
* play.kotlinlang.org
*/
fun main() {
val cities1 = ArrayList<City>()
cities1.add(City("Teresina"))
cities1.add(City("Campo Maior"))
cities1.add(City("Altos"))
private void startLocation() {
Context mContext = MainActivity.this;
SmartLocation.with(mContext).location().config(LocationParams.NAVIGATION)
.start(new OnLocationUpdatedListener() {
@Override
public void onLocationUpdated(Location location) {
Log.w("Localização", "Lat: " + location.getLatitude() + ",Lng: " + location.getLongitude());
}
});
}
@Felipe00
Felipe00 / remount.sh
Created February 21, 2019 19:53 — forked from ertseyhan/remount.sh
Temporarily increase size of tmp folder on Arch linux
#!/bin/bash
sudo mount -o remount,size=10G,noatime /tmp
echo "Done. Please use 'df -h' to make sure folder size is increased."
@Felipe00
Felipe00 / AppHelper.java
Last active December 20, 2018 02:48
Pegar lista de pontos entre 2 coordenadas
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.content.Context;
import android.content.ContextWrapper;
import android.content.Intent;
import android.media.RingtoneManager;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.net.Uri;
import android.support.v4.app.NotificationCompat;
@Felipe00
Felipe00 / Plano_de_testes.txt
Created August 19, 2018 13:30
Plano de testes do Dashboard on Hands
Objetivo do Documento
Descrever plano de teste do produto de Software, e avaliar os tipos de testes a serem aplicados afim de avaliar a conformidade dos requisitos e verificação do Sistema implementado.
Ambiente de Teste
Testar em sistemas android (API > 15) com espaço em memória interna suficiente para baixar dados básicos para o início dos testes.
Materiais de Apoio
Algumas ferramentas se farão úteis no processo de teste das funcionalidades do aplicativo:
@Felipe00
Felipe00 / Readme.md
Created May 15, 2018 04:04 — forked from gabrielemariotti/Readme.md
A SimpleSectionedRecyclerViewAdapter: use this class to realize a simple sectioned `RecyclerView.Adapter`.

You can use this class to realize a simple sectioned RecyclerView.Adapter without changing your code.

The RecyclerView should use a LinearLayoutManager. You can use this code also with the TwoWayView with the ListLayoutManager (https://github.com/lucasr/twoway-view)

This is a porting of the class SimpleSectionedListAdapter provided by Google

Screen

Example:

@Felipe00
Felipe00 / CityCodeAdapter.kt
Created May 3, 2018 01:29
Exemplo de query com edittext e lista
class CityCodeAdapter: BaseAdapter {
val list = MutableList()
// Outros métodos obrigatórios do adapter
fun updateList(cityList: MutableList<CityCode>) {
this.list.clear()
this.list.addAll(cityList)
notifyDataSetChanged()
}
@Felipe00
Felipe00 / MainActivity.kt
Created April 12, 2018 20:28
Kotlin implementation Locations (SmartLocation lib)
class MainActivity: AppCompat {
fun startGeoUpdates(callback: (Location) -> Unit) {
val params = LocationParams.Builder().setInterval(5).setDistance(10f).setAccuracy(LocationAccuracy.HIGH).build()
SmartLocation.with(context).location().config(params).continuous().start { location ->
if (location != null) callback(location)
}
}
fun seuMetodo() {
// ...
@Felipe00
Felipe00 / Lambda.kt
Created April 8, 2018 04:30
Lambda com kotlin ~
class Lambda {
fun t1(p: Int, lambda: (l: String) -> String) {
lambda(p.toString())
}
fun t2(p: Int): Long {
return 1L
}
fun t3(p3: Int) {
t1(1) { t2(it.toInt()).toString() }
@Felipe00
Felipe00 / Aluno.java
Created April 4, 2018 00:47
Ajustando servidor do Juan (Projeto Freelancer
package br.com.sistema.escola.modelo;
import com.xpert.utils.DateUtils;
import java.io.Serializable;
import java.text.ParseException;
import java.util.Date;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.persistence.CascadeType;
import javax.persistence.Column;