HNHacker News
TopNewBestAskShowJobs

mkdirp

1,232 karma · joined December 17, 2021

submissionscomments
mkdirp··on Dependency injection in Go with Uber-go/fx
> What does dependency injection give you that a simple combination of Singletons, Constructors, and Factories doesn't?

Easy refactoring of an interface/constructor? I've been using go for a while, and I decided to follow the advise of not using a DI for my project. Every time I refactor a constructor, it is a fun hunt to make the same changes everywhere I'm using that constructor.

mkdirp··on Cut Russia from GitHub due to invasion of Ukraine
Because countries living in an isolated internet has worked out so well historical. Look at North Korea. It's a utopia. The population oh so loves living there. They definitely do not want to leave.

If it's unclear, that's a ball of sarcasm.

> I'm just speculating here, but what if say Microsoft sent a Russia-wide update that wipes all data and kills Windows?

Besides this being quite unethical because that, again, would affect the common folk, many of whom are against this war, it's a temporary measure. That is, assuming their systems aren't mostly Linux/BSD based.

mkdirp··on Italy gets its first unicorn as Scalapay raises $497M from Tencent
> Plenty of bizarro left-wing shit about Coronavirus, 5G and evil conspiracies.

Please do tell me how 5G boils your blood or something, and how Coronavirus doesn't exist, or some other silly little thing.

mkdirp··on Italy gets its first unicorn as Scalapay raises $497M from Tencent
Way to read that. And way for them to phrase it. The White House is trying to combat disinformation, not conservative outlets. It seems obvious but sadly most of the disinformation comes from conservative outlets.

Going to the homepage of that website though, it is clear what their narrative is:

> Trudeau’s Canadian Fascism Is a Bigger Threat to America Than Putin

Yeah okay.

mkdirp··on Vanced: YouTube adblocker for Android
If you think you truly are user 1234567890 then you're sorely mistaken. Corporations have one thing in mind, and that is profit. They'll use your data however they see fit to maximise those profits. If that means identifying you, then so be it.

There is a reason phrase like microtargetting exists. When a political group is able to target individuals using their platform, that's not okay.

It gets worse though, government surveillance is one thing, it's another when Corporations give them full access to their data. Or did we forget Snowden already?

mkdirp··on Vanced: YouTube adblocker for Android
You're not giving it to Vanced. It works through Micro G which uses Google's oauth flow to authenticate you.

Anyway, personally I've moved my YouTube account to a dummy account.

mkdirp··on Vanced: YouTube adblocker for Android
On average only 3 pieces of information are needed to identify a person. Sure you're person 1234567890, but all the information linked to that user can find out exactly who that person is.
mkdirp··on Google Tag Manager, the new anti-adblock weapon (2020)
It is clear Google is finally feeling the hurt from adblockers and the like. That means we are winning. Google knows it's not what people want, but they clearly do not care. In my opinion, if you work for Google on things like this, you are equally to blame. You have Google on your CV, you can easily go elsewhere and find a decent job.

Having said that, uBlock Origin, and I'm assuming other similar extensions, offer inline script filtering. The code being served has to have some common code since it's all coming from a single org. What is stopping a filter that includes a filter like this?

The issue obviously being that this still prevents DNS filters from blocking Google, which is equally a big issue. Assuming the scripts indeed have some common code that can be blocked, perhaps this is where we start crowdsource filters. Something that runs in the background, and inspects scripts, which then gets posted to a server, validated automatically, and then later served as a block list that anyone can download.

[0] https://github.com/uBlockOrigin/uBlock-issues/wiki/Inline-sc...

mkdirp··on Google Tag Manager, the new anti-adblock weapon (2020)
Which is fine, but will it be enforced? So far GDPR rules haven't done a whole lot of damage except make sure everyone knows what a cookie might be. Until the EU is willing to better enforce the GDPR rules, Google will keep doing what they're doing.
mkdirp··on Google Tag Manager, the new anti-adblock weapon (2020)
> This would (or at least could) be a data privacy win if done ethically.

Most, if not all, tracking is unethical.

