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
cleanup(id) { | |
try { | |
delete window[id]; | |
} catch (e) { | |
window[id] = undefined; | |
} | |
const script = document.getElementById(id); | |
if (script) { |
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
keyResource.addMethod('GET', integration, { | |
methodResponses: [{ statusCode: '200' }] | |
}); |
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 * as cdk from '@aws-cdk/aws-cdk'; | |
import * as appsync from '@aws-cdk/aws-appsync'; | |
import * as s3 from '@aws-cdk/aws-s3'; | |
// Our new S3 Data Source Construct | |
import { S3DataSource } from './s3-data-source.ts'; | |
/** | |
* This file contains a sample CDK Stack that creates: | |
* - A new appsync graphql api |
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 update_item(table, item, options): | |
update_expression = [] | |
expression_attribute_names = {} | |
expression_attribute_values = {} | |
for key in item: | |
attribute_name = f'#{key}' | |
attribute_value = f':{key}' | |
update_expression.append(f'set {attribute_name}={attribute_value}') | |
expression_attribute_names[attribute_name] = key |
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 { promises as fs } from 'fs'; | |
import { join } from 'path'; | |
export const importAll = async (dir='.') => { | |
for await (const path of await fs.opendir(dir)) { | |
if (path.isDirectory()) { | |
await import(join(dir, path.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
import * as iam from ‘@aws-cdk/aws-iam’ | |
const key = new iam.CfnAccessKey(this, ‘AccessKey’, { | |
serial: 1, | |
userName: ‘test-user’ | |
status: ‘Active’ | |
}); |
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
@patch("json.dump") | |
@patch("builtins.open", new_callable=mock_open()) | |
def test_cache_content_items(self, m_open, m_json): | |
cache_file_path = "EXAMPLE_FILE_PATH" | |
uncached_content_items = ["content_item_1", "content_item_2"] | |
cached_content = cache_content_items(uncached_content_items, cache_file_path) | |
m_open.assert_called_with(cache_file_path, "w") | |
m_json.assert_called_with( |
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/sh | |
COMMIT_MSG_FILE=$1 | |
COMMIT_SOURCE=$2 | |
SHA1=$3 | |
# Skip on master, test, and qa | |
if [ -z "$BRANCHES_TO_SKIP" ]; then | |
BRANCHES_TO_SKIP=(master test qa) | |
fi |
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 { h } from 'preact' | |
export default ({ id }, { whatever }) => <div>{id}: {whatever}</div> |
NewerOlder