This file contains hidden or 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", | |
"Principal": { | |
"Service": [ | |
"edgelambda.amazonaws.com", | |
"lambda.amazonaws.com" | |
] |
This file contains hidden or 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
'use strict'; | |
// Lambda function to set cache control public header in case of missing cache control header | |
exports.handler = (event, context, callback) => { | |
const { response } = event.Records[0].cf; | |
const { headers } = response; | |
const headerCacheControl = 'Cache-Control'; | |
const defaultTimeToLive = 60 * 60 * 24 * 14; // 14 days |
This file contains hidden or 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
<%= image_tag cdn_for(model.attribute) %> | |
<%# e.g. for a user cover photo %> | |
<%= image_tag cdn_for(user.cover_photo) %> |
This file contains hidden or 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
<%= image_tag url_for(model.attribute) %> | |
<%# e.g. for a user cover photo %> | |
<%= image_tag url_for(user.cover_photo) %> |
This file contains hidden or 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 cdn_for(file) | |
"#{ENV['CDN_URL']}/#{file.key}" | |
end |
This file contains hidden or 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
<?xml version="1.0" encoding="utf-8"?> | |
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet"> | |
<CodeSnippet Format="1.0.0"> | |
<Header> | |
<Title>Unit Test</Title> | |
<Author>Jeremy Wagner</Author> | |
<Description>C# Unit Test Code Snippet with 3 Parts and Assert Inconclusive</Description> | |
<HelpUrl>https://msdn.microsoft.com/en-us/library/ms165394.aspx</HelpUrl> | |
<SnippetTypes /> | |
<Keywords /> |