mkdirp··on Windows 11 Pro will soon require a Microsoft Account during initial setup
This was inevitable to be honest. They've made it harder and harder to use a local only account, probably to drive the adoption rate of Microsoft account sign ins up so that they eventually can stay "no one uses local accounts any more". Give it a little more time and they'll require Microsoft accounts for everyone.
mkdirp··on No one cares about your redesign
Mark Zuckerberg Signature Box confirmed.
mkdirp··on Pure Bash Bible – A collection of pure bash alternatives to external processes
> Ideally, the function is POSIX-compatible, so it runs on the widest number of platforms.

But... Why? During my professional career of about 10 years, and even before that, I've not once had to require POSIX compatibility for any of the shell scripts I've written or come across. The few times I had a snippet that couldn't run I have been able to install bash 4+ with ease.

I'm sure there are times where POSIX is kind of needed, but it's becoming exceedingly rare.

mkdirp··on Frawk: A fast, JITted, statically-typed AWK written in Rust
There is also goAWK[0], a re-implementation of AWK in Go.

[0] https://github.com/benhoyt/goawk

mkdirp··on Show HN: Updatecli – What if Dependabot and Ansible had a child?
I like how some are missing the point of the tool because you mentioned (assuming jokingly) that we all love YAML.

Anyway, looks really cool. Dependabot seems to some strange limitations, and I'll probably look into using this.

Out of curiousity, how are you linked to the Jenkins project? Are you just an OSS contributor or do you do this full time?

mkdirp··on PHP – The Right Way
> this is what I don't get. Why would anyone in their right mind use a language ecosystem where each major version upgrade breaks their code?

Great so let's just leave all of the legacy terribleness in it. Let's not address all the quirks and horribleness that sounded like a good idea at the time. Let's not let the language evolve.

For the longest PHP was really great with backwards compatibility, refused to address issues in the name of backwards compatibility. So it became the butt of the jokes it is today.

As you can imagine, I'm on the other end. Providing backwards compatibility is kept for a relatively long time, I don't think it's unreasonable to break changes with a good system (i.e. major version upgrades). In such cases, I welcome it.

mkdirp··on PHP – The Right Way
> At least for Go and Rust, they have a much steeper learning curve.

Yes for rust, not really for Go. I was able to pick up the basics of Go in less than a day, and the more advanced topics I was able to pick up not long after. OTOH I've tried to pick up Rust several times, and every time I just sit back in defeat.

> should we talk about how dependencies are managed in Go?

I'm curious what you're referring to here. Go's package management works, and is decent enough. No centralisation, and can work with just about any git repo.

mkdirp··on PHP – The Right Way
JavaScript: the language that can barely understand itself is better than PHP! The language, where JetBrain's IDE (arguably one of the best IDEs when it comes to understanding languages, consistently better than any LSPs among other things) can barely understand it fully, is better than PHP! The language that has consistently added new features, but have yet to fix horrible messes of legacy design.

The majority of Gary Bernhardt's 2012 talk "wat"[0] is still relevant today with JavaScript. PHP's devs at least are actively trying to address the majority of issues people have had problems with, and have done so successfully for many of the issues it had.

In my opinion the only thing JavaScript has going for it over PHP is its ability to develop frontend and backend code using the same language, but then, you know, you'll need a million NPM dependencies if you pull in some of the simplest packages.

Until TypeScript takes over JavaScript I refuse to believe anyone who understands either languages fully prefers JS over PHP. I've yet to dabble in Deno, but I'm hoping that it also addresses much of the issues with JS, but I'm doubtful since it's also based on V8.

[0] https://www.destroyallsoftware.com/talks/wat

mkdirp··on More than 1k Dutch residents plan to throw rotten eggs at Jeff Bezos' superyacht
> When you have companies making millions paying more in taxes than the common folk who barely scrape by.

This should have said:

> When you have companies making millions paying less in taxes than the common folk who barely scrape by.

mkdirp··on More than 1k Dutch residents plan to throw rotten eggs at Jeff Bezos' superyacht
Ah right. The wealth that Bezos creates. The one whose workers are living pay cheque to pay cheque and barely scraping by. The one whose workers are peeing in bottles because they can't afford to be fired for taking a break.

It's not zero sum game because the wealth they create favours the investors. Not the population. The aim of a company is to create wealth for the investors. Not for anyone else.

I'm not sure why it is you're defending the rich in this thread, but your arguments have been overplayed for years.

