Skip to content

Instantly share code, notes, and snippets.

View alabeduarte's full-sized avatar

Alabê Duarte alabeduarte

View GitHub Profile

Keybase proof

I hereby claim:

  • I am alabeduarte on github.
  • I am alabeduarte (https://keybase.io/alabeduarte) on keybase.
  • I have a public key ASDlCFAvbWN8t4pSaLQAQx4PIWqTz_AxvPr1wwdr935xuQo

To claim this, I am signing this object:

Keybase proof

I hereby claim:

  • I am alabeduarte on github.
  • I am alabeduarte (https://keybase.io/alabeduarte) on keybase.
  • I have a public key whose fingerprint is BA9F 56A9 94B5 BD4F C670 F96D FFA0 DE90 4092 ADD0

To claim this, I am signing this object:

QUERY='Fix'
git log --all --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit | grep ${QUERY}
@alabeduarte
alabeduarte / git-show-by-message.md
Last active January 27, 2017 13:59
git show by commit message regex
$ MESSAGE='Fix'
$ git show $(git log --oneline --reverse | grep ${MESSAGE} | awk '{print$1}' | xargs)
@alabeduarte
alabeduarte / clone or pull git repo
Last active November 28, 2016 17:15
clone or pull git repo
#!/usr/bin/env bash
function clone_or_pull () {
root_dir=`pwd`
if [ -d $1 ]; then
echo "Prepare to pull the latest version of $1"
cd $1
git pull origin master
else
echo "Prepare to clone $1"
@alabeduarte
alabeduarte / website_downloader.sh
Last active March 8, 2017 00:02
Download a website entirely to read offline.
function _help() {
cat <<EOH
Usage: ./website_downloader.sh download http://xyz.xpto
EOH
}
case ${1} in
download)
wget -r -np -k $2
;;
#!/usr/bin/env bash
set -e
function _colored() { tput -Txterm setaf ${1}; echo -e ${2}; tput -Txterm sgr0; }
function log_error() { _colored 1 "${1}"; } # use for failures
function log_action() { _colored 3 "${1}"; } # use for warnings / attention
function log_command() { _colored "${1}"; } # use for debug messages
readonly MACHINE_NAME="dev"
@alabeduarte
alabeduarte / android_versioning.sh
Last active August 29, 2015 14:01
Versioning android app with maven based on the latest git tag
#!/bin/bash -exu
TAG_COUNT=$(git tag | wc -l | grep -o '[0-9]\+')
CURRENT_TAG=$(git describe --abbrev=0 --tags | grep -o '[0-9\.]\+')
mvn versions:set -DnewVersion=$CURRENT_TAG -DgenerateBackupPoms=false
mvn clean package -Prelease -Dproject.version=$CURRENT_TAG -Dproject.versionCode=$TAG_COUNT -Dsign.keystore=$KEY_STORE_PATH -Dsign.alias=${PROJECT_NAME} -Dsign.storepass= -Dsign.keypass=${PROJECT_PASSWORD}
jarsigner -verbose -verify -certs app/target/app-signed-aligned.apk > jarsigner.verify.certs.verbose.output.txt
echo $(aapt dump badging app/target/app.apk | grep version)
@alabeduarte
alabeduarte / cordova_template.sh
Last active December 25, 2015 10:59
cordova template
#!/bin/sh
npm init
APP="my_app"
COFFEE=$1
LESS=$2
MOBILE_DIR="${APP}/mobile"
WWW_DIR="${MOBILE_DIR}/www"
@alabeduarte
alabeduarte / ios_ci.sh
Last active December 24, 2015 12:39
Continuous Integration Build Script for iOS
#!/usr/bin/env bash
CI_PASSWORD="password"
security unlock-keychain -p ${CI_PASSWORD} /Users/Shared/Jenkins/Library/Keychains/login.keychain
if [ $? -ne 0 ]; then exit 1; fi
BUILD_DIR="/Users/Shared/CI/App/your_project/Build"
TARGET_SDK="iphoneos"