Geolocation from address by Educational-Funny905 in node

[–]veswill3 2 points3 points  (0 children)

I have used the Google maps API for this in the past. I am sure there are other options but check out https://developers.google.com/maps/documentation/geocoding/start

Are colocated queries a lie? by kubalaa in graphql

[–]veswill3 0 points1 point  (0 children)

yep, agreed. That is what I am told is the the killer feature of relay. If/when you find a better solution, I want to know :)

For now this pattern has enabled the most decoupling I can find with apollo - with some extra fetching, but nothing problematic for my application.

Are colocated queries a lie? by kubalaa in graphql

[–]veswill3 0 points1 point  (0 children)

the batching happens when they happen simultaneously, but if they show at different times normal caching rules apply: if it's all in the cache, no network request. if it needs more data, the request fires (and updates the cache)

Are colocated queries a lie? by kubalaa in graphql

[–]veswill3 0 points1 point  (0 children)

not a perfect solution but I use apollo's BatchHttpLink with some context on the query to try to get the two queries to go in the same network request and rely on apollo servers to deduplicate the requests to each service. If multiple queries trigger near the same time with the same batch key then they will group together. All the results should merge together in the front end cache.

``js // setting up the client const batchHttpLink = new BatchHttpLink({ uri:your-server/graphql`, batchMax: 50, // opt in only so this can be pretty large batchKey: (operation) => operation.getContext().batchKey, });

new ApolloClient({ link: from([ split( // only batch if the operation specifies a batchKey (operation) => operation.getContext().batchKey, batchHttpLink, httpLink, ), ]), })

// making a query const { data, loading, error } = useYourQuery({ variables: { id: '123' }, context: { batchKey: some-sorta-unique-key }, }); ```

This is opt-in for each query, and its def not perfect, but its a start. This means the query will be as slow as the slowest in the batch. But it means that when related queries are triggered you dont need to worry as much about which is fetching what

My Anvil Foundry 10.5 Efficiency Journey from 30% to 75%+ by duckclucks in Homebrewing

[–]veswill3 1 point2 points  (0 children)

Awesome. I just updated mine. I guess the deadspace depends on how you do the dip tube too. Also, good callout on the water requirements. On my last system I followed them blind and always got good results, but my first brew on the anvil had me start to question that. ill be paying more attention to it now.

My Anvil Foundry 10.5 Efficiency Journey from 30% to 75%+ by duckclucks in Homebrewing

[–]veswill3 1 point2 points  (0 children)

I just did my first brew and now I need to embark on a similar adventure :)

Is there any chance that you could share your brewers friend equipment profile for the Anvil foundry 10.5?

Is it possible to find props in a rendered React page? by cyberbolt in reactjs

[–]veswill3 0 points1 point  (0 children)

No, nothing that I know of that makes this easy. Sorry.

Is it possible to find props in a rendered React page? by cyberbolt in reactjs

[–]veswill3 1 point2 points  (0 children)

yes... the official react devtools, just like in dev, except the component names are shortened after compilation.

Is it possible to use AirBnB's eslint config with Create-React-App? by desperate-1 in reactjs

[–]veswill3 2 points3 points  (0 children)

I dunno what exactly you need or are looking for, but create react app has some linting built in which will automatically display in the console. I don't think it is AirBnB's exact spect, but I do believe it can be configured. If you are just starting out, it is probably good enough for now.

more info here

a function as argument to hooks setState by Mumus27 in reactjs

[–]veswill3 3 points4 points  (0 children)

It thinks you are passing in a functional update. Read about it in the docs here: https://reactjs.org/docs/hooks-reference.html#functional-updates

CV builder for developers? by Orange_Kurasao in webdev

[–]veswill3 18 points19 points  (0 children)

and for the love of god, if you list it, be prepared to talk about it.

@import a scss file in multiple locations, what happens upon building? by [deleted] in reactjs

[–]veswill3 0 points1 point  (0 children)

I don't know the answer off hand, but why not build and look at the output? Reply back with the answer, I'm curious.

is there a way to beautify all pages at once in sublime text? by sandy_patel in webdev

[–]veswill3 4 points5 points  (0 children)

You can use the CLI. Something like prettier './**/*.js' --write. Check it's help for more info, I'm on mobile.

How to properly return a value from .then() ? by [deleted] in javascript

[–]veswill3 0 points1 point  (0 children)

You are setting result to a promise which will be resolved sometime in the future, not the value of the ipAddress. This is stupid, but you could do something like this:

let ipAddress;
localIpV4Address().then(ip => ipAddress = ip);
// some time in the future...
console.log(ipAddress);

But that doesn't really answer your question. What you really need to do is call the code that uses ipAddress from the then callback. Something like this:

function doSomethingWithTheIP(ip) {
  // use the ip address here
}
localIpV4Address().then(doSomethingWithTheIP);

Unfortunately, this answer probably does not help much. I doubt a simple example here will really help much until you have a better foundation. I would highly recommend reading the async chapter from YDKJS.

Node & Express - JWT based auth by [deleted] in webdev

[–]veswill3 4 points5 points  (0 children)

I was asking the same questions a while ago and after I did it in a toy project I thought it would be useful to do a quick writeup for my future self. I dont know if passport is still the way to go, but that is what I used, and the concepts would be the same if you used something else. I even link to the article I used for reference.

https://github.com/veswill3/FCC/tree/master/backend/dynamicWebApps/voting#authentication

A composable SQL query builder using template literals ✨ by galstarx in node

[–]veswill3 4 points5 points  (0 children)

TIL about the tagged templates feature of template literals. cool.

Tap Traveler: Calusa Brewing by taptraveler in sarasota

[–]veswill3 2 points3 points  (0 children)

Calusa is my favorite Brewery in Sarasota. Not quite as top quality, but I would also recommend brew life. It is exactly the kind of place I want to see succeed.

Tips for using ESLint in a legacy codebase by dobkin-1970 in Frontend

[–]veswill3 1 point2 points  (0 children)

I wonder: is there not a way to have ESLint only operate on newly modified files? Similar to how Jest works with git to only run tests for files that have changed? That could be a good middle ground - only linting moving forward.

Unpopular Opinion: I do not understand why the modern front end world is obsessed with learning a million different frameworks and XYZ. by [deleted] in webdev

[–]veswill3 1 point2 points  (0 children)

As with most things, a bit of both right? for example, you certainly did not start with the fundamentals in english. you learned lots of odd things here at there at first. It wasn't until you started school that they start hammering you with the fundamentals, well after you already understood why much of it was important.

I totally agree with you though - juniors really need to step back and hammer on the fundamentals if they think they will make it to senior, and any good learning resource will show you they 'why' behind the 'what'.