- A recent version of Node.js
npm install -g create-react-app
const getResolvedPromise = () => Promise.resolve('resolved'); | |
const getRejectPromise = () => Promise.reject('rejected'); | |
getResolvedPromise() | |
//getRejectPromise() | |
.then(res => { | |
console.log('in the 1st then'); | |
//return getResolvedPromise(); | |
return getRejectPromise(); | |
}, error => { |
Moving from Monoliths to micro-services which allows components to be developed, deployed, updated and scaled independently. This allows to develop rapidly based on business needs.
However with more deployable components it is increasingly harder to configure, manage and keep the whole system running. We need automation which includes scheduling of those components into our servers, auto configuration, supervision and failure-handling. This is how Kubernetes can help.
Kubernetes allows devs to deploy apps without the help of operations (ops) team. It also helps ops by automatically scheduling and monitoring those apps in event of hardware failure.
::Kubernetes abstracts the entire data-centre as a single enormous computational resource::. It allows you to deploy components without knowing the infrastructure. You give your component(s) and Kubernetes will select the best server for your app.
function memorySizeOf(obj) { | |
var bytes = 0; | |
function sizeOf(obj) { | |
if(obj !== null && obj !== undefined) { | |
switch(typeof obj) { | |
case 'number': | |
bytes += 8; | |
break; | |
case 'string': |
import Ajv from 'ajv' | |
import { JSONSchema7 } from 'json-schema' | |
const ajv = new Ajv({ allErrors: true }) | |
const envSchema: JSONSchema7 = { | |
type: 'object', | |
required: ['SERVICE_NAME', 'ENVIRONMENT', 'LAUNCH_DARKLY_SDK_KEY'], | |
properties: { | |
SERVICE_NAME: { type: 'string' }, |
#!/bin/sh | |
## Requires openssl, nodejs, jq | |
header=' | |
{ | |
"kid": "12345", | |
"alg": "RS256" | |
}' | |
payload=' | |
{ | |
"iss": "https://example.com", |