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
| echo "PUT YOUR MAIL BODY HERE" | mailx -s "SUBJECT" -S smtp=smtp://yoursmtpserver.com -S smtp-auth=login -S smtp-auth-user=YOUR_USERNAME -S smtp-auth-password=YOUR_PASSWORD -S from="Sender Name <[email protected]>" [email protected] |
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
| app.get('/questions/intTags' , function (req ,res) { | |
| console.log(req.query.data) | |
| var data = [ | |
| { "text": "Tag1" }, | |
| { "text": "Tag2" }, | |
| { "text": "Tag3" }, | |
| { "text": "Tag4" }, | |
| { "text": "Tag5" }, | |
| { "text": "Tag6" }, | |
| { "text": "Tag7" }, |
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 mongoose = require('mongoose'); | |
| var counter = mongoose.Schema({ | |
| type: { type: String, index: { unique: true }}, | |
| seq: Number | |
| }); | |
| // create the model for users and expose it to our app | |
| module.exports = mongoose.model('counter', counter); |
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
| use admin | |
| db.createUser( | |
| { | |
| user: "admin", | |
| pwd: "alum123#", | |
| roles: [ { role: "userAdminAnyDatabase", db: "admin" } ] | |
| } | |
| ) | |
| db.createUser( |
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
| app.directive('autofit', function(){ | |
| return function(scope, element, attrs){ | |
| var span = element.find('span:visible:first'); | |
| var maxHeight = element.height(); | |
| var maxWidth = element.width(); | |
| var originalFontSize = parseInt(element.css('font-size').replace('px',''),10); |
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 rejectFolders = ['css', 'bower_components' , 'js', 'fonts' , 'assets'] | |
| app.use(morgan('tiny', { | |
| skip: function (req, res) { | |
| if(rejectFolders.indexOf(req.url.split('/')[1]) != -1 ){ | |
| return true | |
| } else { | |
| return false | |
| } |
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 validUrl = require('valid-url'); | |
| if(validUrl.isUri(imageUrl)){ | |
| request | |
| .get(imageUrl) | |
| .on('response', function (response) { | |
| console.log(response.statusCode) | |
| imagesName = (imagesName.split('?')[0]) | |
| if (response.statusCode == 200) { |
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
| res.locals.titleGenerator = function () { | |
| var urlPath = (req.route.path).split('/') | |
| var urlName = urlPath[1]; | |
| function capitalizeEachWord(str) { | |
| return str.replace(/\w\S*/g, function (txt) { | |
| return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase(); | |
| }); | |
| } |
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
| <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css"> | |
| <link rel="stylesheet" type="text/css" href="components/bootstrap-daterangepicker/daterangepicker-bs3.css"> | |
| <script type="text/javascript" src="https://code.jquery.com/jquery-2.1.1.min.js"></script> | |
| <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/js/bootstrap.min.js"></script> | |
| <script type="text/javascript" src="https://raw.githubusercontent.com/dangrossman/bootstrap-daterangepicker/master/moment.js"></script> |
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
| jQuery(document).ready(function(){ | |
| setTimeout(function(){ | |
| jQuery.fn.simulateClick = function() { | |
| return this.each(function() { | |
| if('createEvent' in document) { | |
| var doc = this.ownerDocument, | |
| evt = doc.createEvent('MouseEvents'); |
NewerOlder