Skip to content

Instantly share code, notes, and snippets.

View igoticecream's full-sized avatar

Pedro Díaz igoticecream

View GitHub Profile
@igoticecream
igoticecream / colors.xml
Created February 29, 2016 20:18
Google's material design color palette resource file
<?xml version="1.0" encoding="utf-8"?>
<resources>
<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
igoticecream / idea.properties
Created January 31, 2017 18:28
Custom IntelliJ IDEA properties
# custom IntelliJ IDEA properties
editor.zero.latency.typing=true
@igoticecream
igoticecream / idea.vmoptions
Created January 31, 2017 18:29
Custom IntelliJ IDEA VM options
# custom IntelliJ IDEA VM options
-server
-Xms2g
-Xmx2g
-XX:NewRatio=3
-Xss16m
-XX:+UseConcMarkSweepGC
-XX:+CMSParallelRemarkEnabled
-XX:ConcGCThreads=4
@igoticecream
igoticecream / Utils.scala
Last active January 31, 2017 18:35
Example of implicit classes on 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) {
f
Copyright (c) $today.year. Pedro Díaz <igoticecream@gmail.com>
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
distributed under the License is distributed on an "AS IS" BASIS,
@igoticecream
igoticecream / RxBus.java
Created January 31, 2017 18:49
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
igoticecream / Singleton.java
Created January 31, 2017 18:53
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
igoticecream / app-build.gradle
Created February 21, 2017 20:47
Basic gradle configuration of Java project
plugins {
id 'application'
}
mainClassName = 'com.igoticecream.rebel.helper.Helper'
applicationDefaultJvmArgs = ["-javaagent:/An/Example/Jvm/Args.jar"]
dependencies {
compile fileTree(dir: 'libs', include: '*.jar')
}
@igoticecream
igoticecream / app-build.gradle
Created February 21, 2017 22:47
Kotlin setup for Android Studio project
apply plugin: 'com.android.application'
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.
org.gradle.daemon=true
# 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