Skip to content

Instantly share code, notes, and snippets.

View savitoh's full-sized avatar
🏠
Working From Home

Sávio Raires de Souza savitoh

🏠
Working From Home
View GitHub Profile
@savitoh
savitoh / consecutive_values.sql
Created November 15, 2021 01:06
Retrieve consecutives values group by status. Tested in Oracle 11gR2. http://www.sqlfiddle.com/#!4/fc98d/2
-- DDL
CREATE TABLE position (
vehicle int,
start_date date,
ignition int,
speed int
);
-- DML
@savitoh
savitoh / DateUtil.java
Created August 3, 2020 11:54
Classe utilitária para trabalhar com Datas em JAVA
public final class DateUtil {
private DateUtil () {
}
public static Long diferencaEmDias(Temporal dataInicio, Temporal dataFim) {
Objects.requireNonNull(dataInicio);
Objects.requireNonNull(dataFim);
return ChronoUnit.DAYS.between(dataInicio, dataFim);