This file contains 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
// TypeScript code to programatically run the equivalent of `tsc` | |
// | |
// With Slight modifications, such as *Colorized* output being displayed. | |
// | |
// However, the nice one-line Error Summary that `tsc` gives you (e.g. Errors in X files) is currently missing. | |
// | |
// Refs: | |
// - https://github.com/microsoft/TypeScript-wiki/blob/main/Using-the-Compiler-API.md | |
// - https://github.com/Microsoft/TypeScript/issues/6387#issuecomment-169739615 |
This file contains 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
# delete and re-create the latest tag on remote | |
rmtag () { | |
export TAG=$(git describe --tags --abbrev=0) | |
git tag -d $TAG | |
git tag $TAG | |
git push origin :$TAG | |
git push origin $TAG | |
} |
This file contains 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
# Note: | |
# Lock in build date on the tag (ex: 2023.03.29) - otherwise, we rebuild the | |
# entire Docker image each time a tag is updated (ex: python:3.9-x86_64) | |
# | |
# Refs: | |
# - https://github.com/peterheb/rembg-lambda/issues/1#issue-1621934443 | |
# - https://docs.aws.amazon.com/lambda/latest/dg/python-image.html | |
# - https://gallery.ecr.aws/lambda/python (-> Image tags) | |
# Date (Timestamp) of the Image to Build |
This file contains 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 pathlib import Path # Optional | |
# Using CDK v2 | |
from aws_cdk import Duration | |
from aws_cdk.aws_lambda import Function, Runtime | |
from aws_cdk_lambda_asset.zip_asset_code import ZipAssetCode | |
# NOTE: Only example usage below (needs some modification) |
This file contains 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
# dataclass type validation for fields on class instantiation -and- on assignment. | |
from dataclasses import dataclass | |
from validators import TypeValidator | |
@dataclass | |
class FooDC: | |
# alternatively, like: |
This file contains 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
import { SSM } from 'aws-sdk'; | |
/** | |
* Get the value for a parameter in SSM Parameter Store. By default, decrypt | |
* the value as we assume it is stored as a "SecretString" | |
* | |
* Ref: https://gist.github.com/cbschuld/938190f81d00934f7a158ff223fb5e02 | |
* | |
* @param ssm The SSM client | |
* @param name Name of the parameter |
This file contains 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 __future__ import annotations | |
import builtins | |
from collections import deque | |
from dataclasses import field as dataclass_field, Field, MISSING | |
from logging import getLogger | |
log = getLogger(__name__) |
This file contains 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
Put below files in `.vscode` folder |
This file contains 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
# EditorConfig helps developers define and maintain consistent | |
# coding styles between different editors and IDEs | |
# http://editorconfig.org | |
# top-most EditorConfig file | |
root = true | |
[*] | |
# Change these settings to your own preference |
This file contains 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
[user] | |
name = Ritvik Nag | |
[init] | |
defaultBranch = main | |
[push] | |
followTags = true | |
autoSetupRemote = true |