Skip to content

Instantly share code, notes, and snippets.

Avatar

Leonardo Rossetto leonardoxh

View GitHub Profile
@leonardoxh
leonardoxh / DateExtensions.kt
Last active May 29, 2019
Simple timezone calculations
View DateExtensions.kt
import java.util.Date
import java.uti.TimeZone
/** Local date to UTC */
val Date.utc: Date get() = Date(time + TimeZone.getDefault().rawOffset)
/** UTC date to local date */
val Date.local: Date get() = Date(time - TimeZone.getDefault().rawOffset)
@leonardoxh
leonardoxh / maven_push.gradle
Created Jan 12, 2015
This is my default maven push gradle for my java projects
View maven_push.gradle
apply plugin: 'maven'
apply plugin: 'signing'
def isReleaseBuild() {
return VERSION_NAME.contains("SNAPSHOT") == false
}
def getRepositoryUrl() {
if(isReleaseBuild()) {
println 'RELEASE BUILD'
@leonardoxh
leonardoxh / Default_git_ignore
Last active Aug 29, 2015
This is my default git ignore for my java/android projects
View Default_git_ignore
# Custom
_site
# Ant
MANIFEST.MF
./*.jar
build.num
build
# ADT
View FloatLabelLayout.java
/*
* Copyright 2014 Chris Banes
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software