Snippets Collections
npm init
npm install express express-generator exlint nodemon


// In package,json
"scripts": {
  ...
  "start": "node ./bin/www",
  "devstart": "nodemon ./bin/www",
  "serverstart": "DEBUG=express-locallibrary-tutorial:* npm run devstart"
  "lint": "eslint src/js"
  ...
}
  
// Express Skeleton using express-generator
express <appnam> --view=pug
cd <appname>
npm install
- Linux: 		DEBUG=express-locallibrary-tutorial:* npm start
- Powershell: 	DEBUG=express-locallibrary-tutorial:* npm start

const mongoose = require("mongoose");
const Schema = mongoose.Schema;
const dateFormat = require("dateformat");

const AssignmentSchema = new Schema({
  title: { type: String, required: true },
  description: { type: String, required: true },
  deadline: { type: date, required: true },
});

AssignmentSchema.virtual("date").get(function () {
  return dateFormat(this.timestamp, "mmmm dS, yyyy, h:MM:ss TT");
});

module.exports = mongoose.model("Assignment", AssignmentSchema);
/* Vertically Centering Text */
.parent {
  position: relative;
}

.child {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
}

/* Horizontally Center */
.text {
  text-align: center;
}
div {
  margin: 0;
  position: absolute;
  top: 50%;
  left: 50%;
  -ms-transform: translate(-50%, -50%);
  transform: translate(-50%, -50%);
}
  .example{
          height: auto;
          position: absolute;
          bottom: 45px;
          width: 100%;
          max-width: 80rem;
          left:50%;
          transform: translate(-50%, 0);
  }
.container {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}
star

Thu Sep 23 2021 14:46:24 GMT+0000 (Coordinated Universal Time)

#css #design #center
star

Fri Sep 10 2021 12:29:54 GMT+0000 (Coordinated Universal Time)

#css #design #center
star

Fri Sep 03 2021 10:54:39 GMT+0000 (Coordinated Universal Time)

#css #design #div #center #imp
star

Wed Mar 17 2021 09:25:58 GMT+0000 (Coordinated Universal Time)

#css #absolute #position #center
star

Sun Feb 28 2021 18:56:49 GMT+0000 (Coordinated Universal Time)

#absolute #center

Save snippets that work with our extensions

Available in the Chrome Web Store Get Firefox Add-on Get VS Code extension