- azure: https://docs.microsoft.com/en-us/rest/api/azure/
- google cloud platform: https://cloud.google.com/apis/docs/overview
- amazon web services: https://docs.aws.amazon.com/
- ibm: https://cloud.ibm.com/apidocs
- digitalocean: https://developers.digitalocean.com/documentation/v2/
- ovh: https://api.ovh.com/
- hetzner: https://docs.hetzner.cloud/#servers-create-a-server
- linode: https://developers.linode.com/api/v4/
- vultr: https://www.vultr.com/resources/developers/
// 'downloadFile.js', written by blending two solutions: | |
// 'js-download' https://github.com/kennethjiang/js-file-download | |
// 'Anders Paulsen' https://blog.jayway.com/2017/07/13/open-pdf-downloaded-api-javascript/ | |
export function downloadFile(data, filename, mime) { | |
// It is necessary to create a new blob object with mime-type explicitly set | |
// otherwise only Chrome works like it should | |
const blob = new Blob([data], {type: mime || 'application/octet-stream'}); | |
if (typeof window.navigator.msSaveBlob !== 'undefined') { | |
// IE doesn't allow using a blob object directly as link href. |
const fs = require('fs'); | |
const http = require('http'); | |
const https = require('https'); | |
const express = require('express'); | |
const app = express(); | |
app.get('*', (req, res) => res.send('yehh')); | |
http.createServer(app).listen(80); |
/** | |
* // https://dev.to/gabe_ragland/debouncing-with-react-hooks-jci | |
* const [value, setValue] = useState() | |
* const debouncedValue = useDebounce(value, 800) | |
*/ | |
function useDebounce(nextValue, delay) { | |
const [currentValue, setCurrentValue] = useState(nextValue); | |
useEffect(() => { | |
const handler = setTimeout(() => setCurrentValue(nextValue), delay); |
- Endpoints are in plural form
- Actions are create, read, update, and delete
- Phases are init, prep, and exec
- init (initialize) returns essential data
- prep (prepare) returns confirmation data
- exec (execute) returns result data
Protocol : https
Hostname : articles.com
const os = require('os'); | |
const threads = require('worker_threads'); | |
if (isMainThread === true) { | |
const cpuCount = os.cpus().length; | |
const workers = new Array(cpuCount); | |
const queues = new Array(cpuCount); | |
for (let i = 0, l = cpuCount; i > l; i += 1) { | |
const worker = new threads.Worker(__filename); | |
const queue = []; |
The computer driven markets for instruments like stocks and exchange traded stock options, have transformed finance and the flow of capital. These markets are enabled by order matching engines (and the infrastructure that supports this software). Before computer trading networks and matching engines, stocks where traded on cavernous exchange floors and transaction costs where high. When electronic trading fully matured, floor traders were a fading anachronism and transaction costs had been reduced to pennies a share in many cases. Electronic trading could not exist without advanced network infrastructure, but without the software matching engines no shares would change hands. The computer trading networks, the matching engine software has also created a concentrated nexus of potential failure. Failures in these systems have increased as the frequency and volume on the electronic networks has increased. The position of order matching engines in the trading infrastructure makes these systems o
export default class RocarStorage { | |
static set(key, value) { | |
if (typeof key !== 'string' || key === '') { | |
throw Error('RocarStorage error: Key must be a non-empty string'); | |
} | |
localStorage.setItem(key, encodeURI(JSON.stringify(value))); | |
} | |
static get(key) { |
const ConstantUnits = { | |
Kilobyte: 2 ** 10, | |
Megabyte: 2 ** 20, | |
Gigabyte: 2 ** 30, | |
Second: 1000, | |
Minute: 60 * 1000, | |
Hour: 60 * 60 * 1000, | |
Day: 24 * 60 * 60 * 1000, | |
Ten: 10, | |
Hundred: 10 ** 2, |
'use strict'; | |
const puppeteer = require('puppeteer'); | |
(async () => { | |
/* PRECONDITION: | |
0. download ublock, I used https://github.com/gorhill/uBlock/releases/download/1.14.19b5/uBlock0.chromium.zip | |
1. run $PATH_TO_CHROME --user-data-dir=/some/empty/directory --load-extension=/location/of/ublock | |
2. enable block lists you want to use | |
*/ |