# This is a list of rules for ignoring files in every Git repository on your
# computer. See https://help.github.com/articles/ignoring-files
# GitHub maintains a repository of items that can generally be gitignored
# globally safely at: https://github.com/github/gitignore/tree/main/Global
# GitHub also maintains a repository of language-specific items that should
# typically be ignored on a per-project basis with a .gitignore in that
# project's root directory.
If you'd like a user to be able to enter multi-line text and have that text render the line-breaks within HTML, read on...
As usual, use a String
property on a schema to hold the text content, for example:
const logEntrySchema = new Schema({
If you are using an enum
validator in a schema and would like to access and iterate over the enum's strings to, for example, render the <option>
tags for a <select>
element, you can access the array of strings in your controller function and pass them to your template as follows:
// models/movie.js
const movieSchema = new Schema({
...
mpaaRating: {
Using Neon for PostgreSQL Hosting
-
Sign up at https://neon.tech/.
-
You get one free "project" which can contain multiple "branches" which can contain multiple databases. Name your project something like "sei" and stick with the default "main" branch.
When errors happen in the controller, typically due to validation errors when CUD'ing MongoDB/Mongoose documents, you might want to display specific error information to the user instead of a generic error message.
Let's assume that the schema for a User model has two properties, username
& email
, that need to be unique. When a user signs up, if either property is not unique, we want to let them know which property, username
or email
, caused the error.
The demonstration code we're going to use was created by cloning mern-infrastructure and updating the userSchema
as follows:
# Py-Pac-Poe | |
print("----------------------") | |
print("Let's play Py-Pac-Poe!") | |
print("----------------------\n\n") | |
score = {'X': 0, 'O': 0, 'T': 0} | |
num_wins = int(input("How many wins to play to? ")) | |
board = {} | |
turn = 'X' | |
winner = None |
require('dotenv').config(); | |
require('./config/database'); | |
const Movie = require('./models/movie'); | |
const Performer = require('./models/performer'); | |
(async function() { | |
/*-- Write the code for each exercise below --*/ |
exports.performers = [ | |
{name: 'Natalie Portman', born: '06-09-1981'}, | |
{name: 'Kevin Bacon', born: '07-08-1958'}, | |
{name: 'Tom Cruise', born: '07-03-1962'}, | |
{name: 'Brad Pitt', born: '12-18-1963'}, | |
{name: 'Emma Watson', born: '04-15-1990'}, | |
{name: 'Carrie Fisher', born: '10-21-1956'}, | |
{name: 'Mark Hamill', born: '09-25-1951'}, | |
{name: 'Harrison Ford', born: '07-13-1942'}, | |
{name: 'Jodie Foster', born: '11-19-1962'}, |
This guide contains instructions for the Live Coding Practice session of the Technical Interviewing Basics webinar.
-
In terminal, clone the following repo to a convenient location on your computer:
git clone https://github.com/jim-clark/tech-interview-coding-challenge.git
This guide contains instructions for the Technical Screening Interview Practice session of the Technical Interviewing Basics webinar.
For quick notes and observations, the Interviewer may want to copy/paste the following "URL" into the browswer's address bar:
data:text/html,