Skip to content

Instantly share code, notes, and snippets.

View shekaroppo's full-sized avatar

Shekar shekaroppo

View GitHub Profile
@shekaroppo
shekaroppo / solarized-dark.css
Last active September 18, 2015 13:31 — forked from qguv/solarized-dark.css
Solarized theme for Jekyll, updated to reflect toned-down line numbers
/* Solarized Dark
For use with Jekyll and Pygments
http://ethanschoonover.com/solarized
SOLARIZED HEX ROLE
--------- -------- ------------------------------------------
base03 #002b36 background
base01 #586e75 comments / secondary content
@shekaroppo
shekaroppo / LocalBroadcastExampleActivity.java
Created November 4, 2015 10:12 — forked from Antarix/LocalBroadcastExampleActivity.java
Simple Example of using LocalBroadcastManager in Android
import android.app.Activity;
import android.app.Service;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.os.Bundle;
import android.os.IBinder;
import android.support.v4.content.LocalBroadcastManager;
@shekaroppo
shekaroppo / Android Studio for Experts.md
Created December 1, 2015 08:04 — forked from Epsiloni/Android Studio for Experts.md
Android Studio for Experts (Android Dev Summit 2015)
@shekaroppo
shekaroppo / build.gradle
Last active December 22, 2015 05:42 — forked from chris95x8/build.gradle
Extended toolbar with two floating-label edit texts. The layout was made according to this image from the Material Design guidelines: http://i.imgur.com/x8QsuxU.png The layout below looks like this: http://i.imgur.com/8sOTv7h.png
dependencies {
compile 'com.android.support:appcompat-v7:21.+'
compile 'com.wrapp.floatlabelededittext:library:0.0.5'
}
@shekaroppo
shekaroppo / HashMapAdapter.java
Created January 24, 2016 13:04 — forked from llavin/HashMapAdapter.java
This is a generic hash map adapter that I made in a project for an android view.
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
public abstract class HashMapAdapter<K, V> extends BaseAdapter{
@shekaroppo
shekaroppo / Dagger 2.md
Created March 1, 2016 09:34 — forked from lenguyenthanh/ Dagger 2.md
Dagger 2 configuration

Small gist shows how to config Dagger 2 to an Android project

@shekaroppo
shekaroppo / restAPI.markdown
Created June 12, 2016 07:22 — forked from iksose/restAPI.markdown
Creating a REST API using Node.js, Express, and MongoDB

###Creating a REST API using Node.js, Express, and MongoDB

####Installing Node.js

Go to http://nodejs.org, and click the Install button. Run the installer that you just downloaded. When the installer completes, a message indicates that Node was installed at /usr/local/bin/node and npm was installed at /usr/local/bin/npm. At this point node.js is ready to use. Let’s implement the webserver application from the nodejs.org home page. We will use it as a starting point for our project: a RESTful API to access data (retrieve, create, update, delete) in a wine cellar database.

Create a folder named nodecellar anywhere on your file system. In the wincellar folder, create a file named server.js.

@shekaroppo
shekaroppo / MainActivity.java
Created June 19, 2016 18:21 — forked from lisawray/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;
@shekaroppo
shekaroppo / gist:c9a32e36ec83920d89ca90cbefbc64d6
Created July 10, 2016 12:07 — forked from daschl/gist:db9fcc9d2b932115b679
Draft: Writing Code for Production

Writing Resilient Reactive Applications

This guide is a first draft (that will end up in the official docs) on writing resilient code for production with the Couchbase Java SDK. At the end, the reader will be able to write code that withstands bugs, latency issues or anything else that can make their application fail.

Note that lots of concepts can be applied for both synchronous and asynchronous access. When necessary, both patterns are discussed separately. Also, the focus is on database interaction, but if you are using RxJava as part of your stack you can apply most of the principles there as well (and should!).

RxJava 101 Recap: Cold and Hot Observables

When working with Observables, it is important to understand the difference between cold and hot. Cold Observables will start to emit events once a Observer subscribes, and will do it "fresh" for each Observer. Hot Observables instead are starting to emit data as soon as it becomes available, and will return the same (or parts of the same)

package com.example.android_transition_samples.app;
import android.animation.Animator;
import android.animation.AnimatorSet;
import android.animation.ObjectAnimator;
import android.animation.PropertyValuesHolder;
import android.content.Context;
import android.graphics.Rect;
import android.util.AttributeSet;
import android.view.View;