This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# IMPORTANT: | |
# An up to date version is available here: https://github.com/ddanier/nur/blob/main/scripts/nurify.nu | |
# How I installed this: | |
# > mkdir $env.NU_LIB_DIRS.0 | |
# > vim ($env.NU_LIB_DIRS.0 | path join "nurify.nu") | |
# PUT CODE IN HERE | |
# > vim $nu.config-path | |
# Add `use nurify.nu *` at the end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# git commit using conventional commit schema | |
export def --wrapped "git cc" [ | |
--message (-m): string # Message of the commit | |
--commit-type (-t): string # Commit type (hint: use --template for original git commit -t) | |
--commit-scope (-s): string # Commit scope (hint: use --signoff for original git commit -s) | |
--commit-issue (-i): string # Commit issue (hint: use --include for original git commit -i) | |
--commit-breaking (-b) # Mark commit as breaking | |
--no-emoji # Don't use any emojis | |
...git_args: string | |
] { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
This allows to use global variables inside the FastAPI application using async mode. | |
# Usage | |
Just import `g` and then access (set/get) attributes of it: | |
```python | |
from your_project.globals import g | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from typing import Callable, Type | |
import functools | |
class class_or_instance_method: | |
func: Callable | |
def __init__(self, func: Callable): | |
self.func = func |