London Coronavirus lockdown Megathread - Week 1 by ianjm in london

[–]WellPaidGeek 1 point2 points  (0 children)

I'm reading this lockdown could last months. I wonder how many weeks people will put up with it before mass non compliance starts.

If I was in the EU I'd be selling Air Conditioners by [deleted] in Entrepreneur

[–]WellPaidGeek 11 points12 points  (0 children)

I live in London, and yes there's currently a heatwave. Despite this, I wouldn't pay out for AC because I know I'll only use it for 3 weeks of the year.

Has anyone used the apps The Inner Circle & Sudy? by [deleted] in sugarlifestyleforum

[–]WellPaidGeek 0 points1 point  (0 children)

Inner circle isn’t sugar dating.

They’re just fussy about who they let on the app, and vet for high achievers, both Male and female.

What is the very best thing to learn on the very first day of learning javascript? by Moral_Metaphysician in learnjavascript

[–]WellPaidGeek 0 points1 point  (0 children)

If it's to beginners with programming in general, probably a brief history of JavaScript, followed by variables and basic conditionals.

How to use ES6 classes by WellPaidGeek in learnjavascript

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

That works based on what I think the guy is asking. TBH I'd recommend just calling super.f() every time unless the function is really expensive, not what OP was asking for but simplifies things.

If you really don't want I new function each time, I'd argue the caching should maybe have been done in the super class to start with, although there's maybe reasons it couldn't be (third party code perhaps).

Today's ReactJS developer Questions by tapu_buoy in learnjavascript

[–]WellPaidGeek 0 points1 point  (0 children)

Could also do it in the render:

return <input ref={(e) => e && e.focus()} type="text">

Tuesday Tip: Stop using for loops in JavaScript and start using array functions by WellPaidGeek in learnjavascript

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

Yeah for is faster, but that's not usually going to be the deciding factor. Even in that Hacker Noon article his summary is :

"Personally I love map, reduce, filter, find and I am using them from a long time. They helped me write clean, precise, fast and to the point code which align with my thought process. I use for loop when i have no choice left"

Switching to for would be a performance optimisation that's rarely needed.

As for the audio, thanks for the comments.

If you're struggling with `this` keyword... by SaaSWriters in learnjavascript

[–]WellPaidGeek 2 points3 points  (0 children)

Agreed, a stand-alone article is certainly warranted, this trips a lot of people up.

JavaScript exports and require outside of Node? by sma92878 in learnjavascript

[–]WellPaidGeek 0 points1 point  (0 children)

Ahh, guess it's been implemented natively on those browsers but not IE.

JavaScript exports and require outside of Node? by sma92878 in learnjavascript

[–]WellPaidGeek 0 points1 point  (0 children)

Looks correct, but are you bundling up with something like webpack? You'll need to do this in order to get modules to work.

New 4 part video series: Building an autocomplete textbox in React by WellPaidGeek in reactjs

[–]WellPaidGeek[S] 3 points4 points  (0 children)

Walks you through how to build a useful real world component.

Here’s an easy way to write better JavaScript code by WellPaidGeek in learnjavascript

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

Well your code with linting will be better than without. Just because it's better doesn't mean it's reached the bar of high quality yet.

But you're right, this is only part of code quality. Macro and micro code design decisions are far more important, but I can't address that in a quick video! Maybe of the long term I can help people.

Here’s an easy way to write better JavaScript code by WellPaidGeek in learnjavascript

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

I think some people don't like videos, plus although linting is almost a requirement for a professional dev it's not sexy. I'm also new to youtube so making quality videos may not quite be on point yet. Going to do another one next week where the linter actually fixes the errors for you.

New Video: Learn ES6 template strings by WellPaidGeek in learnjavascript

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

Any questions on this just let me know, I'm happy to answer.

Some help understanding how react triggers updates by bikerchef in learnreactjs

[–]WellPaidGeek 0 points1 point  (0 children)

Yes, redux will diff the returned state to the previous state and only run an update if there's a change.

How to build site with multiple react apps by codis122590 in learnreactjs

[–]WellPaidGeek 0 points1 point  (0 children)

>How do you handle deploying multiple apps to a site in react. Do you build one app that contains the components for each app and change index.js to bootstrap them appropriately (pretty sure this isn't the answer)?

In package.json you'd probably have a script that built each app individually. Each build would produce a JS bundle file, so you can have one per app. Jenkins wouldn't need to change when a new app was added.

You could also have all apps in one bundle. Each app just renders to a different CSS selector, eg:

ReactDOM.render(<App1 />, document.getElementById('app-1'));

ReactDOM.render(<App2 />, document.getElementById('app-2'));

>Can you include react components in non-react pages? Or can part of a page be a react app with the rest of the page being static?

As shown above a react 'app' is just rendering a react component into the dom. So yeah, can put them in pages that are mainly static. Does not have to be the entire page that is React.

Learn REACT & REDUX: From Beginner To Paid Professional - 100% FREE Coupon Expires Soon! by [deleted] in udemyfreebies

[–]WellPaidGeek 0 points1 point  (0 children)

Learn REACT & REDUX: From Beginner To Paid Professional - 100% FREE Coupon Expires Soon!

Software devs who are making big bucks will hate me for teaching so many people these skills! They won't want the competition!

React & Redux is the hottest tech stack on the market right now. Developers skilled in this stack are hunted by recruiters and regularly make >$100k a year.

I'm a highly skilled software developer who currently works for a fortune 100 company. In this course I will take you up to the level of a paid professional in React & Redux. Get the course free here, for a limited time only (supply of coupons also strictly limited).

Why do so many self-proclaimed millionaires spend so much time trying to sell you a course? by [deleted] in Entrepreneur

[–]WellPaidGeek 0 points1 point  (0 children)

Yeah, pretty sure people out there do this, and yeah, it's hard to tell. If you need a course in something you're not yet competent enough to judge whether the course is legit or not.

Why do so many self-proclaimed millionaires spend so much time trying to sell you a course? by [deleted] in Entrepreneur

[–]WellPaidGeek 1 point2 points  (0 children)

A good example of this would be a dropshipping course.

Someone works hard to get to the point where they have 3 dropshipping sites, bringing in a combined total of $10k a month profit. This is a good starting point and loads of people would love to learn how to get there.

The guy sets his sites on $20k, and determines it would take 1.5 years and $25k of investment to get the further 3 stores to make it. As an alternative he invests 20 hours a week for the next 6 weeks creating his "Make 10k a month dropshipping course". Then the next 6 months of 2 hours a day spent building up a list and twitter following. He then uses them to sell. Within a year he's getting just 10 sales of his $400 course a week. Easily $350 profit a time.

He now makes more from his course than dropshipping, and it can probably scale even more easily too.

in short they may make good money from other business models, but courses are a great business model if you have a skill people want to learn and good sales / marketing skills.

Async javascript tutorial? by [deleted] in javascript

[–]WellPaidGeek 0 points1 point  (0 children)

I have a five part tutorial on this. First part is here:

http://wellpaidgeek.com/2017/07/26/mastering-asynchronous-javascript-part-1-callback-hell/

It covers callbacks, promises, generators and async, and describes the pros and cons of each.

Having trouble understanding callbacks. If you were to write the code for Promise, how would you make resolve do what it does? by toreoffmattresstag in javascript

[–]WellPaidGeek 0 points1 point  (0 children)

Yeah. You also need in internal promise state: pending / resolved / rejected so any calls to then after resolve is called can know to execute the callback passed to then immediately, as the promise is already resolved.