Skip to content

Instantly share code, notes, and snippets.

View ioggstream's full-sized avatar

Roberto Polli ioggstream

View GitHub Profile
@ioggstream
ioggstream / 99github.sh
Last active April 21, 2021 08:12
Github bash aliases for /etc/profile.d
# gh alias
_git_base(){
local repo="$1"
if [[ "$repo" =~ '^https://' || "$repo" =~ 'git@' ]]; then
echo ''
return
fi
if [[ "$repo" =~ 'ioggstream' || "$repo" =~ 'teamdigitale' || "$repo" =~ 'par-tec' ]]; then
echo 'git@github.com:'
@ioggstream
ioggstream / samm_resolver.py
Last active April 14, 2021 17:11
Parse SAMM2 model yaml files
#
# Parses yaml files contained in https://github.com/OWASP/samm/tree/master/Supporting%20Resources/v2.0/Datamodel/Datafiles
#
from glob import glob
from pathlib import Path
import yaml
def read_yaml(f):
@ioggstream
ioggstream / gisco.yaml
Last active February 25, 2021 11:25
OpenAPI Gisco yaml
#
# Questo e' un progetto d'esempio in formato OpenAPI 3.0 API Starter Kit.
#
# Stai per sviluppare un API? Segui attentamente questo template e
# potrai integrarla facilmente in Developers Italia.
#
# Se usi componenti in modo ricorrente, yaml
# permette di definirle e riusarle.
# Puoi metterle nell'oggetto x-commons e rimuoverlo
# prima di pubblicarle.
@ioggstream
ioggstream / europe-border-nuts-1915.ipynb
Created November 21, 2020 22:57
notebook rendering eu 1915
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ioggstream
ioggstream / europe-border-nuts-1915.yaml
Created November 21, 2020 20:30
European borders 1915
maps:
Asburgici:
Wien:
- AT
- ITH1
- ITH2 # trentino alto adige
Istria:
- ITH4
- SI
- HR # istria
@ioggstream
ioggstream / wg-materials-agenda.md
Created November 17, 2020 14:43
An Example file for wg-materials-agenda.md
@ioggstream
ioggstream / github-oas-2.22.yaml
Created September 24, 2020 15:33
Incipit delle specifiche OAS di github
openapi: 3.0.3
info:
version: 1.0.0-rc.1
title: GitHub v3 REST API
description: GitHub's v3 REST API.
license:
name: MIT
url: https://spdx.org/licenses/MIT
termsOfService: https://docs.github.com/articles/github-terms-of-service
contact:
@ioggstream
ioggstream / anpr-certificati.md
Last active September 17, 2020 10:46
Diagrammi per rilascio certificati ANPR

Oggi

Richiesta certificato tramite il comune

Visualizzazione dati tramite ANPR

@ioggstream
ioggstream / strip_solutions.py
Created August 21, 2020 17:04
Useful for courses. Replace the solution code with a NotImplementedError, so that you don't have to duplicate code.
import click
import ast
import astor
from pathlib import Path
import logging
log = logging.getLogger()
logging.basicConfig(level=logging.INFO)
@ioggstream
ioggstream / 99-azure-profile.sh
Last active July 9, 2020 11:43
Bash function to use azure-cli without installing all that stuff on your laptop.
# azure cli, if you don't want to install node on your laptop
az(){
# Prepend az if you run this function with parameters
if [ "$#" -gt "0" ]; then
set -- az "$@"
fi
docker run --rm -it -u $UID \
-v $PWD:/code \
-v $HOME/.kube-azure:/.kube \
-v $HOME/.azure:/root/.azure \