Skip to content

Instantly share code, notes, and snippets.

View ProfAndreaPollini's full-sized avatar
🎯
Focusing

Andrea Pollini ProfAndreaPollini

🎯
Focusing
View GitHub Profile
@ProfAndreaPollini
ProfAndreaPollini / googleAutocompleteDemoWithPlaceChangeListener
Created March 29, 2018 15:42
A HTML page that uses Google Place API Autocomplete to update some div content
<html>
<head>
</head>
<body>
<input type="text" id="search-input" placeholder="Inserire la località">
<div id="city">
città
</div>
<div id="country">
stato
@ProfAndreaPollini
ProfAndreaPollini / index.html
Created October 22, 2018 19:06
EARTHQUAKEVIS - VIsualizzazione Terremoti in tempo reale /1
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<link rel="stylesheet" href="https://unpkg.com/purecss@1.0.0/build/pure-min.css" integrity="sha384-nn4HPE8lTHyVtfCBi5yW9d20FjT8BJwUXyWZT9InLYax14RDjBj46LmSztkmNP9w" crossorigin="anonymous">
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.3.4/dist/leaflet.css" integrity="sha512-puBpdR0798OZvTTbP4A8Ix/l+A4dHDD0DGqYW6RQ+9jxkRFclaxxQb/SJAWZfWAkuyeQUytO7+7N4QKrDh+drA==" crossorigin="" />
@ProfAndreaPollini
ProfAndreaPollini / decode_number.c
Created November 9, 2018 15:59
Codice per l'analisi di un numero floating point 32 bit codificato IEEE754 (funziona solo con i numeri "giusti")
#include <stdio.h>
#include <math.h>
/*
INTERPRETZIONE DI UN UNSIGNED INT INSERITO COME NUMERO ESADECIMALE COME
NUMERO FLOATING POINT IEEE754 (Esercizio)
ROADMAP:
[] stampo i bit che compongono la variabile (show_bits_r)
@ProfAndreaPollini
ProfAndreaPollini / index.html
Created November 13, 2018 07:31
REACT START IN THE BROWSER
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Page Title</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" media="screen" href="main.css" />
<script src="https://unpkg.com/babel-standalone@6/babel.min.js"></script>
@ProfAndreaPollini
ProfAndreaPollini / somma_numeri.asm
Created November 16, 2018 14:07
ASSEMBLY: Somma di un vettore di numeri usando https://schweigi.github.io/assembler-simulator/
JMP start
elementi: DB 5
vettore: DB 2
DB 5
DB 10
DB 10
DB 20
start:
JMP start
v1len: DB 3
v1: DB 2
DB 5
DB 10
v2len: DB 3
v2: DB 2
@ProfAndreaPollini
ProfAndreaPollini / configGCP.md
Created December 7, 2018 19:23
ESP32 MONGOOSE OS - GOOGLE CLOUD PLATFORMCONFIGURATION

After create the project with id :

  • CREATE DATA TOPIC gcloud beta pubsub topics create iot-data

  • create subscription gcloud beta pubsub subscriptions create --topic iot-data iot-subscription

  • CREATE REGISTRY

@ProfAndreaPollini
ProfAndreaPollini / readme.md
Created December 14, 2018 12:51
COMPITO INGEGNERIA DEL SOFTWARE: ANALISI DI UNA APPLICAZIONE ESISTENTE

COMPITO

Scegliere una applicazione smartphone a tua scelta e effettuare una analisi di tipo "reverse", andando a definire

  • un insieme di possibili user story
  • Da queste elaborare i relativi casi d'uso (eventualmente suddividendo il sistema in sottosistemi)
  • Descrivere in dettaglio due casi d'uso
  • Definire il relativo diagramma delle classi
  • per due azioni, realizzare il sorrispettivo diagramma di sequenza (in forma di lista e pseudocodice)
@ProfAndreaPollini
ProfAndreaPollini / generate_cert.sh
Created February 4, 2020 10:46
CREAZIONE DI UN CERTIFICATO SSL SELF SIGNED
openssl genrsa -des3 -out server.key 1024
openssl req -new -key server.key -out server.csr
cp server.key server.key.orig
openssl rsa -in server.key.orig -out server.key
openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt
@ProfAndreaPollini
ProfAndreaPollini / index.js
Created March 5, 2020 10:41
serve auth node.js jwt
require('dotenv').config()
const express = require('express')
const helmet = require('helmet')
const morgan = require('morgan')
const bcrypt = require('bcrypt')
const jwt = require('jsonwebtoken')
const app = express()
const port = 3000