Recent submissions

Comment · 1 year ago
Comment · 3 years ago
People say the title of the article "Ruby Outperforms C: Breaking the Catch-22" is misleading, which is true, this is about Ruby code optimized by JIT outperforming a extension written in C.

But to give some context: the author Aaron Patterson is a Ruby and a Rails core team member. The article and headline is clearly targeting the ruby community, where this article has been very well received. I think it's a good title for the intended audience.

The post clarifies in the first section:

> In this post I’d like to present one data point in favor of maintaining a pure Ruby codebase, and then discuss some challenges and downsides of writing native extensions. Finally we’ll look at YJIT optimizations and why they don’t work as well with native code in the mix.

edit: added original title of the hackernews post / article

Comment · 3 years ago
Not necessarily. Something being too fast can be confusing. If you expect a process to take some time and it ends immediately, it can feel like it failed.

I remember the people from Blogger (google) talking about this problems. People were not very familiar with blog / website builders and users were confused when their blogs got created instantly, like "This is a big deal, me getting an entire website, what happened, what went wrong? It must have aborted the process…"

Comment · 3 years ago
Comment · 3 years ago
Mine was basically ignoring all the mining, get as many food plots as possible, and focus on energy and food. Worked well against the computer, they believed there will be enough supply. But I actually bought out the warehouse and then drove prices extremely high.

So I sold food energy at a higher pricepoint than the ore. Often the AI players couldn't afford food / energy anymore and therefore their production collapsed and they did not have enough food to have enough time to change the installations on their plots.

Comment · 4 years ago
Comment · 5 years ago
Comment · 5 years ago
Nice. I did something similar recently with an iFrame where you have a form for configuring customer sites and it displays the preview in an iFrame.

I had to throw in some debouncing and special handling for hidden inputs, as changes to hidden inputs do not trigger a change event on the form.

In the end the markup was very simple and is very reusable (StimulusJS v1):

        <div data-controller="iframe-preview" data-iframe-preview-url="<%= preview_path(@letter) %>">
          <form data-target="iframe-preview.form">
             <textarea name="body">My letter</textarea>
         </form>
         <iframe data-target="iframe-preview.iframe">
        </div>
This is when StimulusJS becomes really nice, when you can compose behavior in your markup with some simple data attributes. I did not think at first that I would need this controller in other places, but a couple of weeks later, I actually needed it, and was able to reuse the controller without modification for another use case.
Comment · 5 years ago
Comment · 5 years ago
Exactly.

Basically all you to is to call a remote procedure, which you can do by adding a simple `data-reflex="click->Todo#toggle`. In the remote method you change something about the state (for example db, redis). The server rerenders the page and morphs the difference.

If you need more control you can get it by defining which elements to render and to morph.

Comment · 5 years ago
It looks beautiful, but please increase the contrast. Some texts are #aaa on #fff, which is almost illegible. This is an accessibility issue not just for people with impaired vision, also for people checking a page on a mobile phone on a sunny day.
Comment · 6 years ago
Just as you did here most people who submit a Show HN give a short description of what they did in a comment. I think it would be a good addition to include the posters top level comments in the detailed view.
Comment · 6 years ago
For people on Rails I recommend checking out https://www.heya.email/ from The guys at honeybadger. It is a paid/open source gem, that will let work with the db data instead of having to transmit all that user data to a third party.

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton