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
fs.readdirSync(__dirname).filter(function(file) { | |
return (file.indexOf('.') !== 0) && (file !== 'index.js') | |
}).forEach(function(file) { | |
var model = sequelize.import(path.join(__dirname, file)) | |
var name = capitaliseFirstLetter(model.name); //ugly hack to restore uppercase | |
console.log(name); | |
db[name] = model |
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
/Users/MacBook/hashiontag/node_modules/sequelize/lib/associations/mixin.js:101 | |
throw new Error(this.name + "." + Utils.lowercaseFirst(Type.toString()) | |
^ | |
Error: comment.function (source, target, options) { | |
Association.call(this); | |
this.associationType = 'BelongsTo'; | |
this.source = source; | |
this.target = target; | |
this.options = options; |
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
db.User.findAll({ | |
attributes: ['userId', 'lastStreamUpdate'] | |
}).then(function(results){ | |
results.forEach(function(el, i) { | |
el.updateAttributes({ | |
lastStreamUpdate: Date.now() | |
}).catch(function(err){ | |
console.log(fname + 'user lastStreamUpdate error userId: ' + el.userId + ' Error: ' + err); |
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 fname = "instagramLink.js "; | |
module.exports = function instagramLink(req, res, action) { | |
var retries = 0; | |
//GET USER | |
if(action === "getuser") { | |
instaNode.user_search(req.body.screenName, function(err, users, remaining, limit) { | |
if(err) { console.log(err); return res.json({success:false}); } |
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
SELECT "Hashtag".*, "Post_Hashtag"."createdAt" as "Post_Hashtag.createdAt", "Post_Hashtag"."updatedAt" as "Post_Hashtag.updatedAt", "Post_Hashtag"."Post_postId" as "Post_Hashtag.Post_postId", "Post_Hashtag"."Hashtag_hashtagId" as "Post_Hashtag.Hashtag_hashtagId" FROM "Hashtag" AS "Hashtag", "Post_Hashtag" AS "Post_Hashtag" WHERE ("Post_Hashtag"."Post_postId"=245 AND "Post_Hashtag"."Hashtag_hashtagId"="Hashtag"."hashtagId"); |
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
[email protected] /Users/MacBook/hashiontag | |
├── [email protected] | |
├── [email protected] | |
├── [email protected] | |
├── [email protected] | |
├─┬ [email protected] | |
│ ├── [email protected] | |
│ ├─┬ [email protected] | |
│ │ └── [email protected] | |
│ └─┬ [email protected] |
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
$.validator.addMethod( | |
"regex", | |
function(value, element, regexp) { | |
var re = new RegExp(regexp); | |
return this.optional(element) || re.test(value); | |
} | |
); | |
$('#signupForm').validate({ | |
rules: { | |
username: { |
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
<!doctype html> | |
<html lang="en" class="no-js" ><!--<![endif]--> | |
<head> | |
<meta charset="UTF-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> | |
<title>{title}</title> | |
<meta name="description" content="Description."> | |
<meta name="keywords" content=""> | |
<meta name="author" content=""> |
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
{ | |
"name": "hashionable", | |
"version": "0.0.1", | |
"private": true, | |
"scripts": { | |
"start": "node ./bin/www" | |
}, | |
"dependencies": { | |
"async": "0.9.0", | |
"bcrypt-nodejs": "0.0.3", |
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
gm(rawPath).noProfile().autoOrient() | |
//parse the stream for async saving. | |
.stream(function(err, stdout, stderr) { | |
if(err) { | |
console.log('Stream error...'); | |
console.log(err); | |
return res.json({success: false}); | |
} |