Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

Steve Griffith prof3ssorSt3v3

🎯
Focusing
Block or report user

Report or block prof3ssorSt3v3

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View express-requests.js
"use strict";
const express = require("express");
const app = express();
app.get("/", (req, res) => {
console.log(req.headers);
console.log(req.url);
console.log(req.ip);
console.log(req.hostname);
console.log(req.method); //get
View app.js
"use strict";
const express = require("express");
const app = express();
app
.get("/", (req, res) => {
console.log(req.url);
res.send("<h1>Hello</h1>"); //determine the content-type automatically
})
.post("/", (req, res) => {})
View app.js
//How to export and require modules with NODE JS
const fs = require("fs");
//const f = require("./module1.js")
// const mod = require("./module1");
const { f, P } = require("./module1");
//const y = require("./module2/bubba.js");
//const y = require("./module2/bubba");
const y = require("./module2");
View str-arr.js
//treating Strings like Arrays
let log = console.log;
let str = "Ragnar Lothbrok";
// log(str[0], str[1]);
// log(str.charAt(0), str.charAt(1));
let arr = str.split("");
let arr2 = Array.from(str);
//log(arr, arr2);
// log(arr[0], arr2[1]);
View index.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<title>Static Server</title>
<link rel="stylesheet" href="./main.css" />
</head>
<body>
View literals.js
let obj1 = {
a: "this",
b: "is",
c: "an",
d: "object",
e: "literal"
};
let obj2 = new Object(["object", "contructor", "one"]); // new Array("", "", "")
let obj3 = new Object({ an: "object", literal: "again" });
let obj4 = new Object(obj1.a); // new Object("some string") new String("asdfas")
View clip-path.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<title>CSS clip-path Property</title>
<style>
html {
font-size: 12px;
View one.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<title>Animating A Box</title>
<style>
html {
font-size: 20px;
View parse-int-float.js
let log = console.log;
let myInt = 123;
let myStrInt = "456";
let address = "456 Main Ave.";
let myFloat = 123.456;
let myStrFloat = "345.567.789.345";
let cost = "12.99 per box";
//parseInt parseFloat
log(parseInt(address)); //456
log(parseFloat(address)); //456
View scroll-snap.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<title>CSS Scroll Snap properties</title>
<style>
* {
padding: 0;
You can’t perform that action at this time.