This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class BatchQuery { | |
constructor(connection, queryList, batchSize = 10, sleepMs = 1000) { | |
this.connection = connection | |
this.queryList = queryList | |
this.batchSize = batchSize | |
this.sleepMs = sleepMs | |
this.queryResults = [] | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const express = require("express") | |
const mw = require("./middleware") | |
const app = express() | |
app | |
.use(express.json()) | |
.use(express.urlencoded({ extended: true })) | |
.use(mw.Book.router) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE HTML> | |
<html lang="en"> | |
<head> | |
</head> | |
<body> | |
<h1>Socketzzz</h1> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/3.0.1/socket.io.js" | |
integrity="sha512-vGcPDqyonHb0c11UofnOKdSAt5zYRpKI4ow+v6hat4i96b7nHSn8PQyk0sT5L9RECyksp+SztCPP6bqeeGaRKg==" | |
crossorigin="anonymous"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* DEMO: https://observablehq.com/@luciyer/exportable-gauge */ | |
/* USAGE */ | |
let chart = GaugeChart(); | |
// Optionally - set properties - these are defaults: | |
/* | |
chart.setProperties({ | |
rotation: 0, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Dependent on d3.js. | |
*/ | |
const svgGradientDefs = (color_array, gradient_id) => { | |
if (color_array.length < 2) | |
throw new Error("Argument should be array of two or more colors.") | |
var pctStep = 100 / (color_array.length - 1), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const events = require("events") | |
module.exports = new events.EventEmitter(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require("dotenv").config() | |
const Agenda = require("agenda") | |
const jobs = require("./jobs") | |
const db_uri = process.env.MONGODB_URI || "mongodb://localhost/dev" | |
const connection_options = { | |
db : { | |
address: db_uri, |