Skip to content

Instantly share code, notes, and snippets.

View almet's full-sized avatar
🗺️

Alexis Métaireau almet

🗺️
View GitHub Profile
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;
@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 / 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">
@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)">
from pelican import readers
from pelican import signals
from pelican.utils import get_date
def patch_metadata_processors():
readers.METADATA_PROCESSORS['yourkey'] = lambda x, y: get_date(x),
def register():
signals.initialized.connect(patch_metadata_processors)
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;
@almet
almet / snippet.js
Created June 17, 2020 17:06
Export google timeline info as text.
javascript:(function(){
var distance = document.getElementsByClassName('top-activity-text')[0].innerText;
var date = document.getElementsByClassName('timeline-subtitle')[0].innerText;
var locations = Array.from(document.getElementsByClassName('place-visit-title')).map(e => e.innerText);
var markup = `
<div id="output">
<h1>Livraisons du ${date}</h1>
<input type="text" />
<p>${distance}</p>
<p><em>Lieux : ${ locations.join(', ')}</em>
@almet
almet / __init__.py
Last active March 10, 2020 18:53
roll split views
from roll.extensions import simple_server
from .core import app
from . import view1, view2 # So that routes are scanned
simple_server(app, port=7777)