Skip to content

Instantly share code, notes, and snippets.

View rochacbruno's full-sized avatar
🛠️
Working on Galaxy_ng and Dynaconf

Bruno Rocha rochacbruno

🛠️
Working on Galaxy_ng and Dynaconf
View GitHub Profile
.DEFAULT_GOAL := help
help: ## show help message
@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m\033[0m\n"} /^[$$()% a-zA-Z_-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)
compile: ## Compile foobar
@echo "##### Compiling foobar"
@rochacbruno
rochacbruno / dynaconf.md
Last active May 18, 2022 12:05
O que é dynaconf

Dynaconf é uma ferramenta para gerenciar as configurações do seu programa.

Digamos que você tenha uma função assim:

def calcula_preco_com_desconto(valor):
    aliquota = 10  # 10% de desconto
    return valor - (valor * aliquota / 100)
@adamchainz
adamchainz / typed_property.py
Created October 18, 2021 10:30 — forked from willmcgugan/typed_property.py
A descriptor that permits a different type in the setter
from __future__ import annotations
from typing import NamedTuple, cast, overload
class ConsoleDimensions(NamedTuple):
width: int
height: int
@ramalho
ramalho / timeslice.py
Last active September 25, 2021 11:22
Abusing Python's T[4:20] syntax to make Time objects
"""
Could this be valid Python?
if now >= T[4:20:PM]: sextou()
>>> t = T[4:20]
>>> t
T[4:20]
@hugoprudente
hugoprudente / Makefile
Created February 25, 2021 21:43
Makefile with help
define PRINT_HELP_PYSCRIPT
import re, sys
for line in sys.stdin:
match = re.match(r'^([a-zA-Z_-]+):.*?## (.*)$$', line)
if match:
target, help = match.groups()
print("%-30s %s" % (target, help))
endef
export PRINT_HELP_PYSCRIPT
@alikins
alikins / .compose.dev
Created February 5, 2021 16:17
dev/alikins/docker-compose.yml
COMPOSE_PROFILE=alikins
DEV_SOURCE_PATH='galaxy_ng'
@rochacbruno
rochacbruno / README.md
Last active May 12, 2024 12:02
Vim Configs and CheatSheet

VIM CheatSheet

Based on configuration provided in .config/nvim/init.vim

Glossary

  • L = Leader Key, mapped to a single space " "
  • C = Control
  • S = Shift
@mikedep333
mikedep333 / pulp_pkgs_playbook.yml
Last active July 30, 2020 20:57
Pulp install from katello repo on el7 / el8
---
- hosts: all
vars:
pulp_settings:
secret_key: secret
content_origin: "https://{{ ansible_fqdn }}"
pulp_default_admin_password: password
pulp_install_source: packages
pulp_install_plugins:
# galaxy-ng: {}
@furious
furious / frs-twitch_current_payout_dashboard.user.js
Last active February 9, 2021 12:59
Twitch - Current Payout (Dashboard)
// ==UserScript==
// @name Twitch - Current Payout (Dashboard)
// @namespace twitchpayout
// @version 1.5.1
// @description Shows current accumulated/estimated payout revenue and last payment on dashboard
// @author FURiOUS
// @homepage https://furious.pro
// @downloadURL https://gist.github.com/furious/d284d67af89a00866fa60c318a84bf50/raw/frs-twitch_current_payout_dashboard.user.js
// @supportURL https://twitch.tv/furious
// @match https://dashboard.twitch.tv/u/*
pulp_default_admin_password: password
pulp_install_source: pip
pulp_settings:
secret_key: secret
content_origin: "https://{{ inventory_hostname }}"
x_pulp_api_host: 127.0.0.1
x_pulp_api_port: 24817
x_pulp_api_user: "admin"
x_pulp_api_password: "{{ pulp_default_admin_password }}"
x_pulp_api_prefix: "pulp_ansible/galaxy/automation-hub/api"