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
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
const split = (str, nmb) => { | |
return str.split('') | |
.reduce((arr, rec) => { | |
console.log(`Arr: ${arr} Rec : ${rec}`) | |
if (arr[arr.length - 1].length < nmb) { | |
arr[arr.length - 1] = [...arr[arr.length - 1], rec] | |
return arr | |
} | |
return [...arr, [rec]] | |
}, [[]]) |
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" |
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
# private token or personal token authentication | |
import gitlab | |
gl = gitlab.Gitlab('https://gitlab.com', private_token='{your_token}') | |
# make an API request to create the gl.user object. This is mandatory if you | |
# use the username/password authentication. | |
result = [] | |
gl.auth() |
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
# if you gonna have more then 500 api gateways, then you gonna need to wrap this into the loop and after first 500 you gonna need to pass position parameter to get_rest_apis method | |
import boto3 | |
client = boto3.client('apigateway') | |
response = client.get_rest_apis( | |
limit=500 | |
) | |
print(f"We have {len(response['items'])} api gateways to process") | |
for apigateway in response['items']: | |
print(f"Enabling {apigateway['name']} api gateway tracing") |
NewerOlder