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 kitty.js
let log = console.log;
let myObj = {}; // new Object()
// log(myObj.constructor); // function Object(){}
// log(myObj.__proto__ === myObj.constructor.prototype);
function Cat() {
//constructor for kitty
}
let kitty = new Cat();
View why-destructure.js
//Why Destructuring (and ES6) is Awesome
let person = {
id: 123,
name: "Leslie",
dob: new Date("1985-01-01").valueOf(),
age: 44,
salary: 55000,
department: "Parks and Recreation",
hometown: "Pawnee"
@prof3ssorSt3v3
prof3ssorSt3v3 / app.js
Created Feb 1, 2020
Cordova File Plugin Video Code
View app.js
/**
* cordova create [folder] [packagename] [app name]
*
* cordova platform add ios
* cordova platform add android
*
* cordova plugin add cordova-plugin-camera --variable CAMERA_USAGE_DESCRIPTION="your usage message" --variable PHOTOLIBRARY_USAGE_DESCRIPTION="your usage message"
* cordova plugin add cordova-plugin-file
*
* navigator.camera.getPicture(success, fail, options)
@prof3ssorSt3v3
prof3ssorSt3v3 / app.js
Created Jan 29, 2020
From Video tutorial about Express JS and the many types of variables and settings
View app.js
"use strict";
const express = require("express");
const app = express();
const apples = require("./routes/apples");
const port = process.env.port || 4040;
app.set("views", "./views");
app.set("view engine", "pug");
app.set("custom", "Mandalorian");
app.locals.ihave = "spoken"; //lifetime of application
@prof3ssorSt3v3
prof3ssorSt3v3 / app.css
Last active Jan 27, 2020
Cordova Reviewr iOS Starter Code W2020
View app.css
*,
*:before,
*:after {
padding: 0;
margin: 0;
box-sizing: border-box;
}
html {
font-size: 20px;
line-height: 1.7;
@prof3ssorSt3v3
prof3ssorSt3v3 / app1.js
Last active Jan 26, 2020
Express JS Routing examples for YouTube video series on Express
View app1.js
//Starter version of the main app.js file
"use strict";
const express = require("express");
const app = express();
const port = process.env.port || 4444;
app.get("/", (req, res) => {
//handle root
});
@prof3ssorSt3v3
prof3ssorSt3v3 / app.js
Created Jan 25, 2020
Using Express JS to serve static files
View app.js
"use strict";
const express = require("express");
const app = express();
const port = process.env.port || 5005;
// https://expressjs.com/en/4x/api.html#express.static
let options = {
dotfiles: "ignore", //allow, deny, ignore
etag: true,
extensions: ["htm", "html"],
@prof3ssorSt3v3
prof3ssorSt3v3 / app.js
Created Jan 25, 2020
Express Sending Responses of various types from YouTube tutorial.
View app.js
"use strict";
// https://expressjs.com/en/4x/api.html#res
const express = require("express");
const app = express();
const port = process.env.port || 3000;
app.set("view engine", "pug");
app.set("views", process.cwd() + "/views");
app.get("/", (req, res) => {
//handle route: get requests for "/"
View app.js
"use strict";
const data = require("./data"); //data.channels[n].id .name .last_update
const express = require("express");
const app = express();
app.use(express.json());
app.get("/api/channel", (req, res) => {
//return the list of channels
// respond with a 200
View app.js
//Understanding Middleware
"use strict";
const express = require("express");
const app = express();
const cors = require("cors");
const { sup, how } = require("./middle");
app.use(sup);
app.use(cors());
You can’t perform that action at this time.