Notes from a course on MySQL
This file contains 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
{"lastUpload":"2020-01-22T00:55:14.384Z","extensionVersion":"v3.4.3"} |
This file contains 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
const { ApolloServer, gql } = require('apollo-server'); | |
const lifts = require("./data/lifts.json"); | |
const trails = require("./data/trails.json"); | |
const typeDefs = gql` | |
type Lift { | |
id: ID! | |
name: String! | |
status: LiftStatus |
This file contains 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
# OS generated files # | |
###################### | |
.DS_Store | |
.DS_Store? | |
._* | |
.Spotlight-V100 | |
.Trashes | |
ehthumbs.db | |
Thumbs.db |
This file contains 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
# Colors | |
Color_Off="\[\033[0m\]" # Text Reset | |
Blue="\[\033[0;34m\]" # Blue | |
Cyan="\[\033[0;36m\]" # Cyan | |
BrightBlue="\[\033[0;94m\]" # Bright Blue | |
# Git branch function | |
parse_git_branch() { | |
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/' | |
} |
This file contains 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 http = require("http"); | |
var url = require("url"); | |
var fs = require("fs"); | |
var db = {}; | |
var handleRequest = function(req, res) { | |
res.writeHead(200, {"Content-Type": "text/plain"}); | |
console.log("Request was made to URL: " + req.url); | |
// Get URL params |
This file contains 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 http = require("http"); | |
var url = require("url"); | |
var db = {}; | |
var handleRequest = function(req, res) { | |
res.writeHead(200, {"Content-Type": "text/plain"}); | |
console.log("Request was made to URL: " + req.url); | |
// Get URL params | |
var parsedUrl = url.parse(req.url, true); |
Name | URL | Request Type | Description | MongoDB Method | Sequelize Method |
---|---|---|---|---|---|
INDEX | /posts | GET | Display list of all posts | Post.find() | Post.findAll() |
NEW | /posts/new | GET | Display form to make new post | n/a | n/a |
CREATE | /posts | POST | Add new post to database | Post.create() | Post.create() |
SHOW | /posts/:id | GET | Show info about specific post | Post.findById() | Post.findById() |
EDIT | /posts/:id/edit | GET | Show edit form for specific post | Post.findById() | Post.findById() |
UPDATE | /posts/:id | PUT | Update specific post & reroute to edited post | Post.findByIdAndUpdate() | Post.update() |
DESTROY | /posts:id | DELETE | Delete specific post & reroute | Post.findByIdAndRemove() | Post.destroy() |