Skip to content

Instantly share code, notes, and snippets.

View invalidred's full-sized avatar

abdul khan invalidred

View GitHub Profile
@invalidred
invalidred / Git: Rename Author's Email of All Commits
Last active August 29, 2015 14:26
To Rename Author's Email
git filter-branch --env-filter '
if [ "$GIT_COMMITTER_EMAIL" = "[email protected]" ];
then
GIT_COMMITTER_EMAIL="[email protected]";
fi
' -- --all
@invalidred
invalidred / gist:98307b909801e1c8c9014b4eb94de451
Created May 30, 2016 18:53
Javascript Promises Conundrum
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 => {

React && Firebase Workshop

Contact Information

Prequisite Setup

  • A recent version of Node.js
  • npm install -g create-react-app

Chapter 1: Introduction To Kubernetes

Summary

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.

@invalidred
invalidred / experiment
Created June 15, 2020 16:43
200 productIds
function memorySizeOf(obj) {
var bytes = 0;
function sizeOf(obj) {
if(obj !== null && obj !== undefined) {
switch(typeof obj) {
case 'number':
bytes += 8;
break;
case 'string':
@invalidred
invalidred / JSONSchema to valid env
Created July 20, 2020 02:08
JSONSchema to validate env
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' },
@invalidred
invalidred / create_jwt.sh
Created December 19, 2023 14:32 — forked from shu-yusa/create_jwt.sh
Generate private and public keys, and create JWT and JWKs
#!/bin/sh
## Requires openssl, nodejs, jq
header='
{
"kid": "12345",
"alg": "RS256"
}'
payload='
{
"iss": "https://example.com",