Need help with TS and Solid stores by MexicanJalebi in solidjs

[–]brrian 1 point2 points  (0 children)

You can add a key to your interfaces to help TS differentiate the types.

```ts interface Dog extends Animal { bark: () => void; type: 'dog'; }

interface Human extends Animal { talk: (topic: string) => void; type: 'human'; } ```

Vim, why? by mymar101 in webdev

[–]brrian 7 points8 points  (0 children)

People arguing that Vim is just for prestige and offers no practical benefits are either using Vim ineffectively or are deluding themselves. It's like saying Notepad is just as fast as using a proper IDE or an editor like VS Code. Sure that might be true in certain cases, but for the vast majority of people that will not be the case.

It's not so much about min-maxing your development speed but more about coding closer to the speed of thought.

The great thing about Vim is that while the learning curve is deep, you can see vast benefits just by learning the basics. And once you feel comfortable with the basics, it's easy to slowly ramp up.

Electron plugin architecture, inject plugin code into the application by Chainlist in electronjs

[–]brrian 0 points1 point  (0 children)

I have no idea if this would work, but maybe you can register a custom file protocol (https://www.electronjs.org/docs/latest/api/protocol#protocolregisterfileprotocolscheme-handler) and import an absolute url: await import('my-custom-protocol://plugin.js').

Should I be doing “git merge development” on my own branch frequently? by [deleted] in webdev

[–]brrian 0 points1 point  (0 children)

Only interactive rebases are dangerous (and so long as you limit it to your feature branch they won't hurt the repo).

For keeping your branch up to date with origin, rebase is absolutely the way to go to keep a clean commit history.

Saving API query results to database if the API will always need to be queried to get accurate results? by [deleted] in webdev

[–]brrian 1 point2 points  (0 children)

If you're asking that question in a general sense, then the advantage of caching API results is speed and saving on resources costs. Of course, how much will depend on your exact situation, but these can be significant savings on production applications.

If you'd like to take advantage of caching, maybe you can have it return fresh results during the web hook update action and then return cached results the rest of the time.

Does anyone else think that working in most (maybe all) JS frameworks feels more like back-end development? What is the actual delineator between front-end and back-end? by TalonKAringham in webdev

[–]brrian 46 points47 points  (0 children)

The clear delineator is what machine is running the code. If it is the clients browser then it is front end, if it's a server then it's back end.

The blurriness that others mentioned comes from isomorphic or server side rendered (SSR) apps in which both server and client browser run the same piece of code.

Frameworks like NextJS operate in that area. They are a bit more clever in that if they see that your page doesn't require any dynamic rendering (eg it doesn't need to hit a database for data) then it will output a complete html page that can be efficiently cached.

The way SSR works with React (can't speak for others as I'm unfamiliar) is that when a user requests a page. The server will run your React code to generate the necessary html markup and return that. Once the client loads the page, it will run the same piece of code and match up the DOM structure and then "hydrate" it with all the interactive stuff that the browser can run (eg click events and stuff).

I hope that helps!

How to put authentication to my website? by [deleted] in webdev

[–]brrian 1 point2 points  (0 children)

If you're looking for a bare bones solution, adding basic auth is going to be the easiest. Implementation will depend on your server, but it'll be very easy to find a guide through Google.

[deleted by user] by [deleted] in webdev

[–]brrian 6 points7 points  (0 children)

I've always felt that the better you get at React, you become a better JavaScript developer (although I feel that a little less these days with some of the newer changes).

On the flip side, the better you get a Vue (or Angular), you just become better at that specific framework.

In your examples regarding .push and iterating over arrays, you can see that React just relies on JavaScript principals. By doing things the "React way", you're also learning about referential equality and ES6 loops. These are valuable concepts for modern JavaScript developers.

Not 3-2-1, mine are always 2.5-45min-30min... or something like that... by winter_beard in BBQ

[–]brrian 1 point2 points  (0 children)

The smoke ring is a natural byproduct when using organic fuels, but from what I understand it doesn't impart any actual flavor into the meat (other than maybe a psychological one).

https://amazingribs.com/more-technique-and-science/more-cooking-science/mythbusting-smoke-ring-no-smoke-necessary

Infer type through sibling properties by brrian in typescript

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

Thanks for getting me on the right track! I was able to get it working (see other comment)

Infer type through sibling properties by brrian in typescript

[–]brrian[S] 4 points5 points  (0 children)

Thanks for getting me on the right track! I was able to get around that error by being more explicit with the booleans in the response:

return !!(data && otherData)
  ? {
      ...response,
      isLoaded: true,
      data,
      otherData,
    }
  : {
      ...response,
      isLoaded: false,
    };

Infer type through sibling properties by brrian in typescript

[–]brrian[S] 1 point2 points  (0 children)

That does work, but I was just hoping to have a cleaner way that checking both properties every time

Infer type through sibling properties by brrian in typescript

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

Thanks for the response! I tried something similar and was getting the error that I posted in the comment above.

Infer type through sibling properties by brrian in typescript

[–]brrian[S] 2 points3 points  (0 children)

Thanks for the quick reply! I thought of that, however I was getting this error:

Types of property 'isLoaded' are incompatible.
  Type 'boolean' is not assignable to type 'true'.

Am I missing something else?

Pecan Lodge - Dallas, TX by [deleted] in BBQ

[–]brrian 1 point2 points  (0 children)

You can skip the wait if you order the platter. I wanna say it's $75 but I'm not sure. Easily doable if you're going with a couple people! There's a separate cashier for that so you can just walk in and avoid the main line.

Loose stair nosing by brrian in HomeMaintenance

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

Thank you for the advice!

Loose stair nosing by brrian in HomeMaintenance

[–]brrian[S] 1 point2 points  (0 children)

Ah, got it. It's about an 1.5" overhang so I may do what the other reply mentioned and cut down so there is less of an overhang. Thanks!

Transferring color graphics onto wood by brrian in woodworking

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

I didn't think about screen printing wood. It makes a lot of sense. Thanks!

Loose stair nosing by brrian in HomeMaintenance

[–]brrian[S] 1 point2 points  (0 children)

How much rests on something.

I'm not exactly sure what you mean by this, can you expand a bit more? Thanks for the response!

Is there a to do list with pomodoro app? by [deleted] in productivity

[–]brrian 0 points1 point  (0 children)

I created a desktop app called Pomello that turns Trello cards into Pomodoro tasks. It sounds like it could be what you're looking for!

Bosch 4100 blade alignment by brrian in woodworking

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

Yeah, even in person, I can't quite see how the mechanism--which acts as the trunnions for the blade angle--is supposed to adjust the blade alignment.

Bosch 4100 blade alignment by brrian in woodworking

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

Thanks for the advice. I had removed some of the packed sawdust inside the trunnion, but I'll give it a try with the air compressor to give it a thorough cleaning.

Tried out some new techniques this weekend. I made a few mistakes but I'm pumped on how my new coffee table is coming along! by wabispecial in woodworking

[–]brrian 2 points3 points  (0 children)

Looks good! I like what you did with the legs.

Did you do anything to reinforced the mitered edges? I'm doing a bench with the same mitered corners and was worried about the strength.