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 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 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 fs = require('fs') | |
, path = require('path') | |
, _ = require('underscore'); | |
var rootPath = "/path/to/remove"; | |
removeDirForce(rootPath); | |
// path should have trailing slash | |
function removeDirForce(dirPath) { | |
fs.readdir(dirPath, function(err, files) { |
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
# A little Meteor CheatSheet about Iron-Router. (updated on a weekly basis) | |
# Check our Studio: https://gentlenode.com/ | |
meteor add iron:router | |
meteor update iron:router | |
# Iron Router > Configuration |
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
# A little Meteor CheatSheet about Iron-Router. (updated on a weekly basis) | |
# Check our Studio: https://gentlenode.com/ | |
meteor add iron:router | |
meteor update iron:router | |
# Iron Router > Configuration |
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
/* | |
* A quick example of how to use Bluebird and Q to conjure your own promises | |
* | |
* Everything going on here is explained further in the following video: | |
* http://youtu.be/OU7WuVGSuZw?list=PLT-DLWOBKbB4dZ83I_7Ca-sUTvorckG-E | |
* | |
*/ | |
// Import node modules | |
var Q = require('q'); |
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
var meteor_root = Npm.require('fs').realpathSync(process.cwd() + '/../'); | |
var application_root = Npm.require('fs').realpathSync(meteor_root + '/../'); | |
// if running on dev mode | |
var fs = Npm.require('fs'); | |
if (Npm.require('path').basename(fs.realpathSync(meteor_root + '/../../../')) == '.meteor') { | |
application_root = fs.realpathSync(meteor_root + '/../../../../'); | |
} | |
var assets_folder = meteor_root + '/server/assets/'; |
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
var meteor_root = Npm.require('fs').realpathSync(process.cwd() + '/../'); | |
var application_root = Npm.require('fs').realpathSync(meteor_root + '/../'); | |
// if running on dev mode | |
var fs = Npm.require('fs'); | |
if (Npm.require('path').basename(fs.realpathSync(meteor_root + '/../../../')) == '.meteor') { | |
application_root = fs.realpathSync(meteor_root + '/../../../../'); | |
} | |
var assets_folder = meteor_root + '/server/assets/'; |
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
# METEOR CORE: | |
Anywhere: Meteor.isClient | |
Anywhere: Meteor.isServer | |
Anywhere: Meteor.startup(func) | |
Anywhere: Meteor.absoluteUrl([path], [options]) | |
Anywhere: Meteor.settings | |
Anywhere: Meteor.release | |
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
SessionVar = function(key, initialValue){ | |
if (! (this instanceof SessionVar)) | |
// called without `new` | |
return new SessionVar(key, initialValue); | |
this.key = key; | |
// check if already defined | |
if( SessionVar.keys.indexOf(key) !== -1 ) | |
console.log('SessionVar(' + key + ') defined twice!'); | |
SessionVar.keys.push(key); |