See https://medium.com/unsplash/how-we-gradually-migrated-to-typescript-at-unsplash-7a34caa24ef1
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
| AWSTemplateFormatVersion: '2010-09-09' | |
| Description: Cognito Stack | |
| Parameters: | |
| AuthName: | |
| Type: String | |
| Description: Unique Auth Name for Cognito Resources | |
| Resources: | |
| # Creates a role that allows Cognito to send SNS messages | |
| SNSRole: |
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
| CREATE SEQUENCE country_seq; | |
| CREATE TABLE IF NOT EXISTS country ( | |
| id int NOT NULL DEFAULT NEXTVAL ('country_seq'), | |
| iso char(2) NOT NULL, | |
| name varchar(80) NOT NULL, | |
| nicename varchar(80) NOT NULL, | |
| iso3 char(3) DEFAULT NULL, | |
| numcode smallint DEFAULT NULL, | |
| phonecode int NOT NULL, |
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
| --- | |
| Description: AWSAppSync DynamoDB Example | |
| Resources: | |
| GraphQLApi: | |
| Type: "AWS::AppSync::GraphQLApi" | |
| Properties: | |
| Name: AWSAppSync DynamoDB Example | |
| AuthenticationType: AWS_IAM | |
| PostDynamoDBTableDataSource: |
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/sh | |
| # Build & extract a set of apk from an aab for a specific device and install the results on it. | |
| # | |
| # This needs https://github.com/google/bundletool to be available as `bundletool`. | |
| # Also **exactly** one device needs to be connected to adb. | |
| # Usage: installFromBundle bundle.aab | |
| # optional `--extract-apks` to keep the set on your workstation as well. | |
| basename=${1%%.*} | |
| keystore="~/.android/debug.keystore" |
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 | |
| # I've found that the "Migrate to AndroidX" converter in Android Studio doesn't work very | |
| # well, so I wrote my own script to do the simple job of converting package names. | |
| # | |
| # You can download a CSV of package names here: https://developer.android.com/topic/libraries/support-library/downloads/androidx-class-mapping.csv | |
| # | |
| # It'll run faster on a clean build because then there are fewer files to scan over. | |
| # | |
| # Uses `gsed` because I'm on a Mac. Can easily replace with `sed` if you don't have `gsed`. |
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
| Math.blerp = function (values, x1, y1, x2, y2, x, y) { | |
| let q11 = (((x2 - x) * (y2 - y)) / ((x2 - x1) * (y2 - y1))) * values[x1][y1] | |
| let q21 = (((x - x1) * (y2 - y)) / ((x2 - x1) * (y2 - y1))) * values[x2][y1] | |
| let q12 = (((x2 - x) * (y - y1)) / ((x2 - x1) * (y2 - y1))) * values[x1][y2] | |
| let q22 = (((x - x1) * (y - y1)) / ((x2 - x1) * (y2 - y1))) * values[x2][y2] | |
| return q11 + q21 + q12 + q22 | |
| } |
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
| # This script will explain how to transfer a file to EC2 using SSM ONLY! | |
| # You will need to have permission to run SSM commands on the target machine and have sudo access as well | |
| # Infos | |
| INSTANCE_ID=i-1234567890 | |
| FILE_NAME=the_file.tar.gz | |
| # Step 1: Run command on machine to install netcat and dump from port to filename | |
| # < Start session |
AWS SAM local commands check for the existance of DOCKER_HOST. If the variable is not present, it will fail with the following error message
Error: Running AWS SAM projects locally requires Docker. Have you got it installed and running?
Point DOCKER_HOST to unix socket of the Docker Daemon.