Skip to content

Instantly share code, notes, and snippets.


Pedro Diaz igoticecream

View GitHub Profile
igoticecream / colors.xml
Created Feb 29, 2016
Google's material design color palette resource file
View colors.xml
<?xml version="1.0" encoding="utf-8"?>
<color name="red_50">#FFEBEE</color>
<color name="red_100">#FFCDD2</color>
<color name="red_200">#EF9A9A</color>
<color name="red_300">#E57373</color>
<color name="red_400">#EF5350</color>
<color name="red_500">#F44336</color>
<color name="red_600">#E53935</color>
igoticecream /
Created Jan 31, 2017
Custom IntelliJ IDEA properties
# custom IntelliJ IDEA properties
igoticecream / idea.vmoptions
Created Jan 31, 2017
Custom IntelliJ IDEA VM options
View idea.vmoptions
# custom IntelliJ IDEA VM options
igoticecream / Utils.scala
Last active Jan 31, 2017
Example of implicit classes on Scala
View Utils.scala
package com.igoticecream.wrike.util
object Utils {
implicit class IntWithTimes(x: Int) {
def times[A](f: => A): Unit = {
def loop(current: Int): Unit = {
if (current > 0) {
View Apache License 2.0 template
Copyright (c) $today.year. Pedro Díaz <>
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
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
igoticecream /
Created Jan 31, 2017
Event bus implementation with RxJava 2
import com.jakewharton.rxrelay2.PublishRelay;
import com.jakewharton.rxrelay2.Relay;
import io.reactivex.Observable;
import io.reactivex.disposables.Disposable;
import io.reactivex.functions.Consumer;
@SuppressWarnings({"unused", "FieldCanBeLocal", "WeakerAccess"})
public final class RxBus {
igoticecream /
Created Jan 31, 2017
Doble check singleton implementation
@SuppressWarnings({"unused", "FieldCanBeLocal", "WeakerAccess"})
public final class Singleton {
private static volatile Singleton ourInstance = null;
public static Singleton getInstance() {
if (ourInstance == null) {
synchronized (Singleton.class) {
if (ourInstance == null) {
ourInstance = new Singleton();
igoticecream / app-build.gradle
Created Feb 21, 2017
Basic gradle configuration of Java project
View app-build.gradle
plugins {
id 'application'
mainClassName = 'com.igoticecream.rebel.helper.Helper'
applicationDefaultJvmArgs = ["-javaagent:/An/Example/Jvm/Args.jar"]
dependencies {
compile fileTree(dir: 'libs', include: '*.jar')
igoticecream / app-build.gradle
Created Feb 21, 2017
Kotlin setup for Android Studio project
View app-build.gradle
apply plugin: ''
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
android {
compileSdkVersion 25
buildToolsVersion '25.0.2'
defaultConfig {
applicationId 'hellokotlin'
# Gradle Configuration
# The Gradle daemon aims to improve the startup and execution time of Gradle.
# When set to true the Gradle daemon is to run the build.
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
# Default value: -Xmx10248m -XX:MaxPermSize=256m
org.gradle.jvmargs=-Xmx5120m -XX:MaxPermSize=2048m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8