Skip to content

Instantly share code, notes, and snippets.

Working from home

Yesid yesidlazaro

Working from home
View GitHub Profile
View gist:e7dee95333f93b8f2906d576e2199e84
* Get a file path from a Uri. This will get the the path for Storage Access
* Framework Documents, as well as the _data field for the MediaStore and
* other file-based ContentProviders.
* @param uri The Uri to query.
* @author paulburke
fun getPath(context: Context, uri: Uri): String? {
View Android Color Control Cheat Sheet
Unless specified otherwise, all of the below tinting applies to both Lollipop and pre-Lollipop using AppCompat v21.
To use the support version of these attributes, remove the android namespace.
For instance, "android:colorControlNormal" becomes "colorControlNormal".
These attributes will be propagated to their corresponding attributes within the android namespace
for devices running Lollipop. Any exceptions to this will be noted by including the "android:" prefix.
All Clickable Views:
View templates
#if (${PACKAGE_NAME} && ${PACKAGE_NAME} != "")package ${PACKAGE_NAME};#end
public interface ${NAME}{
interface View extends BaseView {
interface Presenter extends BasePresenter<View> {
yesidlazaro / colors.xml
Last active Aug 30, 2017
Alpha hex codes color
View colors.xml
<!-- Alpha hex codes color in android
100% — FF
95% — F2
90% — E6
85% — D9
80% — CC
75% — BF
70% — B3
65% — A6
60% — 99
View parse_nginx.json
location /parse {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-NginX-Proxy true;
proxy_pass http://localhost:1337/parse;
proxy_ssl_session_reuse off;
proxy_set_header Host $http_host;
proxy_redirect off;
View forevernode.js
sudo su
as root, rm /etc/init.d/
as root, run pm2 startup. it still complains that /etc/init.d/ links already exists, despite just removing it
as root, pm2 start (my processes, eg ecosystem.json), pm2 start ecosystem.json
as root, pm2 save
reboot (if ubuntu)
yesidlazaro /
Created Dec 5, 2016 — forked from jonfhancock/
This set of classes demonstrates what a Not Dumb ViewHolder should look like. It lightens the load on the Adapter, and places decisions about what to do with user interactions on the Activity where it belongs.
public class ExcellentAdventure {
@StringDef({ERA_BC, ERA_AD})
public @interface Era {
public static final String ERA_BC = "BC";
public static final String ERA_AD = "AD";
yesidlazaro /
Created Oct 21, 2016
Fix OpenGApps permissions on CyanogenMod 13

Fix OpenGApps permissions on CyanogenMod 13

Updating to CyanogenMod 13 with OpenGApps is problematic and results in issues including repeated warnings such as

Unfortunately, setup wizard has stopped working


Unfortunately, Google Play Services has stopped working

yesidlazaro /
Created Oct 5, 2016 — forked from liberorignanese/
Android TextInputLayout with credit card mask
* Created by Libero Rignanese.
public class SQLQueryBuilder {
private static final String STATEMENT_SELECT = "SELECT";
private static final String STATEMENT_UPDATE = "UPDATE";
private static final String STATEMENT_INSERT_INTO = "INSERT INTO";
private static final String STATEMENT_DELETE = "DELETE FROM";
private static final String WHERE = "WHERE";
private static final String FROM = "FROM";