Skip to content

Instantly share code, notes, and snippets.

Evelio Tarazona eveliotc

Block or report user

Report or block eveliotc

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
eveliotc / android-select-device
Last active Feb 5, 2019
My (android) dev aliases and scripts
View android-select-device
#! /bin/bash
# from
# selects an android device
PROGNAME=$(basename $0)
for opt in "$@"
case "$opt" in

A visited command for Backtick. Injects CSS to visually differentiate regular links from visited ones.

To install Copy 68fbf2e317c8b4b473c3 then Paste it into the custom commands field in the Backtick settings. You can easily access the settings by clicking the Backtick icon on the command execution console.

eveliotc /
Created Jul 29, 2013
A variant of to show a drop shadow, should not be used for performance in mind views
final ImageView imageView = (ImageView) view.findViewById(;
final int shadowSize = getResources().getDimensionPixelSize(R.dimen.shadow_size);
final int shadowColor = getResources().getColor(R.color.shadow_color);
imageView.setImageDrawable(new RoundedAvatarDrawable(mBitmap, shadowSize, shadowColor));
imageView.setLayerType(View.LAYER_TYPE_SOFTWARE, null);
eveliotc /
Created Jul 22, 2013
RoundedAvatarDrawable: A Drawable that draws an oval with given {@link Bitmap} See
* Copyright 2013 Evelio Tarazona Cáceres <>
* 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
eveliotc /
Created Jul 22, 2013
A better yet dirty way of get rounded avatars
public static Bitmap getRoundedBitmap(Bitmap bitmap) {
final Bitmap output = Bitmap.createBitmap(bitmap.getWidth(), bitmap.getHeight(), Bitmap.Config.ARGB_8888);
final Canvas canvas = new Canvas(output);
final int color = Color.RED;
final Paint paint = new Paint();
final Rect rect = new Rect(0, 0, bitmap.getWidth(), bitmap.getHeight());
final RectF rectF = new RectF(rect);
eveliotc / bad_avatar_overlay.xml
Created Jul 22, 2013
A sample of a bad way of doing rounded avatars
View bad_avatar_overlay.xml
<?xml version="1.0" encoding="utf-8"?>
<!-- From post -->
<FrameLayout xmlns:android=""
View gist:4506761
<!-- res/values/styles.xml -->
<style name="MyCheckbox" parent="@android:style/Widget.CompoundButton.CheckBox">
<item name="android:button">@drawable/btn_check</item>
<item name="android:paddingLeft">@dimen/checkbox_padding_left_workaround</item>
<!-- yada yada yada -->
<!-- res/values/dimens.xml -->
<dimen name="checkbox_padding_left_workaround">50dip</dimen> <!-- or whatever your drawable is -->
<!-- res/values-v17/dimens.xml -->
<dimen name="checkbox_padding_left_workaround">0dip</dimen> <!-- yup, you got it -->
eveliotc /
Created Aug 15, 2012
Script to batch resize non 9patch images
SRC_DIR=$1; # e.g. res/drawable-xhdpi/
DEST_DIR=$2; # e.g. res/drawable-mdpi/
RESIZE_BY=$3; # e.g. 50%
echo "From $SRC_DIR to $DEST_DIR resize by $RESIZE_BY";
for item in $( ls $SRC_DIR | grep -v '\.9.png$' ); do
echo Resizing: $item
convert $SRC_DIR$item -resize $RESIZE_BY $DEST_DIR$item
You can’t perform that action at this time.