Skip to content

Instantly share code, notes, and snippets.

View gonzalez-aj's full-sized avatar

A.J. Gonzalez gonzalez-aj

View GitHub Profile
@gonzalez-aj
gonzalez-aj / SearchBar.md
Last active July 26, 2023 04:13
SearchBar JavaScript Next.JS

Search bar with dynamic routing using Next.JS in React and Fetch

Today I learned how to create a search bar to search through my data and push the result to a dynamically routed page. I searched some ways to ways to build the search bar without using the hook useRouter()

  1. Create your models
    • This is how you define the data stored in the database and how that data is saved
  2. Create your forms (using ModelForm: https://docs.djangoproject.com/en/4.2/topics/forms/modelforms)
  3. Created view
    • This makes the data (aka: context) available to the html template
  4. Create the template that interpolates the data from the view
    • This renders the form
  5. Create a URL that serves the view to users
    • EXAMPLE:
  1. Create your models
    • This is how you define the data stored in the database and how that data is saved
  2. Create your forms (using ModelForm: https://docs.djangoproject.com/en/4.2/topics/forms/modelforms)
  3. Created view
    • This makes the data (aka: context) available to the html template
  4. Create the template that interpolates the data from the view
    • This renders the form
  5. Create a URL that serves the view to users
    • EXAMPLE:
Feynman Writing Prompts - Write out explanations of the following concepts like you are explaining it to a 12 year old. Doing this will help you quickly discover any holes in your understanding. Ask your questions on Slack.
for loop
&& || !
Array
git
@max-mapper
max-mapper / 0.md
Last active February 25, 2024 12:24
JS hoisting by example

JavaScript function hoisting by example

Below are many examples of function hoisting behavior in JavaScript. Ones marked as works successfuly print 'hi!' without errors.

To play around with these examples (recommended) clone them with git and execute them with e.g. node a.js

Notes on hoisting

(I may be using incorrect terms below, please forgive me)