Skip to content

Instantly share code, notes, and snippets.

View harrisonmalone's full-sized avatar

Harrison Malone harrisonmalone

View GitHub Profile
// what is a callback function in js?
[1, 2, 3].forEach((v, i) => {
console.log(v)
})
const myFunc = (cb) => {
return cb(10)
}
// harrison will show you how to run the tests and also what lodash is
// https://www.npmjs.com/browse/depended
/*
Is Match
Tells you if the keys and values in properties are contained in object.
Example:
var stooge = {name: 'moe', age: 32};
isMatch(stooge, {age: 32});
=> true
// es5 prototype syntax
function Hero(name, level) {
this.name = name;
this.level = level;
}
Hero.prototype.shout = function() {
return `I'm ${this.name}!`;
};
const movies = require('/home/movies');
const users = require('/home/users');
function topWatchlistedMoviesAmongFriends(user_id, users, movies) {
// get current user
const currentUser = users.find((user) => user.userId === user_id)
// return an empty array if a current user can't be found
if (!currentUser) {
return []
@harrisonmalone
harrisonmalone / index.js
Last active May 26, 2020 12:02
es5 syntax for inheritance
function Person(name) {
this.name = name
}
Person.prototype.greeting = function() {
console.log(`hi`)
}
function Arm(name) {
Person.call(this, name)

Conferences for maths

Conference 1 Conference 2
Rob Michael
Danny F Ping
Jishan Iryna
Emma Thad
Alex Josh W
Danny L Georgia
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<script src="index.js"></script>
</head>
<body>
<h1>Intro to JS Lesson 👩‍💻</h1>
Q9
tables
rows
attributes
datatypes dependent on the type of rdbms, in postgres you have bigint, text, varchar etc

Project Submission Must Haves

Ensure that:

  1. You submit with the correct folder structure using docs, ppt and src correctly
  2. You have the README.md at the root of this directory and that inside of src is the root of your rails project
  3. You have instructions in your README.md of what credentials are needed to run the rails app in development
  4. You don't include your master.key and your credentials.yml.enc (when we mark your assessment we'll include our own personal credentials when running your app in dev)

Project Submission Recommendations

Explain 3 different high-level components (abstractions) in your app?

One example of a higher level component in my app is Active Record. Active record is a module with the Base class inside of it that gives our models methods through inheritance that allow us to manipulate data.

Essentially, active record can be called on our models to create, read, update and delete records. In the background it's executing SQL that does this record manipulation.