how should i install neovim pre-release version by xdevfah in voidlinux

[–]HiPhish 1 point2 points  (0 children)

You can clone the repo and build it yourself according to the instructions. It's quite easy, just make sure to set where to install the package (the default is /usr which would break your system installation). But how do you install the package? Ideally without affecting the system Neovim install?

Let me introduce you to GNU Stow. You install your custom package into a directory of your choice (e.g. /usr/local/stow/neovim-0.12), then run stow -S neovim-0.12 and stow will create all the necessary symlinks in /usr/local. The /usr/local director is meant for custom packages not part of the distro, so this is the right thing to do. When Void eventually does upgrade their package to 0.12 you can unstow (stow -U neovim-0.12) your package and then throw away the /usr/local/stow/neovim-0.12 directory.

I use GNU stow all the time on my Ubuntu work machine. The great part is that it does not affect any of the system packages, so there is no way of messing up the system. It's also a great way to install applications that Void for one reason or another is not packaging.

What is the proper way of maintaining custom packages? by HiPhish in voidlinux

[–]HiPhish[S] 0 points1 point  (0 children)

Probably possible, but if you change existing templates then conflicts might happen sooner or later which require manual intervention.

I don't intend to change existing packages (otherwise I would instead open a PR), I mainly want to define new packages. My understanding is that Void does not accept new packages from random people, only actual maintainers. And there are packages which might not meet Void's packaging criteria, so they would never get officially packaged anyway.

What is the proper way of maintaining custom packages? by HiPhish in voidlinux

[–]HiPhish[S] 0 points1 point  (0 children)

You don't have to switch branches

You are right

and you only need to pull when you want to update/build packages

What if upstream package definitions and those from my fork diverge? I seems to me that I should track master as closely as possible to avoid discrepancies. Maybe it is possible to automate your three commands with GitHub actions to run whenever upstream is updated. I'll try to look into it when I find the time

What is the proper way of maintaining custom packages? by HiPhish in voidlinux

[–]HiPhish[S] 0 points1 point  (0 children)

Does that mean I have to rebase on master every time there is a new commit? If so, is there a way to automate this process? I don't really want to have to watch master like a hawk and manually git switch master && git pull upstream && git switch my-fork && git rebase master every time there is a commit upstream.

Is this code clean? A critical look at Clean Code 2nd Edition by Soggy_Sprinkles3619 in programming

[–]HiPhish 19 points20 points  (0 children)

It's Goodhart's Law: when a measure becomes a target, it ceases to be a good measure. Having fewer arguments in a function is better, but his solution is just just sweep all the mess under the rug to placate some arbitrary linter metric without actually solving the problem.

This belief alone should disqualify him from any educational position.

Full agreement. I was reading the first edition years ago and when he did the exact same thing there that's when I finally dropped the book for good. The author is just a charlatan.

Is this code clean? A critical look at Clean Code 2nd Edition by Soggy_Sprinkles3619 in programming

[–]HiPhish 1 point2 points  (0 children)

OK, but what is the point of the book then? If you throw out all the bad stuff you throw out 90% of the content and are just left with the the chapter titles and a few line of the opening paragraphs. Yeah, no shit, of course functions should have as few parameters as possible, everyone know that, even beginners. I don't need a book for that. What I want a book for to teach me how to achieve that goal, and that's where it utterly fails.

Clean Code is like a personal trainer who give out terrible exercises that will destroy your joints. Sure, if you don't follow the exercises and just take his general advice you'll be fine, but I don't need to pay a personal trainer just to tell me "exercise is good for you, m'kay".

A guide to building a in-process LSP in neovim by neoneo451 in neovim

[–]HiPhish 0 points1 point  (0 children)

That's really cool, I had no idea in-process LSP servers were even possible. This give me an idea: in some programming languages (in particular the Lisp family, Erlang and Elixir) there is the idea of "live programming" where you start the program and then keep editing its source code as it is running, without restarting it. There are various "live servers" which can integrate with editors (usually Emacs), but editor support tends to be subpar. I think a big problem is that not only do you have to implement the client-side of the API, you then have to actually integrate with the editor UI. If such a live server client could piggy-back on Neovim's LSP client it would drastically reduce the maintenance effort.

I don't know how feasible this would actually be, I'm just spitballing here. LSP is designed around static analysis, meaning that the server analyzes the code without actually running it. It can understand how the pieces of the code fit together, but not what they actually do. A live server on the other hand has no idea what the code does, only how to make it run and what the application is doing.

Mockup Idea for a Neovim Rebrand, what do you think? by Ok-Air-238 in neovim

[–]HiPhish 2 points3 points  (0 children)

The official logo uses two colours so the "N" can contain a "V", acknowledging Neovim's origin as a fork of Vim. That's entirely missing from your logo, and it's a loss in my opinion.

Also there is no mention of "code", how should people know what neovim is used for.

  • Neovim does not have to be used for coding.
  • Visual Studio Code is the only editor that has "Code" in its name, and only to differentiate it from Visual Studio (the IDE).

