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
| module.exports = function(Model, options) { | |
| // Model is the model class | |
| // options is an object containing the config properties from model definition | |
| Model.defineProperty('created', {type: Date, default: '$now'}); | |
| Model.defineProperty('modified', {type: Date, default: '$now'}); | |
| } |
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
| //calculate aspect ratio | |
| // Via: http://stackoverflow.com/questions/1186414/whats-the-algorithm-to-calculate-aspect-ratio-i-need-an-output-like-43-169 | |
| function gcd (a, b) { | |
| return (b == 0) ? a : gcd (b, a%b); | |
| } | |
| var w = screen.width; | |
| var h = screen.height; | |
| var r = gcd (w, h); | |
| console.log("Dimensions = " + w + " x " + h); |
NewerOlder