What this will cover
- Host a static website at S3
- Redirect
www.website.comtowebsite.com - Website can be an SPA (requiring all requests to return
index.html) - Free AWS SSL certs
- Deployment with CDN invalidation
| version: '3' | |
| services: | |
| spanner: | |
| image: gcr.io/cloud-spanner-emulator/emulator:latest | |
| ports: | |
| - "9010:9010" | |
| - "9020:9020" | |
| gcloud-spanner-init: | |
| image: gcr.io/google.com/cloudsdktool/cloud-sdk:latest |
| // | |
| // Companion code to https://medium.com/statuscode/pipeline-patterns-in-go-a37bb3a7e61d | |
| // | |
| // To run: | |
| // go get github.com/pkg/errors | |
| // go run -race pipeline_demo.go | |
| // | |
| package main |
| func main() { | |
| s := time.Now() | |
| args := os.Args[1:] | |
| if len(args) != 6 { // for format LogExtractor.exe -f "From Time" -t "To Time" -i "Log file directory location" | |
| fmt.Println("Please give proper command line arguments") | |
| return | |
| } | |
| startTimeArg := args[1] | |
| finishTimeArg := args[3] |
| package main | |
| import ( | |
| "log" | |
| "syscall" | |
| "unsafe" | |
| "golang.org/x/sys/windows" | |
| ) |
| #sudo apt-get update | |
| #sudo apt-get install -y build-essential autoconf libtool git pkg-config curl automake libtool curl make g++ unzip | |
| #sudo apt-get clean | |
| GRPC_RELEASE_TAG=v1.11.x | |
| GRPC_DIR=$(pwd) | |
| cd ${GRPC_DIR} | |
| #git clone -b ${GRPC_RELEASE_TAG} https://github.com/grpc/grpc ${GRPC_DIR} && \ | |
| cd ${GRPC_DIR} && \ | |
| # git submodule update --init && \ |
| struct Connection { | |
| void disconnected() | |
| { | |
| m_connection = Disconnected(); | |
| } | |
| void interrupted() | |
| { | |
| m_connection = std::visit(InterruptedEvent(*this), m_connection); | |
| } |
Git, used along with Github, is a great way to manage the work of writing code. It allows you to collaborate easily on even very large-scale projects, and provides a great place to quickly host code for sharing it with others. If you're going to write significant amounts of code, I highly recommend using it.
Below is a list of commented Git commands in rough order of probable workflow. I use this as a quick reference for using Git. If you happen to want to add comments or questions, I'm making this blog entry into a Github Gist. You can view it here.
git init #start a repo
git add mynewfile.py #track a file
git rm --cached myoldfile.py #untrack a file
git commit -m 'my commit message' #commit changes with a note
git push -u origin master # push to the 'master' branch on the 'origin' remote
git branch mynewbranch #create a new branch
| # Fix the docker sudo issue | |
| sudo usermod -aG docker $USER # Require logout and then login. |
| template <class T, class TAlloc> | |
| class FlVecAllocator { | |
| public: | |
| template <typename U> | |
| using rebind = FlVecAllocator<U, TAlloc>; | |
| using value_type = T; | |
| using pointer = value_type *; | |
| FlVecAllocator() noexcept = default; |