๐Ÿž TIL 0110

JBยท2022๋…„ 1์›” 10์ผ
0

CodeCamp FE 05

๋ชฉ๋ก ๋ณด๊ธฐ
1/33
post-thumbnail

[Terminal Commandings]

CLI: Command Line Interface

  • The code that users write in terminal (The user commands to computer)
  • Able to make folders and edit them

pwd: Print Current Working Directory

  • Folder=directory
  • This command shows where the file is located

mkdir (folder name goes here)

  • Making a new folder inside directly using terminlal

cd ../
- Shifting your file to upside

cp -r aaa bbb
- Duplicating all the contents in aaa files to bbb

rm -rf (folder name goes here)

  • Removing (the folder you select) with force

rm -rf .git

  • The user is removing the folders that tracks .git file

git add .

  • adding .git files to the storage(uploading)

ls

  • Shows all the contents inside the file

ls -al

  • Shows all the contents including hidden things inside the file.

yarn dev

  • Used for opening Live Server

[Saving to Git Hub]

To upload the projects or to save it, the user must upload the project to git hub repository.
1. Go to terminal in vs code.
2. Type git init
--> Adding the new folder to git
3. Type ls - al
--> Making sure there whether .git file appeared.
4. If .git file exists, use rm -rf .git to remove.
5. type git status
--> Green code = saved.
--> Red code = not saved yet.
6. Type git add .
--> Store arbitrarily. (the file turns into green color)
7. Type git commit -m "title"
--> Saving permanent
8. Type git remote add origin
--> It doesn't have to be named origin, but usually developers use origin.
9. Type git remote -v
--> Checking whether the code is properly being operated.
10. Type git push origin master
--> Finally saves and uploads to git hub.

  • If terminal requires enter the keychain, the user must generate new token from git hub - settings - developer setting - personal access tokens - generate.
  • The token must be generated with no expiration date, and the user must copy and paste the token to somewhere else since it is unable to check again.

[React.js]

  • react.js is basically divided 2 sections. Cosidering return() as the center part of the code, upside of return() is javascript and downside is part of HTML.
  • CSS can be written upside of the function(), or can be written in a separate file.

Regularly using CSS regarding html, the user initially declared via using division tag:

<div class="classname">Hello World</div>
.classname {
	color: black;
}

However, when the user wants to use CSS inside javascript directly, basically he/she is using CSS-in-js:

<Password>Write Down Your Password</Password>
const Password = styled.div `
	color: black;
`

--> Declare and use const and the name the user declared.
--> Const is having similar function alike using the name of class in CSS regarding HTML.
--> There requires backticks instead of curly brackets.
--> styled.div used.

[Algorithms]

#Problem Solving
Get the number of times the robot moved to the way up to 100th floor.
(The robot started moving from the 1st floor, and it can move 1-2 floors per one movement.)

let answer=0;
const limit=100;
for (let i =1; i<limit; i=i+2){
  answer= answer+1
  } 

--> the variable i is decalred as 1 since the robot starts from 1st floor. (first floor = 1 = i)
--> Written i=i+2 since the robot is moving 2 stairs per one movement.
--> One loop of 2 moving 2 stairs, one movement added to answer.

profile
๋‘๋น„๋‘๋ฐฅ๋ฐฅ

0๊ฐœ์˜ ๋Œ“๊ธ€