Version | Link |
---|---|
ECMAScript 2015 - ES2015 - ES6 | All Features List |
ECMAScript 2016 - ES2016 - ES7 | All Features List |
ECMAScript 2017 - ES2017 - "ES8" | All Features List |
ECMAScript 2018 - ES2018 - "ES9" | All Features List |
ECMAScript 2019 - ES2019 - "ES10" | All Features List |
ECMAScript 2020 - ES2020 - "ES11" | All Features List |
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
AWSTemplateFormatVersion: '2010-09-09' | |
Description: Template to connect DynamoDB Stream to EventBridge | |
Resources: | |
OrdersTable: | |
Type: AWS::DynamoDB::Table | |
Properties: | |
TableName: | |
Fn::Sub: ${AWS::StackName}-orders | |
AttributeDefinitions: | |
- AttributeName: id |
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
description: |- | |
### EC2 stopper by tag | |
Stop EC2 instances by tag | |
schemaVersion: '0.3' | |
mainSteps: | |
- name: getInstancesByTag | |
action: 'aws:executeAwsApi' | |
outputs: | |
- Name: InstanceIds |
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
# Checks if an image tag exists in the repo | |
def check_tag_exists(tag, repo): | |
ecr_client = boto3.client('ecr', region_name='us-east-1') | |
response = ecr_client.describe_images(repositoryName=repo, filter={'tagStatus': 'TAGGED'}) | |
for i in response['imageDetails']: | |
if tag in i['imageTags']: | |
return True | |
return False |
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
#!/usr/bin/env bash | |
# -*- coding: utf-8 -*- | |
# vim: set ft=sh et ts=4 sw=4 sts=4: | |
# ================================================================================================= | |
# | |
# Copyright 2022 Serhat Teker <me@serhatteker.com> | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at |
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 { BatchExecuteStatementCommand, BatchExecuteStatementCommandInput, BatchGetCommand, BatchGetCommandInput, DeleteCommand, DeleteCommandInput, ExecuteStatementCommand, ExecuteStatementCommandInput, ExecuteTransactionCommand, ExecuteTransactionCommandInput, GetCommand, GetCommandInput, PutCommand, PutCommandInput, QueryCommand, QueryCommandInput, ScanCommand, ScanCommandInput, UpdateCommand, UpdateCommandInput } from "@aws-sdk/lib-dynamodb"; | |
import { Logger } from "@nestjs/common"; | |
import { DbClientsInstance } from "./db.clients"; | |
class DbDataOps { | |
private static instance: DbDataOps; | |
private constructor() { | |
console.log('DbDataOps init'); | |
if(DbDataOps.instance) { |
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
#!/usr/bin/env ruby | |
require 'shellwords' | |
files = `find . -iname '*.heic'`.split("\n") | |
files.each do |original_file| | |
output_file = original_file.gsub(/\.heic\z/i, ' Converted.jpg') | |
if File.exist?(output_file) | |
STDERR.puts "Skipping output #{output_file} exists." | |
else |
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
# Mount the data disk | |
# Adapted from https://gist.github.com/ctompkinson/30f570882af38879b36fc7bffe3d1a60 | |
device=/dev/sdh | |
mount_point=/monitor-config | |
apt-get install -y nvme-cli | |
while [ true ]; do | |
for blkdev in $(nvme list | awk '/^\/dev/ { print $1 }'); do | |
mapping=$(nvme id-ctrl --raw-binary "${blkdev}" | cut -c3073-3104 | tr -s ' ' | sed 's/ $//g') | |
if [ ${mapping} = ${device} ]; then | |
echo "Found $device on $blkdev" |
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 axios, { AxiosResponse } from 'axios'; | |
import dotenv from 'dotenv'; | |
import newman from 'newman'; | |
import { Collection, Variable } from 'postman-collection'; | |
import { Logger } from './logger.js'; | |
interface PostmanMetadata { | |
id: string; | |
name: string; |
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
AWSTemplateFormatVersion: '2010-09-09' | |
Description: > | |
SSM Automation Document run a custom SSM Command Document | |
against a fleet of target instances. | |
Parameters: | |
AutomationDocumentName: | |
Type: String | |
Description: Name of created SSM Automation Document | |
Default: MyAutomation |