Skip to content

Instantly share code, notes, and snippets.

View vitovalov's full-sized avatar

Vito Valov vitovalov

View GitHub Profile
@vitovalov
vitovalov / rescale_for_android.sh
Created February 20, 2015 22:21
Resize to a given size maintaining proportions and automatically generate all android resource directories
# Author: @vitovalov
# Description: Resize to a given size and automatically generate all android resource directories
# Usage: sh rescale_for_android.sh <dp size (mdpi)> <source path to original images> <output path for results>(optional)
if [ "$#" -le 1 ]; then
echo "\nUsage: sh rescale_for_android.sh <dp size (mdpi)> <source path to original images> <output path for results>(optional)\n"
exit 1
fi
mdpisize=$1
hdpisize=$(echo "$mdpisize * 1.5" | bc -l)
@vitovalov
vitovalov / delete_local_refs_to_remote_branches.sh
Created February 20, 2015 22:17
Delete local references to remote branches
git remote prune origin
@vitovalov
vitovalov / delete_local_merged_branches.sh
Last active August 29, 2015 14:15
Delete locally already merged branches on develop
git checkout develop
git branch --merged | grep -v "*" | grep -v -e "[develop|master]" | xargs -n 1 git branch -d
@vitovalov
vitovalov / generate_android_strings.sh
Created February 20, 2015 22:07
This script allows to generate android strings.xml in each defined language creating all needed directories
# Made by vitovalov@gmail.com
# Overwrites existing files and directories
# Creates missing directories
node generate strings.json 'android'
# no trailing slash
PROJECT_DIR=~/project/src/main/res
if [ ! -d "$PROJECT_DIR" ]; then
echo "Error: Please define PROJECT_DIR"