mkdirp··on More than 1k Dutch residents plan to throw rotten eggs at Jeff Bezos' superyacht
The lawmakers drew a line that favours the rich. When you have companies making millions paying more in taxes than the common folk who barely scrape by. The lawmakers do it because of the rich lobbying them. Something the most people don't have the money for.

For sure everyone does their best to minimise the taxes they pay, but when you are the richest person in the world with some $200 billion, maybe you should be doing silly schemes like charity for tax avoidance.

Heck I tend to minimise my taxes, but often I don't even have such opportunity. The best I can do right now is contribute to my pensions. I'm on a current tax rate of around 50%. Outside that, there's not a lot I can do to minimise the tax I pay. Compare that the rich, who through their lobbying, and their schemes have paid an effective tax rate of around 3% over 5 years.

My statement is ridiculous to the rich, not so much to the rest of the population.

mkdirp··on More than 1k Dutch residents plan to throw rotten eggs at Jeff Bezos' superyacht
Here is an idea. How about we have dislike for those that hoard wealth, while the majority of the people live in poverty, and died of it.

How about we dislike those that avoid taxes like the plague, and yet, use all our services to their fullest extent.

How about we dislike those that exploit workers, turned a blind eye, and give a middle finger to most of their workers, and the people?

It's got nothing to do with jealousy, and everything to do with how horrible of a company Amazon is, and how its founder, and until recently its CEO, have let it become a horrible in the name of money.

I don't under people defending the ultra rich. The likelihood of the average joe getting to Bezos' wealth is next to zero. It's ridiculous to defend him despite all the bad he does. Before you say he adds to society by donating money or whatnot (e.g. Bill Gates), you know what works better? A good welfare system for those that need. One that would otherwise be funded partially by the rich's tax money that they love to avoid.

mkdirp··on More than 1k Dutch residents plan to throw rotten eggs at Jeff Bezos' superyacht
Tax avoidance is not the same as tax evasion. The former is illegal, where the latter is not, though ethically it is frowned upon.
mkdirp··on Ask HN: Does targeted advertising work at all?
Ads don't work on me because I block all ads*. I sent through my wife's Instagram account earlier today (with her consent of course) and the amount of ads is mind boggling. Sometimes it's not easy to figure out what's an ad and what's not.

* where I can. I still struggle with "sponsored" content, or fake review sites. It's becoming harder and harder to figure out what isn't an ad, and I hate it. If I see a good review, I don't know if it isn't an ad. If I see a bad review, I don't know it's not a competitor's doing.

mkdirp··on Jo – a shell command to create JSON (2016)
Combining here-string with `jq` (if you need variables), is plenty good enough. You'd need a single jq invocation.
mkdirp··on Jo – a shell command to create JSON (2016)
This kind of thing has its place and can be useful, but I think there should be options to enable/disable such magic. Personally I'd lean towards it being opt-in, but I think with the cli it's a lot harder to not have it opt-out. Everythint is a string in the cli, but not so much when it comes to json. That's why I think it makes sense, providing you can disable the magic.
mkdirp··on Ask HN: Best hosted alternative to Google Workspace for email?
I did not know this, I moved to mailbox.org in December.

Surely they'll only allow that if they pass the auth and the domain belongs to your account?

mkdirp··on What I'd like to see in Go 2.0
Right. However, C and C++ are far more complex, with no memory safety. Everything has it's ups and downs.
mkdirp··on What I'd like to see in Go 2.0
I generally tend to use enumer[0] to generate some boilerplate code that can help with addressing this, e.g. the below would compile, but would error at runtime. There are probably linters out there that could catch this. With Go, linters are generally pretty good at catching this kind of stuff.

    package main
    
    import "fmt"
    
    type Test int
    
    const (
     T1 Test = 0
     T2      = 1
    )
    
    func main() {
     t, err := TestString("T1")
     if err != nil {
      panic(err)
     }
    
     TestSomething(t)
    }
    
    func TestSomething(t Test) {
     fmt.Println(t.String())
    }
Having said that, it seems weird to have to mimic enums, as opposed to actually having it. Doesn't feel like it would add much complexity, if at all.

[0] https://github.com/dmarkham/enumer

mkdirp··on Silenced AirTags with disabled speakers are popping up for sale online
Not sure why you're getting downvoted. Amazon has small GPS trackers that are not much bigger than an AirTag.
← PreviousPage 3 of 6Next →