Skip to content

Instantly share code, notes, and snippets.

View louisrli's full-sized avatar

Louis louisrli

View GitHub Profile
@louisrli
louisrli / libraries.md
Last active June 22, 2021 11:35
An exercise for students to research some popular JavaScript libraries

Learning Objectives

The objective of this discussion is to expose you to some of the popular frameworks that are built on top of JavaScript or React. The goal is not for you to know how to use these, but simply understand what their intended usage is in case you want to use it at some point in time.

For each of these, I want you to answer the following questions for the class:

  1. Why does this exist? Why did people spend hundreds of hours of their time to build this?
  2. For what types of projects would you use this for?

Questions

  1. Gatsby
  2. Storybook
@louisrli
louisrli / gist:9084918
Last active September 9, 2020 01:58
vim -- automatic comment, header guard, and header inclusion
" Automatic C / C++ file headers
" (relies on automatic creation of new stars on 'o' )
function! s:insert_header()
let filename = expand("%:t")
execute "normal! i/* "
execute "normal! o" . filename
execute "normal! o"
execute "normal! oTODO: Description "
execute "normal! o"
execute "normal! o/"

Discussion Questions: Execution Context

Objectives

  • Explain JavaScript execution context in terms of English language patterns
  • Predict behavior of JavaScript's this keyword

Exercise: Context in Language

In conversation, we use pronouns to 'stand in' for the nouns they refer to. In order to understand sentences that take advantage of this 'language feature', speakers need to be able to infer the meaning from the context.

filetype on
filetype indent on
filetype plugin on
syntax on
set wildmenu
set splitright
let g:goyo_width=110
" Performance reasons, maybe
@louisrli
louisrli / gist:13f52ac417a1eeeae483f48e7317e031
Last active May 21, 2020 14:09
Props and State: Teach each other

React Props and State

Learning Goal

At the end of this activity, you should understand what props and state are and know how to use them. How? You'll teach each other!

You'll be in pairs.

  • Person 1: Responsible for props
  • Person 2: Responsible for state
@louisrli
louisrli / gist:3ab3f898d8c96a095415cce90cb964c9
Created May 21, 2020 13:39
Props and State: Teach each other
# React Props and State
## Learning Goal
At the end of this activity, you should understand what props and state are and know how to use them. How? You'll teach each other!
You'll be in pairs.
* **Person 1:** Responsible for props
* **Person 2:** Responsible for state
@louisrli
louisrli / gist:5b7753027b83bab1233186c07f925184
Created May 21, 2020 13:39
Props and State: Teach each other
# React Props and State
## Learning Goal
At the end of this activity, you should understand what props and state are and know how to use them. How? You'll teach each other!
You'll be in pairs.
* **Person 1:** Responsible for props
* **Person 2:** Responsible for state
@louisrli
louisrli / gist:ea6182b7ac913360d1fddbd9d16d5fb8
Created May 21, 2020 13:39
Props and State: Teach each other
# React Props and State
## Learning Goal
At the end of this activity, you should understand what props and state are and know how to use them. How? You'll teach each other!
You'll be in pairs.
* **Person 1:** Responsible for props
* **Person 2:** Responsible for state
@louisrli
louisrli / gist:41a3cd40e35b9d3344e300a4976c8f97
Last active May 21, 2020 13:39
Props and State: Teach each other
# React Props and State
## Learning Goal
At the end of this activity, you should understand what props and state are and know how to use them. How? You'll teach each other!
You'll be in pairs.
* **Person 1:** Responsible for props
* **Person 2:** Responsible for state
@louisrli
louisrli / components.md
Last active May 16, 2020 11:22
Component Activity

Goal

The goal of this activity is to create a reusable component in React.

Requirements

Write a React class or function component (your choice) that represents a project that you completed.

It should take the following props:

  • Project name
  • Project description