Skip to content

Instantly share code, notes, and snippets.

Avatar

Pedro Diaz igoticecream

View GitHub Profile
@igoticecream
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"?>
<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 Jan 31, 2017
Custom IntelliJ IDEA properties
View idea.properties
# custom IntelliJ IDEA properties
editor.zero.latency.typing=true
@igoticecream
igoticecream / idea.vmoptions
Created Jan 31, 2017
Custom IntelliJ IDEA VM options
View idea.vmoptions
# 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 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) {
f
View Apache License 2.0 template
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 Jan 31, 2017
Event bus implementation with RxJava 2
View RxBus.java
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 Jan 31, 2017
Doble check singleton implementation
View Singleton.java
@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 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
igoticecream / app-build.gradle
Created Feb 21, 2017
Kotlin setup for Android Studio project
View app-build.gradle
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
android {
compileSdkVersion 25
buildToolsVersion '25.0.2'
defaultConfig {
applicationId 'hellokotlin'
View gradle.properties
# 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