Skip to content

Instantly share code, notes, and snippets.

@fanaugen
Created September 24, 2019 09:13
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fanaugen/876fc8fcbd8b222f532b7e50f227efa4 to your computer and use it in GitHub Desktop.
Save fanaugen/876fc8fcbd8b222f532b7e50f227efa4 to your computer and use it in GitHub Desktop.
Ruby on Ice 2019 Notes

Ruby on Ice 2019

Teach by Learning, Lead by Teaching

by Betsy Haibel

ideas from 📕 Pedagogy of the Oppressed by Paulo Freire

Motivations for learning in tech and engineering:

  • Emergency Learning (in response to a need)
    • learners are in reactive mode, learning is goal-directed

Example from a Code Retreat

quadrants: 2 dimensions: early-career devs vs. peer devs, teaching new things vs. encouraging best practices

  • avoid “teacher mode”, b/c it’s all about you
  • their learning, their problem solving, their code is about them

Seniors: lead by example. Be a role model for the kind of senior developer you would like to see your more junior coworkers become

Web Component Design

by Joy Heron

Experience: building the same kind of view over and over for different projects: a sortable, filterable data table displaying data from some kind of backend endpoint

Abstraction: Web Components

What’s in a Web Component?

  • definitely HTML to make it accessible and portable

    • tip for testing whether component is accessible: actually use a screenreader!

    📕 Inclusive Design Patterns

  • probably CSS to make it beautiful

  • possibly JavaScript to make it interactive

Tabelle project (Rails example) (on Heroku)

Workshop: Containers & Rails

Validations and Callbacks

by Tobias Pfeiffer

before_validation callbacks are a smell

  • they make tests slow because they run always (opt-out exceptions such as if email_changed? is a symptom of that)
  • they violate SRP: validation or even view specific code in the model (persistence layer)

What to do instead?

  1. Form Objects (that can, for instance, inherit from ActiveModel in order to have validations)
  2. Inheritance: e.g. use the ActiveType library to make subclasses of your models that are specific to certain use cases (e.g. SignupUser that handles the validations relevant to the signup process)
  3. Elixir: Changesets
  4. Model Operations (the approach taken by Trailblazer and Hanami) – involves a lot of boilerplate code.
    • Models are persistence-only, NO business code, NO validations in there

Lightning Talks

Philipp Tessenow: Stream CSV Data

  • you can stream in any Rack app by assigning an Enumerator to response.body
  • it’s also possible to stream data to a file from Postgres, redirect that pipe into a Ruby process, transform it into CSV on the fly, and pass the stream on to the HTTP request ✨ https://github.com/bitcrowd/sql_to_csv_stream

Diagnosing Postgres Read Performance: EXPLAIN( ANALYZE, BUFFERS ) query

Distributed Systems

…are complex, but the complexity is often abstracted away from us by client libraries that make it appear simple.

  • Communication between the nodes of a distributed system is invisible
  • Internal organization is hidden
  • Components are independent, which adds scalability and fault tolerance
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment