Skip to content

Instantly share code, notes, and snippets.

View devrmartins's full-sized avatar

devrmartins devrmartins

View GitHub Profile
@devrmartins
devrmartins / styles.scss
Created November 2, 2022 13:51
Estilo Global Inicial - CSS
:root {
--primary: #cecece;
}
* {
padding: 0;
margin: 0;
box-sizing: 0;
}
@devrmartins
devrmartins / DistanciaByLatLong.java
Last active September 1, 2022 15:48
Obter distância utilizando Latitude e Longitude
public static double getDistanciaByLatLong(Localizacao usuario, Localizacao ordem) {
/* Agradecimento ao Thiago Galbiatti Vespa
* https://thiagovespa.com.br/blog/2010/09/10/distancia-utilizando-coordenadas-geograficas-em-java
*/
int EARTH_RADIUS_KM = 6371;
double firstLatToRad = Math.toRadians(usuario.getLatitude());
double secondLatToRad = Math.toRadians(ordem.getLatitude());
double deltaLongitudeInRad = Math.toRadians(ordem.getLongitude() - usuario.getLongitude());
@devrmartins
devrmartins / BrPhoneNumberFormatter.java
Created August 1, 2022 13:06 — forked from alfredbaudisch/BrPhoneNumberFormatter.java
Android EditText mask for Brazilian telephone numbers. It deals with the default format (xx) xxxx-xxxx as well the newer longer one (xx) xxxxx-xxxx. Máscara de telefones brasileiros para EditText do Android: formata tanto o telefone padrão (xx) xxxx-xxxx, quanto o novo formato (xx) xxxxx-xxxx.
/**
* Adapted to BR phone format from the class
* UsPhoneNumberFormatter by Samik Bandyopadhyay:
* http://stackoverflow.com/a/23659268/332839
*/
public class BrPhoneNumberFormatter implements TextWatcher {
final int MAX_LENGTH = 11;
//This TextWatcher sub-class formats entered numbers as (41) 1234(5)?-6789
@devrmartins
devrmartins / faces-config.xml
Last active August 12, 2020 19:58
POM file for to start a maven project with jsf
<?xml version="1.0" encoding="UTF-8"?>
<!-- src/main/webapp/WEB-INF/faces-config.xml -->
<faces-config
xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-facesconfig_2_2.xsd"
version="2.2">
</faces-config>