Skip to content

Instantly share code, notes, and snippets.

View billmetangmo's full-sized avatar

Bill Metangmo billmetangmo

  • France
View GitHub Profile
2025-09-05T12:26:34.090212935Z 68 ┃ if (isError(input)) {
2025-09-05T12:26:34.090216340Z 69 ┃ return input;
2025-09-05T12:26:34.090219693Z 70 ┃ }
2025-09-05T12:26:34.090223003Z ❯ 71 ┃ const err = new H3Error(input.message ?? input.statusMessage ?? "", {
2025-09-05T12:26:34.090226844Z 72 ┃ cause: input.cause || input
2025-09-05T12:26:34.090232707Z 73 ┃ });
2025-09-05T12:26:34.090236161Z 74 ┃ if (hasProp(input, "stack")) {
2025-09-05T12:26:34.090239912Z 75 ┃ try {
2025-09-05T12:26:34.090243259Z 76 ┃ Object.defineProperty(err, "stack", {
2025-09-05T12:26:34.090246947Z
@billmetangmo
billmetangmo / extract-chapters.py
Created August 15, 2025 08:39
Get themes and chapters
import os
import glob
from typing import List, Tuple, Dict, Any
from dotenv import load_dotenv
from llama_cloud_services import LlamaExtract
from llama_cloud.core.api_error import ApiError
# Charge les variables d'environnement (ex: LLAMA_CLOUD_API_KEY)
load_dotenv()
api_server-1 | 09/05/2024 03:44:04 PM users.py 76 : Using Auth Type: basic
api_server-1 | ERROR: Traceback (most recent call last):
api_server-1 | File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1968, in _exec_single_context
api_server-1 | self.dialect.do_execute(
api_server-1 | File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/default.py", line 920, in do_execute
api_server-1 | cursor.execute(statement, parameters)
api_server-1 | psycopg2.errors.UndefinedTable: relation "connector_credential_pair" does not exist
api_server-1 | LINE 2: FROM connector_credential_pair
api_server-1 | ^
api_server-1 |
@billmetangmo
billmetangmo / notes.md
Created August 26, 2024 15:13
Test outlines for tool extraction using modal
title date author categories tags
Meeting 36
2024-08-07
collectif mongulu
Meeting notes
generative-ai
data-tools
developer-tools
devops
machine-learning

Recommandations


RUN_IDS=$(gh run list --repo $REPO --json databaseId --limit 50 | jq -r '.[1:] | .[].databaseId')
Delet all runs: gh run delete --repo $REPO 10143283850
@billmetangmo
billmetangmo / draw.py
Created July 2, 2024 14:28
Graph distribution of resources
import pandas as pd
import matplotlib.pyplot as plt
# Load the CSV file
file_path = '/mnt/data/resources(2).csv'
data = pd.read_csv(file_path)
# Calculate the number of resources per region
resources_per_region = data['Region'].value_counts().reset_index()
resources_per_region.columns = ['Region', 'Number of Resources']
@billmetangmo
billmetangmo / deny_regions.json
Created July 2, 2024 09:55
scp deny all unused regions
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "DenyCreateResourcesInSpecificRegions",
"Effect": "Deny",
"Action": [
"*"
],
"Resource": "*",
@billmetangmo
billmetangmo / gist:262fb7f2d379a4ea4c7d3bd499aa7c3b
Last active June 26, 2024 02:07
sample argo applicationset
apiVersion: argoproj.io/v1alpha1
kind: ApplicationSet
metadata:
name: easyappointments-preview
namespace: argocd
spec:
generators:
- pullRequest:
github:
owner: mongulu-cm
import unittest
from typing import List, Dict
from tqdm import tqdm
def distribute_elements(stream: List[int], servers: List[str], weights: List[int]) -> Dict[str, List[int]]:
if len(servers) != len(weights):
raise ValueError("The number of servers and weights must be the same.")
total_weight = sum(weights)
normalized_weights = [weight / total_weight for weight in weights]