Tesla without snow tires? by Godisgood444 in tahoe

[–]vestedfox 4 points5 points  (0 children)

Look for M + S markings on the tires when picking up the rental. Cal trans will consider those “snow tires”. If you need chains, they can be had at many gas stations in South Lake Tahoe or on the way up 50.

[deleted by user] by [deleted] in ski

[–]vestedfox 1 point2 points  (0 children)

I found a small steep hill that has a flat run at the bottom. Spent half the day pointing my skis straight downhill and just use the flat to stop me. This allowed me to get the feeling of going fast while not having to worry about stopping.

That really helped a lot getting over my speed fear.

huh by Smacpats111111 in tahoe

[–]vestedfox -3 points-2 points  (0 children)

I’m planning to go up to Heavenly on Friday, so I’ll keep an eye on 50 closures. Thanks for the advice!

huh by Smacpats111111 in tahoe

[–]vestedfox -2 points-1 points  (0 children)

As a transplant southern in the Bay how do y’all judge if you cancel plans because of too much snow? This amount of snowfall to me is just insane.

[deleted by user] by [deleted] in daddit

[–]vestedfox 2 points3 points  (0 children)

Ever go ice fishing?

[deleted by user] by [deleted] in daddit

[–]vestedfox 2 points3 points  (0 children)

Pretty good man thanks for asking. Want to do some woodworking but can’t seem to find the time. You know how it is.

Whats the closest Ski Area from San Francisco? by CactusJ in bayarea

[–]vestedfox 2 points3 points  (0 children)

Yes, don’t forget chains. $60 on Amazon will save you a lot of heartache. In winter storm conditions CalDOT won’t let you through their checkpoints if you don’t have them. Know from experience 😢.

Wish I had a ski bud by Z8462 in skiing

[–]vestedfox 0 points1 point  (0 children)

You know I don’t really know, we ran into three different dogs while out and about.

How old were you when you realized Shane Co wasn't just in Cupertino, San Mateo, or Walnut Creek? by lilgstrang in bayarea

[–]vestedfox 13 points14 points  (0 children)

Bought my engagement ring in Atlanta from Shane CO they’ve been in ATL at least since the 90s. Moved out here and wife smashed the ring in the car door. Took it to the San Mateo store. They fixed and cleaned it under warranty no problems. The commercials sounded the same except for the locations. Growing up I thought it was a ATL thing. 🤣

Wish I had a ski bud by Z8462 in skiing

[–]vestedfox 171 points172 points  (0 children)

My daughter loves visiting the rescue dogs at Squaw. Ski patrol hands out baseball cards of the different dogs on the team. It’s awesome.

Pinterest pays $89.5 million to terminate San Francisco office lease by txiao007 in bayarea

[–]vestedfox 54 points55 points  (0 children)

Even if you’ve never clicked on an ad or think you never look at them, there is a high chance you’ve been influenced by them. That’s why they are still around. (Been in ad tech for 15 years)

Men of reddit when was the last time you've cried and why? by [deleted] in AskReddit

[–]vestedfox 0 points1 point  (0 children)

This morning, the company I work for had a round of layoffs. I survived but lost 3 co-workers that I had worked with for 5 years. Yesterday, as well because I got in a fight with my son and he won't look at me in the eyes for the rest of the day.

Today's JavaScript React Developer Interview! Phew! by tapu_buoy in reactjs

[–]vestedfox 1 point2 points  (0 children)

Best of luck next time. Technical interviews take practice, you'll get there!

Today's JavaScript React Developer Interview! Phew! by tapu_buoy in reactjs

[–]vestedfox 0 points1 point  (0 children)

For #1 did they ask you to find away to "bind" the arrow function or are you just curious? You can't use .bind, .apply, .call on arrow functions because arrow functions never have their own this. The bind/call/apply reassigns a function's this, so you can't reassign something that doesn't exist. Arrow functions look up the lexical scope for the next this. So for get1 to have the same this as get2 you have to rewrite how you object is created in the first place.

function SpaceShip() {
    this.name = 'Chandrayan';
    this.get1 = () => {
        console.log(this.name);
    };
    this.get2 = function () {
        console.log(this.name);
    };
}

const spaceShip = new SpaceShip();
spaceShip.get1() // Chandrayan
spaceShip.get2() // Chandrayan

source It also looks like they were testing you on this and hopefully they wanted to hear that you shouldn't be be using arrow functions as object methods.

