Skip to content

Instantly share code, notes, and snippets.

View garrefa's full-sized avatar

Alex garrefa

View GitHub Profile
# definição de variáveis de ambiente
export GREP_OPTIONS="--color=auto"
export GREP_COLOR="4;33"
export CLICOLOR="auto"
export EDITOR='subl -w'
export BASH_INIT_COLOR="\[$(tput setaf 2)\]"
export BASH_DEFT_COLOR="\[$(tput sgr0)\]"
export PS1="\n$BASH_INIT_COLOR[\t] (\u) : \w$BASH_DEFT_COLOR\n\[$(tput bold)\]> $BASH_DEFT_COLOR"
gem: --no-ri --no-rdoc
# Xcode
.DS_Store
*/build/*
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
# Auto create gemset when used
rvm_gemset_create_on_use_flag=1
# Prefer default ruby when project file not found in current directory
rvm_project_rvmrc_default=1
# Install bundler gem and run bundle install if Gemfile available
rvm_autoinstall_bundler_flag=1
# command to create my git lg alias
git config --global alias.lg "log --color --graph --pretty=format:'%Cred%h%Creset %Cblue%an%Creset %s'"
# prefered
git config --global alias.lg "log --graph --pretty=format:'%Cred%h%Creset %C(yellow)%d%Creset %Cgreen%cd%Creset %C(bold blue)%an%Creset %s' --date=short"
@garrefa
garrefa / AgregadorTableViewDataSource.m
Created March 24, 2015 20:00
Exemplo de Datasource Aggregator usando no post UITableViewControllers com Máquina de Estados e Agregador de Delegates/Datasources.no blog da Concrete. blog.concretesolutions.com.br
//
// AgregadorTableViewDataSource.m
// DataSourceAggregator
//
// Created by Alexandre Garrefa on 3/24/15.
// Copyright (c) 2015 Concrete Solutions. All rights reserved.
//
#import "AgregadorTableViewDataSource.h"
@garrefa
garrefa / xcode-build-bump.sh
Created November 17, 2015 16:32 — forked from sekati/xcode-build-bump.sh
Xcode Auto-increment Build & Version Numbers
# xcode-build-bump.sh
# @desc Auto-increment the build number every time the project is run.
# @usage
# 1. Select: your Target in Xcode
# 2. Select: Build Phases Tab
# 3. Select: Add Build Phase -> Add Run Script
# 4. Paste code below in to new "Run Script" section
# 5. Drag the "Run Script" below "Link Binaries With Libraries"
# 6. Insure that your starting build number is set to a whole integer and not a float (e.g. 1, not 1.0)

Keybase proof

I hereby claim:

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

To claim this, I am signing this object:

@garrefa
garrefa / remove-boilerplate-comments-from-xcode-templates.sh
Last active December 15, 2016 12:06
Remove useless header comments from Xcode templates
#!/bin/bash
find -E $(xcode-select --print-path)\
-regex '.*___\.(c|h|m|swift)' \
-print0 | xargs -0 -n 1 sed -i '' '1,/^$/d'
function validateCNPJ(cnpj) {
cnpj = cnpj.replace(/[^\d]+/g,'');
if (cnpj.length != 14) return false;
// Remove known invalid CNPJs
if (cnpj === "00000000000000" ||
cnpj === "11111111111111" ||
cnpj === "22222222222222" ||
cnpj === "33333333333333" ||
cnpj === "44444444444444" ||
cnpj === "55555555555555" ||