Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

Andrea Pollini ProfAndreaPollini

🎯
Focusing
Block or report user

Report or block ProfAndreaPollini

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
@ProfAndreaPollini
ProfAndreaPollini / index.html
Created Jun 16, 2019
JAVASCRIPT ES6: ANIMAZIONE CON P5.JS
View index.html
<!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>
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.8.0/p5.js"></script>
</head>
@ProfAndreaPollini
ProfAndreaPollini / server.js
Created May 12, 2019
URL SHORTENER IN NODE.JS EXPRESSJS E MONGODB
View server.js
const express = require("express");
const bodyParser = require("body-parser");
const shortId = require("shortid");
const mongoose = require("mongoose");
mongoose.connect("mongodb://localhost/shorturl", { useNewUrlParser: true });
let db = mongoose.connection;
db.once("open", () => {
console.log("connected to mongodb");
});
@ProfAndreaPollini
ProfAndreaPollini / Activation.js
Last active Mar 25, 2019
NeuralNetworks Backpropagation
View Activation.js
class ActivationFunction {
get f() {}
get df() {}
}
export class SigmoidActivationFunction extends ActivationFunction {
static get f() {
return x => 1 / (1 + Math.exp(-x));
}
@ProfAndreaPollini
ProfAndreaPollini / Matrix.js
Created Feb 23, 2019
Matrix class in Javascript ES6
View Matrix.js
export default class Matrix {
constructor(rows, cols) {
this.rows = rows;
this.cols = cols;
this.data = new Array(rows * cols).fill(0);
}
set(v, x, y) {
this.data[y * this.cols + x] = v;
}
@ProfAndreaPollini
ProfAndreaPollini / heapq.js
Last active Feb 24, 2019
Binary heap in Javascript
View heapq.js
export default class HeapQ {
constructor(priorityFunction = x => x) {
this.data = [];
this.priorityFunction = priorityFunction;
}
get length() {
return this.data.length;
}
@ProfAndreaPollini
ProfAndreaPollini / docker-compose.yaml
Created Feb 13, 2019
node red - influxdb - grafana Docker compose file
View docker-compose.yaml
version: "3"
services:
nodered:
image: nodered/node-red-docker
ports:
- "1880:1880"
influxdb:
image: influxdb
View index.html
<!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>
</head>
View conway.js
let screen = document.getElementById("screen");
screen.width = 600;
screen.height = 400;
let ctx = screen.getContext("2d");
let zoomLevelUI = document.getElementById("zoomLevelUI");
let zoomLevel = 1;
function setZoomLevel() {
View prova.txt
dfgdfg
df
gdf
gdf
dgdf
@ProfAndreaPollini
ProfAndreaPollini / complex.js
Created Jan 11, 2019
MANDELBROT SET + JULIA SET IN PLAIN JAVASCRIPT - from live: https://youtu.be/mXMnW-ET7Tg
View complex.js
export default class Complex {
constructor(x, y) {
this.x = x;
this.y = y;
}
add(other) {
return new Complex(
this.x + other.x,
this.y + other.y
You can’t perform that action at this time.