Skip to content

Instantly share code, notes, and snippets.

Avatar
🐺
Hunting Knowledge

Mad Mirrajabi mirrajabi

🐺
Hunting Knowledge
View GitHub Profile
View migrate_repo.sh
# Assume we are in your home directory
cd ~/
# Clone the repo from GitLab using the `--mirror` option
$ git clone --mirror git@your-gitlab-site.com:mario/my-repo.git
# Change into newly created repo directory
$ cd ~/my-repo.git
# Push to GitHub using the `--mirror` option. The `--no-verify` option skips any hooks.
View ImageLoaders.md

Image loading libraries comparison

A quick overview

First lets look at some pros and cons features of some of the most famous libraries in this category[^1]

Fresco by facebook (~13k stars)

Cons Pros
Huge size of library Pretty fast image loader (for small && medium images)
No Callback with View, Bitmap parameters A lot of functionality(streaming, drawing tools, memory management, etc)
SimpleDraweeView doesn't support wrap_content Possibility to setup directly in xml (for example round corners)
@mirrajabi
mirrajabi / generatepublicresources.gradle
Created Apr 19, 2017 — forked from HannahMitt/generatepublicresources.gradle
This is a gradle task to generate the public.xml file in an Android library project. It assumes all public resources are kept in a res-public/ resource source directory. Providing this as a starting point, but there may be more efficient ways.
View generatepublicresources.gradle
import groovy.xml.MarkupBuilder
// Task to generate our public.xml file
// See https://developer.android.com/studio/projects/android-library.html#PrivateResources
// We assume resources within res-public are public
task generatepublicxml {
def resDir = project.projectDir.absolutePath + "/src/main/res-public"
// Include the desired res types
@mirrajabi
mirrajabi / Album.java
Created Dec 12, 2016 — forked from krzysztof-miemiec/Album.java
List parsing done with LoganSquare and Realm database.
View Album.java
/**
* Sample class showing how to use type converter in this gist.
*
* @author Krzysztof Miemiec
*/
@JsonObject
public class Album extends RealmObject {
@PrimaryKey
@JsonField
@mirrajabi
mirrajabi / BaseItemHolderAdapter.java
Last active Sep 21, 2019
Generic RecyclerView Adapter boilerplate.
View BaseItemHolderAdapter.java
import android.content.Context;
import android.support.annotation.AnimRes;
import android.support.annotation.IdRes;
import android.support.annotation.LayoutRes;
import android.support.annotation.Nullable;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.animation.Animation;
You can’t perform that action at this time.