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
| <template> | |
| <div :class="$style.container"> | |
| <video :class="$style.video" src="./assets/test.mp4" autoplay loop controls ref="video" id="video"/> | |
| <canvas :class="$style.canvas" ref="canvas" hidden></canvas> | |
| <chart v-if="videoLoaded" :frame="frame" :color="averageColor"/> | |
| </div> | |
| </template> | |
| <script> |
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
| const test = '12131415' | |
| const input = "3294199471327195994824832197564859876682638188889768298894243832665654681412886862234525991553276578641265589959178414218389329361496673991614673626344552179413995562266818138372393213966143124914469397692587251112663217862879233226763533911128893354536353213847122251463857894159819828724827969576432191847787772732881266875469721189331882228146576832921314638221317393256471998598117289632684663355273845983933845721713497811766995367795857965222183668765517454263354111134841334631345111596131682726196574763165187889337599583345634413436165539744188866156771585647718555182529936669683581662398618765391487164715724849894563314426959348119286955144439452731762666568741612153254469131724137699832984728937865956711925592628456617133695259554548719328229938621332325125972547181236812263887375866231118312954369432937359357266467383318326239572877314765121844831126178173988799765218913178825966268816476559792947359956859989228917136267178571776316345292573489873792149646548747995 |
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
| <template> | |
| <div :class="$style.container"> | |
| <form @submit.prevent="handleSubmit"> | |
| <div :class="$style.input"> | |
| <input @change="handleFileChange" :class="$style.file" type="file" name="files[]" id="file" data-multiple-caption="{count} files selected" multiple /> | |
| <label for="file">Choose files</label> | |
| </div> | |
| <h3>Files To Upload</h3> |
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
| <template> | |
| <div :class="$style.container"> | |
| <upload-form :setUploadStatus="setUploadStatus"/> | |
| <list :isUploading="isUploading"/> | |
| </div> | |
| </template> | |
| <script> | |
| import UploadForm from '@/components/uploadForm.vue' | |
| import List from '@/components/list.vue' |
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
| import Vue from 'vue' | |
| import Router from 'vue-router' | |
| import Home from '@/components/Home' | |
| import Upload from '@/components/upload' | |
| Vue.use(Router) | |
| export default new Router({ | |
| routes: [ | |
| { |
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
| import {config, S3} from 'aws-sdk' | |
| import {aws} from 'config' | |
| import {map} from 'lodash' | |
| // Remember to add the name of your thumbnail bucket to the config file | |
| const {region, accessKeyId, secretAccessKey, uploadBucket, thumbnailBucket} = aws | |
| config.update({ | |
| region: region, | |
| credentials: { |
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
| <template> | |
| <ul :class="$style.list"> | |
| <li :class="$style.item" v-for="upload in uploads"> | |
| <router-link :to="`upload/${upload.Key}`"> | |
| <div :class="$style.header" :style="{backgroundImage: `url(${uploadBucketUL}/${sanitizeKey(upload.Key)})`}"> | |
| </div> | |
| <div :class="$style.body"> | |
| <h3>{{upload.Key}}</h3> | |
| </div> | |
| </router-link> |
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
| const AWS = require('aws-sdk') | |
| const sharp = require('sharp') | |
| const config = require('client/config/production.json') | |
| AWS.config.update({ | |
| credentials: { | |
| accessKeyId: config.aws.accessKeyId, | |
| secretAccessKey: config.aws.secretAccessKey | |
| } | |
| }) |
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
| { | |
| "name": "thumbnail-creator", | |
| "version": "1.0.0", | |
| "description": "", | |
| "main": "index.js", | |
| "scripts": { | |
| "test": "echo \"Error: no test specified\" && exit 1", | |
| "test:transform": "docker run -v \"$PWD\":/var/task lambci/lambda:nodejs6.10 handlers/transform.transform \"$(cat handlers/test.json)\"", | |
| "extract:sharp": "tar -xzvf ./sharp/tarballs/sharp-0.18.4-aws-lambda-linux-x64-node-6.10.1.tar.gz -C ./", | |
| "build:sharp": "docker build -t serverless-sharp-image ./sharp && docker run -v \"$PWD/sharp\":/var/task serverless-sharp-image && npm run extract:sharp", |
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
| # Set some variables | |
| SHARP_VERSION=$(npm show sharp version) | |
| SHARP_DIRECTORY=sharp-$SHARP_VERSION | |
| TARBALL=sharp-$SHARP_VERSION-aws-lambda-linux-x64-node-6.10.1.tar.gz | |
| # Make a working directory | |
| mkdir $SHARP_DIRECTORY | |
| cd $SHARP_DIRECTORY | |
| # NPM install sharp |