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 / check-my-understanding-1.md
Created October 11, 2019 02:47
Check my React understanding - Day 1

Do I understand...

  1. What is state?

  2. What is setState() and what does it do?

  1. What happens when I call setState()?
  1. How do the values inside the state get rendered?
@yi-mei-wang
yi-mei-wang / axios-syntax.md
Created October 16, 2019 08:09
Syntax of an axios call (GET request)

Step 1:

Install axios npm install axios

Step 2:

Import axios import axios from 'axios';

Step 3:

Use axios

@yi-mei-wang
yi-mei-wang / jwt-img-upload.md
Created October 16, 2019 15:54
JWT and Image Upload Lecture
  1. Form validation
  • Disable buttons when the form inputs are empty
  • Show error feedback
  1. JWT in header
@yi-mei-wang
yi-mei-wang / react-recap.md
Created October 17, 2019 09:38
React recap
  1. Syntax of functions (declaration with function keyword vs arrow functions)

  2. Passing props to direct children (one level)

  3. Passing props down to grandchildren (multiple levels)

<NameOfComponent nameOfProp={name of value or function}/> > <Container handleClick={this.handleClick}/> > <Button handleClick={props.handleClick}/>

  1. Import components from another file import from "";
@yi-mei-wang
yi-mei-wang / react-basics.md
Created October 18, 2019 09:20
React basics

How to manage the state

  1. state is an obj (state={})
  2. setState() - updates the state

How to use lifecycle methods

  1. render() - convert what is inside return() into HTML
  2. componentDidMount() - after the first render, only runs once
  3. componentDidUpdate() - after setState()

How to write components in React

@yi-mei-wang
yi-mei-wang / python-day-1.md
Last active October 23, 2019 06:53
Python day 1 part 2

Today's agenda!

  1. Comments

  2. Lists (just an array)

    1. Slice syntax
    2. name_of_list[start:end:step]
  3. Dictionaries (just an object)

  4. Accessing items inside a dict

@yi-mei-wang
yi-mei-wang / regex.md
Last active October 23, 2019 05:35
Regular expressions in Python

Regex in Python

  1. Use the regex library by typing

    import re
  2. A regex pattern looks like this:

r""

@yi-mei-wang
yi-mei-wang / flask_demo.md
Last active November 5, 2019 05:57
Learning points for Intro to Flask lecture

What we will do in this lecture

  1. Set up Conda env

  2. Install the necessary packages

    1. pip install flask
    2. pip freeze > requirements.txt
  3. Set up Git repo

@yi-mei-wang
yi-mei-wang / pw-todo.md
Last active November 5, 2019 02:39
Peewee To-do List

Setting up

  1. Create Conda environment
  2. Install peewee, peewee-db-evolve
  3. Save your installation into requirements.txt
  4. Create a db

Tasks

  1. Create your tables, you may refer to your todo-list schema from our previous challenge if you want