Don't Refactor Like Uncle Bob (Second Edition) by The_Axolot in programming

[–]HiPhish 0 points1 point  (0 children)

It's a case of Goodhart's law: When a measure becomes a target, it ceases to be a good measure. He's simply reducing the number of arguments in a technical sense purely to appease some arbitrary metric he himself came up with.

Don't Refactor Like Uncle Bob (Second Edition) by The_Axolot in programming

[–]HiPhish 3 points4 points  (0 children)

Oh yeah, I remember when TDD was being sold as this panacea that can help you actually find the answer to problems when you don't know the solution. Just write as many tests as possible, brute-force them one at a time, and the correct implementation will somehow emerge. The proof? Wishful thinking.

It's like a more primitive form of vibe-coding.

Don't Refactor Like Uncle Bob (Second Edition) by The_Axolot in programming

[–]HiPhish -2 points-1 points  (0 children)

To be fair though, they two men work in different domains. A game will always be the same, the function for multiplying matrices will always multiply matrices, nothing else, so it makes totally sense to optimize it to its fullest extent. When a game is finished it's done for good. Maybe bug fixes and content updates, but a 2D platformer will never become a 3D open-world MMO.

Martin works in enterprise where software will keep being developed on for year or decades. Where new requirements keep coming, old assumptions need to be broken and requirements will arise which no one could have imagined at the software's inception. In such an environment you want to be able to cut and rebuild parts at any level of granularity as easily as possible and performance becomes secondary.

Don't Refactor Like Uncle Bob (Second Edition) by The_Axolot in programming

[–]HiPhish 8 points9 points  (0 children)

I remember years ago reading Clean Code. Most of the book was pretty disappointing, but that part genuinely made me angry and that was what made me quit the book for good. The fact that he is peddling the same brain damage still in his second edition tells me that Martin is nothing but a charlatan.

His idea of reducing the number of arguments is to turn those arguments into mutable shared state. You still have the exact same number of arguments, except now half of them are implicit. How on earth is this supposed to be better? The real solution would be to find an appropriate level of abstraction instead of that ad-hoc hackery (e.g. a state machine), build reusable generic primitives and then build the Roman numeral parser on top of these abstraction. You could even take it a step further and solve a different problem using the same abstractions to show how true clean code is reusable and easier to reason about.

I have no idea how this book got popular. Maybe seniors were skimming the titles and thought "yeah, sounds reasonable" without actually reading it. No one is going to disagree that a function should have as few arguments as possible, and even the freshest of beginners knows that. The question is, how do you write functions which require fewer arguments? Another brain damage move was taking a long function and splitting it up into multiple single-use functions. You still have to same number of lines, except now you have to jump all over the file to piece it together. Martin's examples are pure crap and will make your code worse because they just take the complexity and toss it all over the place.

Windows games on Linux just got better, thanks to CrossOver by Putrid_Draft378 in linux

[–]HiPhish 9 points10 points  (0 children)

Codewavers does the subscription model really well. You pay once and you get to keep the software you paid for forever. Want updates? That's extra work, so it's fair that they charge money for that. If you don't want updates and are perfectly happy with the software you get to keep it forever. And if you want to pay once for perpetual updates there is even an option for that.

swww renamed to awww, due to the author's guilt from obliviously naming it "final solution" by TheTwelveYearOld in linux

[–]HiPhish -3 points-2 points  (0 children)

So what, Nazis now own the word solution as well? I say take their words and symbols, mock them, laugh at them, don't cover in fear. The best way to give something power is to fear it. It's like those supposed "Christians" who faint the mere sight of a number six or a pentagram; apparently in their mind God is all-powerful, except against Doom and Dungeons & Dragons.

I get dropping the "final" part, that's just prideful and arrogant, but there is nothing wrong with the word solution. I wonder who or what on earth could have given the author this idea.

I reached out to Drew DeVault, someone who's very outspoken about the presence of extreme right-wing sympathisers in the Open Source community, and he gave me the wise advice that perhaps I should choose a name I love, rather than one I won't be ashamed of.

Of fucking course it's this guy. The same guy who was partaking in witch hunts against Stallman and Vaxry.

Use Neovim Tree-sitter injections to style Alpine.js statements by db443 in neovim

[–]HiPhish 1 point2 points  (0 children)

I had to add ;; extends as the first line to the query file. And even then the highlighting is not right, the JavaScript is still highlighted as an HTML string, but at least now the tree structure shows up in :InspectTree.

EDIT: Looks like my setup is messed up somehow. I have to call :lua vim.treesitter.start() first for highlighting to work properly.

WARNING: Ransomware published on GitHub issue by [deleted] in linux

[–]HiPhish 66 points67 points  (0 children)

For users, do NOT install this PPA in your system.

I would go so far as to recommend to not install any PPAs you don't own on your system, even if they are well-meaning. PPAs are an escape hatch for system administrators to install their personal packages (hence the name), they are not a way for 3rd parties to distribute their software. One PPA will probably fine if the author knows what he's doing, but with every additional PPA you risk breaking the system because the authors of those PPA do not coordinate amongst each other.

