Create a Meteor app and put the client_/server_ files in a client/server directories. Also, create a public dir to save the uploaded files.
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
| FROM ubuntu:trusty | |
| RUN \ | |
| apt-get update \ | |
| && apt-get -y install gettext-base \ | |
| && apt-get clean \ | |
| && rm -rf /var/lib/apt/lists/* | |
| ENV VALUE=foo | |
| ENV VALUE1=boo | |
| COPY config.txt source_config.txt |
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
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <title>Recursive Rendering in React</title> | |
| <script src="https://cdnjs.cloudflare.com/ajax/libs/react/0.14.2/react.js"></script> | |
| <script src="https://cdnjs.cloudflare.com/ajax/libs/react/0.14.2/react-dom.js"></script> | |
| <script src="https://cdnjs.cloudflare.com/ajax/libs/babel-core/5.8.23/browser.min.js"></script> | |
| </head> | |
| <body> |
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
| var AWS = require('aws-sdk'); | |
| AWS.config.update({ | |
| accessKeyId: '{AWS_KEY}', | |
| secretAccessKey: '{AWS_SECRET}', | |
| region: '{SNS_REGION}' | |
| }); | |
| var sns = new AWS.SNS(); |
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
| var AWS = require('aws-sdk'); | |
| AWS.config.update({ | |
| accessKeyId: '{AWS_KEY}', | |
| secretAccessKey: '{AWS_SECRET}', | |
| region: '{SNS_REGION}' | |
| }); | |
| var sns = new AWS.SNS(); |
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
| //License CC0 1.0: https://creativecommons.org/publicdomain/zero/1.0/ | |
| class Deferred extends React.Component { | |
| constructor(props) { | |
| super(props); | |
| this.state = { | |
| value: '' | |
| }; | |
| } | |
| componentDidMount() { |
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
| function sanitizeJSON(unsanitized){ | |
| return unsanitized.replace(/\\/g, "\\\\").replace(/\n/g, "\\n").replace(/\r/g, "\\r").replace(/\t/g, "\\t").replace(/\f/g, "\\f").replace(/"/g,"\\\"").replace(/'/g,"\\\'").replace(/\&/g, "\\&"); | |
| } |
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
| /* | |
| by Martin Güther @magegu | |
| just call it: | |
| uploadFile(absoluteFilePath, callback); | |
| */ | |
| var path = require('path'); | |
| var async = require('async'); |
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
| /* | |
| * Valid options are: | |
| * - chunk_read_callback: a function that accepts the read chunk | |
| as its only argument. If binary option | |
| is set to true, this function will receive | |
| an instance of ArrayBuffer, otherwise a String | |
| * - error_callback: an optional function that accepts an object of type | |
| FileReader.error | |
| * - success: an optional function invoked as soon as the whole file has been | |
| read successfully |
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
| // At top, import immutable | |
| import { Map } from 'immutable'; | |
| // Later, in constructor... | |
| this.state = { | |
| // Create an immutable map in state using immutable.js | |
| user: Map({ firstName: 'Cory', lastName: 'House'}) | |
| }; | |
| updateState({target}) { |