Skip to content

Instantly share code, notes, and snippets.

@3v1n0
3v1n0 / fattura-elettronica-xml-lint.sh
Created Oct 19, 2019
Linter script for the Italian electronic invoice (Fattura Elettronica)
View fattura-elettronica-xml-lint.sh
#!/bin/bash
URI_PREFIX="https://raw.githubusercontent.com/italia/fatturapa-testsdi/master/core/schemas/"
tmp_dir=$(mktemp -d -t fe-xml-lint-XXXXXXXXXX)
schemas="xmldsig-core-schema.xsd Schema_del_file_xml_FatturaPA_versione_1.2_cleanup.xsd"
for schema in $schemas; do
if ! wget -P $tmp_dir -q $URI_PREFIX/$schema; then
echo "Schema files not properly downloaded"
@3v1n0
3v1n0 / fattura-elettronica-imap-extractor.py
Last active Feb 23, 2021
Extract italian electronic invoices (fatture elettroniche) from a PEC provider IMAP server
View fattura-elettronica-imap-extractor.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright 2019 - Marco Trevisan
#
# A Tool to export your invoices in the Italian electronic Fattura Elettronica
# format from any IMAP PEC provider (defaulting to Aruba PEC) to your computer
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@3v1n0
3v1n0 / canoninvoice.py
Last active Feb 5, 2021
Fattura Elettronica and Python playground
View canoninvoice.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# 2019-2021 - Marco Trevisan
#
# Fattura Elettronica and python Playground
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
View Ping.txt
A Shanghai ho partecipato al Trade and Innovation Forum e ho avuto il piacere di presentare proprio le idee che il governo ha su come devono evolvere innovazione e commercio nel nostro Paese. Ecco il mio discorso.
Signore e signori,
grazie per essere qui, è per me un onore poter parlare qui alla vostra presenza.
Questa è la seconda volta nel giro di pochi mesi in cui vengo in Cina, questo perché il nuovo governo italiano ritiene che la Cina sia un partner fondamentale.
Ho ascoltato con molta attenzione il discorso del presidente Xi Jinping questa mattina e le sue parole parlano di un progetto di sviluppo di cui noi vogliamo essere protagonisti.
L’Italia è la seconda potenza manifatturiera in Europa e, nell’ambito dell’Unione Europea, occupa la quarta posizione sia come cliente che come fornitore della Cina.
@3v1n0
3v1n0 / gpupaths.c
Created Oct 11, 2018
mutter based GPU presency init checks
View gpupaths.c
// gcc `pkg-config --cflags --libs gio-2.0 glib-2.0 gudev-1.0 libsystemd` /tmp/gpupaths.c -o /tmp/gpupaths &&/tmp/gpupaths
#include <errno.h>
#include <fcntl.h>
#include <malloc.h>
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
View bzr-format-patch
#!/bin/bash
#
# Simply cherry picks a revision from a bazaar branch, cloning its metadata
#
# Usage:
# bzr-format-patch [lp:unity] [1234] [--add-bzr-revision] [--stdout] [--only-merged] [-1]
if [ -z "$1" ]; then
if ! (bzr root &> /dev/null); then
echo "It seems you're not in a bazaar branch directory"
@3v1n0
3v1n0 / keybindings.json
Last active Dec 29, 2020
VSCode keybindings for alternative HJLK navigation, when using non-vim mode and support for quick panel navigation with Tab/Shift+Tab.
View keybindings.json
/* VSCode keybindings for alternative HJLK navigation, when using non-vim mode
* and support for quick panel navigation with Tab/Shift+Tab.
*
* So basically I just tried to use everywhere in the editor these aliases:
* Alt+j = down
* Alt+k = up
* Alt+l = right
* Alt+h = left
* Alt+b = previous-word
* Alt+w = next-word
@3v1n0
3v1n0 / xrandr-scale.sh
Last active Mar 25, 2019
Xrandr Scaling script, with auto panning when scaling down
View xrandr-scale.sh
#!/bin/bash
export LANG=C
output=$1;
scale=$2;
if [ -n "$output" ] && ! (xrandr --listmonitors | grep -qw "$output"); then
echo "Invalid output: '$output'";
exit 1;
@3v1n0
3v1n0 / gobject-override.c
Created Oct 11, 2017
GObject LD_PRELOAD override
View gobject-override.c
/*
gcc -shared -fPIC -o liboverride.so gobject-override.c -ldl $(pkg-config --cflags --libs glib-2.0 gtk+-3.0)
LD_PRELOAD=./liboverride.so any-binary!
*/
#define _GNU_SOURCE 1
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>
@3v1n0
3v1n0 / nextcloud-client-qt-shared.yaml
Last active Apr 5, 2018
Snapcraft QT builds examples (shared, static...)
View nextcloud-client-qt-shared.yaml
name: nextcloud-client
version: 2.2.4+git
icon: ../nextcloudtheme/theme/colored/Nextcloud-icon.svg
summary: Nextcloud Desktop Client
description: |
The Nextcloud Desktop Client is a tool to synchronize files from Nextcloud
Server with your computer.
grade: stable
confinement: strict