PointFactory builds an RGeo point, DRYing up similar calls across the codebase. Instead of returning the raw point, however, I define `lng` and `lat` methods on it, which are just aliases. This makes the resulting object more ergonomic without bike-shedding bigger tools like inheritance.
2/2
07.08.2025 07:24 โ ๐ 1 ๐ 0 ๐ฌ 0 ๐ 0
require "rgeo"
module PointFactory
REFERENCE_SYSTEM = 4326
def self.build(lng:, lat:)
raw_point_factory.point(lng, lat).tap do |point|
def point.lng = x
def point.lat = y
end
end
def self.raw_point_factory
@raw_point_factory ||= RGeo::Geographic.spherical_factory(srid: REFERENCE_SYSTEM)
end
end
Today I used a little technique I picked up from a @kaspth.com workshop: defining methods directly on objects.
1/2
07.08.2025 07:24 โ ๐ 1 ๐ 0 ๐ฌ 1 ๐ 0
In which counterworld do you live?
07.08.2025 05:19 โ ๐ 1 ๐ 0 ๐ฌ 0 ๐ 0
A "procedure" is as much of an object as a "user", a "controller" or a "cat". The fact that some things are more clearly described as a sequence of operations does not make them "not object oriented". And even if it did, who cares!
Good code describes the flow of information effectively. That's it.
06.08.2025 10:04 โ ๐ 5 ๐ 1 ๐ฌ 1 ๐ 0
Love this!
06.08.2025 08:29 โ ๐ 1 ๐ 0 ๐ฌ 0 ๐ 0
Thatโs no caterpillar, itโs a snake.
05.08.2025 09:07 โ ๐ 1 ๐ 0 ๐ฌ 1 ๐ 0
I love this.
05.08.2025 08:43 โ ๐ 3 ๐ 0 ๐ฌ 0 ๐ 0
โฆohhhh
04.08.2025 19:48 โ ๐ 0 ๐ 0 ๐ฌ 0 ๐ 0
I wear crocs all the time at home and in the garden. Have no kids.
04.08.2025 19:46 โ ๐ 2 ๐ 0 ๐ฌ 1 ๐ 0
If either of you do, please report back!
Iโm not sure what Iโd make of seeing this on a cv tbh.
03.08.2025 19:13 โ ๐ 1 ๐ 0 ๐ฌ 0 ๐ 0
Code Complete is timeless. Need to re-read it, really.
03.08.2025 14:36 โ ๐ 2 ๐ 0 ๐ฌ 0 ๐ 0
The Linux Foundation
The Linux Foundation online learning classes
TIL The Linux Foundation offers a course + certificate for $79 on JSON and YAML.
JSON. And YAML.
I wonder who this is targeted at.
trainingportal.linuxfoundation.org/courses/open...
trainingportal.linuxfoundation.org/courses/open...
03.08.2025 14:11 โ ๐ 4 ๐ 1 ๐ฌ 1 ๐ 0
This, I agree with.
03.08.2025 10:30 โ ๐ 1 ๐ 0 ๐ฌ 0 ๐ 0
Didnโt mean to be reductive. Fantastic post! /o is crazy.
02.08.2025 20:04 โ ๐ 1 ๐ 0 ๐ฌ 1 ๐ 0
If you see this, post a castle.
youtu.be/qZwr511qGoY
02.08.2025 19:02 โ ๐ 3 ๐ 0 ๐ฌ 0 ๐ 0
As a Brit living in The Netherlands, I feel conflicting emotions.
02.08.2025 18:58 โ ๐ 1 ๐ 0 ๐ฌ 0 ๐ 0
If developers focused on optimisation as much as they used to, you would also not have nearly as much (useful) software.
02.08.2025 15:11 โ ๐ 3 ๐ 0 ๐ฌ 1 ๐ 0
TL;DR: never use /o. Thanks!
02.08.2025 15:09 โ ๐ 3 ๐ 0 ๐ฌ 1 ๐ 0
Live coding sucks
Why I believe live coding is NOT fair
Live coding interviews measure stress, not coding skills hadid.dev/posts/living... HN discussion news.ycombinator.com/item?id=4475...
01.08.2025 17:44 โ ๐ 3 ๐ 2 ๐ฌ 0 ๐ 0
I like to think that people whom I compliment feel about 1/10 as good as I feel when I receive a compliment, and that makes it a very worthwhile investment.
01.08.2025 14:09 โ ๐ 2 ๐ 0 ๐ฌ 0 ๐ 0
Well, you've definitely succeeded in the interesting department!
01.08.2025 14:08 โ ๐ 0 ๐ 0 ๐ฌ 0 ๐ 0
This might just be the trade-off of the framework having strong opinions. In general I think that has been a great thing, but it leaves Rubyisms which aren't Railsisms in the shadow.
01.08.2025 11:30 โ ๐ 1 ๐ 0 ๐ฌ 0 ๐ 0
Very neat work, and quick too!
01.08.2025 11:27 โ ๐ 1 ๐ 0 ๐ฌ 0 ๐ 0
Screenshot of a part of the Minitest changelog:
5.0.0 / 2013-05-10
Oh god... here we go...
And now onto the other Ruby 2.3 (but Sinatra this time) codebase of the week, and I know I'm in for some pain.
01.08.2025 11:01 โ ๐ 4 ๐ 0 ๐ฌ 0 ๐ 0
They nailed the zero-uptime upgrade, though.
01.08.2025 06:14 โ ๐ 1 ๐ 0 ๐ฌ 0 ๐ 0
The other side of this is that `ActiveRecord::Type::Serialized` refuses to serialize default values. Another facet is that MySQL doesn't let you set defaults on TEXT columns.
Hahaha monkey-patches go brrrrrr.
31.07.2025 14:37 โ ๐ 1 ๐ 0 ๐ฌ 0 ๐ 0
rails/activerecord/lib/active_record/attribute_methods/dirty.rb at 3c194d4a8d585547d1fe45f596d2800c155b1a4c ยท rails/rails
Ruby on Rails. Contribute to rails/rails development by creating an account on GitHub.
TIL that non-nullable serialized attribute columns without a default will break in Rails 4.1 and/or 4.2 because of changes to Dirty.
I didn't need to discover that, but I did. And now, so did you.
github.com/rails/rails/...
31.07.2025 13:37 โ ๐ 1 ๐ 0 ๐ฌ 1 ๐ 0
If you're feeling down, just remember: you could always be working on a Rails 4.0 / Ruby 2.3 codebase like I am this week.
31.07.2025 12:27 โ ๐ 11 ๐ 0 ๐ฌ 4 ๐ 0
Not from the Space Invaders prompt, I hope.
30.07.2025 16:02 โ ๐ 0 ๐ 0 ๐ฌ 0 ๐ 0
So that's what his eyes look like!
30.07.2025 16:00 โ ๐ 0 ๐ 0 ๐ฌ 0 ๐ 0
The next evolution of SQLite
tur.so/discord
tur.so/github
I'm writing a book: Kill the HiPPO: How small, bootstrapped software companies decide what feature to build next.
Follow along or be a beta reader at killthehippo.com
A good old fashioned blog that has been covering tech, law, policy, and democracy for almost three decades now.
I help small teams do big things and help big teams have big impact. And I build GoodJob, Day of the Shirt, Panlexicon, and Brompt too.
The Hotwire Native guy - I help Ruby on Rails developers build server-powered Android and iOS apps with Hotwire Native.
Blog + newsletter: masilotti.com
Trans girl (They/Them). Rubyist. This is where I tweet about computers.
Mostly posts about gummi bears, space probes, and Ruby.
OSS contributor, maintaining Nokogiri, SQLite3, Rails::Html::Sanitizer, Mechanize, and more in the Ruby ecosystem.
Working at 37signals. Former Shopify, VMware, Pivotal, Bloomberg, various startups.
Author of Sustainable Web Development with Ruby On Rails, https://sustainable-rails.com - former Mood Health, Stitch Fix, LivingSocial, Opower. I play bass and love to scuba dive.
I want you to win and be happy. Code, OSS, STEM, Beyoncรฉ, T1D, open source artificial pancreases, Portland, 3D printing, sponsorship http://hanselminutes.com inclusive tech podcast! VP of Developer Community @ Microsoft ๐ฎ
http://hanselman.com/about
Computers bend to my will. https://jardo.dev
Voor een diervriendelijke samenleving. Al 160 jaar. Doe mee!
Bezoek onze website: www.dierenbescherming.nl
Adopteer een dier: www.ikzoekbaas.nl
Kom bij ons werken: www.dierenbescherming.nl/vacature-overzicht
Help kittens: bit.ly/43nRm42.
Head gardener, @graceful.dev. Code cleric, software coach and consultant, author, Ruby Hero, recovering podcaster, and very tired dad of many kids. He/him.
Home: http://avdi.codes
Staff Random Engineer at GitLab. Creating some magic!
https://buymeacoffee.com/vitallium
The largest and longest running annual Ruby conference in Europe (since 2003). Community driven.
2025 edition will be held in Viana do Castelo, Portugal: https://2025.euruko.org
Independent AI researcher, creator of datasette.io and llm.datasette.io, building open source tools for data journalism, writing about a lot of stuff at https://simonwillison.net/
APM for Ruby, Elixir, Python & Node.js
Support: support@appsignal.com
Rubyist. Leading Hanami, dry-rb, ROM. I love programming!
Canberra, Australia. he/him.
https://timriley.info/
Video courses, content, and tutorials that will make you a better Ruby and Rails developer at https://beautifulruby.com
Linux on desktop is happening. I'm permanently building something.
http://devtui.com and http://poshtui.com