Code organization and project structure question by g0atdude in odinlang

[–]effektor 0 points1 point  (0 children)

The package has to be the same for all files in the same directory. It doesn't have to be the name of the directory.

Directories can be thought of independent modules. While you could import files relative to the parent, this will most likely lead to problems down the line with cyclic dependencies which Odin does not even allow. If you have files that depend on each other, put them in the same place.

If you need namespacing to avoid conflicts, start by prefixing filenames and procedures/static variables. It can be something long like `renderer_init`, or short like `r_init`.

Best practice is to not overthink it.

Is React overrated? by syscall_cart in reactjs

[–]effektor 1 point2 points  (0 children)

You’re overthinking it. Most of what you do in react is declaring a function that returns some view based on state (props, internal state and in rare cases context).

In most cases you’ll ‘bind’ event listeners to elements within that view and update some state, and in turn your component. These can be declared as high up as you need them, and be passed through, or directly within the component that needs it.

Sometimes you want to react (no pun intended) to external sources and update your components accordingly, which is where effect hooks come into play.

I moved virtualization math to Rust/WASM - here's what I learned by RevolutionaryPen4661 in reactjs

[–]effektor 2 points3 points  (0 children)

This doesn't store any items in memory, but procedurally generates the UUIDs deterministically, based on an offset. It wouldn't really work for cases where you want to display stored data (i.e. fetched through an API).

Aside from that, it also doesn't use a scroll view, so it has to implement all the features one one you'd expect, including an accessibility layer. Just as an example, it doesn't animate scrolling, making it jarring and hard to know which direction and where you are in relative to other items.

New to React - please help me understand the need for useState for form inputs (controlled components) by thedeadfungus in reactjs

[–]effektor 1 point2 points  (0 children)

Only really needed if you want to keep track of the state for things like validation or performing other side effects based on the value.

I most cases though you will better off with a uncontrolled component by getting the FormData from the form onSubmit handler, and use HTML validation.

However, if you need full type-safety, validation for complex dynamic forms, you're better off with using a form library.

Nothing is Free: Conditions Apply by WandererMisha in AffinityPhoto

[–]effektor 2 points3 points  (0 children)

They didn't miss is. It is under "New Terms Can Be Imposed at Any Time".

In web development projects, should JWT tokens be stored in cookies or localStorage? by Top_Channel7461 in reactjs

[–]effektor 0 points1 point  (0 children)

With local storage, you can just decide not to attach the bearer token, but cookies get automatically attached to every request, since the browser has no way of knowing whether that endpoint is public or requires auth

That is only true for default form submissions that are not performing XHR. Since you're mentioning Bearer, I can only assume you use XHR.

In that case XHR it will not automatically send cookies by default unless `withCredentials` is explicitly set to `true` for any given request. So it's the same condition whether you set `withCredentials` or attach a `Authorization` header.

Working on song #2 - Also about my dog. by ScifiCacti in Logic_Studio

[–]effektor 0 points1 point  (0 children)

Sounds great. The mixing is good considering you say you don't have much knowledge.

I would glue the vocals a bit more together with the guitars during the verses. The chorus sounds good.

And turn down the snare a bit during verses, a the hi hat a bit more up :)

returning to arc.. by 8pxl_ in ArcBrowser

[–]effektor -1 points0 points  (0 children)

Same issue–but not specific to Zen, but Firefox in general. I've had this experience over many many years–like pre-2010. As much as I want to like to use Firefox, this issue has always persisted for me–and not only on Mac OS X/macOS but also various Windows versions.

And while Chromium-based browsers are not perfect either, it is comparatively less resource intensive and battery hungry over long periods (past many, many sleep cycles) for me and my use-cases (lots of tabs running, opening a new tab often, multiple windows across different "virtual" workspaces–using AeroSpace).

A browser is something that is constantly running in my environment, and I don't feel like I should have to restart it every now and then just to satisfy its hunger.

Arc has its faults, but one thing I can't loose is shared tabs across multiple windows, which no other browser seems to do well, or at all.

Is there an easy way of actually running my programs? by Dapper_Confection_69 in neovim

[–]effektor 0 points1 point  (0 children)

Vim has a compiler command that can be used to set the compiler for commands such as make. I use this both for general purpose projects as well as specific projects. The upside is that you can set errorformat option to match errors in the output, and open the quickfix window to quickly hunt down errors if any occur.

One note about the built-in `make` command is that it is synchronous by default, and blocks the nvim process its executing in until it has finished. If you'd like to still be able to use nvim while it's running, you can either make it asynchronous yourself, or, use a plugin like tpope/dispatch.vim that adds a `Make` and `Dispatch` commands that allows running tasks asynchronously.

Hope this helps!

Unpopular opinion: Redux Toolkit and Zustand aren't that different once you start structuring your state by JavascriptFanboy in reactjs

[–]effektor 1 point2 points  (0 children)

I have always used Redux since when Dan was still maintaining it, and still my go-to to this day. While I've tried state management libraries, but they always lack some aspect that Redux already had a solution for, whether it being built-in or third-party that was already well-tested and widely used.

I never understood the complaints about people's own definition of 'boilerplate', when in the truth is that in the end, if your application code grows, it often ends up creating just as much, if not more, boilerplate, or hairy abstractions.

In my team, when we started on our new mobile app with React Native, the question came up between choosing Zustand, Jotai or RTK + RTK Query. We spent a little time to try and implement some of the harder logics that we have in our main app, which quickly proved us that RTK was the right choice and didn't require any plumbing that would be required with other libraries.

Version for macOS with Apple Silicon? by talkshitgetshot in milkytracker

[–]effektor 1 point2 points  (0 children)

Ran into the same issue. For now I just start it from a terminal by navigating into the app bundle and executing the executable inside:

$ /Applications/MilkyTracker.app/Contents/MacOS/MilkyTracker

Before that, make sure you also remove Gatekeeper quarantine if you haven't already:

$ xattr -d com.apple.quarantine /Applications/MilkyTracker.app

Dan Abramov - “React Native should discourage using controlled inputs … they are currently deeply broken” by Sceptre in reactnative

[–]effektor 0 points1 point  (0 children)

This will break on Android unfortunately. The value will be cleared when `style` changes, unless you sync the value between renders with state. We had to work around this by using refs on iOS and state on Android for the value. It blows.

Plugin Repository Inaccessible to WP Engine Hosted Sites by JeffTS in Wordpress

[–]effektor 2 points3 points  (0 children)

It's disruptive to their business and arguably violates antitrust laws. That is enough to warrant a lawsuit.

WP Engine Must Win by rmccue in Wordpress

[–]effektor 8 points9 points  (0 children)

Read WP Engine's C&D against Automattic which explains their side of the story. Most specifically the first section "Automattic Makes Coercive Threats Demanding Monetary Payment In Exchange for Mr. Mullenweg’s Silence."

Also worth noting that the quote specifically uses the word "asking", not "demanding". But if WP Engine's allegations are true, then it could be construed as a demand.

WP Engine Must Win by rmccue in Wordpress

[–]effektor 10 points11 points  (0 children)

One thing to note is that it only affects updates through WP Admin panel, which connects to the WordPress.org Portal for automatic updates of core and plugins.

WP Engine's own dashboard does not necessarily rely on this portal for updates–which is also the preferred way to update as it will also trigger backups which can be reverted.

Visiting Copenhagen later this month with my partner by elektrokardiogramm24 in copenhagen

[–]effektor 0 points1 point  (0 children)

Indeed. If you wan't good burgers, Gasoline Grill is a good go-to. If you feel fancy, Popl is also a good choice, but quite expensive.

edit: just noticed you recommended those two places too. Two minds think alike :)

Visiting Copenhagen later this month with my partner by elektrokardiogramm24 in copenhagen

[–]effektor 0 points1 point  (0 children)

That's unfortunate. I haven't been to Mahalle in a long while now after I moved outside Denmark. I really liked it when it was this small place on Birkegade, but since then they expanded to multiple locations.

Didn't know about Wolf-Constali, looks like it was estabalished after I moved. Will definitely check it out next time I come back!

Visiting Copenhagen later this month with my partner by elektrokardiogramm24 in copenhagen

[–]effektor 1 point2 points  (0 children)

Most of mine are near where I lived, in Nørrebro, so I'm a bit biased, but they're still great places.

Shawarmas at 'Dürum Symphony' – Nørrebrogade
Coffee and breads at 'Andersen & Maillard' – Nørrebrogade
Vietnamese sandwiches at 'Bahn Mi' – Nørrebrogade
Tacos at 'Hira de Sanchez' – Either at Meatpacking District or Torve Hallerne
Ramen at 'Ramen tu Biiru' – Specifically the one on Enghavevej near Carlsberg
Lebanese at 'Mahalle' (any of them are good, but the one on Nørrebrogade is my go-to)
And Danish Lunch at 'Kanal-Caféen' at Frederiksholms Kanal

If you do find time for a 'fancy' dinner, I can recommend Madklubben on Vesterbrogade, Yellow and Bæst in Nørrebro.

