Make your terminal more usable
You're going to spend all day looking at your terminal. Make it be kind to you.
Here's a video walk-through of part 1 of this guide:
[![Play the video][image0]][hyperlink0]
This guide will make Turing's mod 1 much easier than it otherwise would be.
note: please see the updated version of this guide; if you continue reading, you'll have a far inferior experience than if you head over here: https://josh.works/turing-backend-prep-01-intro
We'll do this by working on, (and completing) a few dozen small Ruby exercises.
You might be thinking:
Josh. This already sounds like a lot of work. I just finished my prework, and I know Turing's gonna be brutal. Why should I do all of this optional work, instead of enjoying my last few days of freedom?
Learning is cool.
Learning how to learn is a super power.
Lets look at the lense of learning a new language:
At the most tactical level, we would be studying the language itself. Reading a children's book in the target language, or making and studying flashcards.
At a higher level, we would be considering how we can best study the language. Flash cards? Reading children's books in the foreign language? Passive or active learning? etc.
Turing starts soon. Have you finished all of your prework? Do you want to take your learning even farther along?
If so, read on.
We're going to talk about
I needed a URL validator - it needed to check that URL's had HTTP or HTTPS at the beginning. I initially wrote a "before save" action, but didn't like it cluttering up my model. I found a reference to basically "monkey patching" Rail's default Validator class, so that's what I did!
# concerns/url_validator.rb require 'uri' class UrlValidator < ActiveModel::Validator def validate(record) if record.url?