Skip to content

Instantly share code, notes, and snippets.

View mcollina's full-sized avatar

Matteo Collina mcollina

View GitHub Profile
@mcollina
mcollina / go.js
Created August 18, 2023 15:36 — forked from cjihrig/go.js
Parse Node Download Data
'use strict';
const assert = require('node:assert');
const fs = require('node:fs/promises');
const DATA_HOME_URL = 'https://storage.googleapis.com/access-logs-summaries-nodejs/index.html';
const DATA_FILE_PATH = 'data.json';
const DATA_CSV_PATH = 'data.csv';
const DATA_CSV_SEVEN_DAY_PATH = 'data-seven-day-avg.csv';
const LINES = ['14', '16', '18', '19', '20'];
async function main() {
exports.notification = (req, res, next) => {
const notificationPayload = {
notification: {
title: 'Blogial new post',
body: req.body.title,
icon: 'assets/icons/icon-512x512.png'
}
};
Subscription.find()
.then(subscriptions => {
var five = require("johnny-five"),
board, sensor;
board = new five.Board();
board.on("ready", function() {
sensor = new five.Sensor({ pin: 0, freq: 250 });
board.repl.inject({
sensor: sensor
});
@mcollina
mcollina / .gitignore
Last active December 14, 2015 15:19 — forked from adamvr/.gitignore
node_modules