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
@vrotaru
vrotaru / Base58.java
Created Feb 6, 2012
Base58 encoding an decoding
View Base58.java
package core;
public class Base58 {
private static final char[] ALPHABET = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"
.toCharArray();
private static final int BASE_58 = ALPHABET.length;
private static final int BASE_256 = 256;
private static final int[] INDEXES = new int[128];
@katowulf
katowulf / inc_id_rules.js
Last active Jun 24, 2018
Security rules for creating an incremental, numeric ID in Firebase. See http://jsfiddle.net/firebase/xLq7grcc/
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"
},
@moust
moust / Sample.java
Last active Nov 12, 2019
Example of implementation of APK Expansion Files download process with a PhoneGap application
View Sample.java
package com.phonegap.Sample;
import java.io.File;
import android.app.AlertDialog;
import android.app.AlertDialog.Builder;
import android.app.PendingIntent;
import android.app.ProgressDialog;
import android.content.Intent;
import android.content.pm.PackageManager.NameNotFoundException;
@romannurik
romannurik / DrawInsetsFrameLayout.java
Created Feb 10, 2014
DrawInsetsFrameLayout — adding additional background protection for system UI chrome when using KitKat’s translucent decor flags.
View DrawInsetsFrameLayout.java
/*
* Copyright 2014 Google Inc.
*
* 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
@lifuzu
lifuzu / auto_update.md
Created Apr 3, 2014
Android auto update apk implementation
View auto_update.md
public class UpdateApp extends AsyncTask<String,Void,Void>{
private Context context;
public void setContext(Context contextf){
    context = contextf;
}

@Override
protected Void doInBackground(String... arg0) {
      try {
@gsoltis
gsoltis / RxFirebase.java
Last active Mar 7, 2019
RxJava Bindings for Firebase
View RxFirebase.java
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 {
@staltz
staltz / introrx.md
Last active Nov 18, 2019
The introduction to Reactive Programming you've been missing
View introrx.md
@alexfu
alexfu / DividerItemDecoration.java
Last active Jun 27, 2019
An ItemDecoration that draws dividers between items. Pulled from Android support demos.
View DividerItemDecoration.java
/*
* 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
@JakeWharton
JakeWharton / AutoGson.java
Last active May 12, 2019
A Gson TypeAdapterFactory which allows serialization of @autovalue types. Apache 2 licensed.
View AutoGson.java
import com.google.auto.value.AutoValue;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
import static java.lang.annotation.ElementType.TYPE;
import static java.lang.annotation.RetentionPolicy.RUNTIME;
/**
* Marks an {@link AutoValue @AutoValue}-annotated type for proper Gson serialization.
* <p>
View AssetUriFetcher.java
package com.wannacorp.util.glide;
import android.content.ContentResolver;
import android.content.Context;
import android.content.res.AssetManager;
import android.net.Uri;
import android.util.Log;
import com.bumptech.glide.Priority;
import com.bumptech.glide.load.data.DataFetcher;
You can’t perform that action at this time.