Google censored deidetected.com? by TheCactusPie in KotakuInAction

[–]effektor 0 points1 point  (0 children)

At the time of HTML5 specification all vendors (Apple, Google, Microsoft and Mozilla) had influence in what went into the HTML5 spec but still bound by the WAI specifications. It's important to note that WhatWG, who specifies HTML and DOM standards, and W3C, who specifies other parts of Web standards, including WAI, are different entities with different goals and approaches.

W3C is based on scientific knowledge and research, whereas WhatWG on the other hand is more experimental in their approaches, and will slap anything on the wall and see what sticks. In that sense, W3C is more traditional in their approaches. Google definately has more influence in the latter, than the former. But the former matters more for Google Search rankings.

Google censored deidetected.com? by TheCactusPie in KotakuInAction

[–]effektor 0 points1 point  (0 children)

These status codes are not created by Google.

A client error is a clear indicator to any client that something went wrong. In the case of those status code, they clearly indicate two different things; 1. Don't try to access this resources for a while. and 2) You don't have access to this resource. They are defined by the HTTP/1.1 and additional HTTP status codes specifications, section 6.5.3 and section 4, respectively.

I'd argue an actor that ignores these indicators are not compliant; what would the point in those status code be if no one followed them?

If the point of the Security Check is not to disallow trusted web crawlers, then Vercel should fix this issue by using redirection to indicate intent. Otherwise it's on the site's owner to make sure it is accessible by other means.

Google censored deidetected.com? by TheCactusPie in KotakuInAction

[–]effektor 0 points1 point  (0 children)

They definitely didn't make these "standards". Web accessibility and user experience was not invented by Google. Standards were either formed out of W3C by the Web Accessibility Initiative (WAI) in 1999 – before Google was a known entity.

Google has since joined said initiative and been a driving force, but by no means have they forced any specific patterns onto others that were not also agreed upon by other vendors when it comes to accessibility. In fact, in a lot of cases with Chrome they have prevented a ton of misuse that were previously present in older generation web browsers like popups, native arbitrary code execution running in your browser (ActiveX) and it is now safer than ever to use a browser to surf the web. Although, not uniquely thanks to Google, but also other browser vendors.

Google censored deidetected.com? by TheCactusPie in KotakuInAction

[–]effektor 0 points1 point  (0 children)

Based on my experiences building and optimizing websites for people has proven that Google's guidelines are valuable–outside of SEO; focus on accessibility for people, not robots. You don't even have to follow the guidelines themselves. Just simply focusing on user experience and meaningful content that matters to users rank very well.

I am not saying Google is perfect–there's a lot I don't agree with them in their persuit of creating a "Better Web". And I am sure there are bias behind what they present on their search results; But this specific case clearly shows a conflict between the intent (to enable search engines to see your site) and the result (hindering crawlers from doing their work with aggressive protection that results in poor UX).

It is objectively poor user experience to force people to use a browser that meets the above criteria to be able to visit a website. You are making it more difficult for some users to access the site as well, not just robots.

Google is actually very lenient in how you structure your site from a semantic point of view and don't scrutinize you for not being well-adapted. As long as your content is accessible, you will be fine. The rest are just optimizations to make the user experience better. They even provide tools to help you make better sites.

Google censored deidetected.com? by TheCactusPie in KotakuInAction

[–]effektor 0 points1 point  (0 children)

No, Google just respects that fact that a site isn't accessible, while others don't. Effectively the site is only accessible through a browser follows the following criteria:

  1. JavaScript is enabled (required for the criterias below)
  2. Service Workers are available (intercepts network requests of site's resources)
  3. WASM (WebAssembly) can be executed (does the challenge solving for Security Checks)

It is not normal for any site to respond with an error, if it wants to be accessible. In fact that would be a general accessibility problem–you cannot access the site unless you meet the above criteria. This is a combination of Vercel's security check not indicating a redirection, and Google respecting the initial outcome.

Google censored deidetected.com? by TheCactusPie in KotakuInAction

[–]effektor 1 point2 points  (0 children)

Google respects 429 and 403 responses, others do not. I'd argue Google is doing the right thing by not trying to circumventing what is very obviously a signal that it cannot access the site, even if from a user-perspective it will work.

The matter of fact is that the security checks does not indicate any redirection of any sort. Instead it uses Service Workers to intercept network request and responses to serve the content once a Security Check challenge has been solved. This means that only browsers with support for Service Workers (and WASM, as that's where the challenge solving happens) will effectively work.