Better HN
topnewbestaskshowjobs
Log inSign up

selectnull

2,376 karma · joined Nov 25, 2010 (16y ago) · 453 submissions

I write software, mostly Python guy, have love/hate relationship with JavaScript, love exploring programming languages.

Email: sasha@selectnull.com

meet.hn/city/45.3267976,14.442208/Grad-Rijeka

Socials: - bsky.app/profile/https://bsky.app/profile/selectnull.com - github.com/https://github.com/selectnull

Interests: Networking, Programming, Web Development

---

Submissions

comment 4y ago · link · parent

Extension or not, .sh or .bash: definitely subjective.

That was the intention of my comment. Because the rest of the post (or most of it for sure) is not subjective.

comment 4y ago · link · parent

> Use the .sh (or .bash) extension for your file. It may be fancy to not have an extension for your script, but unless your case explicitly depends on it, you’re probably just trying to do clever stuff. Clever stuff are hard to understand.

I don't agree with this one. When I name my script without extension (btw, .sh is fine, .bash is ugly) I want my script to look just like any other command: as a user I do not care what the language program is written in, I care about its output and what it does.

When I develop a script, I get the correct syntax highlight becuase of the shebang so the extension doesn't matter.

The rest of the post is great.

comment 4y ago · link · parent

It looks more like Chinese government proxy.

comment 4y ago · link · parent

That's easy: try it with Firefox.

comment 4y ago · link · parent

Agreed that everyone has their own personal definition. With that in mind, I would never think of telephone as decentralized, at least not more than any other service provided by a company.

comment 4y ago · link · parent

Super easy to use, highly recommended: https://46elks.com/

comment 4y ago · link · parent

Just like few others here, I wanted keyboard shortcuts so I just hacked it quickly. Will break if DOM classes change, but author should implement something better.

Cool game.

```

const rotate = (direction) => { const directions = {counterclockwise: 0, clockwise: 1}; const buttons = Array.from(document.querySelector('.mt-16.flex.items-center.justify-between.w-72.h-12.px-2').querySelectorAll('div')).filter(el => el.className === ''); buttons[directions[direction]].click(); }

document.addEventListener('keydown', (ev) => { switch (ev.key) { case 'ArrowLeft': rotate('counterclockwise'); break; case 'ArrowRight': rotate('clockwise'); break; } });

```

comment 4y ago · link · parent

Barack Obama is #1. Trump is #2 :)

comment 4y ago · link · parent

Because he was not born in neither Serbia or the US.

comment 4y ago · link · parent

Self hosted.

I pay about 40 Eur (Hetzner) per database server. You can get cheaper; I used to pay 50 usd for 2 database nodes with backup at digitalocean.

comment 4y ago · link · parent

Using latest Chrome gives "Uncaught (in promise) TypeError: Failed to fetch" console error.

The same is with any input, even with predefined ones; the progress bar gets to the end (slowly) and nothing happens.

Firefox works.

comment 4y ago · link · parent

How much are you willing to pay for the fridge?

comment 4y ago · link · parent

I will. As soon as they allow me to pay, because I do not plan to move to US or Canada.

> Today, MDN Plus is available in the US and Canada. In the coming months, we will expand to other countries including France, Germany, Italy, Spain, Belgium, Austria, the Netherlands, Ireland, United Kingdom, Switzerland, Malaysia, New Zealand and Singapore.

comment 4y ago · link · parent

I welcome this idea and will gladly pay immediately when they launch. After that, they will have to earn the money with quality content. If the service provided is good, I don't care for CEO's salary or whatnot; if not I don't care for the CEO either way.

comment 4y ago · link · parent

I like it. Nicer design on top of the same functionality is really what I want from Django admin. In contract to some CMSes that change to much and in the process lose features.

166.

Tiobe Index for October 2021 (Python programming language number 1)(tiobe.com ↗)

2 points · by selectnull · 5y ago · discuss

comment 5y ago · link · parent

When that named cow gets old and dies, does it get buried in the family cemetery along with the rest of the family? Do you mourn for it? Or perhaps, it turns into a steak of some form or another?

comment 5y ago · link · parent

I always wondered why is that a space separated string, when a list can work as well. The docs are not well written on that one. This works:

    Point = namedtuple('Point', ['x', 'y'])

comment 5y ago · link · parent

I have just started to play with neovim and the first thing I did was to define a function:

  function bindKey(mode, keys, command, options)
    options = options or {noremap = true, silent = true}
    return vim.api.nvim_set_keymap(mode, keys, command, options)
  end
With that, remapping looks like this:

  bindKey('n', '<Tab>', ':bnext<CR>')
Which is in my opinion better than Vim syntax. I definitely see the potential in having Lua as scripting language.

comment 5y ago · link · parent

https://literarydevices.net/something-is-rotten-in-the-state...

comment 5y ago · link · parent

I can so recommend this.

I've switched to emacs few years ago for the same reason and spent about a year using it. Although I've switched back to vim afterwards, having spent time with emacs was fun and not a waste of time.

Have a leap of faith, find the advantages of one (or the other) for yourself. If you don't like at any time for any reason just switch back: after all, it all text files you're editing.

comment 5y ago · link · parent

You can setup whatever name you want as default branch, both in git and github.

comment 5y ago · link · parent

I fight against this useless political correctness with my own, albeit invisible, rebellion:

I've set repository default branch to `master` [1] on Github.

I've created init.templateDir with HEAD set to `master` [2]

That way, whenever I init a new repo, either locally or via Github, the default branch is master, not main.

[1] https://github.com/settings/repositories

[2] http://git-scm.com/docs/git-init

comment 5y ago · link · parent

https://news.ycombinator.com/topcolors

comment 6y ago · link · parent

The last release was in 2013. For all intents and purposes, this is abandonware.

comment 6y ago · link · parent

I was not sending them. I was receiving them as several SSL providers send them zippped via email.

comment 6y ago · link · parent

I've been using Letsencrypt since the beta and I enjoy it for the simple reason of not having to get private keys via email (remember the times before LE?).

So far, I had exactly one frustrating moment with LE (or was it certbot?). I've created AAAA records for a domain, but didn't set the nginx up to accept IPv6 connections. Certbot failed to fetch the certificate with some strange message. I figured it out. It was not that bad.

Letsencrypt is a blessing.

comment 6y ago · link · parent

I would gladly pay for MDN access. Mozilla has done a wonderful work with that, it's a goto place for any kind of web related documentation (and I'm probably not the only one).

comment 6y ago · link · parent

Django ORM mainly hides the SQL from the developer (which is kind of the idea of any ORM). But if a developer does not understand the underlying SQL concepts, they will soon write performance wise horrific code. But, if you remove the ORM from that equation, I don't see how that same developer doesn't make the same mistakes. So in the end, I don't think that Django ORM (in its core) can help much in this area.

There are of course tools that can help with that (django-debugger and others).

1
567
16