Given an array of orders like this:
type Order = {
orderId: number;
customerId: number;
amount: number;| cd ~/ | |
| mkdir .localhost-ssl | |
| sudo openssl genrsa -out ~/.localhost-ssl/localhost.key 2048 | |
| sudo openssl req -new -x509 -key ~/.localhost-ssl/localhost.key -out ~/.localhost-ssl/localhost.crt -days 3650 -subj /CN=localhost | |
| sudo security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain ~/.localhost-ssl/localhost.crt | |
| npm install -g http-server | |
| echo " | |
| function https-server() { |
| Install WireGuard via whatever package manager you use. For me, I use apt. | |
| $ sudo add-apt-repository ppa:wireguard/wireguard | |
| $ sudo apt-get update | |
| $ sudo apt-get install wireguard | |
| MacOS | |
| $ brew install wireguard-tools | |
| Generate key your key pairs. The key pairs are just that, key pairs. They can be |
| package awss3 | |
| import ( | |
| "crypto/tls" | |
| "fmt" | |
| "io" | |
| "net/http" | |
| "os" | |
| "path/filepath" | |
| "time" |
| provider "aws" { | |
| version = "~> 2.0" | |
| region = "eu-west-2" | |
| } | |
| # Providing a reference to our default VPC | |
| resource "aws_default_vpc" "default_vpc" { | |
| } | |
| # Providing a reference to our default subnets |
| #!/bin/bash | |
| # Written by Frans Rosén (twitter.com/fransrosen) | |
| _debug="$2" #turn on debug | |
| _timeout="20" | |
| #you need a valid key, since the errors happens after it validates that the key exist. we do not need the secret key, only access key | |
| _aws_key="AKIA..." | |
| H_ACCEPT="accept-language: en-US,en;q=0.9,sv;q=0.8,zh-TW;q=0.7,zh;q=0.6,fi;q=0.5,it;q=0.4,de;q=0.3" | |
| H_AGENT="user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.146 Safari/537.36" |
I have moved this over to the Tech Interview Cheat Sheet Repo and has been expanded and even has code challenges you can run and practice against!
\
Picking the right architecture = Picking the right battles + Managing trade-offs