Skip to content

Instantly share code, notes, and snippets.

View Ambro17's full-sized avatar
💭
Coding

Nahuel Ambrosini Ambro17

💭
Coding
  • Shiphero
  • Los Cardales, Argentina
View GitHub Profile
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Ambro17
Ambro17 / contextvars_config.py
Created July 10, 2022 21:33
Here we try to imitate Flask global objects magic in which `from flask import request` magically finds the current request. We use contextvars to make it more understandable, as a con it requires calling `.get()` instead of just using the imported module attribute. I like this since it doesn't hide the fact that the object is lazily evaluated
"""
Here we try to imitate Flask global objects magic in which `from flask import request`
magically finds the current request.
We use contextvars to make it more understandable, as a con it requires calling `.get()`
instead of just using the imported module attribute.
I like this since it doesn't hide the fact that the object is lazily evaluated
"""
# This single file represents three modules. app.py, bootstrap.py and settings.py
# Each file's content is preceded by the file name.
@Ambro17
Ambro17 / PythonPackaging.md
Last active September 27, 2023 00:02
Packaging Useful Articles

Articulos

@Ambro17
Ambro17 / commit-msg
Created May 26, 2020 23:10
Auto Git Emoji
#!/usr/bin/python3.6
"""
Loosely based on gitmoji https://gitmoji.carloscuesta.me/
WIP: 🚧
Meant for work in progress. Incomplete or still an idea
NEW: ✨
New functionality that is working. Meant as a checkpoint
FIX: 🔧
Minor code changes/ Refactors that are steps before a NEW feature
BUG: 🐞
<?xml version='1.0'?>
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
<fontconfig>
<match target="scan">
<test name="family">
<string>Noto Color Emoji</string>
</test>
<edit name="scalable" mode="assign">
<bool>true</bool>
</edit>