Skip to content

Instantly share code, notes, and snippets.

View gabrielrbarbosa's full-sized avatar
🎯

Gabriel R. Barbosa gabrielrbarbosa

🎯
  • Londrina, PR, Brazil
  • 22:02 (UTC -03:00)
View GitHub Profile
@gabrielrbarbosa
gabrielrbarbosa / gotofix.sh
Last active January 16, 2026 14:58
Git alias to create or checkout to current hotfix branch
#!/usr/bin/env bash
set -euo pipefail
# Ensure we're inside a git repo
git rev-parse --is-inside-work-tree >/dev/null 2>&1 || {
echo "Not a git repository."
exit 1
}
# Month mapping (portable)
@gabrielrbarbosa
gabrielrbarbosa / docker-wsl2.md
Created May 8, 2025 19:24 — forked from martinsam16/docker-wsl2.md
How to install wsl2 ubuntu + docker + docker-compose

Activate wsl2

dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
wsl --set-default-version 2

Install and Configure Ubuntu

// ==UserScript==
// @name Show All Branches
// @namespace http://tampermonkey.net/
// @version 2024-06-04
// @description Show All branches by default in bitbucket
// @author You
// @match https://bitbucket.org/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=bitbucket.org
// @grant none
// ==/UserScript==
@gabrielrbarbosa
gabrielrbarbosa / trello-theme.js
Last active April 9, 2025 16:50
Trello Minimalist Theme
// ==UserScript==
// @name Trello Minimalist Theme
// @namespace http://tampermonkey.net/
// @version 1.6
// @description Change Trello default theme
// @author gabrielrbarbosa
// @match https://trello.com/b/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=trello.com
// @require https://code.jquery.com/jquery-3.7.1.min.js
// ==/UserScript==
@gabrielrbarbosa
gabrielrbarbosa / inscricao_estadual_mg.js
Last active October 11, 2022 19:41
Dígito Verificador Inscrição Estadual - MG
//https://www.4devs.com.br/gerador_de_inscricao_estadual
function weightCalculator(ie) {
let weights = [1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2];
let weights2 = [3, 2, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2];
let base = "";
let base2 = 0, soma = 0;
let block = ie.toString().split("");
block.splice(3, 0, "0");
@gabrielrbarbosa
gabrielrbarbosa / whatsapp-web-darkmode.js
Created May 19, 2020 12:51
WhatsApp Web Dark Mode - Tampermonkey
// ==UserScript==
// @name WhatsApp Web Dark Mode
// @namespace https://github.com/gabplay/
// @version 1.0
// @description Switch theme to dark mode in web.whatsapp.com
// @author Gabplay
// @match http://web.whatsapp.com/*
// @match https://web.whatsapp.com/*
// ==/UserScript==
(function() { document.getElementsByTagName("body")[0].classList.add('dark'); })();
import webbrowser
from bs4 import BeautifulSoup as bs
import urllib
#soup = bs(ur.urlopen("https://www.google.com/search?q=" + input("Digite uma frase para detectar plágio: ").lower().strip(), "html.parser"))
input_text = input("Digite uma frase para detectar plágio: ").lower().strip()
params = urllib.parse.urlencode({'q': input_text})
url = "https://www.google.com/search?%s" % params
headers = {'User-Agent':'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.7) Gecko/2009021910 Firefox/3.0.7',}
@gabrielrbarbosa
gabrielrbarbosa / sublime_preferences
Created April 4, 2017 23:23
Sublime Text Preferences with Material Theme
{
"font_size": 11,
"bold_folder_labels": true,
"fade_fold_buttons": false,
"color_scheme": "Packages/Material Theme/schemes/Material-Theme.tmTheme",
"theme": "Material-Theme.sublime-theme",
"line_padding_bottom": 3,
"line_padding_top": 3,
"material_theme_accent_acid_lime" : true,