Skip to content

Instantly share code, notes, and snippets.


Miguel Catalan Bañuls MiguelCatalan

Block or report user

Report or block MiguelCatalan

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
public class UriUtil {
private final Context context;
private static final byte[] GIF89A_HEADER = {0x47, 0x49, 0x46, 0x38, 0x39, 0x61};
public UriUtil(Context context) {
this.context = context;
public boolean isGif(Uri input) {
yossorion /
Last active Feb 17, 2020
What I Wish I'd Known About Equity Before Joining A Unicorn

What I Wish I'd Known About Equity Before Joining A Unicorn

Disclaimer: This piece is written anonymously. The names of a few particular companies are mentioned, but as common examples only.

This is a short write-up on things that I wish I'd known and considered before joining a private company (aka startup, aka unicorn in some cases). I'm not trying to make the case that you should never join a private company, but the power imbalance between founder and employee is extreme, and that potential candidates would

jmathai /
Last active Nov 18, 2019
Getting Elodie running on a Synology
public class GlueItemsAdapter extends RecyclerArrayAdapter<GlueItem, GlueItemsAdapter.Holder> {
public GlueItemsAdapter(LayoutInflater inflater) {
protected Holder onCreateViewHolder(LayoutInflater inflater, ViewGroup parent, int viewType) {
return new Holder(inflater.inflate(android.R.layout.simple_list_item_1, parent, false));
rocboronat /
Last active Jul 21, 2016
Use the more popular browser in the user's phone to open a URL
package com.fewlaps.quitnow;
import android.content.ActivityNotFoundException;
import android.content.Context;
import android.content.Intent;
import java.util.ArrayList;
import java.util.List;
ffgiraldez /
Last active May 4, 2016
Disable toolbar scroll flag when content it's not enough to fill the screen
public class ToolbarActivity extends AppCompatActivity {
// Set the flags that fit your needs
private static final int ENABLED_SCROLL_BEHAVIOR = AppBarLayout.LayoutParams.SCROLL_FLAG_ENTER_ALWAYS | AppBarLayout.LayoutParams.SCROLL_FLAG_SCROLL;
private static final int DISABLED_SCROLL_BEHAVIOR = 0;
private static final int SCROLL_DOWN = 1;
//Injected via ButterKnife (
Toolbar toolbar;
easternHong / build.gradle
Last active Feb 9, 2018
android studio gradle checkstyle findbugs pmd lint
View build.gradle
//go to
//get the config file and put them into app/config/..
apply plugin: 'pmd'
apply plugin: 'findbugs'
apply plugin: 'checkstyle'
task findbugs(type: FindBugs) {
description 'Run findbugs'
group 'verification'
classes = fileTree('build/intermediates/classes/debug/')
lauw /
Created May 4, 2015
Snapping RecyclerView (Horizontal)
* Copyright 2015 Laurens Muller.
* 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
* Unless required by applicable law or agreed to in writing, software
AnirudhaAgashe /
Last active Jun 25, 2017 — forked from adelnizamutdinov/
RecyclerView with provosion to add empty view like list view. Displayed when the data set is empty
import android.content.Context;
import android.util.AttributeSet;
import android.view.View;
public class EmptyRecyclerView extends RecyclerView {
gallir / gist:4b88005310587b056ca4
Created Feb 2, 2015
Seach a word recursively in all files under the current working direcrtory
View gist:4b88005310587b056ca4
#! /usr/bin/env bash
if [ $# -eq 0 ]
echo "No word supplied"
find . -type f -and -not -path '*/.git/*' -and -not -path '*/.svn/*' -exec grep -i -H "$word" {} \;
You can’t perform that action at this time.