Hacky Friday Stuff #6.12.2019
Tags: ruby, rails, tutorial, fridaystuff
Published: 2019-12-06 09:49:52

*Links about web development, product engineering, tools and services from all over the internet.*

[Ruby 2.7 adds Enumerator#produce](https://blog.saeloun.com/2019/11/27/ruby-2-7-enumerator-produce.html)
Ruby 2.7 has added Enumerator#produce to generate Enumerator from any custom data-transformation.

[How We Tracked Down an Exception Without Errors: A Detective Story](https://blog.appsignal.com/2019/10/01/tracking-down-exceptions-without-errors.html)
This is a short detective story about how we tracked down an exception in AppSignal.com’s flow that didn’t cause an error…

[Critical CSS with Rails and Webpacker - SprocketsLess Part 1](https://dev.to/adrienpoly/critical-css-with-rails-and-webpacker-sprocketsless-part-1-2bck)
This is the first of hopefully a series of articles on new advanced usage available when moving all assets to Webpacker. In the first part, we will look into optimizing your CSS size. Critical CSS and especially above the fold critical CSS is the ability to inline (in the HTML) the minimal CSS required to render the top of your page (above the fold).

[Track email statuses in Ruby on Rails with SendGrid](https://www.twilio.com/blog/track-email-status-ruby-on-rails-sendgrid)
When your application sends emails it is useful to know what happens to those emails, like whether it has been delivered or opened. Or, sometimes more importantly, whether it bounced. The Twilio SendGrid email API doesn't just send emails, it can also send you events via webhook that tell you what happened to your emails.
In this post we'll build a small application using Ruby on Rails to send emails and update their status based on the Twilio SendGrid event webhooks.

[The Complete Guide to Create a Copy of an Object in Ruby: Part I](https://medium.com/rubycademy/the-complete-guide-to-create-a-copy-of-an-object-in-ruby-part-i-91be8b9daafd)
In this article we’re going to explore the following topics:
* shallow copy and deep copy
* `dup` and `clone`
* `dup` vs `clone`

[What Everyone Should Know About Fibers in Ruby](https://www.rubyguides.com/2019/11/what-are-fibers-in-ruby/)
If you want to get the most performance out of your Ruby projects we have to explore fibers & how they work.

[The Local Variable Aversion Antipattern](http://www.soulcutter.com/articles/local-variable-aversion-antipattern.html)
Strong aversion to using local variables is something that noticeable again and again in Rails projects. In most scenarios, this has several underrecognized drawbacks. The solution is easy: use local variables.

[Refactoring Ruby with Monads](https://codon.com/refactoring-ruby-with-monads)
Monads are in danger of becoming a bit of a joke: for every person who raves about them, there’s another person asking what in the world they are, and a third person writing a confusing tutorial about them. With their technical-sounding name and forbidding reputation, monads can seem like a complex, abstract idea that’s only relevant to mathematicians and Haskell programmers.
Forget all that! In this pragmatic article we’ll roll up our sleeves and get stuck into refactoring some awkward Ruby code, using the good parts of monads to tackle the problems we encounter along the way.

[OOP Refactoring: from a god class to smaller objects](https://blog.arkency.com/oop-refactoring-from-a-god-class-to-smaller-objects/)
How to get rid of a class that knows almost everything using CQRS and DDD principles.

[Faking External Services in Tests with Adapters](https://thoughtbot.com/blog/faking-external-services-in-tests-with-adapters)
When faking external services in tests, it worth starting with a simple solution and only progress to a more complex one if needed. A simple class that acts as the public interface to adapters might be good at the beginning and then you can make an in-memory adapter for tests.

### Gems & Tools

[ezmetrics. Simple, lightweight and fast metrics aggregation for Rails.](https://nyku.github.io/ezmetrics/)

[Deno. A secure runtime for Javascript and Typescript](https://deno.land/)

### Podcasts

[Software Engineering Daily. Heroku Infrastructure with Mark Turner](https://softwareengineeringdaily.com/2019/12/04/heroku-infrastructure-with-mark-turner/)
Mark Turner is an engineer at Heroku. He joins the show to discuss the architecture and engineering of a Layer 2 cloud provider. Heroku is built on top of Amazon Web Services, and the core compute infrastructure is built on top of a pool of EC2 virtual machines that are continually scheduled with applications that users create on Heroku.

[Ruby Rogues. RR 440: Swagger and OpenAPI with Josh Ponelat](https://devchat.tv/ruby-rogues/rr-440-swagger-and-openapi-with-joshua-s-ponelat/)
The panel discusses the difference between Swagger and Open API with Josh Ponelat. Josh details the difference between the two. Swagger is a set of protocols around describing restful APIs. Swagger was taken over by a company called SmartBear, who donated the specification to the Open Linux Foundation, and that became the Open API. Swagger is the tooling surrounding these specifications. Open API is a standardized way to describe a restful API in a YAML file. Once you’ve got a YAML file to describe your API, you can use tooling like Swagger to leverage that and take it to the next level.

[Bright & Early. The Mom Test with Rob Fitzpatrick](https://www.brightandearlypodcast.com/18)
Rob talks about common mistakes people make when conducting customer interviews and how to avoid them.

### Books

[Sandi Metz. 99 Bottles of OOP](https://www.sandimetz.com/99bottles)
In honor of Sandi and Katrina’s half birthdays, 99 Bottles of OOP is 40% off December 4 - 13.

### Videos

[RubyConf 2019 - Principles of Awesome APIs and How to Build Them by Keavy McMinn](https://www.youtube.com/watch?v=NgFm7qAhv9g&feature=youtu.be)
This is a talk for those curious about designing, building, and maintaining modern APIs. We’ll look at specific tooling and strategies to help improve and maintain the quality, consistency, and stability of your API. You’ll learn how to proactively make improvements to these areas, and how to make it easier to shepherd API development in your company.

[RubyConf 2019 - Keynote: Lucky You by Sandi Metz](https://www.youtube.com/watch?v=c5WWTvHB_sA&feature=youtu.be)

[dry-rb in five: 002 dry validation (intro)](https://www.youtube.com/watch?v=dBXd8U98ugQ&feature=youtu.be)
dry-rb in five (minutes) is a series of short tutorials about [dry-rb](https://dry-rb.org/) ecosystem.
dry-validation is a data validation library that provides a powerful DSL for defining schemas and validation rules.
In today's episode, we're going to have a brief introduction to the basics of dry-validation and which problems it solves.

[Ruby Tapas Freebies](https://www.rubytapas.com/category/freebies/)
RubyTapas is one of the largest collections of Ruby-related screencasts on the web. If you're hungry for advanced Ruby and software development skills, RubyTapas will satisfy your appetite. RubyTapas is served up by Avdi Grimm.