You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Instantly share code, notes, and snippets.
🏠
Working from home
Troy Forster
tforster
🏠
Working from home
Creative Technology Director, idea factory, tinkerer, cyclist, hiker, vegetarian living in the wilds of downtown Toronto
[Tumblr to Mongo] NodeJS script to fetch all posts from multiple tumblr blogs into a single MongoDB collection. It saves the sorted data to disk as a .JSON file as well as bulk inserting into a MongoDB collection. #tumblr #mongo
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
[Mattermost Sharing Bookmarklet] Quick-n-dirty Bookmarklet to share the current page to MatterMost #mattermost #sharethis #share #bookmarklet
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 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
[New Linux Setup] A collection of shell snippets useful when setting up a new Linux instance #linux #setup
New Linux Setup
Setting up Linux systems is a frequent activity for me. Whether it is configuring a Docker image, setting up a new SDCard for a Raspberry Pi or migrating from one laptop to another. This README is an ongoing record of installation snippets that I copy and paste.
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 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
Lambda@Edge function to redirect requests for a naked domain to the www subdomain
Naked Redirector Lambda@Edge Function
THIS GIST HAS BEEN DEPRECATED
AWS introduced CloudFront Functions as an alternative (but not replacement) to Lambda@Edge functions. Both have their pros and cons but for naked-domain-to-www redirection a CloudFront Function is a better choice. Please see Naked Redirector CloudFront Function for an implementation example.
Intended to run on CloudFront as Lambda@Edge, naked redirector checks the incoming hostname and if it is naked, e.g. somedomain.com and not www.somedomain.com, it will redirect to the www subdomain with preserved path and query string variables.
Implements a simple basic auth function to attach to an AWS CloudFront distribution. Note that basic auth is inherently insecure and should not be used to protect content of value. It does work well to keep search engines and crawlers out of stage websites.
Usage
Create a new Lambda function in us-east-1 (AWS does not support @Edge functions from other regions at this time.)
Copy the contents of index.js to the new Lambda
Replace {your-shared-username} and {your-shared-password} with actual values
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 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