Ivan Kolmychek's blog

home about tags feed

Links: Ruby and Rails tips, local variables, virtual memory and more

13 Jan 2017

Todays batch of links contains mostly Ruby and Rails-specific articles and four questions from StackExchange - one about programming, one about virtual memory, one about workplace and one about human psychology and numbers.

Common Rails Idioms That Kill Database Performance by Honeybadger

A pretty detailed article about finding database performance issues with PostgresQLs EXPLAIN.

dalek-explain-gif

By the way, the guys at Honeybadger do listen to the feedback, which is nice. :)

Rails Security Essentials by EveryDayRails

Short post about why we should care about security in our apps and what can we do to make it a continious process.

Security is always a moving target, so a reminder once in a while that it should be a continious process (instead of one-shot effort) is probably a good thing.

Both suggested tools (brakeman and bundler-audit) are also nice.

How to write your own Rack middleware by RedPanters

Concise article about building Rack middleware. Nothing new for me, but may be a good link to share with someone who doesn’t yet know how to do it.

It also has a nice list of references and does acknowledge that it’s a general pattern, not only a rack-specific stuff, which is also good, in my humble opinion.

Data Migrations In Rails by ThoughtBot

A old but still good take on solving the problem that Rails doesn’t provide way to make data-migrations “out of the box”.

And, speaking about data migrations…

data-migrate by ilyakatz

A nice gem for making data-migrations and keeping them separated from the schema migrations.

From Rails To Hanami: Models by CodeMiner 42

A first part in series of post describing Hanami/Lotus by comparing it to Rails, starting with models.

I really hope Hanami will get much more traction, as in a lot of things right now I like its way of doing things more than what is suggested by Rails.

How To Execute Rake Tasks More Than Once

Very short tip from SolidFoundationWeb on how to execute rake tasks more than once from inside another rake task.

Stack Exchange questions:

Should we eliminate local variables if we can? @ Software Engineering SE

I’ve been a proponent of “readability over shortness” in code for a while now, and I really like top two (at the time of writing) answers: 1 and 2.

How is virtual memory actually increasing the memory space? @ SuperUser SE

An interesting question based on misunderstanding of the purposes/uses of virtual memory. The answers describe why is it used and that it’s not increasing the actual physical memory at all.

Would opting out of catered lunch be taken poorly? @ Workplace SE

Answers suggest a good way to communicate what question author is intending without being harsh or perceived as “negative”.

In general, a lot of answers on Workplace do that. Apparently, sometimes even simple rephrasing the original thought alone may go a long way in establishing good communication. Who knew. :)

Can you predict a number that is “randomly” chosen by a person better than chance? @ Skeptics SE

An interesting question about probabilities, but, again, answers are much more interesting that the question itself, as they deal with the psychology, which can give insight into the human behavior. Our users are human, right?

That’s all

I hope you enjoy this bunch of links.

If you have any feedback on this or any other post, I will be glad to receive it from you.