Skip to content

Instantly share code, notes, and snippets.

View jordangarrison's full-sized avatar

Jordan Garrison jordangarrison

View GitHub Profile
@mikesparr
mikesparr / anthos-service-mesh.sh
Last active March 20, 2023 15:55
Install Anthos Service Mesh and Hipster shop
#!/usr/bin/env bash
export PROJECT_ID=$(gcloud config get-value project)
export PROJECT_USER=$(gcloud config get-value core/account) # set current user
export CLUSTER_NAME="central"
export CLUSTER_LOCATION="us-central1"
export MACHINE_TYPE="n1-standard-4"
export NODE_POOL_NAME="default-pool"
export NETWORK_NAME="anthos-demo"
@matthewsuan
matthewsuan / axios.js
Last active December 20, 2024 16:45
Axios request queue-like that limits number of requests at any given time
import axios from 'axios'
const MAX_REQUESTS_COUNT = 5
const INTERVAL_MS = 10
let PENDING_REQUESTS = 0
// create new axios instance
const api = axios.create({})
/**
@ccnokes
ccnokes / axios-instance-config.js
Created July 6, 2017 16:23
Good default configuration for axios in node.js
const axios = require('axios');
const http = require('http');
const https = require('https');
module.exports = axios.create({
//60 sec timeout
timeout: 60000,
//keepAlive pools and reuses TCP connections, so it's faster
httpAgent: new http.Agent({ keepAlive: true }),