commit fff73d6a371e6388de10b3d351fce75a73b7e4c0 Author: ducoterra Date: Sun Oct 25 16:06:00 2020 -0400 day0 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..eba74f4 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +venv/ \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..2783e9c --- /dev/null +++ b/README.md @@ -0,0 +1,5 @@ +# Docs + +```bash +ffmpeg -i in.mov -filter:v "setpts=0.5*PTS" out.gif +``` diff --git a/docs/day0.md b/docs/day0.md new file mode 100644 index 0000000..bbc44c9 --- /dev/null +++ b/docs/day0.md @@ -0,0 +1,193 @@ +# Day 0 + +"You wouldn't learn to carve wood with your fingernails." + +\- me + +When you start programming half the battle is getting your bearings. Suddenly it matters where you put your files. You need to know where you home directory is, you need to understand file permissions, you need to understand what a file actually *is*. Trying to program without first learning about *the thing you are programming* will cause headache. + +Fortunately we can do some things to make your life easier. We can install an IDE: a program that lets you visualize your files and folders and quickly switch between them. We can install a version control system that will let you "snapshot" your code and save it to the cloud so you never lose it. We can organize our project to be repeatable, and more importantly, unloseable. + +## Install VSCode + +Your most important tool as a programmer is a proper editor. It should offer you a wide selection of tools but get out of your way when you don't need it. VSCode is a great option in 2020. It has tons of extensions and support for almost every language you can throw at it. + +1. Head to + +2. Click on the download link + + ![vscode_download](img/day0/code_download.png) + +3. Run through the installer, select default options + +4. Open VSCode + + ![vscode_open](img/day0/vscode_open.png) + +5. Uncheck "Show welcome page on startup" + + ![vscode_uncheck](img/day0/vscode_uncheck.gif) + +6. Close out of the welcome page + + ![close_welcome](img/day0/close_welcome.gif) + +## Install Git + +Git is a version control program, but you can think of it as your best friend in the cold, dark world of data loss. Git will make sure you don't lose progress. It lets you save your code at various stages and + +1. Head to + +2. Click Download + + ![git_download](img/day0/git_download.png) + +3. Run through the default install process + +## I have a Windows PC (or skip to [I have a Mac](#i-have-a-mac)) + +### Install Python + +1. Head to + +2. Hover over Downloads and click the most recent version + + ![download_for_windows](img/day0/download_for_windows.png) + +3. Run through the install process - uncheck "install for all users" and check "add python 3.9 to path" + + ![python_windows_install](img/day0/install_for_windows.gif) + +### Create a "Projects" folder + +I keep all my projects in a folder called "Projects" in my home directory. On Windows this is at `C:\Users\username\Projects`. Create this folder now. Bookmark it, put it in your favorites, don't lose it. + +1. In your `Projects` folder create another folder called `my_website` + +2. Switch to VSCode You can use alt+tab to quickly switch between windows. Press ctrl+k+o and select the projects/my_website folder + + ![ctrl_ko](img/day0/ctrl_ko_windows.gif) + +### Create a virtual environment + +A python virtual environment is a folder that will hold your python installation for the project you're working on. You'll have a virtual environment for every project you create. + +1. With your "my_website" folder open in VSCode open the terminal with ctrl+~ + + ![open_terminal_windows](img/day0/open_terminal_windows.gif) + +2. Type `python --version` + + ![python_version_windows](img/day0/python_version_windows.gif) + +3. If you see `Python 3.9.#` you have the correct version, if you see another version try typing `python3.9 --version`. If that doesn't work you'll need to reinstall python 3.9. + +4. Type `python -m venv venv`. You'll see a folder appear on the right side of VSCode. + + ![venv_windows](img/day0/venv_windows.gif) + +5. Source your venv: type `venv\Scripts\activate`. You'll see a (venv) appear next to your terminal cursor. + + ![source_venv_windows](img/day0/source_venv_windows.gif) + +### Install Django + +Django is a pip package. Pip packages are other people's python code that you can download for free. In much the same way you downloaded VSCode and Python itself with your browser, we can download pip packages with "pip". Pip comes preinstalled with Python. + +1. Make sure you followed step 5 above, you should have a (venv) next to your terminal cursor. Type `pip install django` + + ![pip_django](img/day0/pip_django.gif) + +1. If you have a warning like above you can ignore it for now. Type `django-admin startproject config .` + + ![startproject](img/day0/startproject.gif) + +1. Click on `manage.py`. You should see VSCode activate python extensions in the bottom left and select an interpretor. ('venv': venv) should be selected. + + ![open_manage](img/day0/open_manage.gif) + +1. Close out of manage.py by clicking the 'x' at the top. + +1. Type `python manage.py runserver` + + ![runserver](img/day0/runserver.gif) + +1. Open a browser and navigate to + + ![localhost8000](img/day0/localhost8000.gif) + +1. You should see an install success page. If so, congratulations! You have successfully installed Django. + +## I have a Mac + +### Install Python + +1. Head to + +2. Hover over Downloads and click the most recent version + + ![download_python_mac](img/day0/download_for_mac.png) + +3. Follow the standard install procss + + ![install_for_mac](img/day0/install_for_mac.gif) + +### Create a "Projects" folder + +I keep all my projects in a folder called "Projects" in my home directory. On MacOS this is at `/Users/username/Projects`. Create this folder now. Bookmark it, put it in your favorites, don't lose it. + +1. In your `Projects` folder create another folder called `my_website` + +2. Switch to VSCode You can use cmd+tab to quickly switch between windows. Press ctrl+o and select the projects/my_website folder + + ![ctrl_ko](img/day0/ctrl_o_mac.gif) + +### Create a virtual environment + +A python virtual environment is a folder that will hold your python installation for the project you're working on. You'll have a virtual environment for every project you create. + +1. With your "my_website" folder open in VSCode open the terminal with ctrl+~ + + ![open_terminal](img/day0/open_terminal.gif) + +2. Type `python3 --version` + + ![python_version](img/day0/python_version.gif) + +3. If you see `Python 3.9.#` you have the correct version, if you see another version try typing `python3.9 --version`. If that doesn't work you'll need to reinstall python 3.9. + +4. Type `python3 -m venv venv`. You'll see a folder appear on the right side of VSCode. + + ![venv_mac](img/day0/venv_mac.gif) + +5. Source your venv: type `source venv/bin/activate`. You'll see a (venv) appear next to your terminal cursor. + + ![source_venv_mac](img/day0/source_venv_mac.gif) + +### Install Django + +Django is a pip package. Pip packages are other people's python code that you can download for free. In much the same way you downloaded VSCode and Python itself with your browser, we can download pip packages with "pip". Pip comes preinstalled with Python. + +1. Make sure you followed step 5 above, you should have a (venv) next to your terminal cursor. Type `pip install django` + + ![pip_django](img/day0/pip_django.gif) + +1. If you have a warning like above you can ignore it for now. Type `django-admin startproject config .` + + ![startproject](img/day0/startproject.gif) + +1. Click on `manage.py`. You should see VSCode activate python extensions in the bottom left and select an interpretor. ('venv': venv) should be selected. + + ![open_manage](img/day0/open_manage.gif) + +1. Close out of manage.py by clicking the 'x' at the top. + +1. Type `python manage.py runserver` + + ![runserver](img/day0/runserver.gif) + +1. Open a browser and navigate to + + ![localhost8000](img/day0/localhost8000.gif) + +1. You should see an install success page. If so, congratulations! You have successfully installed Django. \ No newline at end of file diff --git a/docs/img/day0/close_welcome.gif b/docs/img/day0/close_welcome.gif new file mode 100644 index 0000000..2c23370 Binary files /dev/null and b/docs/img/day0/close_welcome.gif differ diff --git a/docs/img/day0/code_download.png b/docs/img/day0/code_download.png new file mode 100644 index 0000000..1ed3475 Binary files /dev/null and b/docs/img/day0/code_download.png differ diff --git a/docs/img/day0/ctrl_ko_windows.gif b/docs/img/day0/ctrl_ko_windows.gif new file mode 100644 index 0000000..5e35fcd Binary files /dev/null and b/docs/img/day0/ctrl_ko_windows.gif differ diff --git a/docs/img/day0/ctrl_o_mac.gif b/docs/img/day0/ctrl_o_mac.gif new file mode 100644 index 0000000..08189a6 Binary files /dev/null and b/docs/img/day0/ctrl_o_mac.gif differ diff --git a/docs/img/day0/download_for_mac.png b/docs/img/day0/download_for_mac.png new file mode 100644 index 0000000..d5158f6 Binary files /dev/null and b/docs/img/day0/download_for_mac.png differ diff --git a/docs/img/day0/download_for_windows.png b/docs/img/day0/download_for_windows.png new file mode 100755 index 0000000..0530ac6 Binary files /dev/null and b/docs/img/day0/download_for_windows.png differ diff --git a/docs/img/day0/git_download.png b/docs/img/day0/git_download.png new file mode 100644 index 0000000..94db777 Binary files /dev/null and b/docs/img/day0/git_download.png differ diff --git a/docs/img/day0/git_link.png b/docs/img/day0/git_link.png new file mode 100644 index 0000000..6aa96e8 Binary files /dev/null and b/docs/img/day0/git_link.png differ diff --git a/docs/img/day0/google_git.png b/docs/img/day0/google_git.png new file mode 100644 index 0000000..13fcc90 Binary files /dev/null and b/docs/img/day0/google_git.png differ diff --git a/docs/img/day0/install_for_mac.gif b/docs/img/day0/install_for_mac.gif new file mode 100644 index 0000000..12dd700 Binary files /dev/null and b/docs/img/day0/install_for_mac.gif differ diff --git a/docs/img/day0/install_for_windows.gif b/docs/img/day0/install_for_windows.gif new file mode 100644 index 0000000..90f214f Binary files /dev/null and b/docs/img/day0/install_for_windows.gif differ diff --git a/docs/img/day0/localhost8000.gif b/docs/img/day0/localhost8000.gif new file mode 100644 index 0000000..1e13594 Binary files /dev/null and b/docs/img/day0/localhost8000.gif differ diff --git a/docs/img/day0/open_manage.gif b/docs/img/day0/open_manage.gif new file mode 100644 index 0000000..f01bbb4 Binary files /dev/null and b/docs/img/day0/open_manage.gif differ diff --git a/docs/img/day0/open_terminal.gif b/docs/img/day0/open_terminal.gif new file mode 100644 index 0000000..e06b9b6 Binary files /dev/null and b/docs/img/day0/open_terminal.gif differ diff --git a/docs/img/day0/open_terminal_windows.gif b/docs/img/day0/open_terminal_windows.gif new file mode 100644 index 0000000..4227fb5 Binary files /dev/null and b/docs/img/day0/open_terminal_windows.gif differ diff --git a/docs/img/day0/pip_django.gif b/docs/img/day0/pip_django.gif new file mode 100644 index 0000000..1a8f7db Binary files /dev/null and b/docs/img/day0/pip_django.gif differ diff --git a/docs/img/day0/python_version.gif b/docs/img/day0/python_version.gif new file mode 100644 index 0000000..3e9b059 Binary files /dev/null and b/docs/img/day0/python_version.gif differ diff --git a/docs/img/day0/python_version_windows.gif b/docs/img/day0/python_version_windows.gif new file mode 100644 index 0000000..545363b Binary files /dev/null and b/docs/img/day0/python_version_windows.gif differ diff --git a/docs/img/day0/runserver.gif b/docs/img/day0/runserver.gif new file mode 100644 index 0000000..beb7598 Binary files /dev/null and b/docs/img/day0/runserver.gif differ diff --git a/docs/img/day0/source_venv_mac.gif b/docs/img/day0/source_venv_mac.gif new file mode 100644 index 0000000..7250d25 Binary files /dev/null and b/docs/img/day0/source_venv_mac.gif differ diff --git a/docs/img/day0/source_venv_windows.gif b/docs/img/day0/source_venv_windows.gif new file mode 100644 index 0000000..b263c40 Binary files /dev/null and b/docs/img/day0/source_venv_windows.gif differ diff --git a/docs/img/day0/startproject.gif b/docs/img/day0/startproject.gif new file mode 100644 index 0000000..18999e6 Binary files /dev/null and b/docs/img/day0/startproject.gif differ diff --git a/docs/img/day0/venv_mac.gif b/docs/img/day0/venv_mac.gif new file mode 100644 index 0000000..4691579 Binary files /dev/null and b/docs/img/day0/venv_mac.gif differ diff --git a/docs/img/day0/venv_windows.gif b/docs/img/day0/venv_windows.gif new file mode 100644 index 0000000..40aa068 Binary files /dev/null and b/docs/img/day0/venv_windows.gif differ diff --git a/docs/img/day0/vscode_open.png b/docs/img/day0/vscode_open.png new file mode 100644 index 0000000..bb392df Binary files /dev/null and b/docs/img/day0/vscode_open.png differ diff --git a/docs/img/day0/vscode_uncheck.gif b/docs/img/day0/vscode_uncheck.gif new file mode 100644 index 0000000..ae50e33 Binary files /dev/null and b/docs/img/day0/vscode_uncheck.gif differ