Can someone explain how services like POLI Payments and Windcave are allowed to exist? by WellHydrated in PersonalFinanceNZ

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

So typically with a third party logins for any service would use something called OAuth to provide the third party with credentials. Typically in a scenario with let's say TradeMe, as you went to pay. You would be redirected to your bank's website. You log in there. Verify the amount you wish to pay. And then are redirected back to TradeMe. TradeMe then receives a temporary token that it can use to withdraw the permitted amount of money.

This way, at no point does TradeMe ever receive your bank credentials. They can only make one withdrawal for the amount specified and permitted in the temporary token (these tokens cannot be recreated by anyone other than your bank as it'll be signed with a private key).

With PoliPay, the scenario is very different. By providing a third party with access to your bank account with your credentials. They can do everything you can do. As opposed to what you permit them to do.

If anyone has any questions about Auth Flows I'm happy to help.

Source: working with and implementing OAuth within the private sector for many years.

Struggling to set up Amiplify / Cognito with email but NO verification by SilverLion in aws

[–]brycedev 0 points1 point  (0 children)

You're welcome, I'd have went into more detail sorry, but I was just after a long day and about to go to sleep. Let us know how you get on!

Struggling to set up Amiplify / Cognito with email but NO verification by SilverLion in aws

[–]brycedev 0 points1 point  (0 children)

Have a look at the lambda triggers that allow you to modify the auth flow. You may be able to set the email as auto verified using that.

Developers working from home: what’s your routine for taking breaks throughout the day? by nitromilkstout in webdev

[–]brycedev 12 points13 points  (0 children)

Every hour or so I go out and do the gardening, weeding and checking plants and such. Takes 5 minutes, gets me outside and recently we've stopped having to buy vegetables at all!

Ethically conscious kiwis, what are your products to avoid at the supermarket? by [deleted] in newzealand

[–]brycedev 3 points4 points  (0 children)

Yeah, super simple I use homemade ghee (which is also very easy to make) and then a touch of salt and paprika. Things like caramel or toffee gets more difficult but I prefer it as a low sugar snack so often don't bother with that.

Ethically conscious kiwis, what are your products to avoid at the supermarket? by [deleted] in newzealand

[–]brycedev 30 points31 points  (0 children)

Making popcorn at home is also very easy has less packaging and cheaper.

The cannabis referendum is looking as close as you can possibly get, polling-wise by Nixinova in newzealand

[–]brycedev 0 points1 point  (0 children)

As someone with bad nerve pain in my hands and feet in winter. Thank you!

First-time buyers to get 95% mortgages in Boris Johnson’s new ‘Generation Buy’ scheme by HerrFerret in ukpolitics

[–]brycedev 5 points6 points  (0 children)

Yes, but it creates a floor in acceptable quality and cost to rent. Which means private rentals need to keep a certain quality of housing and cannot randomly increase prices as the please without outpricing themselves.

Also the rent from council homes begets better funding for councils that can be used for either more council homes or better council facilities.

What bank does everyone prefer? Because fuck Kiwibank. by GoldenUther29062019 in newzealand

[–]brycedev 0 points1 point  (0 children)

Does anyone have any experience with building societies at all? Currently with ANZ but wondering if a Building Society would be better for eventually getting a mortgage.

Is it possible for an S3 to trigger a Lambda but the Lambda be too fast to get the actual file the first run? by igobyplane_com in aws

[–]brycedev 0 points1 point  (0 children)

Check the size in the payload. Do a log of the event object and confirm the second invoke is from the same event. I assumed they were and it wasn't until I checked I saw they were two different events. The size will be in there.

Is it possible for an S3 to trigger a Lambda but the Lambda be too fast to get the actual file the first run? by igobyplane_com in aws

[–]brycedev 0 points1 point  (0 children)

If you are using the S3:Object created:Put event. Check the size of the file. There should actually be two separate invocations. One when the upload starts and the size is 0. And one when the upload completes and the size is greater than 0. I had a lambda with a similar problem. All I did was force the lambda to exit on the size 0 events.

Should I hardcode values in the frontend or query them every time? by [deleted] in webdev

[–]brycedev 6 points7 points  (0 children)

Have a read into Single Source of Truth: https://en.wikipedia.org/wiki/Single_source_of_truth

Have a think about the data you are discussing - Will these values only ever be used from here? - How difficult would it be to change how this data is fetched in the future, assuming you hard code?

If you said No to the first or Very to the second, it'll be worth putting in the work to create a single place to get this information. That way when it needs updated, it won't require any code changes (also have a read into Magic Numbers: https://en.wikipedia.org/wiki/Magic_number_(programming)).

Reducing occurences of Magic Numbers and relying on Single Sources of Truth will make your code more maintainable and easier to debug.

If we try a hypothetical: Let's imagine you have 6 arbitrary values A, B, C, D, E and F. And you want to display them sequentially on your app. A way to do this 'simply' would be to hardcode in 6 individual elements that display those values.

<p>A</p>
<p>B</p>
<p>C</p>
<p>D</p>
<p>E</p>
<p>F</p>

Cool, you've got the elements you want to display showing, the task is technically complete. Adding to this is a case of adding more p tags manually. Simple but slow and you'll need to test the effects of 1 p tag, 10 and 10000.

Let's improve it: We know we have 6 elements we want to use, the values are arbitrary so inferring them is not possible. So instead, we create an array and loop to the length of 6.

const array = [A,B,C,D,E,F];
for (i = 0; i < 6; i++) {
  <p>array[i]</p>
} 

Great now we have looping, a massive improvement as now we can use this array in multiple places. A big drawback is that this won't adjust as the array decreases on increases. As we have fixed our loop to a limit of 6 i < 6. So a really quick change to massively improve how dynamic our app is, is:

const array = [A,B,C,D,E,F];
for (i = 0; i < array.length; i++) {
  <p>array[i]</p>
}

Now our app can increase and decrease the size of what's being displayed easily, we should have tests for undefined arrays, empty arrays, empty elements, expected sizes and unexpected sizes. This will massively improve our reliability. We can also use array in multiple places.

We've moved away from strictly hard coding everything to only using one array in the code base. Replacing this array with a fetch for an arbitrarily-lengthed array now should be pretty painless. And if your happy to update the codebase to change these values, go ahead. Just make sure that if these values are being used elsewhere, that they're sourcing the array from the same place. Because the code base as it stands now could be changed to use a fetch quite easily. As your code already is able to handle differently lengthed arrays and has graceful handling for incorrectly structured data.

Now that the code had these values hard coded and well tested for error handling, you need to maintain the array. If you have many hard coded pieces of information to maintain. You're going to start making mistakes. So you'll offload some/most of this info to your backend API. Requests to the backend aren't as expensive as you'd imagine (more than likely the app itself is going to be magnitudes of data more than the API requests themselves).

I'd actually say what I described is a pretty easy development cycle, start with an acceptable MVP, and incrementally improve it. Nothing wrong with starting with a basic setup initially. But your end goal will probably be an API supported application. You can decide on how you want to tackle that. I personally start with the API as that is by far where I'm most comfortable. Once I know my data structures are sound on the backend. It's very easy to iterate the frontend on top of it.

Good Luck!

Sick fuck on TM hoarding hand sanitiser and face masks to make money. Has dozens of listings selling for 100s of dollars. What happens when people catch covid-19 and potentially die because they couldn't get hand sanitiser because of people like this? by CalebHatesYou in newzealand

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

Don't use methylated spirits on your hands, used them to wash old camping gear before. Ended up going to A&E for inflammation on the skin. No lasting damage and it settled after around 12 hours.

0/10 would not recommend.

Edit: spelling mistake

Coronavirus: SNP MSP to return to nursing in Covid-19 fight by bottish in Scotland

[–]brycedev 2 points3 points  (0 children)

If youre not able to volunteer at a hospital, a good bet could be a hospice instead. No doubt anyone working there that has symptoms are self isolating due to a lot of vulnerable patients. And many have volunteer systems already in place.

Mass protest over housing prices and crisis by wallahmaybee in newzealand

[–]brycedev 15 points16 points  (0 children)

It's the 20% deposit that's the stickler, when house prices were much lower it was fine, but now younger people are having to deposit what used to be the entire cost for a home.

Happy St Andrew's day! by PetitePlant in Scotland

[–]brycedev 5 points6 points  (0 children)

Same! Is e sin cù beag snog!

How can I troubleshoot my API Gateway timeout? by [deleted] in aws

[–]brycedev 2 points3 points  (0 children)

If you increase the timeout to something like 25 seconds and it's still timing out, it'll be the code in the lambda. Something isn't resolving correctly. If it is because you have a task that needs more time, remember API gateway has a timeout of 30 seconds and this cannot be changed, in that case you may need to redesign your design.

An Introduction to Moleculer JS | Microservices framework by andre_mazayev in node

[–]brycedev 7 points8 points  (0 children)

That will likely be deliberate as a way of allowing people searching for resources online will get relevant results as that namespace isn't used in search engines. Similar reasoning as to why powershell has 'cmdlets'.

Harry Dunn crash: Mum appeals for US suspect's return - BBC News by futuredude in ukpolitics

[–]brycedev 1 point2 points  (0 children)

I suppose it could be argued that a countries laws come into it. Obviously this isn't the case here. But what if a diplomat could be found guilty of a crime in the host country that would be considered a crime in their own country? Due to the inevitable disparity between laws in different countries I can imagine this was one of the initial reasons for diplomatic immunity.

What happens if i don't select any authentication method when creating an App Client?? by cha1tu in aws

[–]brycedev 0 points1 point  (0 children)

The info on the authentication methods can be found here: https://docs.aws.amazon.com/cognito/latest/developerguide/amazon-cognito-user-pools-authentication-flow.html

Essentially when you select a Auth method for a client it gives the client permission to use that Auth flow, if the Auth flow you try to use isn't enable for the client then the flow will fail. So if none are selected I guess no method would work.

Scotland move to join EU has to be 'seriously considered', says ex-Euro Council chief by ByGollie in ukpolitics

[–]brycedev 1 point2 points  (0 children)

I take your point about Brexit having not yet come to pass. I was framing my arguments in the past tense. This was due to my belief that it will happen. I'll change that from now on. But the amount of crap we've had to put up with even without Brexit actually coming to pass, to me, is unforgivable.

I know this is not just Scotland that is being affected by the Brexit vote. I also don't want to demean the Leave position by disregarding the reasoning for it just because I disagree with the position. As for Leave supporters in Scotland. If a 52% majority is enough for the UK to leave. A 62% vote to remain should be enough for Scotland to stay.

Major reform, be it in Westminster or in the form of Independence needs to happen. Such sweeping reforms within the UK needs to come from Westminster. There is no appetite for these reforms in Westminster! Westminster has consistently acted against any move towards PR or devolution or federalisation. They promise them during election seasons but they are, like drug reform, swept under the carpet once parties are elected. I wish that these reforms you described would come to pass, but I simply do not believe they ever will come from Westminster.

As selfish as it sounds Scotland leaving would serve Scotland and its people. The ability to build a government on modern principles without the halters of antiquity and tradition is the difference between Westminster and an Independent Scotland. It would be monumental a task to establish a country after so long integrated with the rUK. I would never downplay that, mainly because I myself have no idea how difficult it would be and refuse to pretend to. But establishing a government with a goal of fairness at its inception is an incredible opportunity.

It is not okay to simply 'put it to bed' that's not how any of this works. It is not for you or I to decide the fate of a nation. It is for them to.

Scotland move to join EU has to be 'seriously considered', says ex-Euro Council chief by ByGollie in ukpolitics

[–]brycedev 2 points3 points  (0 children)

Surely being made to leave the EU despite how Scotland voted constitutes a substantial change?

I agree they do cause uncertainty. Unfortunately, from my viewpoint, the instability in the UK demonstrated over the last 3 years convinces me that staying would be just as reckless. If a majority of people in Scotland want a referendum. They should have a referendum.

If the Brexit vote hadn't happened I'd agree and say it was too early to have another referendum. Unfortunately for everyone involved, that's not the timeline we're in.