Skip to content

Instantly share code, notes, and snippets.

View ioggstream's full-sized avatar

Roberto Polli ioggstream

View GitHub Profile
@ioggstream
ioggstream / migrazione-anpr.py
Created October 10, 2019 12:39
Processa alcuni dati da dashboard.anpr.it
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
# INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
# GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#!/usr/bin/env python
@ioggstream
ioggstream / .bashrc-git
Created July 4, 2019 13:05
Some git settings.
# git
. /usr/share/git-core/contrib/completion/git-prompt.sh
# git prompt.
# NB: You must wrap all escape sequences between \[ and \]
# in order for 'readline' to correctly calculate the prompt's visible length.
# Without them, 'readline' thinks the prompt is longer than it is,
# and doesn't know when the text reaches the margin
# PS1='$(foo="\e[90m$(__git_ps1)\e[0m"; echo -e "[$foo \u@\h \e[32m\W\e[0m]\$" ) '
PS1='$(foo="\[\e[90m\]$(__git_ps1)\[\e[0m\]"; echo -e "[$foo \u@\h \e[32m\W\e[0m]\$" ) '
@ioggstream
ioggstream / admin_api.yaml
Created June 21, 2019 09:33
Example of new admin_api.yaml conformant with OAS which maintain object-relations.
swagger: '2.0'
info:
version: 0.1.0
title: Digital Citizenship Admin API.
description: Digital Citizenship Admin API.
basePath: "/adm"
schemes:
- https
paths:
"/services/{service_id}":
@ioggstream
ioggstream / generate_oas_definitions_from_url
Last active June 21, 2019 09:25
Retrieve a set of schemas defined in an URL and generate a set of definitions referencing those schemas
from requests import get
import yaml
from urllib.parse import urlparse
url = 'https://raw.githubusercontent.com/teamdigitale/io-functions-commons/3c1ce27905798f87bdae08f46697edc38bb4ca99/openapi/index.yaml#/definitions'
def generate_definitions_from_url(url):
ret = get(url)
fragment = urlparse(url).fragment.strip('/')
@ioggstream
ioggstream / draft-polli-digest-header.xml
Created April 24, 2019 15:52
RFC draft for revising RFC3230 under RFC 7231
<?xml version="1.0" encoding="US-ASCII"?>
<!-- This template is for creating an Internet Draft using xml2rfc,
which is available here: http://xml.resource.org. -->
<!DOCTYPE rfc SYSTEM "rfc2629.dtd" [
<!-- One method to get references from the online citation libraries.
There has to be one entity for each item to be referenced.
An alternate method (rfc include) is described in the references. -->
<!ENTITY RFC2119 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.2119.xml">
<!ENTITY RFC2629 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.2629.xml">
@ioggstream
ioggstream / domibus-oas3.yaml
Last active April 19, 2019 10:31
edelivery domibus api
openapi: 3.0.0
servers:
- url: 'http://gist.githubusercontent.com/domibus'
- url: 'https://gist.githubusercontent.com/domibus'
info:
description: Domibus REST API documentation
version: v1
title: Domibus REST API documentation
license:
name: EUPL 1.2
@ioggstream
ioggstream / domibus.yaml
Created April 19, 2019 10:30
edelivery domibus api
swagger: '2.0'
info:
description: Domibus REST API documentation
version: v1
title: Domibus REST API documentation
license:
name: EUPL 1.2
url: 'https://joinup.ec.europa.eu/page/eupl-text-11-12'
basePath: /domibus
tags:
@ioggstream
ioggstream / async-poll.yaml
Created April 5, 2019 12:48
oas3 for async
openapi: 3.0.1
info:
title: RESTbusywaiting
version: "1.0"
description: |-
Questo file descrive semplicemente i metodi di un'API
e non indica tutte le informazioni di metadatazione che
normalmente vanno inserite.
license:
name: Apache 2.0 License
@ioggstream
ioggstream / modi_cap3_concordato.md
Last active March 26, 2019 16:42
Capitolo 3 concordato

Modalità di interazione, profili, casi d`uso e tecnologie

Il terzo documento del Modello di Interoperabilità 2018, così come introdotto nella Visione

generale, fornisce indicazioni concrete, a livello tecnico, su differenti modalità operative

@ioggstream
ioggstream / StetPSD2API-1.4.yaml
Created March 22, 2019 13:34
STET OpenBanking API
openapi: 3.0.0
info:
version: 1.4.1.3
title: 'PSD2 ASPSP services for AISP, PISP and CBPII.'
description: >
This API intends to provide an interface between
- Account Servicing Payment Service Providers (ASPSP)
- Third Party (Payment Service) Providers (TPP)