| /* | |
| * Edit these variables to suit your environment | |
| */ | |
| var blogs = ["x.tumblr.com", "y.tumblr.com", "z.tumblr.com"]; | |
| var apiKey = "**************************************************"; | |
| var databaseName = "node-blog"; | |
| var databaseHost = "localhost"; | |
| var databasePort = 27017; | |
| var databaseCollection = "posts"; |
| /******************************************************************************* | |
| * Quick-n-dirty Bookmarklet to share the current page to MatterMost | |
| * | |
| * Limitations | |
| * ----------- | |
| * - Doesn't work in mixed content yet so don't try and share an | |
| * HTTPS URL if your MatterMost is running on HTTP (which it really should | |
| * not be). | |
| * - Only tested on Chrome. Uses some ES6 stuff so your mileage will vary | |
| * - Doesn't check for classes called ti-input, ti-post or ti-cancel so it may |
| <table border="0" cellpadding="0" cellspacing="0" width="445" style="font-family:'Times New Roman'"> | |
| <tbody> | |
| <tr> | |
| <td height="65" valign="top" width="65" style="padding-right:8px;vertical-align:top"> | |
| <table border="0" cellpadding="0" cellspacing="0"> | |
| <tbody> | |
| <tr> | |
| <td height="65" width="65"><img alt="photo" height="65" width="65" style="vertical-align:initial;border-radius:0px;max-width:90px" | |
| src="https://ci5.googleusercontent.com/proxy/5oomNlZNp3iyPEopuZyMtittq7y2tOgN3Gr8GNJ3Xx9D_EvoYh3fJlhCvmboDzi7gHDd2ZyyhLdE0sd1uZ07pS8F3rsReC2MxGszQUyE5c8Wlvb4FpCP1ps7UXdhzkE7X3dSgOk4Qfblslu7LKKd0TzaSnYbIBq1NOIsOYzE-9es4Ue2O6sesogA9fKv0nZ-lbY=s0-d-e1-ft#https://s3.amazonaws.com/ucwebapp.wisestamp.com/42a7f41a-9cca-437d-a291-f0fc0f4a9097/sidefacew500.format_png.resize_200x.png"></td> | |
| </tr> |
| // Because I can never remember the precise syntax and the Serverless Framework docs are out of date (at least when I wrote this)... | |
| // Handler.js | |
| resSuccess(data = {}, statusCode = 200) { | |
| return { | |
| statusCode, | |
| body: JSON.stringify(data), | |
| headers: { | |
| "Content-Type": "application/json", | |
| "Access-Control-Allow-Headers": "*", |
| { | |
| "Version": "2012-10-17", | |
| "Statement": [ | |
| { | |
| "Effect": "Allow", | |
| "Action": [ | |
| "s3:GetObject", | |
| "s3:PutObject", | |
| "s3:GetObjectAcl", | |
| "s3:PutObjectAcl", |
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.
- 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
- Attach to CloudFront as a viewer request function
| # Debug state | |
| DEBUG=true | |
| # MySQL configuration | |
| DB_USER= | |
| DB_PASSWORD= | |
| DB_NAME= | |
| DB_HOST=db:3306 | |
| # WordPress configuration |
| { | |
| "info": { | |
| "_postman_id": "e5d286ab-6f35-46dd-a9f0-9c3c55b5db18", | |
| "name": "MailChimp", | |
| "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json" | |
| }, | |
| "item": [ | |
| { | |
| "name": "Get lists info", | |
| "request": { |