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
#!/bin/bash | |
# use another role-name if needed | |
role_credentials=$(aws sso get-role-credentials --role-name=AdministratorAccess --account-id=$(aws sts get-caller-identity --query "Account" --output text) --access-token=$(jq .accessToken ~/.aws/sso/cache/$(ls -1rt ~/.aws/sso/cache | tail -n1) | sed -r 's/^"|"$//g') | jq -r '.roleCredentials') | |
export AWS_ACCESS_KEY_ID="$(echo $role_credentials | jq -r '.accessKeyId')" | |
export AWS_SECRET_ACCESS_KEY="$(echo $role_credentials | jq -r '.secretAccessKey')" | |
export AWS_SESSION_TOKEN="$(echo $role_credentials | jq -r '.sessionToken')" |
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
data "aws_iam_policy_document" "instance_assume_role_policy" { | |
statement { | |
actions = ["sts:AssumeRole"] | |
principals { | |
type = "AWS" | |
identifiers = ["<ACCOUNT_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
resource "aws_iam_role" "aws_sam_api_deployment_role" { | |
name = "aws-sam-api-deployment-role" | |
assume_role_policy = data.aws_iam_policy_document.deployment_role.json | |
tags = local.tags | |
} | |
data "aws_iam_policy_document" "deployment_role" { | |
statement { | |
effect = "Allow" | |
actions = ["sts:AssumeRole"] |
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
# Backup | |
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql | |
# Restore | |
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE | |
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 React from 'react'; | |
import { View, Text, StyleSheet } from 'react-native'; | |
const ComponentName = props => { | |
return ( | |
<View> | |
</View> | |
); | |
}; |
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
<?php | |
namespace App\ApiPlatform; | |
use ApiPlatform\Core\Exception\ResourceClassNotFoundException; | |
use ApiPlatform\Core\Metadata\Resource\Factory\ResourceMetadataFactoryInterface; | |
use ApiPlatform\Core\Metadata\Resource\ResourceMetadata; | |
class AutoGroupResourceMetadataFactory implements ResourceMetadataFactoryInterface |
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
<?php | |
namespace App\Entity; | |
use ApiPlatform\Core\Annotation\ApiFilter; | |
use ApiPlatform\Core\Annotation\ApiResource; | |
use ApiPlatform\Core\Annotation\ApiSubresource; | |
use ApiPlatform\Core\Serializer\Filter\PropertyFilter; | |
use Carbon\Carbon; | |
use Doctrine\Common\Collections\ArrayCollection; |
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
<?php | |
namespace App\Serializer\Normalizer; | |
use App\Entity\User; | |
use Symfony\Component\Serializer\Normalizer\CacheableSupportsMethodInterface; | |
use Symfony\Component\Serializer\Normalizer\NormalizerInterface; | |
use Symfony\Component\Serializer\Normalizer\ObjectNormalizer; | |
class UserNormalizer implements NormalizerInterface, CacheableSupportsMethodInterface |
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
{ | |
"_readme": [ | |
"This file locks the dependencies of your project to a known state", | |
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", | |
"This file is @generated automatically" | |
], | |
"content-hash": "d70bf592518f042992850c6f6dffdcfb", | |
"packages": [ | |
{ | |
"name": "api-platform/api-pack", |
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 | |
phpVersion=7.3 | |
if [[ "$1" == "status" ]]; then | |
if [[ -e /etc/php/${phpVersion}/fpm/conf.d/20-xdebug.ini ]]; then | |
echo "Xdebug is Enabled"; | |
else | |
echo "Xdebug is Disabled"; | |
fi |
NewerOlder