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
{ | |
"values": [ | |
{ | |
"country": "Albania", | |
"length": "28", | |
"code": "AL", | |
"format": "AL2!n8!n16!c" | |
}, | |
{ | |
"country": "Andorra", |
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
# Example entities.yaml file for Backstage.io | |
# Systems | |
- kind: System | |
metadata: | |
name: Trello | |
description: Web-based project management tool | |
namespace: my-namespace | |
spec: | |
owner: myteam |
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
stages: | |
- prepare | |
- build | |
- test | |
- post_test | |
unit tests: | |
timeout: 20 minutes | |
stage: test | |
variables: |
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 boto3 | |
import json | |
# Create CloudWatchLogs client | |
cloudwatch_logs = boto3.client('logs') | |
paginator = cloudwatch_logs.get_paginator('describe_log_groups') | |
subscription_details = {} | |
for response in paginator.paginate(): | |
for logGroup in response['logGroups']: | |
log_group_name = logGroup['logGroupName'] | |
subscription_filters = cloudwatch_logs.describe_subscription_filters(logGroupName = log_group_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
var CryptoJS = require('crypto-js'); | |
var algo = CryptoJS.algo.SHA256.create(); | |
algo.update(password, 'utf-8'); | |
algo.update(CryptoJS.SHA256(salt), 'utf-8'); | |
var hash = algo.finalize().toString(CryptoJS.enc.Base64); | |
console.log(hash); |
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
def convertFromSnakeToCamel(string): | |
return string[0].lower() + ''.join(x.capitalize() or '_' for x in string.split('_'))[1:] |
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
package aws | |
import ( | |
"github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs" | |
"github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs/cloudwatchlogsiface" | |
) | |
// CloudWatchLogsClientMock is a mock for cloudwatch logs client | |
type CloudWatchLogsClientMock struct { | |
cloudwatchlogsiface.CloudWatchLogsAPI | |
Psfr func(input *cloudwatchlogs.PutSubscriptionFilterInput) cloudwatchlogs.PutSubscriptionFilterRequest |
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
package aws | |
// Error implements AWS Error interface | |
type Error struct { | |
error | |
ErrorCode string | |
ErrorMessage string | |
OriginalError error | |
} |
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
package aws | |
// Error implements AWS Error interface | |
type Error struct { | |
error | |
ErrorCode string | |
ErrorMessage string | |
OriginalError error | |
} |
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
// This shows an example of how to generate a SSH RSA Private/Public key pair and save it locally | |
package main | |
import ( | |
"crypto/rand" | |
"crypto/rsa" | |
"crypto/x509" | |
"encoding/pem" | |
"golang.org/x/crypto/ssh" |
NewerOlder