Skip to content

Instantly share code, notes, and snippets.

View guibranco's full-sized avatar
🎯
Focusing

Guilherme Branco Stracini guibranco

🎯
Focusing
View GitHub Profile
@guibranco
guibranco / repo_info_extractor_windows.ps1
Created May 9, 2025 14:36
Extracts developer contribution data from local Git repositories (excluding GitHub) using the CodersRank repo_info_extractor tool for Windows.
<#
.SYNOPSIS
Extracts developer contribution data from local Git repositories (excluding GitHub) using the CodersRank repo_info_extractor tool.
.DESCRIPTION
This script automates the discovery and processing of Git repositories that are **not hosted on GitHub**.
It uses the repo_info_extractor to generate JSON contribution files, which can be uploaded to CodersRank to compute your developer profile score.
.REQUIREMENTS
- The executable `repo_info_extractor_windows.exe` should be in the same directory or in your PATH.
@guibranco
guibranco / cleanup.bat
Created May 9, 2025 14:21
Development Environment Cleanup Script
@echo off
setlocal enabledelayedexpansion
:: Define the list of directories to clean
set DIR_LIST=bin obj node_modules target\debug target\tmp .angular .terraform visuals\traces visuals\videos visuals\screenshots visuals\information
set ADDITIONAL_DIR_LIST=%temp% C:\Windows\Temp C:\Users\%username%\AppData\Local\Temp C:\ProgramData\Microsoft\Windows\WER\ReportQueue C:\Windows\SoftwareDistribution\Download
set VS_CODE_DIR=%APPDATA%\Code\Cache %APPDATA%\Code\Cookies %APPDATA%\Code\LocalStorage %APPDATA%\Code\User\workspaceStorage
set VS_DIR=C:\Users\%username%\AppData\Local\Microsoft\VisualStudio
set PYTHON_CACHE_DIR=%APPDATA%\Local\pip\cache
set GO_CACHE_DIR=%GOPATH%\pkg\mod
@guibranco
guibranco / docker-compose.yml
Created April 26, 2025 14:11
A docker-compose file with: CosmosDB (noSQL), Microsoft SQL Server (SQL), RabbitMQ (queue), Redis (noSQL), SEQ (log), SonarQube (local analysis), and Azurite (storage) services, with health checks and port mappings for local development
services:
cosmosdb:
image: mcr.microsoft.com/cosmosdb/linux/azure-cosmos-emulator:latest
container_name: cosmosdb
deploy:
resources:
reservations:
cpus: "0.1"
memory: 1.5G
@guibranco
guibranco / sonarcloud.yml
Last active July 19, 2024 12:22
GitHub Actions workflow to build, test, and report to SonarCloud a .NET project.
name: SonarCloud Analysis
on:
push:
branches:
- main
pull_request:
types: [opened, synchronize, reopened]
jobs:
@guibranco
guibranco / createIssueIfContentOfFileAndFileExistsViaPostman.js
Last active January 27, 2024 02:14
Create an issue to replace part of a file based on its content (and existence).
const ghToken = pm.globals.get("GH_PAT");
const authorizationHeader = `Authorization: Bearer ${ghToken}`;
const fileName = "appveyor.yml";
const pattern = "ps: $COVERLET_FORMATS = @('cobertura', 'lcov', 'opencover')";
const issueTitle = "Run all coverage formats at once per project";
const issueBody = "**Is your feature request related to a problem? Please describe.**\r\nRun all coverage formats at once per project\r\n\r\n**Describe the solution you'd like**\r\nReplace the actual code:\r\n```ps\r\n- ps: $TEST_PROJECTS = (Get-ChildItem -Path .\Tests\**\ -Recurse -Include *.csproj).Fullname\r\n- ps: $COVERLET_FORMATS = @('cobertura', 'lcov', 'opencover')\r\n- ps: |\r\n foreach($testProject in $TEST_PROJECTS)\r\n {\r\n foreach($coverletFormat in $COVERLET_FORMATS)\r\n {\r\n dotnet test $testProject /p:CollectCoverage=true /p:CoverletOutputFormat=\"$coverletFormat\"\r\n }\r\n }\r\n```\r\n\r\nWith the following code:\r\n```ps\r\n- ps: $TEST_PROJECTS = (Get-ChildItem -Path .\
@guibranco
guibranco / createIssueIfWorkflowExistsViaPostman.js
Created January 27, 2024 01:37
Create issue if a file exists in the repository (a specific workflow file).
const ghToken = pm.globals.get("GH_PAT");
const authorizationHeader = `Authorization: Bearer ${ghToken}`;
const workflowName = "build.yml"
const issueTitle = `Remove \`${workflowName}\``;
const repositories = pm.response.json();
for (let i = 0; i < repositories.length; i++) {
@guibranco
guibranco / Dockerfile
Created December 15, 2023 15:33
Docker file for PHP 8.3 with Apache, MySQLi extension, GD2 extension and Apache mod_rewrite enabled
FROM php:8.3-rc-apache
RUN apt-get update
RUN apt-get install --yes --force-yes cron g++ gettext libicu-dev openssl libc-client-dev libkrb5-dev libxml2-dev libfreetype6-dev libgd-dev libmcrypt-dev bzip2 libbz2-dev libtidy-dev libcurl4-openssl-dev libz-dev libmemcached-dev libxslt-dev
RUN a2enmod rewrite
RUN docker-php-ext-install mysqli
RUN docker-php-ext-enable mysqli
@guibranco
guibranco / generate_token.py
Created September 23, 2023 20:56
Generates a JWT for a GitHub application based on PEM file and APP ID.
#!/usr/bin/env python3
import jwt
import time
import sys
# Get PEM file path
if len(sys.argv) > 1:
pem = sys.argv[1]
else:
pem = input("Enter path of private PEM file: ")
@guibranco
guibranco / build-bump-version.yml
Last active September 17, 2023 20:25
A GitHub action to build (debug) .NET framework project with some comments/reports on the Pull Request
name: Build & Bump Version
on:
push:
branches:
- '*'
- '*/*'
- '**'
- '!main'
paths-ignore:
@guibranco
guibranco / generateHTMLfromJSON.js
Last active December 15, 2023 15:42
Generate HTML from repositories list from API response
const jsonData = pm.response.json();
const divPattern = "<div style=\"margin-top: 10px;\">";
const imageUrl = (item) => `https://github-readme-stats-guibranco.vercel.app/api/pin/?username=${item.organization.login}&amp;repo=${item.name}&amp;theme=dark&amp;bg_color=222222&amp;show_owner=true&amp;show_forks=false&amp;show_issues=true`;
const link = (item) => `<a href="${item.url}" target="_blank">${image(item)}</a>`;
const image = (item) => `<img style="min-height: 100px; padding-right: 10px;" src="${imageUrl(item)}" alt="${item.full_name}" />`;
var html = divPattern;
for(let i = 0; i < jsonData.length; i++){
html += link(jsonData[i]);