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
package main | |
import ( | |
"fmt" | |
"log" | |
"os" | |
"github.com/aws/aws-sdk-go/aws" | |
"github.com/aws/aws-sdk-go/aws/credentials" | |
"github.com/aws/aws-sdk-go/aws/session" |
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
(function(modules) { | |
// The module cache | |
var installedModules = {}; | |
// The require function | |
function __webpack_require__(moduleId) { | |
// Check if module is in cache | |
if(installedModules[moduleId]) | |
return installedModules[moduleId].exports; |
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
language: node_js | |
node_js: | |
- 6 | |
cache: | |
directories: | |
- dir_1/node_modules | |
before_install: | |
- cd dir_1 |
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
language: node_js | |
node_js: | |
- 6 | |
cache: | |
directories: | |
- vinhlh.static/node_modules | |
install: | |
# for invalidating CloudFront distribution |
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": [ | |
"s3:DeleteObject", | |
"s3:GetObject", | |
"s3:GetObjectAcl", | |
"s3:PutObject", |
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
// Requirements | |
// - React Dev Tools is installed. | |
// | |
// 1. Select scrollable-holder > f listType=course | |
// 2. Open Console | |
// 3. Run | |
$r.props.list.lessons.map(({ download_url }) => download_url) | |
// It will return a list of URLs like this | |
["https://d3j4ov1z2pxjvg.cloudfront.net/lessons/eggh…Yk8rdCRrG717PA__&Key-Pair-Id=APKAIEGNPCBY26T6OCUQ", "https://d3j4ov1z2pxjvg.cloudfront.net/lessons/eggh…JqohRQd8QSziCQ__&Key-Pair-Id=APKAIEGNPCBY26T6OCUQ", "https://d3j4ov1z2pxjvg.cloudfront.net/lessons/eggh…CWI7XuOLvgo6gg__&Key-Pair-Id=APKAIEGNPCBY26T6OCUQ", "https://d3j4ov1z2pxjvg.cloudfront.net/lessons/eggh…ttRijk5eKVqmWg__&Key-Pair-Id=APKAIEGNPCBY26T6OCUQ", "https://d3j4ov1z2pxjvg.cloudfront.net/lessons/eggh…-BkUuXhdRKojMA__&Key-Pair-Id=APKAIEGNPCBY26T6OCUQ", "https://d3j4ov1z2pxjvg.cloudfront.net/lessons/eggh…KJ50oYPlKNYp4A__&Key-Pair-Id=APKAIEGNPCBY26T6OCUQ", "https://d3j4ov1z2pxjvg.cloudfront.net/lessons/eggh…PzTlKj~APZyNDw__&Key-Pair-Id=APKAIEGNPCBY26T6OCUQ", "https://d3j4ov1z2pxjvg.cloudfront.net/lessons/eggh…- |
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", | |
"Id": "PutObjPolicy", | |
"Statement": [ | |
{ | |
"Sid": "DenyUnEncryptedObjectUploads", | |
"Effect": "Deny", | |
"Principal": "*", | |
"Action": "s3:PutObject", | |
"Resource": "arn:aws:s3:::oms-services.secrets/*", |
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 | |
# Check that the environment variable has been set correctly | |
if [ -z "$SECRETS_BUCKET_NAME" ]; then | |
echo >&2 'error: missing SECRETS_BUCKET_NAME environment variable' | |
exit 1 | |
fi | |
# Containers that are running on your container instances | |
# have access to all of the permissions that are supplied to the container instance role. |
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
# s3 bucket for storing secrets | |
ENV SECRETS_BUCKET_NAME oms-services.secrets | |
# pull secrets data | |
COPY secrets-entrypoint.sh /secrets-entrypoint.sh | |
RUN chmod +x /secrets-entrypoint.sh | |
ENTRYPOINT ["/secrets-entrypoint.sh"] | |
# ./cyclops.conf is pulled from S3 | |
CMD cyclops -c ./cyclops.conf -p 80 |
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
/** | |
* Setup Js error lazy tracking | |
* - Pros: doesn't block rendering, onload event | |
* - Cons: lower quality error reports for lazy errors | |
* | |
* @author vinhlh | |
* | |
* @param {object} window | |
* @param {object} labJs | |
* @param {string} ravenCdn |
NewerOlder