One Paragraph of project description goes here
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.
var mongoose = require('./index') | |
, TempSchema = new mongoose.Schema({ | |
salutation: {type: String, enum: ['Mr.', 'Mrs.', 'Ms.']} | |
}); | |
var Temp = mongoose.model('Temp', TempSchema); | |
console.log(Temp.schema.path('salutation').enumValues); | |
var temp = new Temp(); | |
console.log(temp.schema.path('salutation').enumValues); |
router.put('/:newsId', (req, res, next) => { | |
const _id = req.params.newsId; | |
const updateOptions = {}; | |
for(let ops of req.body) { | |
updateOptions[ops.propName] = ops.value; | |
} | |
// Called Update Method from News Model | |
News.update({_id}, {$set: updateOptions}) | |
.exec() |
module.exports = function(passport){ | |
let opts = {}; | |
opts.jwtFromRequest = ExtractJwt.fromAuthHeaderWithScheme("jwt"); | |
opts.secretOrKey = config.secret; | |
passport.use(new JwtStrategy(opts, (jwt_payload, done) => { | |
User.getUserById(jwt_payload.data._id, (err, user) => { | |
if(err){ | |
return done(err, false); | |
} |
{"lastUpload":"2018-04-22T20:01:49.065Z","extensionVersion":"v2.9.0"} |
{"lastUpload":"2018-03-21T06:52:08.801Z","extensionVersion":"v2.9.0"} |
xcode-select --install | |
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" | |
brew update | |
brew cask install iterm2 | |
# update iterm2 settings -> colors, keep directory open new shell, keyboard shortcuts | |
brew install bash # latest version of bash | |
# set brew bash as default shell | |
brew install fortune | |
brew install cowsay | |
brew install git |
function create_UUID(){ | |
var dt = new Date().getTime(); | |
var uuid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) { | |
var r = (dt + Math.random()*16)%16 | 0; | |
dt = Math.floor(dt/16); | |
return (c=='x' ? r :(r&0x3|0x8)).toString(16); | |
}); | |
return uuid; | |
} |
tinymce.init({ | |
selector: '#body', | |
height: 500, | |
menubar: 'file edit format help', | |
plugins: 'advlist lists link autolink autosave code preview searchreplace wordcount media table emoticons image imagetools', | |
toolbar: 'bold italic underline | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image media | forecolor backcolor emoticons | code preview searchreplace', | |
images_upload_url: '/', | |
images_upload_handler: function (blobinfo, success, failure) { | |
}, |
var buff = new Buffer(100); | |
fs.open(file, 'r', function(err, fd) { | |
fs.read(fd, buff, 0, 100, 0, function(err, bytesRead, buffer) { | |
var start = buffer.indexOf(new Buffer('mvhd')) + 17; | |
var timeScale = buffer.readUInt32BE(start, 4); | |
var duration = buffer.readUInt32BE(start + 4, 4); | |
var movieLength = Math.floor(duration/timeScale); | |
console.log('time scale: ' + timeScale); | |
console.log('duration: ' + duration); |