Skip to content

Instantly share code, notes, and snippets.

View abravalheri's full-sized avatar
💭
😆

Anderson Bravalheri abravalheri

💭
😆
View GitHub Profile
@abravalheri
abravalheri / commit.md
Last active September 4, 2026 19:43 — forked from stephenparish/commit.md
RFC: Git Commit Message Guidelines

Commit Message Guidelines

In the last few years, the number of programmers concerned about writing structured commit messages have dramatically grown. As exposed by Tim Pope in article readable commit messages are easy to follow when looking through the project history. Moreover the AngularJS contributing guides introduced conventions that can be used by automation tools to automatically generate useful documentation, or by developers during debugging process.

This document borrows some concepts, conventions and even text mainly from these two sources, extending them in order to provide a sensible guideline for writing commit messages.

@abravalheri
abravalheri / 0_disclaimer.md
Last active May 12, 2026 00:06
How to implement Namespace packages via `MetaPathFinder`?

Please note that the implementations here are simple PoCs, and is subject to implementation errors, bugs, over simplifications etc..

A variation of the Observer pattern have emerged over the past few yes in the JavaScript community. Called Event Emitter, this pattern seems to simplify the implementation and usage of events.

This is especially true for lightweight libraries in dynamic languages, such as Smoke Signals, where there is no Event object. Instead, plain strings are used to notify the event handlers, which are simple callback functions. The influence of jQuery in this pattern is also remarkable: the features can be accessed in an expressive way with short named methods.

@abravalheri
abravalheri / helpers.cmake
Last active July 11, 2025 07:26
CMake examples
if(NOT HOME)
if(WIN32)
string(REPLACE "\\" "/" HOME "$ENV{USERPROFILE}")
else()
set(HOME $ENV{HOME})
endif()
endif()
### Useful Functions and Macros ###
# Prints a list of messages, each one in a new line
from flit_core.buildapi import *
@abravalheri
abravalheri / .gitignore
Last active June 20, 2022 18:48
Simple profiling script to verify `setuptools` execution time.
.venv
build
dist
*.pstats
*.html
*.egg-info
@abravalheri
abravalheri / !Dummy rst2myst example for issue.md
Last active September 11, 2021 14:56
Dummy `rst2myst` example for issue

dummy-rst2myst-example-for-issue

This repository demonstrates an issue with the rst2myst conversion tool.

Issue

The way rst2myst translates rst substitutions to Markdown does not seem to work properly. So far 2 inconsistencies have been identified:

title PyScaffold 4.0 is here 🔥
published false
description PyScaffold, the Python project template generator with batteries included, just released a new version with lots of new features and it is even easier to use!
tags
python
packaging
opensource
news
cover_image https://dev-to-uploads.s3.amazonaws.com/i/qqo4pnhhaxnx1qqc74v7.png

It has been a long journey since PyScaffold v3 was released and a lot of things happened in the Python community especially regarding the packaging ecosystem...

@abravalheri
abravalheri / .sphinx-issue-README.md
Last active August 6, 2020 23:10
Example for sphinx issue

Describe the bug Hello, I have 3 muiltiline docstrings for type aliases (using the next-line """ documentation syntax). For 1 one them the docstring is correctly shown in the rendered HTML, but for 2 of them, the docstrings are ignored and the only thing shown is the alias of ... text. I suppose this is related to #4422, but I might be doing something wrong here (so if you could point me out in the correct direction that would be very good).

To Reproduce The following is a reduced example of something happening in pyscaffold's code base:

  1. Given a directory with file.py:
# file.py
from pathlib import Path
git config --global alias.lola "log --graph --decorate --pretty=oneline --abbrev-commit --all"