Skip to content

Instantly share code, notes, and snippets.

Emin Yahyayev ewintory

Block or report user

Report or block ewintory

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
package com.wannacorp.util.glide;
import android.content.ContentResolver;
import android.content.Context;
import android.content.res.AssetManager;
import android.util.Log;
import com.bumptech.glide.Priority;
avrahamshukron / activity
Created May 2, 2015
FloatingActionButton dimming
View activity
public void onMenuToggle(final boolean isOpen) {
private void setBackgroundDimming(boolean dimmed) {
final float targetAlpha = dimmed ? 1f : 0;
final int endVisibility = dimmed ? View.VISIBLE : View.GONE;
kaushikgopal /
Created Jul 4, 2016 — forked from gsoltis/
RxJava Bindings for Firebase
package com.firebase.client;
import com.firebase.client.core.Constants;
import rx.Observable;
import rx.Subscriber;
import rx.functions.Action0;
import rx.functions.Func1;
import rx.subscriptions.Subscriptions;
public class RxFirebase {
mformetal /
Last active Apr 7, 2017
A simple way to add a predraw listener to a view
public abstract class PreDrawer<T extends View> {
// Private constructor prevent instantiation by the caller. Use addPredrawer() method instead.
private PreDrawer(final T view) {
// Adds the observer to the given view, then calls notifyPredraw() when clean up has been done ready
final ViewTreeObserver viewTreeObserver = view.getViewTreeObserver();
viewTreeObserver.addOnPreDrawListener(new ViewTreeObserver.OnPreDrawListener() {
public boolean onPreDraw() {
vrotaru /
Created Feb 6, 2012
Base58 encoding an decoding
package core;
public class Base58 {
private static final char[] ALPHABET = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"
private static final int BASE_58 = ALPHABET.length;
private static final int BASE_256 = 256;
private static final int[] INDEXES = new int[128];
snekse / Hibernate + Spring ignoring @Column
Last active May 25, 2018
Hibernate + Spring Boot ignoring @column(name="camelCase")
View Hibernate + Spring ignoring @Column
tonyshkurenko / Dagger 2, quick start
Last active Jun 18, 2018
Everything I found about Dagger 2
View Dagger 2, quick start
Dagger step 1: Add android-apt, dagger 2, dagger2-compiler, and javax annotation to the build.gradle files.
Note that they're not all "compile" dependencies.
Step 2: Add our module. Our ApplicationModule will be able to inject the ApplicationContext to classes that need it.
Step 3: Add our Component.Dagger 2 generates code for each Component you create,
using the file name Dagger(NameOfComponent).
Example: DaggerApplicationComponent.
Components can have multiple modules, in our case we have one.
katowulf / inc_id_rules.js
Last active Jun 24, 2018
Security rules for creating an incremental, numeric ID in Firebase. See
View inc_id_rules.js
"rules": {
".read": true,
".write": false,
"incid": {
"counter": {
// this counter is set using a transaction and can only be incremented by 1
// the total number of records must be less than 10,000 simply for demo purposes
".write": "newData.isNumber() && ((!data.exists() && newData.val() === 1) || newData.val() === data.val()+1) && newData.val() <= 10000"
yrom /
Last active Sep 2, 2018
SpacesItemDecoration for RecyclerView.
import android.view.View;
public class SpacesItemDecoration extends RecyclerView.ItemDecoration {
private int space;
private int spanCount;
private int lastItemInFirstLane = -1;
public SpacesItemDecoration(int space) {
vgaidarji / AndroidStudio as git difftool, mergetool
Last active Nov 26, 2018
Use AndroidStudio as git difftool/mergetool on MacOS (place this inside your ~/.gitconfig).
View AndroidStudio as git difftool, mergetool
tool = studio
[mergetool "studio"]
prompt = false
cmd = /Applications/Android\\ merge $(cd $(dirname "$LOCAL") && pwd)/$(basename "$LOCAL") $(cd $(dirname "$REMOTE") && pwd)/$(basename "$REMOTE") $(cd $(dirname "$BASE") && pwd)/$(basename "$BASE") $(cd $(dirname "$MERGED") && pwd)/$(basename "$MERGED")
trustExitCode = true
tool = studio
[difftool "studio"]
prompt = false
You can’t perform that action at this time.