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

Be aware that if you run it on the internet other people will find it. I had one open to the web for a bit and was a bit surprised how many systems started making requests to it.


I suspect they are using the 50-75 character rule for the text [0]. It makes the page look empty with so much white space. For me 100 characters is a better line length as I prefer to scan text on the web over reading it and the page doesn't look as empty.

[0] https://en.wikipedia.org/wiki/Line_length#Electronic_text


Sounds like you have the opportunity to make the map better for yourself and everyone else. The data comes from Open Street Map which is community edited and maintained https://www.openstreetmap.org



Awesome little project! I went through the US state flags and found that you are using the old Mississippi flag.

https://en.wikipedia.org/wiki/Flag_of_Mississippi


The official Afghanistan flag did also change.

https://en.m.wikipedia.org/wiki/Flag_of_Afghanistan


Good catch. The flag images come from https://flagpedia.net/. I'll notify the maintainer.


Fun ASCII gotcha: [A-z] includes [ ] \ ^ _ and `


I think this is why I usually see `[A-Za-z]` for ascii. My previous employer decidedly ignored "non-english" text.

`[A-z]` -> https://regex101.com/r/IlhPiD/1 `[A-Za-z]` -> https://regex101.com/r/iWjwf2/1

After looking it up, `\p{L}` looks like it matches letters https://regex101.com/r/1UiG9S/1.


Nvim has some plugins and features that do some of the things you might be interested in. Telescope[0][1] which is a fuzzy finder for anything you can think of (files, symbols, color themes, etc.[2]). The LSP and Treesitter stuff in nvim 0.5+ is also pretty cool. If you want to just try it without much work the Lunarvim[3] project comes with sane defaults and included plugins (including Telescope).

Lua as the default configuration language makes things simple to configure as well.

Having said all that...if someone told me [insert-text-editor] had everything I would want I would probably check it out and go home to vim (but I do enjoy learning about new stuff and features).

[0] https://github.com/nvim-telescope/telescope.nvim

[1] https://www.youtube.com/watch?v=65AVwHZflsU -- demo video

[2] https://github.com/nvim-telescope/telescope.nvim#vim-pickers

[3] https://www.lunarvim.org/


I already configured something philosophically similar using Unite. Is it worth it to migrate to Lua?


I do need to try nvim again, I'm sure there's a lot of new amazing plugins.


Apollo: Missions to the Moon[0]

There is no narrator for this documentary. All of the "narration" is from recorded tv, radio, and home movies from the time. It is really inspiring to watch humans overcome Earth's gravity to get to the Moon as it happened over 50 years ago.

[0] https://www.natgeotv.com/int/apollo-missions-to-the-moon


You can define your own `$` function. This way you can have the clean code without the entire jQuery library

    function $(arg) {
        if (arg.charAt(0) == "#") {
            // HTML spec does not support ids to start with numbers [0]
            // (you may not need this conditional on your website)
            return document.getElementById(arg.slice(1))
        }
        return document.querySelector(arg)
    }
Using this function you can select your comment with

    $('#27677234')
jQuery does add many extra features but if clean code is the only thing you are after there are other options.

[0] https://www.w3.org/TR/html4/types.html#type-id


The HN js actually does just this. The file isn't very long but has some great functions at the top

https://news.ycombinator.com/hn.js


True, but jQuery does a lot more than just id selection with $!

You could just extend the function to detect '.' vs '#', and do a class selection as well. And then add all of the selectors, subselectors, etc. (similar to, but far more powerful than css3's selectors.) and if you go far enough, you reinvented zepto (but still a long way from jQuery)

(actually, since $ is basically synonymous with jQuery, it'd probably be better to choose a different function name. too bad you can't define it as #(id).)


> True, but jQuery does a lot more than just id selection with $!

Yes. For a high degree of jquery-compatibility, you can use my library.

    const $ = document.querySelectorAll.bind(document);


This comment made me spit my drink out. People forget about bind, it's nice to replace the old closure patterns.


I believe this is what is know as a "nerd snipe" https://xkcd.com/356/


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

Search: