show dbs
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
:root { | |
--color-red: red; | |
} | |
* { | |
margin: 0; | |
padding: 0; | |
} | |
*, |
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
"scripts": { | |
"server": "live-server", | |
"watch:sass": "node-sass sass/main.scss css/style.css -w", | |
"dev": "npm-run-all --parallel server watch:sass", | |
"compile:sass": "node-sass sass/main.scss css/style.comp.css", | |
"concat:css": "concat -o css/style.concat.css css/icon-font.css css/style.comp.css", | |
"prefix:css": "postcss --use autoprefixer -b \"last 10 versions\" css/style.concat.css -o css/style.prefix.css", | |
"compress:css": "node-sass css/style.prefix.css css/style.css --output-style compressed", | |
"build:css": "npm-run-all compile:sass concat:css prefix:css compress:css" | |
} |
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
@mixin respond ($breakpoint) { | |
@if $breakpoint==laptop { | |
@media only screen and (max-width: 1000px) { | |
@content; | |
} | |
} | |
@if $breakpoint==tablet { | |
@media only screen and (max-width: 600px) { | |
@content; |
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
module.exports = { | |
config: { | |
// default font size in pixels for all tabs | |
fontSize: 13, | |
// font family with optional fallbacks | |
fontFamily: 'Roboto Mono, Menlo, "DejaVu Sans Mono", Consolas, "Lucida Console", monospace', | |
// terminal cursor background color and opacity (hex, rgb, hsl, hsv, hwb or cmyk) | |
cursorColor: 'rgba(248,28,229,0.8)', |
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
{ | |
"workbench.colorCustomizations": { | |
"titleBar.activeBackground": "#FF2C70", | |
"titleBar.inactiveBackground": "#FF2C70CC" | |
} | |
} |
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
// instance properties (set it to arrow fn) | |
handleChange = (e) => { | |
const { name, type, value } = e.target; | |
const val = type === "number" ? parseFloat(value) : value; | |
this.setState({ [name]: e.target.value }); | |
}; |
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
import App from "next/app"; | |
import HomePage from "../components/HomePage"; | |
import "../styles/global.css"; | |
export default class MyApp extends App { | |
static async getInitialProps({ Component, ctx }) { | |
let pageProps = {] | |
if (Component.getInitialProps) { | |
pageProps = await Component.getInitialProps(ctx); |
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 express = require("express") | |
const router = express.Router(); | |
const Todo = require("../models/todo") | |
router.get("/todos", (req, res, next) => { | |
Todo.find({}, "action") | |
.then(data => res.json(data)) | |
.catch(next); | |
}) |
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 bcrypt = require("bcryptjs") | |
const jwt = require("jsonwebtoken") | |
// The client sends post request here with `name, email and password` as its body | |
// which are processed and stored in our database | |
router.post("/", async (req, res) => { | |
const { name, email, password } = req.body; | |
// Simple validation |