Hacker Newsnew | past | comments | ask | show | jobs | submit | drzel's commentslogin

    plans = { 
      1.month => {standard: 10, pro: 50, enterprise: 100},
      1.year => {standard: 100, pro: 500, enterprise: 1000}
    }
    
    plans.each do |interval, details|
      details.each do |name, amount|
        Billing::Plan::Factory.find_or_create_by!(name: , interval:, amount:)
      end
    end


I think this is the pattern I would reach for as well, separating the data from the execution. Being declarative about the plans (either with a config file, db backend, or simply a PORO) allows the plans themselves to be agnostic to how they are used and leaves you room to write a clean API for their creation without mixing in their definition.

Also ActiveSupport has Object#with_options which has a similar intent, but I rarely ever see it used in codebases.


Exactly. Use a fancy expressive structure if you want, but don't try to abstract away the mapping between that and the general-purpose code that it relies on. "Each domain has its own rules"? How would I even know where to look for those?


Love Pico CSS. I've used it for close to a decade on https://www.fortressone.org - just works, and looks pretty enough out of the box.


FortressOne is a fork of 1996 QuakeWorld Team Fortress. International tournaments are still played and streamed in Twitch. Next weekend there will be players from around the world meeting in Sydney Australia for a in-person LAN event.


Not really an app, but I really missed playing the 1997 multiplayer-only game QuakeWorld Team Fortress, so I forked it and made FortressOne. It worked! We play most days, and wonderful community has grown around it.

https://www.fortressone.org


Great moments in this vid. Captures the scene in Australia in 2003. Focussed on Team Fortress. https://m.youtube.com/watch?v=ESzTCRsz7vY

Many of the people captured in this video still play today and have enduring friendships.


Someone do pushing shit uphill with a stick.


The copied data will one day get out of sync. And you will have a difficult and urgent issue to solve.

Query complexity on the other hand requires knowledge, to make the query work and again to make it fast. But it won’t be urgent, and having made it work you will be a better developer.

Of course, sometimes we need to copy / cache etc. but avoid it if you can.


yeah you are right I think I will try to use view, and union

this will make me a better developer!


Yep I’m in this code base a lot, and there’s a lot of this. Some of it by John’s own hand. But you know, if it works, it works. I’ve added plenty of my own bugs in the same spirit.


Adding bugs intentionally? Based


Modern QuakeWorld has the option of enabling ‘air step’ which allows surfing up stairs. I don’t think the deathmatch purists use it, but it’s become standard in FortressOne (modern QWTF fork).


In 1997 I played my first online multiplayer game. It was QuakeWorld Team Fortress. It was incredible, janky, fast, ugly, complicated and absorbing. I found a community of other players through IRC and devoted 8 hours a day to playing this treasure.

By 2005 (a very decent shelf life), the game was all but dead. This was a significant part of my life gone.

In 2018 I found the source, forked it and began FortressOne, a modern port of this classic game.

There are now a thousand people on our discord channel and daily games in four continents. I’m over the moon but more work needs to be done. This year my goal is to get it on steam.


so cool. the competitive quake 3 ctf scene was this for me. IRC from 97-2005ish was a beautiful time on the internet for me. discord seems close but doesn’t quite match that world for me for some reason.


i played a lot of TF in my life. i took a long hiatus from the HL2/Source based TF2 and decided to play again a few years after they added hats. i joined a game and quit after a few minutes, just before the barrage of crap ruined my LAN party memories.

i hope no one remakes Tribes.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: