62 cards
View

287 The asset pipeline [2d]

The asset pipeline is Rails' mechanism how stylesheets, javascripts and images from your /assets folder are processed and delivered to the browser.

You have certainly already used it, but maybe do not know what happens behind the scenes.

Learn

290 Structuring CSS with the BEM pattern [4d]

We are we using the BEM pattern ("Block, Element, Modifier") to structure our CSS in all new projects. We try to migrate legacy projects to BEM, block-by-block.

Read

Read the chapter "Taming Stylesheets" from our book Growing Rails Applications in Practice (in our library).

Talk with a colleague about the reasons for the naming conventions we use:

.block
.block--element
.block.-modifier

Why are elements preceded by a double dash?

Why is it important modifiers start with -?

Feel …

295 Advanced JavaScript [3d]

Stepping forward from JavaScript Basics, the goal of this card is for you to be able to read and write more complex ES6+ and CoffeeScript code, and to migrate code from one language to another.
While we don't use CoffeeScript in new projects any more, we require you to understand it enough to work on existing projects that use it.

ES6+

  • Understand what modules are and what [export](https://developer.mozilla.org/en-US/docs/web/javascript/reference/statements/exp…

300 Javascript: Writing asynchronous code [2d]

Reading

Browse the internet to answer the following questions:

  • What are “synchronous” or “blocking” APIs versus “asynchronous” APIs?
  • Why does $.ajax not simply return the response from the server?
  • Why is asynchronous code such a big issue in Javascript (as opposed to the code we usually write in Ruby)?
  • What are "callbacks" in Javascript? Can you find examples for libraries that use callbacks to deal with asynchronity?
  • What are "promises" in Javascript? Can you find examples for libraries that use promises to deal with a…

301 Using external JavaScript libraries [1.5d]

Just like we use gems on the server, we use third party JavaScript libraries in the browser. These typically provide functionality like:

  • General support libraries like jQuery or lodash
  • Wysiwyg HTML editors
  • Datepickers
  • Sliders
  • Tooltips
  • Dialogs

Choosing and installing a JavaScript library

Take a look at the popular lodash library.

  • Try to understand what it does.
  • Lodash comes in two variants "Core build" and "Full build". Why is that? Why would you always prefer the "Core …
Deprecated

305 Internal APIs and client-side rendering

In a web application you often need to move data between the client (HTML, Javascript) and the server (Ruby, Rails).

Step 1: Moving HTML snippets

Add a find-as-you-type search to MovieDB. Above the list of movies there should be a text input that updates the list with the search results as the user is typing in the query. The user should not have to press a "Search" button (hint: you can bind to the [input](https://makandracards.com/makandra/33699-input-a-dom-event-that-is-fired-whenever-a-text-field-cha…

315 Advanced Ruby: Metaprogramming and DSLs [3d]

Rubymonk training

Read the following Rubymonk articles:

316 Advanced Ruby: More metaprogramming with Modularity and ActiveSupport::Concern [2d]

Learn about method lookup

Understand all the terms in How Ruby method lookup works, in particular:

  • include
  • extend
  • singleton class

Do you understand why object.extend(SomeModule) is the same as object.singleton_class.include(SomeModule)?

How does include and extend work together with inheritance?

Learn about metaprogramming libraries

  • Find out how ActiveSupport::Concern works.
  • Unde…

320 State machines [4d]

Requirements

Movies in MovieDB should have one of the following workflow states:

  • draft
  • pending
  • accepted
  • rejected

A movie always begins as a draft and then transitions through the states as it's getting reviewed. This could be a typical state flow for a movie:

draft => pending => rejected => pending => accepted

Change the visibility rules (Consul powers) so:

  • All users can see accepted movies of other users.
  • All users can see the movies they created themselves, regardless of their state.
  • A…

325 Consuming external APIs with Javascript [2d]

Example 1: Google Maps

  • In MovieDB, add a new field “Principal filming location”.
  • In a movie’s show view, geocode that location and show a Google map centered around it
  • Now write a Cucumber feature that tests that the map shows the correct location.

Hint:

  • Your JavaScript that creates and centers the map should expose an API that lets you query the current map position from your test.
  • Your test can use evaluate_script(...) to talk with …

326 Consuming external APIs from Ruby [1d]

Exercise 1: XML

On the Movie DB index, show a random actor who was born today:

Exercise 2: JSON

Automatically retrieve the year of a movie for any new movie entered into MovieDB, using the themoviedb.org API. For the UI this means that there is no longer a "Year" …

330 Images [1.5d]

Basics

  • Understand the difference between raster images (like .png) and vector images (like .svg).
  • Understand why a print designer talks a lot about physical measurements like "cm" and "DPI" and why this rarely matters to us.
  • Understand how JPEG compression degrades the image quality every time your save the file.
  • Understand the strengths and weaknesses of the following file formats:
    • png
    • gif
    • jpg
    • svg

High density displays

Browse the internet in order to:

  • Understand the dis…

335 Secure storage of file attachments [2d]

Read Deliver Paperclip attachments to authorized users only

Add the following feature to MovieDB:

  • Actors have a contract document
  • Only users with an admin role are allowed to upload or download contract documents
  • It should be impossible for an unauthorized user to access a contract document, e.g. by guessing the download URL

Create two implementations of this requirement:

  1. Contracts are saved to RAILS_ROOT/public/system, but incl…

345 Advanced git [2d]

Goals

  • Understand what a "fast forward" is.
  • Understand the differences between git diff and git diff --cached.
  • Undestand the difference between git reset and git reset --hard
  • Use add -p
  • Use checkout -p
  • Use git rebase.
  • Use git rebase --onto.
  • Use git rebase -i
    • Understand what it means for pushing to a remote, and for working with your colleagues
  • What does git commit --amend do?
    • Understand what it means for pushing to a remote, and for working with your colleagues
  • Understand the differences …

350 Visual design basics [2.5d]

Read the following material:

Discuss what you took away with your mentor.

Look at 3 random websites and discuss their design.

Apply at least three…

355 Requirements analysis and minimum viable UIs [3d]

Many of our clients can't or don't want to design their user interfaces. In the absence of a good UI design, you should always be able to come up with a default. Since the user interface makes up 70% of a typical web application, this is closely related to requirements analysis and cost estimation.

Learn

Talk with your mentor about the following topics:

  • Extracting nouns from requirements prose
  • Drawing ER diagrams and minimizing boxes
  • Why nouns from the client domain do not always map to Ruby models 1:1. E.g. only if a "client"…

370 Technology choice [0.5d]

Read the following chapters from our book Growing Rails Applications in Practice:

  • Surviving the upgrade pace of Rails
  • Owning your stack
  • On following fashions

Discuss each chapter with your mentor.

372 Dealing with legacy applications [0.5d]

Talk to your mentor about how we're approaching applications that are either old or adapted from a different team:

  • Add integration tests for the happy path
  • Always add tests on whatever we work on
  • Make sure setup for a new developer is as frictionless as possible (ideally it's bundle && rake db:create db:migrate)
  • Make sure deployment is as frictionless as possible
  • Setup failure notifications

Also have a look at our homepage.

This website uses cookies to improve usability and analyze traffic.
Accept or learn more