Skip to content

Instantly share code, notes, and snippets.

exports.uploadImageUri = function (options, cb){
var buf = new Buffer(options.image.replace(/^data:image\/\w+;base64,/, ""),'base64');
uploadPhotoFromBuffer(options, buf, function(err, data){
if(err) cb(true, 'uri upload error');
else{
cb(false, 'URI Upload Success');
}
});
};
fs.readFile(photo.path, function(err, buf){
if(err) throw (err);
var awsReq = client.put('/' + base + "." + ext, {
'Content-Length': buf.length
, 'Content-Type': photo['type']
, 'x-amz-acl': 'public-read'
});
awsReq.on('response', function(awsRes){
.home-drawer.active .viewport {
visibility: visible;
opacity: 1;
}
.home-drawer.active #container-main {
-webkit-transform: translate3d(-630px, 0, 0);
transform: translate3d(-630px, 0, 0);
}
window.UserVoice = {
events: window.UserVoice || [],
push: function(x) {
window.UserVoice.events.push(x)
},
account: {
"campaign": "footer_poweredby",
"name": "SimpleCrew",
"white_labeled": false,
var DISQUS = function(a) {
"use strict";
var b = a.DISQUS || {};
return b.define = function(c, d) {
"function" == typeof c && (d = c, c = "");
for (var e = c.split("."), f = e.shift(), g = b, h = (d || function() {
return {}
}).call({
overwrites: function(a) {
email : "max@email.com"
password : "$98s9f8uas9fajs9f8a9u9rjofijsfsf",
fullname : "max lastname",
createddate : Date,
testimonialcount : 1, //this is the first testimonial
Company : [ ]
facebookid: "23452345245", //verified with fb
linkedinid: undefined or null (whichever you prefer)
verifytype: "facebook"
profileimage: "facebook.com/max/profile.img"
email : { type: String, unique: true },
password : String,
fullname : String,
createddate : Date,
testimonialcount : String,
Company : [
{
id: { type: String, sparse: true },
name: String,
role: String,
// define the schema for our company model
var companySchema = mongoose.Schema({
id: { type: String, unique: true, sparse: true }, //Max, is this the SHORTID?
name: { type: String },
createdDate: { type: Date },
owner: {
_id : { type: Schema.ObjectId, ref: 'User' }
firstName: { type: String },
lastName: { type: String },
// define the schema for our user model
var userSchema = mongoose.Schema({
email : { type: String, unique: true },
password : String,
firstName : String,
lastName : String,
createdDate : Date,
//company permissions
Company : [{
// define the schema for our company model
var pushSchema = mongoose.Schema({
createdDate: { type: Date },
refreshedDate: { type: Date, default: null }, //timestamp when we go from "style" to "refresh" state - an owner may want to refresh social stats for a push after it has gone stale - the push will now be in a refresh state and we'll keep track of when the owner clicked "refresh" - for now this functionality is out of scope this is for future work
updatedDate: { type: Date }, // the timestamp of the last time the social stats were updated.
state: { type: String }, //"active" or "stale" or "refresh" active means we will continue to check social stats on FB/twitter and update, "stale" means we no longer need to query fb/twitter to get updates on the social stats of this push. "refresh" means we are tracking for X time again ("refresh" is out of scope for this project)
creator: {
_id: { type: Schema.ObjectId, ref: 'User', default: null } //mongo id of the user (owner/admin)