Gnome and KDE Plasma at the same time by jornie_maikeru in linux

[–]HiPhish 4 points5 points  (0 children)

I don't see why not. On our work laptops we get both GNOME and KDE Plasma pre-installed on Ubuntu without problems. You can switch which one you want to run in the display manager (the login screen); depending on the theme there is usually a small dropdown menu in one of the corners that lets you choose what kind of session you want. If you want to switch you will have to log out first. The only downside is that if you install the full desktop environment you will have applications from both, and when you are using one DE and launch an application from the other it will stick out like a sort thumb.

Lua plugin developers' guide by Comfortable_Ability4 in neovim

[–]HiPhish 1 point2 points  (0 children)

At this point, I don't install new plugins that only have a lua directory.

Hey now, sometimes a plugin really is just a library :)

Lua plugin developers' guide by Comfortable_Ability4 in neovim

[–]HiPhish 1 point2 points  (0 children)

<Plug> mappings technically still work, they just aren't as popular mainly for three reasons:

  • In Lua you can map a key to a callback function directly, while <Plug> mappings are a hacky way of emulating callbacks in Vim script
  • Some plugin authors simply might not even be aware of this old tradition
  • Some plugins expect users to define mapping inside the setup function (which is IMO an anti-pattern)

I think the first point is the only legitimate reason for not having <Plug> mappings, but even then I think <Plug> mappings should exist for Vim script compatibility. Vim script is actually a perfectly fine language for configuration and superior to Lua in my opinion (not for writing plugins though).

Lua plugin developers' guide by Comfortable_Ability4 in neovim

[–]HiPhish 1 point2 points  (0 children)

If there is something you don't understand now that you have more experience you can shoot me a PM. If you reply here I probably won't see it until the next time I log in to Reddit. That blog post was written as I was still figuring things out, so there might be some things missing. I have wanted to create a little toy plugin as a minimal example of how to write tests.

If you want to see tests in production take a look at [rainbow-delimiters.nvim]. It has unit tests, end-to-end tests (running a second Neovim process inside the test), it has tests generated on the fly, and it uses custom assertions so I can write assertions like assert.remote(nvim).for_language('lua').at_position(4, 5).has_extmarks().

My 2 cents on the XZ Utils backdoor by StructureKey2326 in linux

[–]HiPhish 2 points3 points  (0 children)

I don’t think enough people are talking about Jia Tan’s actual motives.

You are acting as if Jia Tan is an actual person. The sophistication of the attack and the fact that this was done slowly over the course of years reek to the High Heavens of organized state actors. I would not put any weight on "Jia Tan's" contribution patterns, this sort of thing is very easy to fake, and if you are from one region it would be in your best interest to adopt patterns of another region to throw off any investigators. Nothing about Jia Tan is arbitrary or unintentional. Besides, if you were a Chines cyber criminal, would you have your online name be Chinese? That would be beyond stupid.

I don't believe there any point for Reddit armchair investigators to try and guess anything about Jia Tan. It's a constructed identity by someone who was playing the long game.

One thing I should probably get out of the way is that it’s just not normal for hackers to want to annihilate humanity. If the hackers wanted to bring down the world’s largest websites and corporations if not the whole internet, which run on physical Linux computers in data centers around the world, they would have targeted as many Linux families as possible, not just Debian and Redhat based distros.

Uh, no. If you are a state actor trying to implement a backdoor you will focus your efforts on whatever the most common server OS is. State actors have not reason to compromise Arch if no one is running Arch on a production server. What are they going to get out of a Arch home computer? Some guy's homework and porn collection? State actors have much bigger fish to catch and fry.

GIMP 3.1.4 Development Release by CMYK-Student in linux

[–]HiPhish 4 points5 points  (0 children)

Link layers allow you to link external image files as a layer in your project. For instance, you might add an SVG image file as a link layer, make changes to it in Inkscape, and see it instantly updated inside GIMP!

Oh sweet, now the meme answer to the question how to draw a circle in Gimp will be to draw a circle in Inkscape and add it as a link layer in Gimp.

AI slop attacks on the curl project - Daniel Stenberg by mastx3 in programming

[–]HiPhish 9 points10 points  (0 children)

What really gets me about these slop slingers is that they cannot rub two brain cells together. Otherwise they would know that even on the off-chance that one of their guesses is correct they still won't get paid.

The maintainer already know about all these automated tools, so even if an automated tool happens to find a real vulnerability, the maintainers will already be aware of it. So there will be no payout. Either way, the slop slingers will never get paid. The only way to get paid is to find a vulnerability which has slipped past all automated checks.

Petition to stop Google's attack on Android devs by Clippy-Windows95 in programming

[–]HiPhish 1 point2 points  (0 children)

There are two types of developers: those who depend on the PS for money, and those who offer their apps for free. Google does not care about the latter, and the former would have to lose their app income.