Skip to content

Instantly share code, notes, and snippets.

View yi-mei-wang's full-sized avatar
👻
Inactive on GitHub

Yi Mei Wang yi-mei-wang

👻
Inactive on GitHub
View GitHub Profile
@yi-mei-wang
yi-mei-wang / html-css-layout.md
Last active September 20, 2019 09:34
HTML & CSS summary notes

How to change the layout of HTML elements?

  1. Make use of display and position properties
  1. What is the display property?

    • Allows you to adjust how the elements are placed on the web page

    • Some most commonly used values:

@yi-mei-wang
yi-mei-wang / js-loops.md
Created July 16, 2019 13:37
16 Jul 2019 Office Hours Notes

const favSingers = [
        "Yuna",
        "Britney Spears",
        "Backsteet Boys",
        "Spice Girls",
        "Meatloaf"
];

  1. programmatically print out the numbers
  2. generate numbers from 1 to n (the number of elements inside the array)
@yi-mei-wang
yi-mei-wang / polldb.md
Last active April 26, 2019 03:58
POLL DB MODIFY

Simple adding and deleting

  1. The Texas vote is close! Add 2 new voters, and fabricate a vote for each of the 2 incumbent senators of Texas. Make up their names and info.

INSERT INTO voters
VALUES(
5001, 'Jon', 'Rain', 'male', 'democrat', '3', 24, 0, 0, 0, 0, DATETIME('now'), DATETIME('now')
);

INSERT INTO voters

@yi-mei-wang
yi-mei-wang / SQLite.md
Last active April 25, 2019 10:14
SQLite
  1. Count the votes for Sen. Olympia Snowe, whose id is 524.

sqlite> SELECT COUNT(id) FROM votes WHERE politician_id = 524;
23

  1. Now do that query with a JOIN statement without hard-coding the id 524 explicitly, querying both the votes and congress_members table.

sqlite> SELECT COUNT(votes.id) FROM votes JOIN congress_members
...> ON votes.politician_id = congress_members.id
...> WHERE congress_members.name = 'Sen. Olympia Snowe';