Skip to content

Instantly share code, notes, and snippets.

@Rhoxio
Created November 30, 2019 09:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Rhoxio/dcb30cdf9c30abc58d504e1ccd9386a2 to your computer and use it in GitHub Desktop.
Save Rhoxio/dcb30cdf9c30abc58d504e1ccd9386a2 to your computer and use it in GitHub Desktop.
This file is meant to hold links and information that might be useful in your post-bootcamp job search. I would highly recommend doing the suggested exercises - they will progressively get more challenging, but it's nothing that's out of your reach if you understand the previous section in the list! I would VERY HIGHLY recommend taking the time the actually do the exercises, as it will solidify your ability to write code that manipulates strings, accesses data, does some math, and iterates over sets of data. This stuff is absolutely at the core of being able to work as a web developer.
Rails is awesome, but knowing how Ruby works is a much more valuable usage of your time right now. This is how you are going to be able to pass technical interviews and provide value from day one (the most enticing thing for any company looking to hire juniors) at your job-to-be. This is also a precursor to being able to learn other languages, as enough mastery of the first makes a huge difference in the long run as you can more easily draw parallels and get functionality rolling after getting everything set up.
The challenges are meant to be hard and require you to do your own research outside of the links provided.

Ruby

Initial Review:

It is a good idea to freshen up on how basic Ruby syntax and operations work. This is a good article to jog your memory about some of the things you can do: https://medium.com/the-renaissance-developer/ruby-101-the-basics-f10961f990ac

I'm sure you ran into some bugs when trying out the code above - so it would really help to know how to read error messages more efficiently. It takes practice to be able to quickly debug issues, so don't feel discouraged if you can't decipher them naturally yet. This article is a good overview of the most common ones you may run in to: https://learn.co/lessons/ruby-lecture-reading-error-messages In lieu of following their instructions, you should be able to just open up irb or make a new ruby file and run it to see the error outputs. You can do the testing stuff if you want, but it's not the main focus of this exercise. The beginning of the video has a good directory structure for ruby projects in general.

Next, you should remind yourself about what data structures are available to you in Ruby. You should be comfortable setting up Arrays and Hashes, as you will be using them all the time in web development. Let me reiterate: All. The. Time. I would suggest playing with some of the code in this article and making your own sets of data instead of copy-pasting: https://medium.com/the-renaissance-developer/ruby-101-data-structures-7705d82ec1

Check out the Ruby enumerable module and try to figure out a use for each of the methods. Most of the time, they will work on arrays or hashes. Some of them may seem really confusing (because they are - trust me), so don't feel ashamed to skip around and try things that look easy or cool. The idea is to get you used to thinking about the types of operations you can do on sets of data: https://ruby-doc.org/core-2.6.5/Enumerable.html

Finally, I would suggest creating an analogue of a real-life object that interacts with another object in Ruby. A familiar example would be something like the 'Animal that can Eat' found here: https://github.com/Rhoxio/teaching-materials-2019/blob/master/object_oriented/animal_that_can_eat.rb Give it some advanced functionality - it should have at least one array and hash as an instance variable that you use fairly regularly. Methods that group together instance variables like #stats in the Animal class or #nutrition in Food work, too.

Mid-Level Challenges

Make sure you understand how to read and write to files using Ruby. This is a key skill and is considered basic knowledge when it comes to job hunting, so make sure you understand how to read, write, and append to files. This is the base concept of how databases work (reading and writing to a file in an efficient and structured manner): https://www.rubyguides.com/2015/05/working-with-files-ruby/

Using your custom class (Animal & Food in my case) you set up earlier, you should practice saving certain data to a JSON file as a sort of pseudo-database. You will need to implement #save and #get_all functionality, and should be able to #load all of the saved models with the correct data in them. You can convert Ruby Hashes (you will need to pull relevant data from the model itself) into JSON format, which can be saved and pulled from a file and parsed immediately - here's an example: https://stackoverflow.com/questions/3183786/how-to-convert-a-ruby-hash-object-to-json #to_json will return a string, so it may just be a matter of writing that string directly to a file to mirror #save functionality in Rails.

If you are able to complete the exercises above, I would say you are good to start working on Rails apps again!

However... I really want to stress how important it is to have a certain level of confidence and efficacy in one language (Javascript being the only exception, as you need it for the front-end) as this builds a baseline for everything else. I would recommend you start brainstorming a Rails app you'd like to build as a post-bootcamp stretch challenge. If you understand the information given above, you will find that building functionality is exponentially easier and your app will have the capacity to be much more than just a webpage that does one or two things.

Webhooks:

Webhooks are a way to make it so your front-end can openly communicate with your back-end Ruby code to keep data in all connected clients (people in a chatroom, for example) up-to-date. Below is a good example of a basic Rails chat app that comes with some decent initial styling. https://iridakos.com/programming/2019/04/04/creating-chat-application-rails-websockets

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment