Skip to content

Instantly share code, notes, and snippets.

@aramkumar06
aramkumar06 / petstore_oas3_requestBody_example.json
Created September 17, 2019 09:31 — forked from biggates/petstore_oas3_requestBody_example.json
Example of OpenAPI Specification v3.0.0, containing multiple examples of requestBody
{
"openapi": "3.0.2",
"info": {
"description": "This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.",
"version": "1.0.0",
"title": "Swagger Petstore",
"termsOfService": "http://swagger.io/terms/",
"contact": {
"email": "apiteam@swagger.io"
},
const cluster = require('cluster')
const { cpus } = require('os')
const log = require('./modules/log')
const isMaster = cluster.isMaster
const numWorkers = cpus().length
if (isMaster) {
log(`Forking ${numWorkers} workers`)
@aramkumar06
aramkumar06 / async.js
Created October 10, 2019 15:18 — forked from bschwartz757/async.js
Async/await function to fetch data from multiple URLs in parallel
/* Client side, works in Chrome 55 and Firefox 52 without transpilation */
//https://blogs.msdn.microsoft.com/typescript/2016/11/08/typescript-2-1-rc-better-inference-async-functions-and-more/
async function fetchURLs() {
try {
// Promise.all() lets us coalesce multiple promises into a single super-promise
var data = await Promise.all([
/* Alternatively store each in an array */
// var [x, y, z] = await Promise.all([
// parse results as json; fetch data response has several reader methods available:
//.arrayBuffer()
@aramkumar06
aramkumar06 / README.md
Last active October 14, 2019 13:31 — forked from joyrexus/README.md
Nested grouping of arrays

nest.js

A multi-level groupBy for arrays inspired by D3's nest operator.

Nesting allows elements in an array to be grouped into a hierarchical tree structure; think of it like the GROUP BY operator in SQL, except you can have multiple levels of grouping, and the resulting output is a tree rather than a flat table. The levels in the tree are specified by key functions.

See this fiddle for live demo.

@aramkumar06
aramkumar06 / package.json
Created November 6, 2019 11:11 — forked from adamreisnz/package.json
Simple pure npm scripts build process
{
"name": "project-name",
"description": "Template for static sites",
"version": "1.0.0",
"homepage": "http://www.project-name.com",
"author": {
"name": "Adam Reis",
"url": "http://adam.reis.nz"
},
"license": "UNLICENSED",
@aramkumar06
aramkumar06 / Dynamic Script
Last active January 31, 2020 04:03 — forked from autumnwoodberry/user.js
vuex + vuelidate
dynamic-script-loader.service.ts
import { Injectable } from '@angular/core';
interface Scripts {
name: string;
src: string;
}
export const ScriptStore: Scripts[] = [
CF Installation
wget -q -O - https://packages.cloudfoundry.org/debian/cli.cloudfoundry.org.key | sudo apt-key add -
echo "deb https://packages.cloudfoundry.org/debian stable main" | sudo tee /etc/apt/sources.list.d/cloudfoundry-cli.list
sudo apt-get update
sudo apt-get install cf-cli
@aramkumar06
aramkumar06 / Dockerfile
Created November 16, 2019 07:47 — forked from RinatMullayanov/Dockerfile
Ubuntu Node.js Dockerfile
#
# Ubuntu Node.js Dockerfile
#
# https://github.com/dockerfile/ubuntu/blob/master/Dockerfile
# https://docs.docker.com/examples/nodejs_web_app/
#
# Pull base image.
FROM ubuntu:14.04
FROM ubuntu
MAINTAINER Kimbro Staken
RUN apt-get install -y python-software-properties python python-setuptools ruby rubygems
RUN add-apt-repository ppa:chris-lea/node.js
RUN echo "deb http://us.archive.ubuntu.com/ubuntu/ precise universe" >> /etc/apt/sources.list
RUN apt-get update
RUN apt-get install -y nodejs
RUN apt-key adv --keyserver keyserver.ubuntu.com --recv 7F0CEB10
@aramkumar06
aramkumar06 / api_backends.conf
Created November 17, 2019 08:16 — forked from nginx-gists/api_backends.conf
Deploying NGINX Plus as an API Gateway, Part 1
upstream warehouse_inventory {
zone inventory_service 64k;
server 10.0.0.1:80;
server 10.0.0.2:80;
server 10.0.0.3:80;
}
upstream warehouse_pricing {
zone pricing_service 64k;
server 10.0.0.7:80;