Skip to content

Instantly share code, notes, and snippets.

View pawamoy's full-sized avatar
🤔
Ping me if I don't reply!

Timothée Mazzucotelli pawamoy

🤔
Ping me if I don't reply!
View GitHub Profile
@pawamoy
pawamoy / funding.py
Created April 3, 2024 09:59
funding urls for installed python packages, from FUNDING.yml source
import os
from importlib.metadata import distributions
import httpx
import yaml
def fetch_funding(httpx_client, owner, repo):
query = """
query($owner: String!, $repo: String!) {
@pawamoy
pawamoy / funding.py
Last active April 2, 2024 19:53
Print funding URLs of installed Python packages
from importlib.metadata import distributions
funding_keywords = {"donate", "funding", "tidelift"}
def print_funding_urls():
for package in distributions():
funding_urls = []
for line in package.metadata.get_all("Project-URL", []):
title, url = line.split(", ", 1)
if title.lower() in funding_keywords:
@pawamoy
pawamoy / docs.py
Last active August 29, 2023 14:39
Documentation Metadata
# This gist shows how we could get rid of docstrings micro-syntax
# like Google-style and Numpydoc-style pseudo-standards,
# using an enhanced version of PEP 727.
# The goal is to replace the following sections:
# Attributes
# Functions/Methods
# Classes
# Modules
@pawamoy
pawamoy / build.sh
Last active May 4, 2023 15:37
mkdocs to manpage
export BUILD_MANPAGE=true
export PERMALINK=false
export SHOW_SOURCE=false
mkdocs build
@pawamoy
pawamoy / script.sh
Created May 10, 2019 17:24
LINENO in Bash and ZSH
echo $(
# comment
echo "hello" \
"world" \
"thanks" | # comment
cat | ( # comment
# comment
cat -n # comment
) | cat && # comment
echo bye
@pawamoy
pawamoy / .bugwarriorrc
Last active April 26, 2023 04:11
conky porn post
[general]
targets = github_pawamoy
shorten = True
inline_links = False
annotation_links = True
annotation_comments = False
legacy_matching = False
# Your init script
#
# Atom will evaluate this file each time a new window is opened. It is run
# after packages are loaded/activated and after the previous editor state
# has been restored.
#
# An example hack to log to the console when each text editor is saved.
#
# atom.workspace.observeTextEditors (editor) ->
# editor.onDidSave ->