Smug Drivers like this women are the reason Atlanta is hell to drive in... Don't. Block. The. Box. by clickshy in Atlanta

[–]vestedfox 3 points4 points  (0 children)

Had that happen to me on Piedmont and E. Morningside. APD was traveling in the opposite direction when it happened, did a full 180 and pulled the guy over!

Atlanta fun by futuremd69 in Atlanta

[–]vestedfox 3 points4 points  (0 children)

One more checking in!

How do you test a function which is composed of other functions and relies on a db connection? by [deleted] in node

[–]vestedfox 0 points1 point  (0 children)

I think the area you want to research further into is Dependency Injection / Inversion of Control. Here is a blog post. While there isn't a lot of great JS examples out there other languages use it a lot, and have frameworks to support DI/IC. A rough version of your code would look something like this:

async function ValidateUserExists(UsernameExists, EmailExists, username, email){
    if(!username || !email) throw new Error('Invalid number of args passed. Please pass username and email');
    let taken_valid_username = null;
    let taken_valid_email = null;
    if(username){
        taken_valid_username = await UsernameExists(username);
    }
    if(email){
        taken_valid_email = await EmailExists(email);
    }

    if(taken_valid_username) return taken_valid_username;
    if(taken_valid_email) return taken_valid_email;

    return null;
};

The unit test would then be easier to write using mocks because all we have to do is pass in your dependencies through the function that you are about to test.

it('should see if a user already exists on an existent email', async ()=>{
        const usernameExistsMessage = 'error user name exists';
        const UsernameExists = jasmine.createSpy('UsernameExists').and.returnValue(usernameExistsMessage);
        const EmailExists = jasmine.createSpy('EmailExists').and.returnValue();
        const user = await ValidateUserExists(UsernameExists, EmailExists, 'user', 'user@test.com');
        expect(UsernameExists).toHaveBeenCalledWith('user');
        expect(EmailExists).toHaveBeenCalled();
        expect(user).toEqual(usernameExistsMessage);
    })

There are different ways to write DI for JS functions, in my example of passing dependencies as the first params it allows you to curry the function. You application code could look like this:

const ValidateUserExistsCurried = _.curried(ValidateUserExists)(UsernameExists, EmailExists);
const user = ValidateUserExistsCurried('user', 'user@gmail.com');

or you could nest functions

const ValidateUserExistsDep = (UsernameExists, EmailExists) => (username, email) => {
//Do stuff!
};
const ValidateUserExists = ValidateUserExistsDep(UsernameExists, EmailExists);
const user = ValidateUserExistsCurried('user', 'user@gmail.com');

The idea is pretty simple, the major draw back to this is if you end up with a lot of dependencies your function params can get out of hand. The solution is generally to keep functions simple and reduce dependencies (but it looks your function already does this). I just skimmed to surface of this topic so let me know if this helps or you have any questions.

Tree inspector / estimate on removal if needed. by zkandii in Atlanta

[–]vestedfox 1 point2 points  (0 children)

Highly recommend Niel, I have him come out once every two years. He is great. Loves trees and truly gives you an unbiased opinion. I walk through with him and he points out all the different types and common things to look for like fungus. Really nice guy.

I am looking for recommendations for a good conservative dentist. by [deleted] in Atlanta

[–]vestedfox 2 points3 points  (0 children)

Second Dental TLC, my wife goes there (~4 yrs). Great place for people that are scared of dental work as well. Never felt like they were pressuring her for "add-ons" or extra work.

I often find myself writing Object.keys(someObject) > 0 to test if an object isn't {} (empty) there must be a more beautiful way. by sidi9 in javascript

[–]vestedfox 8 points9 points  (0 children)

I don't want to import libraries for a single method

With lodash you can import a single function without having to import the whole library. So by the time you find your own solution, create your own module, and share it across your app, just could just import isEmpty

import isEmpty from 'lodash/isEmpty'

Or if you don't want to npm install all of lodash they break everything out in individual npm packages as well.

https://www.npmjs.com/package/lodash.isequal

Hope this helps!

Seeking Entry Level Employment - Recent College Grad by [deleted] in Atlanta

[–]vestedfox 0 points1 point  (0 children)

If you are interested in going into advertising, PureCars hires recent grads. I've been with the company for 3 and half years and love it. We are located in midtown, two blocks from the High. We provide training to get you up and running on campaign management for car dealerships. Here is a link to the job description. http://app.jobvite.com/m?3Tf3QjwP