Recent submissions

Comment · 2 years ago
Comment · 2 years ago
We have a rails 6 app, and there's a test that essentially expects time_ago_in_words(1.year.from_now) to return "about 1 year" (as part of a user facing message). The test failed. I thought it's a flaky test but i was able to reproduce it locally. Turns out executing that code on a leap day returns "almost 1 year" instead. Can test it in rails console if you are interested:

  irb(main):001:0> include ActionView::Helpers::DateHelper
  => Object
  irb(main):002:0> distance_of_time_in_words(Date.new(2025, 2, 28), Date.new(2024, 2, 29))
  => "almost 1 year"
  irb(main):003:0> distance_of_time_in_words(Date.new(2025, 3, 1), Date.new(2024, 2, 29))
  => "about 1 year"
  irb(main):004:0> distance_of_time_in_words(Date.new(2025, 2, 28), Date.new(2024, 2, 28))
  => "about 1 year"
Comment · 7 years ago
7 hours of observation, one image every 90 seconds: that's 280 images. My phone takes 8 megapixel photos and those are about 2 MB, based on that the 870 megapixel image would be about 200 MB. 200 MB * 280 = 56 GB. Doesn't sound that much.

Did they publish the images? I'm sure many astronomers would be happy to examine them.

Comment · 9 years ago
While reading the article i thought if there's no number 6, then the universe can't have more than 5 of anything. So perhaps 5 photons and that's it. There cannot be anything else because then there would be 6 objects in the universe.
Comment · 9 years ago
If i use iTerm's autocopy feature (e.g. that the selected text automatically goes to the clipboard) and rarely press CMD+C then i'm safe? Or should i start changing my passwords? Since i usually generate passwords with `pwgen`, then copy with double click.
Comment · 9 years ago
Just out of curiosity, how long did it take for you to come up with this PoC? From the initial notice that something might be exploitable until you sent the email to slack?

Your post makes it look so easy, but it would surely take weeks for me to figure out all these things.

Comment · 9 years ago
Comment · 10 years ago
Maybe i misunderstand what permission.INTERNET permission means, but i fail to see how Google Play Games is not using the internet.
Comment · 10 years ago
> "test".indexOf("st") == "test".length - "st".length

I don't think this is a correct implementation of "endsWith".

"testtest".indexOf("st") =/= "testtest".length - "st".length

Comment · 10 years ago
Yes, but it is so annoying and confusing that these symbols are not printed on the actual keyboard. Looking at the keyboard doesn't help much when I try to press a shortcut I just saw in the menu.
Comment · 10 years ago

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton