Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View leonardoxh's full-sized avatar

Leonardo Rossetto leonardoxh

View GitHub Profile
@leonardoxh
leonardoxh / DateExtensions.kt
Last active May 29, 2019 20:16
Simple timezone calculations
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 January 12, 2015 11:37
This is my default maven push gradle for my java projects
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 August 29, 2015 14:13
This is my default git ignore for my java/android projects
# Custom
_site
# Ant
MANIFEST.MF
./*.jar
build.num
build
# ADT
/*
* 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