We'll cover two things:
- Have a great workflow
- Ask great questions
From Regis, who will cover the "workflow" portion of the spike
A few days ago, I worked on a project that was mostly about serving up basic store data (modeled after Etsy) to an API.
We had a few dozen end-points, and all responses were in JSON.
Most of the action happened inside of our controllers, and as you might imagine, our routes.rb
file was bananas.
One of the instructors made an exceptionally simple suggestion, I was embarrassed to not have seen it.
in .psqlrc
, I've got:
\set PROMPT1 '\n%[%033[1;31;40m%] ➤ %[%033[32m%]psql%033[36m%]%/ %[%033[K%]%[%033[0m%]\n\n%[%033[1;33m%]%#%[%033[0m%] '
\set PROMPT2 '%[%033[1;33m%]%##%[%033[0m%] '
\timing
\set HISTSIZE 2000
\set alldata 'SELECT * FROM '
Follow these instructions to start using Zsh:
https://github.com/robbyrussell/oh-my-zsh
I'm using the Agnoster theme:
https://github.com/agnoster/agnoster-zsh-theme
You'll have to install the Patched Solarized Fonts:
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.
D3 stands for Data Driven Documents, and it's the coolest thing ever.
Check out a few examples:
I'd like to alias awesome_print
+ the _
command in rails console
to pp
. In other words, I'd like pp[return]
to function the same as ap _[return]
.
As I'm spending more and more time in a rails console session, I'd like to be able to use awesome print to regularly evaluate objects.
I know I can enter ap _
at any time to return the prior object in awesome_print
's sweet formatting, but I want to map ap _
to pp
.
it takes six keystrokes (including return
) to hit ap _
, but only three for pp
. The problem is, I couldn't figure out a way to alias this inside of my .irbrc
.
To master anything, we need to build mental models, and build some habits around using those mental models.
For example, the first time you set up a ruby file with testing, you probably had to refer to something to come up with the right file structure.
Lets say you have dragon.rb
:
class Dragon
# maybe some attr_readers
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
if you're here from www.josh.works, here's the gist Jason sent back to me the next day, with his answers:
Jason's answers He said:
From then on, you duplicate that class variable to an instance variable. The .dup should "protect" you from one test modifying data for another test, which is a concern with class variables.
Hey Jason!