Skip to content

Instantly share code, notes, and snippets.

View matheus-alpe's full-sized avatar
:shipit:

Matheus Alves Pereira matheus-alpe

:shipit:
View GitHub Profile

A única lista de comandos do Linux que você precisa marcar:

Daily Heroes:

  • ps aux | grep {process} - Encontre aquele processo furtivo
  • lsof -i :{port} - Quem está monopolizando aquela porta?
  • df -h - O clássico verificador de "estamos sem espaço"
  • netstat -tulpn - Detetive de conexão de rede
  • kubectl get pods | grep -i error - Localizador de problemas do K8s

Log Warriors:

@matheus-alpe
matheus-alpe / pre-commit
Created January 20, 2024 15:26
Git pre-commit hook focused on Go projects
#!/bin/bash
STAGED_GO_FILES=$(git diff --cached --name-only | grep ".go$")
if [[ "$STAGED_GO_FILES" = "" ]]; then
exit 0
fi
PASS=true
for FILE in $STAGED_GO_FILES

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

@matheus-alpe
matheus-alpe / formatNumber.js
Created September 9, 2022 17:29
Compact large values
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat
const compactFormatter = Intl.NumberFormat('en', { notation: 'compact' })
let number = compactFormatter.format(1555123321456)
console.log(number)// 1.6T
number = compactFormatter.format(1555123321)
console.log(number)// 1.6B
number = compactFormatter.format(1555123)