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 -v "$HOME/.aws":/root/.aws \ | |
| -e AWS_REGION=us-east-1 -e AWS_PROFILE=myprofile \ | |
| -p 9000:8080 \ | |
| pdf2png-test |
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
| FROM alpine:3.12 AS rie-image | |
| RUN apk add --no-cache curl && \ | |
| cd / && \ | |
| curl -sSL -O https://github.com/aws/aws-lambda-runtime-interface-emulator/releases/download/v1.0/aws-lambda-rie && \ | |
| chmod +x /aws-lambda-rie | |
| FROM pdf2png |
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
| FROM golang:1-alpine3.12 AS build-image | |
| WORKDIR /app | |
| COPY go.mod go.sum ./ | |
| RUN go mod download | |
| COPY *.go ./ | |
| RUN go build -tags lambda.norpc -ldflags="-s -w" main.go |
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
| func main() { | |
| os.Chdir("/tmp") // Change working directory to /tmp so we can write files | |
| if len(os.Args) > 1 && os.Args[1] == "--test" { | |
| pdf2png() | |
| } else { | |
| lambda.Start(handler) | |
| } | |
| } |
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
| FROM golang:1-alpine3.12 AS build-image | |
| WORKDIR /app | |
| COPY *.go ./ | |
| RUN go build main.go | |
| FROM alpine:3.12 |
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 ( | |
| "os" | |
| "os/exec" | |
| "strings" | |
| ) | |
| func main() { | |
| os.Chdir("/tmp") // Change working directory to /tmp so we can write files |
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
| # Try to create a 200MiB layer | |
| head -c 209715200 /dev/random > file.dat | |
| rm -f layer.zip && zip layer.zip file.dat | |
| aws s3 cp layer.zip s3://my-bucket/my-key | |
| aws lambda publish-layer-version --cli-connect-timeout 0 --layer-name large-200MiB-dep --content S3Bucket=my-bucket,S3Key=my-key | |
| # Results in: | |
| # An error occurred (ServiceException) when calling the PublishLayerVersion operation (reached max retries: 2): An error occurred and the request cannot be processed. | |
| # One byte less and it works (`aws lambda publish-layer-version` takes about 60 secs) |
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
| // First, create a new directory, copy this file into it, and run: `npm install xml2js` | |
| // Then `plutil -convert xml1 ~/Library/Application\ Support/NetNewsWire/Subscriptions.plist` | |
| // Then `node plistToOpml.js > exported.opml` | |
| // Then File->Import Subscriptions... in NetNewsWire 5.x | |
| const fs = require('fs') | |
| const xml2js = require('xml2js') | |
| const data = fs.readFileSync(`${process.env.HOME}/Library/Application Support/NetNewsWire/Subscriptions.plist`, 'utf8') |
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
| name: CI | |
| on: [push] | |
| jobs: | |
| tslint: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| job: [0, 1, 2, 3, 4] |
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
| #!/bin/bash -ex | |
| # Tries to download latest cached node_modules based on package-lock.json | |
| # If it can't, then `npm ci` and push up node_modules to cache | |
| # Assumes S3_BUCKET env var has been set, and that `aws` credentials | |
| # are configured (either in env, or ~/.aws/credentials) | |
| CHECKSUM=$(sha256sum package-lock.json | awk '{print $1}') |