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
{ | |
"Version": "2012-10-17", | |
"Statement": [ | |
{ | |
"Effect": "Allow", | |
"Action": [ | |
"rds-db:connect" | |
], | |
"Resource": [ | |
"arn:aws:rds-db:region:account-id:dbuser:dbi-resource-id/database-user-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
# Create EC2 Instance Role | |
$ec2RoleTrustPolicyDocument = '{"Version":"2012-10-17","Statement":[{"Effect":"Allow","Principal":{"Service":"ec2.amazonaws.com"},"Action":"sts:AssumeRole"}]}' | |
$iamRole = New-IAMRole -AssumeRolePolicyDocument $ec2RoleTrustPolicyDocument -RoleName MyEC2Role | |
Register-IAMRolePolicy -RoleName $iamRole.RoleName -PolicyArn arn:aws:iam::aws:policy/CloudWatchLogsFullAccess | |
$instanceProfile = New-IAMInstanceProfile -InstanceProfileName MyEC2InstanceRole | |
Add-IAMRoleToInstanceProfile -RoleName $iamRole.RoleName -InstanceProfileName $instanceProfile.InstanceProfileName | |
# Attach to existing instance | |
Register-EC2IamInstanceProfile -InstanceId i-0a5c81b759851230c -IamInstanceProfile_Name $instanceProfile.InstanceProfileName |
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 hoistNonReactStatic from 'hoist-non-react-statics'; | |
import React from 'react'; | |
function getDisplayName(WrappedComponent) { | |
return WrappedComponent.displayName || WrappedComponent.name || 'Component'; | |
} | |
// See: https://facebook.github.io/react/docs/higher-order-components.html | |
export default function mutatable({ mutationName = 'mutate' } = {}) { | |
return (SourceComponent) => { |
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
# Index | |
--------------------------------------------------------------------- | |
curl -XPUT http://localhost:9200/pictures/ -d ' | |
{ | |
"settings": { | |
"analysis": { | |
"analyzer": { | |
"index_analyzer": { | |
"tokenizer": "standard", |