Skip to content

Instantly share code, notes, and snippets.

View rodrigozrusso's full-sized avatar

Rodrigo Russo rodrigozrusso

View GitHub Profile
@rodrigozrusso
rodrigozrusso / Makefile
Created July 13, 2022 10:04
Makefile for go projects - Replace <<<project-name>>> with your project name
.PHONY: all clean
BINARY=bin/<<<project-name>>>
VERSION=$(shell git tag | tail -1)
BUILD=$(shell git rev-parse HEAD)
LDFLAGS=-ldflags "-X <<<project-name>>>.Version=$(VERSION) -X <<<project-name>>>.Build=$(BUILD)"
all: test coverage build
.PHONY: build
@rodrigozrusso
rodrigozrusso / agility.md
Created May 30, 2021 20:48
Bootstrap de agilidade - Fluxo de trabalho

Bootstrap de agilidade - Fluxo de trabalho

Publico alvo

  • Times novos
  • Times já formados, porém que não seguem nenhuma metodologia
  • Times já formados, porém que não conseguem realizar entregas de valor continuamente.

Preparação

Realizar 3 ou 4 encontros com todos do time (Engenharia + Produto + QA + SRE). É impressindível todos participarem de todos os encontros para auxiliar no team building e também para criar ownership dos acordos firmados.

@rodrigozrusso
rodrigozrusso / readme.md
Created April 28, 2021 21:21
project readme template

Project documentation (Readme.md)

Why?

  • Onboarding readiness
  • Inner sourcing
  • Efficiency in changing contexts between projects
  • Reduce cognitive load

How it works

@rodrigozrusso
rodrigozrusso / .gitconfig
Created February 4, 2021 13:50
Git config
[user]
name = <add-your-name>
email = <add-your-email>
[color]
ui = auto
[color "branch"]
current = yellow reverse
local = yellow
remote = green
@rodrigozrusso
rodrigozrusso / flutter_decoration_gradient
Created June 27, 2020 20:56
flutter_decoration_gradient
Container(
decoration: BoxDecoration(
gradient: LinearGradient(
begin: Alignment.topRight,
end: Alignment.bottomLeft,
colors: [
Colors.amber,
Colors.brown
]
)
@rodrigozrusso
rodrigozrusso / bbox.py
Created September 13, 2019 22:05
Calculate bounding box
#!/usr/bin/python
'''
Copied from: https://stackoverflow.com/questions/238260/how-to-calculate-the-bounding-box-for-a-given-lat-lng-location
'''
import math
# Semi-axes of WGS-84 geoidal reference
WGS84_a = 6378137.0 # Major semiaxis [m]
WGS84_b = 6356752.3 # Minor semiaxis [m]
@rodrigozrusso
rodrigozrusso / get_data_with_leading_trailing_spaces.sql
Created January 11, 2019 12:40
Select data from column with leading and trailing sapces
select url from mytable where substr(url,1,1) = ' ' or substr(url,-1,1) = ' ';
@rodrigozrusso
rodrigozrusso / list_commits_between_branches.sh
Created March 27, 2018 09:26
list commits between branches
if [ -z "$1" ]
then
echo "usage: ${0} newer_branch [old_branch | default: master]"
fi
NEWER_BRANCH=${1}
OLDER_BRANCH=${2}
if [ -z "$2" ]
then
@rodrigozrusso
rodrigozrusso / jenkins_inject-var_from-other-build.groovy
Created December 6, 2016 12:43
Jenkins retrieve EnvVar from Another job and inject in the build.
import jenkins.*;
import jenkins.model.*;
import hudson.*;
import hudson.model.*;
def item = Jenkins.getInstance().getItemByFullName("my-awesome-job")
//build = item.getBuildByNumber("$buildNumberFromParameter".toInteger())
build = item.getBuildByNumber(1234)
def var = build.getEnvVars()['SpecificEnvOrParam']
@rodrigozrusso
rodrigozrusso / add_launchd_to_tcc.sh
Created September 26, 2016 15:37 — forked from mtauraso/add_launchd_to_tcc.sh
TCC Database Script
#!/bin/bash
# This will add lauchd to the list of allowed processes for accessibility access
sudo sqlite3 /Library/Application\ Support/com.apple.TCC/TCC.db "INSERT or REPLACE INTO access VALUES('kTCCServiceAccessibility','/sbin/launchd',1,1,1,NULL)"
# This outputs the rows in the TCC database
sudo sqlite3 /Library/Application\ Support/com.apple.TCC/TCC.db 'select * from access'
echo "Restart is required for these changes to take effect"