This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "fmt" | |
| "strconv" | |
| "github.com/aws/aws-sdk-go/aws" | |
| "github.com/aws/aws-sdk-go/aws/session" | |
| "github.com/aws/aws-sdk-go/service/dynamodb" | |
| "github.com/aws/aws-sdk-go/service/dynamodb/dynamodbattribute" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const poll = async (fn: any, timeout: number, interval: number) => { | |
| const endTime = Date.now() + timeout; | |
| const checkCondition = async (resolve: any, reject: any) => { | |
| const result = await fn(); | |
| if (result) { | |
| resolve(result); | |
| } else if (Date.now() < endTime) { | |
| setTimeout(checkCondition, interval, resolve, reject); | |
| } else { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export interface Repository { | |
| beginTransaction: () => Promise<Transaction>; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Postgres Docker creates a volume by default so we only need the following parameters | |
| docker run -e POSTGRES_USER=<dbuser> -e POSTGRES_PASSWORD=<dbpassword> -e POSTGRES_DB=<dbname> -p 5432:5432 --name <dbname> -d postgres |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "fmt" | |
| "sync" | |
| "github.com/dghubble/sling" | |
| ) | |
| func main() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| docker run -d --name my_postgres -v my_dbdata:/var/lib/postgresql/data -p 54320:5432 postgres:11 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class PageBrowser() implements AutoCloseable { | |
| final SeleniumDriver mDriver; | |
| public PageBrowser() { | |
| mDriver = new SeleniumDriver(); // setup the rest of the driver | |
| } | |
| TPage <TPage> goTo() { | |
| // Todo Java Reflection on TPage and inject SeleniumDriver | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export function* request(apiCall) { | |
| const response = yield apiCall | |
| if (response.status === 401) { | |
| yield put(SessionActions.logout()) | |
| return null | |
| } | |
| return response | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| cluster="cluster-name" | |
| x="aws ecs wait services-stable --cluster $cluster --services $cluster" | |
| echo "Waiting until ecs services report as healthy" | |
| for i in 1 2 3 4 5; do (eval $x) && break || sleep 5; done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| deploy: | |
| - provider: script | |
| skip_cleanup: true | |
| script: chmod +x ./deploy.sh && ./deploy.sh | |
| on: | |
| branch: master |