Skip to content

Instantly share code, notes, and snippets.

View markus2610's full-sized avatar

Markus markus2610

View GitHub Profile
@markus2610
markus2610 / MainActivity.java
Created September 27, 2017 17:07 — forked from TouchBoarder/MainActivity.java
Vector drawables from XML with the Android support library 23.3.0
package com.xwray.vectorbinding;
import android.databinding.BindingAdapter;
import android.databinding.DataBindingUtil;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.support.graphics.drawable.VectorDrawableCompat;
import android.support.v7.app.AppCompatActivity;
import android.widget.TextView;
@markus2610
markus2610 / Install Composer using MAMP's PHP.md
Created September 8, 2017 12:01 — forked from irazasyed/Install Composer using MAMP's PHP.md
Instructions on how to change preinstalled Mac OS X PHP to MAMP's PHP Installation and then install Composer Package Management

Change default Mac OS X PHP to MAMP's PHP Installation and Install Composer Package Management


Instructions to Change PHP Installation


First, Lets find out what version of PHP we're running (To find out if it's the default version).

To do that, Within the terminal, Fire this command:

which php

@markus2610
markus2610 / TimeLineIndicatorItemDecoration.java
Created August 11, 2017 17:25 — forked from SachinR90/TimeLineIndicatorItemDecoration.java
Exploring ItemDecoration for RecyclerView. Drawing Timelines
/*
* Copyright (C) 2014 The Android Open Source Project
*
* 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
@markus2610
markus2610 / LifecycleObservableTransformer.java
Created August 10, 2017 05:01 — forked from magillus/LifecycleObservableTransformer.java
Observable transformer that will act on event of the Lifecycle to auto dispose its subscriptions when the event occurs. By default ON_DESTROY
package com.example.playground;
import android.arch.lifecycle.Lifecycle;
import android.arch.lifecycle.LifecycleObserver;
import android.arch.lifecycle.OnLifecycleEvent;
import android.support.annotation.NonNull;
import android.util.Log;
import java.lang.ref.WeakReference;
import java.util.Map;
@markus2610
markus2610 / PagingRecyclerView
Created March 23, 2017 13:39 — forked from mgarnerdev/PagingRecyclerView
Horizontal Snapping RecyclerView with Page Indication
import android.content.Context;
import android.graphics.PointF;
import android.support.v7.widget.LinearSmoothScroller;
import android.support.v7.widget.RecyclerView;
import android.util.AttributeSet;
import android.util.DisplayMetrics;
import android.util.TypedValue;
import android.view.MotionEvent;
/**
@markus2610
markus2610 / PagingRecyclerView
Created March 23, 2017 13:39 — forked from mgarnerdev/PagingRecyclerView
Horizontal Snapping RecyclerView with Page Indication
import android.content.Context;
import android.graphics.PointF;
import android.support.v7.widget.LinearSmoothScroller;
import android.support.v7.widget.RecyclerView;
import android.util.AttributeSet;
import android.util.DisplayMetrics;
import android.util.TypedValue;
import android.view.MotionEvent;
/**
@markus2610
markus2610 / rainbow.kt
Created March 6, 2017 07:31 — forked from stepango/rainbow.kt
kotlin apply example
val rainbowPaint = Paint(Paint.ANTI_ALIAS_FLAG).apply {
style = Paint.Style.STROKE
strokeCap = Paint.Cap.ROUND
}
import android.text.TextUtils;
import io.realm.Case;
import io.realm.Realm;
import io.realm.RealmObject;
import io.realm.RealmResults;
public class RealmFullTextSearch {
public static <T extends RealmObject> RealmResults<T> search(Realm realm, Class<T> modelClass, String query, String fieldName, boolean partialSearch){
@markus2610
markus2610 / Person.kt
Created January 12, 2017 18:58
Builder Pattern Kotlin
class Person private constructor(val name: String, val surname: String, val age: Int) {
private constructor(builder: Builder) : this(builder.name, builder.surname, builder.age)
companion object {
fun create(init: Builder.() -> Unit) = Builder(init).build()
}
class Builder private constructor() {
@markus2610
markus2610 / gist:2a70fbe348998034434b3af1da7528e5
Created December 16, 2016 10:14 — forked from dodyg/gist:5616605
Kotlin Programming Language Cheat Sheet Part 2

This is a quick guide to Kotlin programming language. The previous part of this guide is here

#Object Oriented

fun main(args : Array<String>) {
  class local (val x : Int)
  
  val y = local(10)
 println("${y.x}")