Skip to content

Instantly share code, notes, and snippets.

Roberto Polli ioggstream

Block or report user

Report or block ioggstream

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@ioggstream
ioggstream / render_calendar.py
Last active Jan 15, 2020
Render a simple calendar with python.
View render_calendar.py
from datetime import datetime, timedelta, timezone
from requests import get
import icalendar
from dateutil.rrule import *
import pytz
import locale
locale.setlocale(locale.LC_TIME, "it_IT")
import time
@ioggstream
ioggstream / io-server-api-resolved.yaml
Created Oct 23, 2019
Resolved references in io-onboarding-pa-api
View io-server-api-resolved.yaml
openapi: 3.0.0
info:
contact:
email: teamdigitale@governo.it
url: https://io.italia.it
description: |-
The backend used by the onboarding portal for public administrations of the IO project.
The website for the project is [io-website].
Privacy Policy is [privacy].
@ioggstream
ioggstream / person_ontology_to_schema.py
Created Oct 18, 2019
Renderizza i campi di un json-ld
View person_ontology_to_schema.py
import yaml
from os.path import basename
from pyld import jsonld
import logging
log = logging.getLogger()
logging.basicConfig(level=logging.INFO)
url = "https://ontopia-lodview.prod.pdnd.italia.it/onto/CPV/Person"
@ioggstream
ioggstream / circleci-gh-deploy-keys.md
Last active Dec 17, 2019
Create an ecdsa keypair and configure circleci+github for deploying on gh-pages.
View circleci-gh-deploy-keys.md

Deploy to github pages with circleci

To deploy on github pages via CircleCI you need a brand new keypair.

Follow these steps.

Create a keypair.

The private key goes into this circleci page:

@ioggstream
ioggstream / migrazione-anpr.py
Created Oct 10, 2019
Processa alcuni dati da dashboard.anpr.it
View migrazione-anpr.py
#
# 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 Jul 4, 2019
Some git settings.
View .bashrc-git
# 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 Jun 21, 2019
Example of new admin_api.yaml conformant with OAS which maintain object-relations.
View admin_api.yaml
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 Jun 21, 2019
Retrieve a set of schemas defined in an URL and generate a set of definitions referencing those schemas
View generate_oas_definitions_from_url
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 Apr 24, 2019
RFC draft for revising RFC3230 under RFC 7231
View draft-polli-digest-header.xml
<?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 Apr 19, 2019
edelivery domibus api
View domibus-oas3.yaml
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
You can’t perform that action at this time.