Skip to content

Instantly share code, notes, and snippets.

View bergpb's full-sized avatar
💻
https://blog.bergpb.dev

Lindemberg Barbosa bergpb

💻
https://blog.bergpb.dev
View GitHub Profile
@bergpb
bergpb / revisao-commit.md
Created February 15, 2021 12:35 — forked from pedrosancao/revisao-commit.md
Manual de Revisão de Commit

Manual de Revisão de Commit

O uso de repositórios GIT tem diversos benefícios: trabalho em equipe, desenvolvimento de recursos separadamente, histórico das alterações, etc. Mas para disponibilizar todo o potencial é preciso um pouco de dedicação no momento do commit.

Não é preciso uma vasta experiência para já ter passado por situações como conflito de arquivos onde a mensagem não traz nenhuma informações relevante e é preciso inverstigar o que a outra pessoa estava desenvolvendo ou após

@bergpb
bergpb / openweather_emoji.py
Created January 18, 2021 00:06
Uses the OpenWeatherMap to get an emoji based on the current weather // OpenWeaterMap emoji matcher in python.
# Based on ruby version: https://gist.github.com/michels/90327b8d284646a238e6
import requests
OPENWEATHER_APIKEY = "" # TODO add your apikey here
CITY = "Fortaleza"
def get_weather_emoji(weather_id):
# Openweathermap Weather codes and corressponding emojis
thunderstorm = "💨" # Code: 200's Thunderstorm
drizzle = "💧" # Code: 300's Drizzle
@bergpb
bergpb / ansible-github.yml
Created January 11, 2021 14:12 — forked from devynspencer/ansible-github.yml
Example playbook for cloning a private git repository with Ansible.
---
hosts: all
tasks:
- name: add github ssh key
copy: >
src=files/id_rsa.github
dest=/root/.ssh/id_rsa.github
owner=root
group=root
@bergpb
bergpb / semantic-commit-messages.md
Created January 10, 2021 16:28 — forked from joshbuchea/semantic-commit-messages.md
Semantic Commit Messages

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

@bergpb
bergpb / .gitconfig
Created January 7, 2021 19:23 — forked from lifuzu/.gitconfig
Three levels of GIT config
# There are 3 levels of git config; project, global and system.
# project: Project configs are only available for the current project and stored in .git/config in the project's directory.
# global: Global configs are available for all projects for the current user and stored in ~/.gitconfig.
# system: System configs are available for all the users/projects and stored in /etc/gitconfig.
# Create a project specific config, you have to execute this under the project's directory.
$ git config user.name "John Doe"
# Create a global config
@bergpb
bergpb / frases_christian_profanus.txt
Last active March 31, 2021 23:44
Frases de Chris (Profanus) Cardoso
Sim.
Não.
Seja criativo e analógico pois a calcanheza ébria te torna obsoleto.
A lógica é um método para chegar a uma conclusão errada com confiança.
Um despertar é como acordar as vezes é melhor do que enxergar.
Acreditar que não acreditamos em nada é crer na crença do descrer.
Um homem sem propósito é um homem incalcanhável.
A derrota só existe para os perdedores.
Nem tudo aquilo que você vê é aquilo que você enxerga.
Leia um livro, hitrate-se, coma polenta e diga gratidão.
@bergpb
bergpb / install_stremio.sh
Last active November 22, 2020 23:09
Install Stremio in Linux
# https://www.edivaldobrito.com.br/como-instalar-o-stremio-no-ubuntu-debian-e-derivados/
wget https://dl.strem.io/shell-linux/v4.4.116/stremio_4.4.116-1_amd64.deb -O stremio.deb
sudo dpkg -i stremio.deb
sudo apt-get install -f
wget http://archive.ubuntu.com/ubuntu/pool/universe/x/x264/libx264-152_0.152.2854+gite9a5903-2_amd64.deb
@bergpb
bergpb / Program.cs
Created August 19, 2020 19:46
Outro exemplo de Extension Methods no C#
using System
public class ProcessFile
{
public static void Main()
{
string s1 = "Good morning dear students";
Console.WriteLine(s1.Cut(0));
}
}
@bergpb
bergpb / DateTimeExtensions.cs
Created August 19, 2020 19:37
Exemplo de Extension Methods in C#
using System.Globalization
namespace System
{
static class DateTimeExtensions
{
public static string ElapsedTime(this Datime thisObj)
{
TimeSpan duration = DateTime.Now.Subtract(thisObj);
@bergpb
bergpb / bitbucket-pipelines.yml
Created August 15, 2020 20:21 — forked from mcnamee/bitbucket-pipelines.yml
Bitbucket Pipelines - Deploy via FTP to shared hosting
# Installation ---
# 1. In Bitbucket, add $FTP_USERNAME $FTP_PASSWORD and $FTP_HOST as environment variables.
# 2. Commit this file to your repo
# 3. From Bitbucket Cloud > Commits > Commit Number > Run Pipeline > Custom:Init (this will
# push everything and initial GitFTP)
#
# Usage ---
# - On each commit to master branch, it'll push all files to the $FTP_HOST
# - You also have the option to 'init' (from Bitbucket Cloud) - pushes everything and initialises
# - Finally you can also 'deploy-all' (from Bitbucket Cloud) - if multiple deploys fail, you