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:

@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
;;
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)
#!/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 / 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 / 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"
@alabeduarte
alabeduarte / run_ios_tests.rb
Last active December 24, 2015 12:29
Script for running iOS unit tests by command line inspired on http://stackoverflow.com/a/10823483/2839823
if ENV['SL_RUN_UNIT_TESTS'] then
launcher_path = "ios-sim"
test_bundle_path= File.join(ENV['BUILT_PRODUCTS_DIR'], "#{ENV['PRODUCT_NAME']}.#{ENV['WRAPPER_EXTENSION']}")
environment = {
'DYLD_INSERT_LIBRARIES' => "/../../Library/PrivateFrameworks/IDEBundleInjection.framework/IDEBundleInjection",
'XCInjectBundle' => test_bundle_path,
'XCInjectBundleInto' => ENV["TEST_HOST"]
}