Skip to content

Instantly share code, notes, and snippets.

View sleepiecappy's full-sized avatar

Evangelista sleepiecappy

View GitHub Profile
public class GPSTracker implements LocationListener {
private final Context mContext;
// flag for GPS status
private boolean gpsEnabled;
// flag for network status
private boolean networkEnabled;
// flag for GPS status
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="red_50">#fde0dc</color>
<color name="red_100">#f9bdbb</color>
<color name="red_200">#f69988</color>
<color name="red_300">#f36c60</color>
<color name="red_400">#e84e40</color>
<color name="red_500">#e51c23</color>
# API aka Brain?
The * microservice is a `HATEOAS` implementation for expose others bussiness microservices to clients. Using Spring REST and Spring HATEOAS, it provides navigation through relations to easy access and discovery.
It integrates over HTTP and we plan to port it to AMQP, using Hyxtris to provide fault tolerant over AMQP connection, using HTTP as fallback.
<?xml version="1.0" encoding="UTF-8"?>
<inspections version="1.0">
<option name="myName" value="Default" />
<inspection_tool class="AbstractClassNamingConvention" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="AnnotationNamingConvention" enabled="true" level="WARNING" enabled_by_default="true">
<option name="m_regex" value="[A-Z][A-Za-z\d]*" />
<option name="m_minLength" value="8" />
<option name="m_maxLength" value="64" />
</inspection_tool>
<inspection_tool class="AnonymousClassComplexity" enabled="true" level="WARNING" enabled_by_default="true">
package demo;
import static java.lang.reflect.Modifier.*;
import java.util.Arrays;
import java.util.Set;
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.beans.factory.config.BeanExpressionResolver;
@sleepiecappy
sleepiecappy / submodule_update
Created July 2, 2015 17:03
Snippet to update all submodules of a repository
git submodule foreach "(git checkout master; git pull; cd ..; git add '$path'; git commit -m 'Submodule Sync')"
@sleepiecappy
sleepiecappy / gist:de792aae3313b801099d
Last active September 9, 2015 01:53
Simple node.js code style tips to improve code quality

Whether you use 2 spaces or 4 spaces, there are a few simple things that can make your node.js code easier to read. We've been using them in all the hapi modules for over 4 years now to great results. This list is by no means complete but it highlights the most useful elements that will give you immediate value in reducing bugs.

Required modules

JavaScript makes it harder than most languages to know where variables are coming from. Variables assigned required modules are particularly important because they represent a singleton object shared with the entire application. There are also globals and module globals, along with function variables and arguments.

Traditionally, variables starting with an uppercase letter represent a class that must be instantiated using new. This was an important semantic in the early days of JavaScript but at this point, if you don't know Date requires new Date() you are probably very new. We have adopted Upper Camel Case variable names for all module global variables

@sleepiecappy
sleepiecappy / agendamento
Last active October 14, 2015 23:47
iClinic
# Agendamento
### Ações:
- Pacientes serão adicionados em sua primeira consulta, e terá uma senha gerada
- Pacientes podem escolher uma data e um horário para a consulta.
- Se o horário não estiver vago o paciente pode optar por entrar na lista de espera para aquele horário ou escolher um novo.
@sleepiecappy
sleepiecappy / USING-VAULT.md
Created November 29, 2015 04:13 — forked from voxxit/USING-VAULT.md
Consul + Vault + MySQL = <3
git clone https://gist.github.com/dd6f95398c1bdc9f1038.git vault
cd vault
docker-compose up -d
export VAULT_ADDR=http://192.168.99.100:8200

Initializing a vault:

vault init
@sleepiecappy
sleepiecappy / Field.java
Created December 10, 2015 01:29
Annotation based mapper
package com.mobiconn.tracker.support.db.repository;
import java.lang.annotation.*;
/**
* @author Joao Pedro Evangelista
*/
@Documented
@Target(ElementType.FIELD)
@Retention(RetentionPolicy.RUNTIME)