- 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
/** | |
* // 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); |
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, |
- 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/
'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 | |
*/ |
// does not use cookies | |
// uses localstorage instead | |
export default class Candies { | |
static set(key, value) { | |
if (typeof key !== 'string' || key === '') { | |
throw Error('Key must be a non-empty string'); | |
} | |
localStorage.setItem(key, encodeURI(JSON.stringify(value))); | |
} |
idea
- hash url's by sha512-256
- digest that sha512-256 hash into base62 (a-zA-Z0-9)
- truncate the base62 hash into first 3 characters and use it as key
- if record already exists for those first 3 characters, use 4 characters
- its generally a hash table backed by sha512-256 with base62 characters
- we use base62 because its more readable than hex
references