Working example of the code below
Install dependencies:
npm install @reduxjs/toolkit react-redux
Working example of the code below
Install dependencies:
npm install @reduxjs/toolkit react-redux
Make sure you are running a Ruby version supported by Heroku to make your app easier to deploy later. At the time of writing, that is:
Live Server is a great tool for working with Javscript. It automatically reloads our code any time changes are made to files in the folder where Live Server is running. This becomes an issue when using a tool like json-server
with a .json
file in the same directory - since changes you make using POST/PATCH/DELETE requests will update the .json
file, these changes will also cause your app to reload.
You can solve this by telling Live Server to ignore changes to certain files. Open your VSCode preferences by pressing command + shift + p
in VSCode and searching for "Preferences: Open Settings (JSON)". Then, add the following lines to the settings.json
file:
"liveServer.settings.ignoreFiles": [
Write code that handles the following action:
<p>
tag on a webpage, change the font of the <p>
tag that was clicked to comic sans.You should be able to test your code by opening up a console on any webpage that has <p>
tags (so, pretty much any webpage... NY Times, Wikipedia, and Medium are fun) and pasting in your solution.
If you want some hints, expand the sections below.
# How to play audio from the command line using afplay. Mac only! | |
# good reading on working with processes/forks: https://saveriomiroddi.github.io/Executing-and-killing-ruby-parallel-background-jobs/ | |
# afplay: https://ss64.com/osx/afplay.html | |
# POSIX signals: https://man7.org/linux/man-pages/man7/signal.7.html | |
# Here's a simple example: | |
# play a song | |
process_id = spawn "afplay test.mp3" | |
# stop playing (make sure to use the same process_id returned by spawn) |
Today, you'll be working on building out a many-to-many domain using Active Record to practice creating associations between classes, AR-style.
Your mission: take one existing OO Ruby Practice lab, and refactor the code to use Active Record.
You're welcome to work on any old lab you like (so long as it has a many-to-many relationship). Here are some good labs to try:
git clone
.git clone
the link, and cd
into the assignment directorygit checkout -b your-name