Skip to content

Instantly share code, notes, and snippets.

SVALBOARD_LAYER(NORMAL,
// ╭──────╮ ╭──────╮ ╭──────╮ ╭──────╮ ╭──────╮ ╭──────╮ ╭──────╮ ╭──────╮
Q
// ╭────── ├──────┤ ──────╮ ╭────── ├──────┤ ──────╮ ╭────── ├──────┤ ──────╮ ╭────── ├──────┤ ──────╮ ╭────── ├──────┤ ──────╮ ╭────── ├──────┤ ──────╮ ╭────── ├──────┤ ──────╮ ╭────── ├──────┤ ──────╮
A
// ╰────── ├──────┤ ──────╯ ╰────── ├──────┤ ──────╯ ╰────── ├──────┤ ──────╯ ╰────── ├──────┤ ──────╯ ╰────── ├──────┤ ──────╯ ╰────── ├──────┤ ──────╯ ╰────── ├──────┤ ──────╯ ╰────── ├──────┤ ──────╯
Z
// ╰──────╯ ╰──────╯ ╰──────╯ ╰──────╯ ╰──────╯ ╰──────╯
[@bs.send] external dispatchEvent : (Dom.window, Dom.event) => unit = "";
[@bs.new] external makeEvent : ([@bs.string] [ | `popstate]) => Dom.event = "Event";
let initializeRouter = () =>
switch ([%external window]) {
| None => ()
| Some(window: Dom.window) => dispatchEvent(window, makeEvent(`popstate));
};
[@bs.send] external dispatchEvent : (Dom.window, Dom.event) => unit = "";
[@bs.new] external makeEvent : ([@bs.string] [ | `popstate]) => Dom.event = "Event";
let initializeRouter = () =>
switch ([%external window]) {
| None => ()
| Some(window: Dom.window) => dispatchEvent(window, makeEvent(`popstate));
};
[@bs.send] external dispatchEvent : (Dom.window, Dom.event) => unit = "";
[@bs.new] external makeEvent : ([@bs.string] [ | `popstate]) => Dom.event = "Event";
let initializeRouter = () =>
switch ([%external window]) {
| None => ()
| Some(window: Dom.window) => dispatchEvent(window, makeEvent(`popstate));
};
<script type="template" id="predator-list">
<% predators.each(function(predator) { %>
<li>
<a href="#predators/<%= predator.get('id') %>">
<%= predator.get('name') %>
</a>
</li>
<% }) %>
</script>

##dog.js: part 1

This exercise is an expansion on what we did today in class.

####Spec:

Create a Dog "class" (remember, technically there are no classes in JavaScript). Use the Constructor Function Object Creation Pattern.

A Dog must be initialized with a firstName and a lastName, plus any of the following optional properties:

On the necessity of a remediation role

I consider us to be ill-prepared with respect to remediation of struggling students. It feels as though, to a large extent, our message to those who have fallen off the horse is "tough luck". I think we need to do better, especially as GA walks the fine line between growing the product and compromising it by admitting students whose needs are difficult to meet as our instructional teams (and broader course infastructure) are presently constituted.

There is a need for a new role. This person (persons?) would:

  1. Communicate with instructional teams and identify students with a low probability of course success under its normal administration.

  2. Develop and administer process for locating specific problem areas.

# Connect to the sportz_teams database
# Define a Player class?
# Define a Team class?
# *** ^ Using ActiveRecord? ^ ***
# -- Mutation: Modifying Data
# INSERT INTO teams (name, location, slogan) VALUES ('Lemurs', 'Madagascar Bay', 'Time to climb de fence');
# INSERT INTO teams (name, location, slogan) VALUES ('Racoons', 'Jersey', 'Awwwwwwww... No.');
# INSERT INTO teams (name, location, slogan) VALUES ('Cheddarsaurs', 'Vermont', 'Time to Smile');

##nba sql

Part 1

Fire up psql and create a database called nba_db.

You will find the schema for a table called players in the file players.sql. The schema includes an id, name, age, team, games, and points.

Run the players.sql file for your nba_db by typingpsql -d nba_db -f players.sql into your terminal. This will create the players table in your nba_db. Alternatively, you can open 'psql' and paste in the contents of players.sql.

-- create database
CREATE DATABASE sportz_teams;
-- connect to database
\c sportz_teams
-- create tables
CREATE TABLE teams (id SERIAL PRIMARY KEY, name varchar(100), location varchar(100), slogan varchar(250));
CREATE TABLE players (id SERIAL PRIMARY KEY, name varchar(100), age integer, team_id integer);