Skip to content

Instantly share code, notes, and snippets.

View almet's full-sized avatar
😮‍💨

Alexis Métaireau almet

😮‍💨
View GitHub Profile
@almet
almet / count.sql
Last active February 25, 2025 11:47
ihatemoney stats
SELECT COUNT(*)
FROM project
WHERE id IN (
SELECT p.project_id
FROM bill b
JOIN person p ON b.payer_id = p.id
GROUP BY p.project_id
HAVING COUNT(*) > 10
AND MAX(b.date) > CURRENT_DATE - INTERVAL '90 days'
);
@almet
almet / registry_client.py
Created December 9, 2024 16:48
Get an attestation from a container registry with python
#!/usr/bin/env -S uv run
# /// script
# requires-python = ">=3.12"
# dependencies = [
# "requests>=2.31.0",
# ]
# ///
import requests
import json
@almet
almet / README.md
Last active September 26, 2024 09:36
Scrap mairies emails

Comment installer ça sur ma machine ?

Prérequis:

  • Je pars du principe que brew est déjà installé (sinon suivre leurs instructions)
  • Avoir copié le fichier quelque part sur sa machine

Ouvrir un terminal, puis:

@almet
almet / keybase.md
Created October 15, 2023 20:26
keybase.md

Keybase proof

I hereby claim:

  • I am almet on github.
  • I am ametaireau (https://keybase.io/ametaireau) on keybase.
  • I have a public key ASAKABnoLbApusIuay1vR0Wi37T0-NEDXdZtZP1SHYiTtQo

To claim this, I am signing this object:

@almet
almet / obsidian_pelican.py
Created July 16, 2023 15:30
Obsidian Pelican
"""A pelican plugin to read Obsidian files and import them as pelican Articles.
This reads the tags made with hashtags and render them as pelican tags instead
(they won't be present in the output).
Adds the title in the output, and specify a default dummy date.
"""
from pathlib import Path
@almet
almet / delivery_sum.qweb
Last active April 20, 2022 13:36
Sums for delivery in Odoo (Action)
<?xml version="1.0"?>
<t t-name="stock.report_deliverylist">
<t t-call="web.basic_layout">
<div class="page o_report_layout_boxed">
<t t-set="totals" t-value="{}"></t>
<t t-foreach="docs" t-as="o" t-if="o.state!='done'">
<t t-set="lines" t-value="o.move_lines.filtered(lambda x: x.product_uom_qty)"/>
<t t-foreach="lines" t-as="move">
<t t-if="not(move.product_id.packaging_ids)">
@almet
almet / report.delivery_document.qweb
Last active April 28, 2022 14:00
Add packaging quanity to Odoo report delivery. Permet d'ajouter le nombre de cartons à côté du nombre d'unités commandées, ainsi que le total, et quelques autres changements mineurs
<?xml version="1.0"?>
<t t-name="stock.report_delivery_document">
<t t-call="web.html_container">
<t t-call="web.external_layout">
<t t-set="o" t-value="o.with_context(lang=o.partner_id.lang)"/>
<t t-set="partner" t-value="o.partner_id or (o.move_lines and o.move_lines[0].partner_id) or False"/>
<div class="page">
<h2><span t-field="partner.self.name"/></h2>
<div class="row">
server {
server_name odooproxy.vieuxsinge.com;
location / {
# Activer le proxy
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass https://brasserieduvieuxsinge.auneor-conseil.fr;
proxy_redirect off;
document.querySelectorAll("#messages-list > div").forEach(
item => {
let id=item.id.replace('msg-', '');
$.get(`https://mobile.free.fr/account/messagerie-vocale/message_vocal?id=${id}&action=delete`);
});
@almet
almet / nginxconfig.ini
Last active June 24, 2020 07:03
Nginx reverse proxy to add CORS support to an API. Tested and working with Firefox 68.9 and Chrome 80.0
server {
server_name xxx
location / {
# Activer le proxy
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass https://yourapi;
proxy_redirect off;