Starting with Book: Automate the Boring Stuff with Python by Al Sweigart (free online).
Current Place: https://automatetheboringstuff.com/2e/chapter6/
9/28/2024
- Downloaded Python, downloaded Mu. Run IDLE (Python GUI).
- https://gist.github.com/ for pastebin-style gh notes.
- https://inventwithpython.com/ also contains a series of free books by the author.
- bin() converts binary or format(NUMBER, ‘b’) without the 0b starter.
- THAT WOULD MAKE A BINARY CLOCK SO EASY WTF
- I feel like JS would take 50+ lines vs Python’s… 10 if I had to guess?
https://projecteuler.net/ and https://exercism.org/ for coding challenges and drills.
I almost discounted this because Python is mostly backend v. frontend. The computation is powerful and there’s no solid GUI integrations that could match HTML/CSS. Spoke with TJ (Frumbus) and he said it’s a bear vs web. Good to know.
All the same, it’s worth trudging through. I feel like going through the processing and learning how to automate a lot of things would still be worth that particular knowledge.
9/29/2024
- while and try seem interesting, good exception handling
Things aren’t clicking yet, but I’m hoping through some repetition it’ll fall into place. Knowledge through repetition. Though maybe it’s also because I’m learning so late at night (10pm now).
9/30/2024
- Tuple unpacking is an efficient way to assign to items in lists(arrays)
>>> cat = ['fat', 'gray', 'loud']
>>> size, color, disposition, name = cat
I need to give myself grace for not devouring chapters on weeknights like on weekends. This takes time.
10/03/2024
- lists[] are mutable, tuples() are immutable, and can be identified as a tuple with a trailing comma
>>> tuple('example',)
- references and values are different, will learn more on that later
- oh, it’s just a built variable
- I hate practice projects T_T Flipping an axis for a practice project was clever, just not feeling like I’m absorbing things as much right now. Hoping it comes from the repetition, my subconscious is most likely doing great works.
On to chapter 5.
10/08/2024
Dictionaries as data structures, learning keys(), values(), and items() k = category of v = values items = all
pprint (pretty print) is great for tabling console
10/12/2024
Learned about f strings
print(f"{v} {k}")
Printing formatted variables:
42 gold coin
It feels insanely embarrassing to hold the mistaken assumption that I know something, get thrown into an arena to demonstrate it, and it just proves that I know nothing.
Fuel for the fire I suppose. Good news is that means I have more I get to learn.
10/18/2024 - Pivot: Notion Clone
What if I did this instead: https://www.youtube.com/watch?v=0OaDyjB9Ib8 Fullstack Notion Clone that handles authentication security and gives a taste test with React, Convex, Tailwind, and NEXT.js. Let’s do it.
Installed using npx create-next-app@notion-clone
10/19/2024 - Actual progress
npx shadcn@latest init
is the correct one to install shadcn. Suffered a few hours and finally hit stack overflow (via Google, guess it’s still good sometimes) to find out the correct CLI; tutorial uses shadcn-ui@latest instead of the correct one.
Whups.
clear
erases all the stuff in your terminal, that’s cool.
layout is a grouping of elements as a template page is the actual page to edit
Trunk Check is a multi-tool linter/checker that live-checks your code for many common issues.
Adding an underscore to a folder name like _components
removes it from being a route/navigable. Adding parenthesis (root)
makes it an organizational folder.
Note to self since I keep forgetting:
SFC
is the Snippet Command!!
You can create layout.tsx files inside organizational folder to style the routes. Organizational folders will not be accessible via URL BUT their child files will be.
Currently in section 4: https://youtu.be/0OaDyjB9Ib8?si=4jm5V845Z7AJUlYe&t=2231
rm -rf .next
will clear the cache (.next file) in case there are caching issues.
I can call the notion-clone anything I want. “Jotion” is what’s used. Thought of Lotion/Motion. Wife says Potion, love that.
REMEMBER TO USE POTION WHENEVER ANTONIO USES JOTION
Note for resources use https://www.svgrepo.com/ for SVGs royalty-free.
Ended here for the night: https://youtu.be/0OaDyjB9Ib8?si=fChZA_e1Sjwi3qzo&t=3580
- Created components
- Learned Tailwind className descriptors
- Tailwind feels like flying in front-end WHEEEE
- import components and assets across pages and folders
- hidden organization folders
npm run dev
to fire up the localhost server.
10/20/2024
Spacing matters in TailwindCSS. md: justify-end
will not work. md:justify-end
will.
https://clerk.com/ for user auth and https://www.convex.dev/ for backend
had to use import { ConvexProviderWithClerk as ConvexClerkProvider } from "convex/react-clerk";
to avoide a naming conflict in my convex-provider.tsx file. In case this is an error carried forward.
Starting the Server
npx convex dev
to start auth functionsnpm run dev
to start localhost:3000 app
In that order. I PASSED THE ERROR. Brackets for import Link caused an error. And it works and I’m auth’d now, love this.
Ending here: https://youtu.be/0OaDyjB9Ib8?si=fROd2-eKhS0tUwvg&t=6179
The Link (vs. { Link }) import really messed me up BUT… some cool things learned:
- calling a component will automatically import it in the head of the .tsx file if you select the right autofill in VS Code
- sometimes the fix is deleting and retyping
- do the annoying stuff. the really annoying stuff you don’t want to do. there is no such thing as an easy fix the first time.