Holm :ruby: boosted

Hi, everyone!
Does anyone know of any company that is hiring remote junior developers? I have more than one year of experience in backend and I am looking for new opportunities.

I will appreciate all your RT! 🙌 :mastodon:

Holm :ruby: boosted

Random Ruby performance tip: if you are using anything more complicated than strings/symbols for hash keys, you may want to consider caching their hash values (override the Object#hash method to do so).

I even went to the library to find a good book on Simula67 since there’s so little information online

so far I've been using Brainfuck, Whitespace, and Simula67

in this year's Advent of Code I'm using a new language every day: github.com/judofyr/aoc2018

Holm :ruby: boosted

At some point, the NPM community will have to reckon with the fact that they've painted themselves into a corner with a design which makes long-term maintenance really expensive.

slowly refreshing timelessrepo.com/ so I have a place to write more articles

Holm :ruby: boosted

@judofyr we're using graphql-ruby on our backend, and while I quite like my experience so far, getting started has often been confusing. The library recently transitioned to a class-based API instead of a DSL, but much of the documentation is in an in-between state. It's quite easy to build a confusing mess, but as with all things ruby---that's probably our own fault ;). Once you get the hang of things, it's quite nice. There are definitely tradeoffs with GraphQL, but I do think it's worthwhile.

I've been having a lot of fun with a HTML DSL in Ruby recently: github.com/judofyr/tubby

it feels very React/component-like

Holm :ruby: boosted
Holm :ruby: boosted

Did you know that

User.where(id: [])

actually performs a useless ActiveRecord query?

For more nice tidbits, I recommend watching "Cache is King: Get the Most Bang for Your Buck From Ruby" when it gets processed in confreaks.tv/events/rubyconf20

Holm :ruby: boosted
Holm :ruby: boosted

Proc#<< might get merged into ruby-trunk. Functional style closure composition! Shweet!

@janko do you have any Roda best-practices for how to structure apps btw?

Holm :ruby: boosted

Now I am convinced that Roda is simpler than Sinatra.

But I need to sleep now since it is 1am now.

Holm :ruby: boosted
Holm :ruby: boosted

On ever big codebase flaky tests are part of the deal, and usually don't have enough attention or even workflow/tools to deal with them.

I wonder why I haven't found any automated test services (CircleCI/Travis/BuildKite/SemaphoreCI/etc...) with some kind of feature/help to deal with those 🤔

The trickiest part seems to be how to identify/reference them as lines/files/names change across time & branches.

Holm :ruby: boosted

Convert a string to ASCII and remove any resulting awkward spaces:

s.encode('ASCII', invalid: :replace, undef: :replace, replace: '').squeeze(' ').strip

Holm :ruby: boosted
Holm :ruby: boosted

:ruby: thought for today:

Form field validation is very different to error cases in business logic.

validates :password, length: { minimum: 8 }
validates :email, uniqueness: true

These two validations appear to be the same kind of thing, but are actually very different in terms of performance, correctness (race conditions), dependencies, etc.

Rails does not differentiate, so we slap messages on `x.errors[:base]` as a bandaid solution, because there is no proper place to put them.

Show more

A Mastodon instance for Rubyists & friends