Skip to content

Instantly share code, notes, and snippets.

View MiguelCatalan's full-sized avatar
🏍️

Miguel Catalan Bañuls MiguelCatalan

🏍️
View GitHub Profile
@JMPergar
JMPergar / LogManager.java
Last active August 29, 2015 14:02
LogManager.java
import android.util.Log;
public final class LogManager {
public static final int VERBOSE = 0;
public static final int DEBUG = 1;
public static final int INFO = 2;
public static final int WARN = 3;
public static final int ERROR = 4;
public static final int WTF = 5;
@ffgiraldez
ffgiraldez / ToolbarActivity.java
Last active May 4, 2016 16:11
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 (http://jakewharton.github.io/butterknife)
@InjectView(R.id.toolbar)
Toolbar toolbar;
@InjectView(R.id.recyclerview)
@rocboronat
rocboronat / PopularBrowser.java
Last active July 21, 2016 15:58
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 android.net.Uri;
import java.util.ArrayList;
import java.util.List;
@jkeyes
jkeyes / _vimeo.html
Last active November 16, 2016 20:07
ResponsiveEmbedConverter
<style>.embed-container { position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; max-width: 100%; height: auto; } .embed-container iframe, .embed-container object, .embed-container embed { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }</style>
<div class='embed-container'>
<iframe src='{{ scheme }}://player.vimeo.com/video/{{ video_id }}' frameborder='0' webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>
</div>
@AnirudhaAgashe
AnirudhaAgashe / EmptyRecyclerView.java
Last active June 25, 2017 03:00 — forked from meoyawn/EmptyRecyclerView.java
RecyclerView with provosion to add empty view like list view. Displayed when the data set is empty
import android.content.Context;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v7.widget.RecyclerView;
import android.util.AttributeSet;
import android.view.View;
public class EmptyRecyclerView extends RecyclerView {
@scabilbao
scabilbao / FloatingView.java
Created June 9, 2014 08:48
Android Floating View
/**
Copyright Grupo SCA 2014 (@SCA_Consultores)
Licensed under the GPL General Public License, Version 3.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.gnu.org/licenses/gpl.html
Unless required by applicable law or agreed to in writing, software
public class UriUtil {
private final Context context;
private static final byte[] GIF89A_HEADER = {0x47, 0x49, 0x46, 0x38, 0x39, 0x61};
@Inject
public UriUtil(Context context) {
this.context = context;
}
public boolean isGif(Uri input) {
@gallir
gallir / gist:4b88005310587b056ca4
Created February 2, 2015 19:52
Seach a word recursively in all files under the current working direcrtory
#! /usr/bin/env bash
if [ $# -eq 0 ]
then
echo "No word supplied"
fi
word=$1
find . -type f -and -not -path '*/.git/*' -and -not -path '*/.svn/*' -exec grep -i -H "$word" {} \;
@easternHong
easternHong / build.gradle
Last active August 29, 2020 07:59
android studio gradle checkstyle findbugs pmd lint
//go to https://github.com/easternHong/vb-android-app-quality
//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/')
@vinnymac
vinnymac / README.md
Last active October 13, 2020 00:25
Guide to Hackintosh (specifically for Z390i/9900K/Vega64 build)