These are chat archives for FreeCodeCamp/HelpJavaScript

17th
Nov 2018
Brad
@bradtaniguchi
Nov 17 2018 00:04
wtf I refactored and now part of the script is running 2 times with different inputs?? wtf is going on
Jason Luboff
@JLuboff
Nov 17 2018 00:05
You did a shit job refactoring :)
Brad
@bradtaniguchi
Nov 17 2018 00:06
I just moved the functions into their own files tho?
Jason Luboff
@JLuboff
Nov 17 2018 00:08
I just messing with you
time to debug
Simon Cordova
@gbsimon87
Nov 17 2018 00:10
I feel that's all I ever do sometimes
Jason Luboff
@JLuboff
Nov 17 2018 00:12
Always fun looking at a super long query and having to remember what the fuck its doing
Brad
@bradtaniguchi
Nov 17 2018 00:13
yooo like for real I call a function 1 time... and it prints out a console log I have in there 2 times with the name of a file and the contents of it the next time?
Jason Luboff
@JLuboff
Nov 17 2018 00:14
Hmm..
Brad
@bradtaniguchi
Nov 17 2018 00:14
It's cuse I imported the same file two.....
I blame lack of typescript
Jason Luboff
@JLuboff
Nov 17 2018 00:15
...well why didn't you write it in typescript than?
Brad
@bradtaniguchi
Nov 17 2018 00:17
I don't wanna compile the scripts, but then there might be a way around this.... just wonder if I'll have a problem with linting, might not be as hard as I think...
Jason Luboff
@JLuboff
Nov 17 2018 00:18
Fair enough
Well...I think I can officially call this a major upgrade..and thus.. version 3!
Simon Cordova
@gbsimon87
Nov 17 2018 00:27
Good man :)
Sounds like progress..
Brad
@bradtaniguchi
Nov 17 2018 00:27
Nice, I love new version hehe
Jason Luboff
@JLuboff
Nov 17 2018 00:27
Ya...technically. I didn't really want to make the changes but...here we are lol
My cron job function is hideous...
Simon Cordova
@gbsimon87
Nov 17 2018 00:33
You should see my ex
HA!
Jason Luboff
@JLuboff
Nov 17 2018 00:33
ZING
Jason Luboff
@JLuboff
Nov 17 2018 00:40
Well.. my cron job needs refactoring but.. I only have 20 minutes left for the day...think it'll wait until the 26th
Lucci Paula
@luccipaula
Nov 17 2018 00:55
Hey guys I'm having some trouble working with const and let scope in my project
const SunCalc = require('suncalc');

export const getSunAlt = () => {
    const today = new Date();
    let sunAlt;
    if ('geolocation' in navigator) {
        sunAlt = navigator.geolocation.getCurrentPosition((position) => {

            const userLat = position.coords.latitude;
            const userLong = position.coords.longitude;

            const sunPosition = SunCalc.getPosition(today, userLat, userLong);
            return Math.floor(sunPosition.altitude * (180 / Math.PI));
        });
    }

    console.log(sunAlt);

};
How can I properly return the value of sunAlt?
I'm trying to make my code more modular
Simon Cordova
@gbsimon87
Nov 17 2018 01:01
try returning it within the fn and then run the getSunAlt function
@luccipaula
oh shoot missed the return in there
Lucci Paula
@luccipaula
Nov 17 2018 01:02
@gbsimon87 I've called getSunAlt() in another file :)
Lucci Paula
@luccipaula
Nov 17 2018 01:14
I want to create another function to render the results on a webpage but I'm just trying to return the necessary value
Simon Cordova
@gbsimon87
Nov 17 2018 02:11
I'm out guys - night
Lucci Paula
@luccipaula
Nov 17 2018 02:15
Bye bye
Christopher McCormack
@cmccormack
Nov 17 2018 02:21
@luccipaula I believe navigator is async, so you can't really return the value directly. If sunAlt is a promise you can return the promise and then call the .then method to access the data returned in your callback
Lucci Paula
@luccipaula
Nov 17 2018 02:53
@cmccormack Thanks! Yeah I realized that navigator is async so it wouldn't work as I expected hehe. I found a workaround but I want to try using the .then method like you're suggesting.
I need more practice with promises
My solution was, in my SunAlt file:
const SunCalc = require('suncalc');

export const getSunAlt = (lat, long) => {
    const today = new Date();

    const sunPosition = SunCalc.getPosition(today, lat, long);
    const sunAlt = Math.floor(sunPosition.altitude * (180 / Math.PI));

    return sunAlt;
};
Then in my index.js (controller):
import { getSunAlt } from './SunAlt';

const user = {};

const setPosition = () => {
    if ('geolocation' in navigator) {
        navigator.geolocation.getCurrentPosition((position) => {
            user.lat = position.coords.latitude;
            user.long = position.coords.longitude;

            user.sunAlt = getSunAlt(user.lat, user.long);
            console.log(user.sunAlt);
        });
    }
};

setPosition();
console.log(user);
If that looks inefficient please let me know! :)
Christopher McCormack
@cmccormack
Nov 17 2018 02:58
seems fine to me if it works, probably better to worry about efficiency when you start having more code reliant on other parts of your code to get a feel for how it should be setup
Lucci Paula
@luccipaula
Nov 17 2018 03:00
@cmccormack Thanks for looking over it!
Maybe I'll turn setPosition into an IIFE
Christopher McCormack
@cmccormack
Nov 17 2018 03:02
it's a good plan if it is reusable but honestly I like the way you have it, it's more explicit what you're doing
Lucci Paula
@luccipaula
Nov 17 2018 03:03
Yeah I realized I can't see the user object properties outside of it so I'll probably keep the function as is
Ah jk it's async so of course the console.log(user) would give different results every refresh lol
hensn5250
@hensn5250
Nov 17 2018 03:06
@luccipaula Just a suggestion
// MDN  : Promise Constructor 
var promise1 = new Promise(function(resolve, reject) {
  setTimeout(function() {                    //   ***replace setTimeout function with your navigator function
    resolve('foo');
  }, 300);
});

promise1.then(function(value) {
  console.log(value);
  // expected output: "foo"
});

console.log(promise1);
// expected output: [object Promise]
Lucci Paula
@luccipaula
Nov 17 2018 03:11
@hensn5250 Thanks, I'm still new to promises so I've gotta dissect this hehe
It can also be used with async await right?
Christopher McCormack
@cmccormack
Nov 17 2018 03:14
sure just remember async await returns a promise as well
Lucci Paula
@luccipaula
Nov 17 2018 03:15
Oh, I haven't used any of this in practice yet pardon my dumb questions lol
hensn5250
@hensn5250
Nov 17 2018 03:16
@cmccormack is async await considered sugar coated code?
Aditya
@ezioda004
Nov 17 2018 03:16
Yes, its syntactic sugar of generators + promises
Christopher McCormack
@cmccormack
Nov 17 2018 03:16
I like sugar coated better
hensn5250
@hensn5250
Nov 17 2018 03:17
i see
Aditya
@ezioda004
Nov 17 2018 03:17
Then again almost every new syntax added to JS is more or less syntactic sugar
Except regex stuff, those cant be polyfilled
Lucci Paula
@luccipaula
Nov 17 2018 03:19
So would setPosition be my async function? like async setPosition() => { // navigator stuff? }
With try catch in there too possibly?
Aditya
@ezioda004
Nov 17 2018 03:22
Yes like:
const setPosition = async () => {
  try {
    ...
  }
  catch(){
    ...
  }
}
Lucci Paula
@luccipaula
Nov 17 2018 03:22
Oopsies my bad syntax
const setPosition = async () => {
  try {
   if ('geolocation' in navigator) {
        await navigator.geolocation.getCurrentPosition((position) => {
            user.lat = position.coords.latitude;
            user.long = position.coords.longitude;

            user.sunAlt = getSunAlt(user.lat, user.long);
            console.log(user.sunAlt);
        });
    }
  }
  catch(){
    // error
  }
}
Would the await be there?
Christopher McCormack
@cmccormack
Nov 17 2018 03:23
yes but you don't need the callback
the point is to limit that syntax
you can instead assign something, like
const { position } = await navigator.geolocation.getCurrentPosition()
you may need to play with that though I don't remember 100%
Lucci Paula
@luccipaula
Nov 17 2018 03:26
I think you lost me there
Christopher McCormack
@cmccormack
Nov 17 2018 03:26
forgot the await
:)
Aditya
@ezioda004
Nov 17 2018 03:27
Hmm, I dont see any problem with the callback in there - since its only just 1 callback.
Cause await will wait and then you can use the result on the next like
await navigator.geolocation.getCurrentPosition((position) => { ... };
//use the result here
Christopher McCormack
@cmccormack
Nov 17 2018 03:27
but there isn't anything else to do outside the callback in their function
Lucci Paula
@luccipaula
Nov 17 2018 03:29
@cmccormack I don't get this bit const { position }
Is that the function declaration?
Aditya
@ezioda004
Nov 17 2018 03:29
Oh then no point in using a callback func :)
Christopher McCormack
@cmccormack
Nov 17 2018 03:30
you can actually assign the response of an async function directly to a variable in async/await @luccipaula
specifically it's the callback of resolve in the Promise I believe but I"ll let @ezioda004 correct me if wrong
Aditya
@ezioda004
Nov 17 2018 03:32
Sounds about right
Christopher McCormack
@cmccormack
Nov 17 2018 03:34
@ezioda004 you ever figure out how to resolve a conflict locally using merge instead of rebase but not getting those 100+ commits added?
or if it even matters if the diff only includes the PR changes?
Aditya
@ezioda004
Nov 17 2018 03:35
@cmccormack Ah no, never resolved a conflict locally so didnt come across that situation
Christopher McCormack
@cmccormack
Nov 17 2018 03:35
dang
I can do it using rebase easily but I worry that might break something elsewhere, like if they had other PRs from the same branch and I force merge the rebase into their fork
Aditya
@ezioda004
Nov 17 2018 03:37
That rarely happens tho, cause if someone makes 2 PR's from same branch then the other commit is also added to both PR's
Lucci Paula
@luccipaula
Nov 17 2018 03:37
you can actually assign the response of an async function directly to a variable in async/await @luccipaula
I'm still confused as to how that applies to setting my lat and long
Sorry I'm slow
Christopher McCormack
@cmccormack
Nov 17 2018 03:39
@luccipaula no worries - if you assign it to a variable, then in subsequent lines you can just use position in your assignments. You no longer would need to do it within a callback of the async function, that's all
not much of convenience for a single promise but imagine nesting a few, that could get pretty ugly
Aditya
@ezioda004
Nov 17 2018 03:39
@cmccormack Do you know how to see if resolving a conflict will add any additional changes or not? Lately I'm resolving conflicts only to see its adding +0 -0 to the file which feels waste of time
@luccipaula
const { position } = await navigator.geolocation.getCurrentPosition();
user.lat = position.coords.latitude;
// and so on
Christopher McCormack
@cmccormack
Nov 17 2018 03:40
@ezioda004 some of the conflicts appear to happen because they split some lines or whatever, doesn't remove or add to the content in fcc master, maybe that's why
Aditya
@ezioda004
Nov 17 2018 03:43
@cmccormack Oh not that, but more like someone corrected a typo on few lines and those few lines have been rephrased/rewritten, I usually make a decision to keep the current change or the master change..but my question is about is there a way to see if before resolving a conflict would add any changes to the file indeed
Kinda like looking into the future kinda thing :D
Lucci Paula
@luccipaula
Nov 17 2018 03:43
@cmccormack @ezioda004 Okay and that goes inside the async function
Aditya
@ezioda004
Nov 17 2018 03:44
Yes, you cant use await outside of async function
Lucci Paula
@luccipaula
Nov 17 2018 03:44
@ezioda004 That's the only thing I remember about await lol
Christopher McCormack
@cmccormack
Nov 17 2018 03:45
@ezioda004 like if it's worth doing at all?
or if it's only modifying not adding or something?
Aditya
@ezioda004
Nov 17 2018 03:45
@luccipaula Wait till they add the "top level await" proposal :D
@cmccormack Yes
Something like that
Lucci Paula
@luccipaula
Nov 17 2018 03:46
async function setPosition() {
    if ('geolocation' in navigator) {
        const { position } = await navigator.geolocation.getCurrentPosition();

        user.lat = position.coords.latitude;
        user.long = position.coords.longitude;

        user.sunAlt = getSunAlt(user.lat, user.long);
        console.log(user.sunAlt);
    }
};
setPosition();
I've done something wrong cuz this ain't workin
Lucci Paula
@luccipaula
Nov 17 2018 03:51
navigator.geolocation.getCurrentPosition() needs at least one argument
Aditya
@ezioda004
Nov 17 2018 03:52
async function setPosition() {
    if ('geolocation' in navigator) {
        await navigator.geolocation.getCurrentPosition((position) => {
          user.lat = position.coords.latitude;
          user.long = position.coords.longitude;

          user.sunAlt = getSunAlt(user.lat, user.long);
          console.log(user.sunAlt);
        }) 
    }
};
This works?
Lucci Paula
@luccipaula
Nov 17 2018 03:53
@ezioda004 Yep!
That one works
But like Chris said there's no point in a callback so...
Lucci Paula
@luccipaula
Nov 17 2018 04:00
What could I pass into .getCurrentPosition() to be able to save it into a variable
It has to be a function right?
Oh wait so there is a point in a callback lol
Dang I'm slow
Christopher McCormack
@cmccormack
Nov 17 2018 04:06
yeah the callback is only to do something with the return value from the Promise's resolve, async await does that stuff for you so you can pretend it's just returning that value
Aditya
@ezioda004
Nov 17 2018 04:07
In that case you dont really need async-await as you're using a callback
Lucci Paula
@luccipaula
Nov 17 2018 04:07
@ezioda004 Oh
Back to square one
Christopher McCormack
@cmccormack
Nov 17 2018 04:08
I don't think getCurrentPosition is a promise is it
sorry if I lead you astray lol
It doesn't specify that it is
@cmccormack No no I'm learning new things! Thank you
Christopher McCormack
@cmccormack
Nov 17 2018 04:09
I'm so used to modules converting to promises I just assumed
many of the backend modules have converted to promises or there is a fork that returns a promise, makes it so much easier
Lucci Paula
@luccipaula
Nov 17 2018 04:09
I'm easily convinced because I know so little haha
Aditya
@ezioda004
Nov 17 2018 04:09
There might be a promise version of that out there somewhere :D
Christopher McCormack
@cmccormack
Nov 17 2018 04:10
yeah if you used it a lot you could just return the promise in the callback and use that I guess
Lucci Paula
@luccipaula
Nov 17 2018 04:10
@ezioda004 @cmccormack Thank you both for helping me :)
Aditya
@ezioda004
Nov 17 2018 04:17
No problem :thumbsup:
@cmccormack I still havent figured out a way to fix the fork - my 2 options are, someone merges my master branch PR or I close the PR, delete the fork and then open a new PR with new branch
Christopher McCormack
@cmccormack
Nov 17 2018 04:20
@ezioda004 which issue was this? the extra commit?
Man I"m over here discussing with the wife how merges actually work hoping to figure out why we see all the commits when we merge locally the upstream master into a PR branch then push back to their branch, my head is so cloudy with git stuff atm lol
Aditya
@ezioda004
Nov 17 2018 04:22
@cmccormack Yes, master commit being referenced to all commits - lol, advanced side of git is very confusing
Christopher McCormack
@cmccormack
Nov 17 2018 04:24
have you looked up cherry picking? I was reading about this a little today, maybe what you're looking for?
hmm that may be the wrong command sorry
Aditya
@ezioda004
Nov 17 2018 04:28
Its basically picking a commit from one branch and applying to others?
Christopher McCormack
@cmccormack
Nov 17 2018 04:29
yeah I think so
but I don't think it removes it
Lucci Paula
@luccipaula
Nov 17 2018 04:31
I just realized something, I can't use the value of user.sunAlt outside of the function until the navigator processes the position
So it is a promise?
My main goal is to have access to that value so that I can create a view function to display it
Jason Luboff
@JLuboff
Nov 17 2018 04:33
Does the show a shrugging emoji ->🤷‍♂️
Lucci Paula
@luccipaula
Nov 17 2018 04:34
@JLuboff I see boxes
But I'm on an older OS
Jason Luboff
@JLuboff
Nov 17 2018 04:34
Nah I suspected it would only show for me on mobile
Aditya
@ezioda004
Nov 17 2018 04:37
@luccipaula Yeah you can use callback, promise, async await for that purpose
Lucci Paula
@luccipaula
Nov 17 2018 04:39
@ezioda004 So ideally, I shouldn't put all my functions in the await
Aditya
@ezioda004
Nov 17 2018 04:40
//with callback
navigator.geolocation.getCurrentPosition((position) => {
  //after everything is done
  callback(); // which uses user.sunAlt
}
// with promises
new Promise(navigator.geolocation.getCurrentPosition((position) => {
  Resolve(/* send data here */);
}).then(data => {
  //use user.sunAlt here
});

//with async await
await navigator.geolocation.getCurrentPosition((position) => {
  //updates the user.sunAlt
}
//can use user.sunAlt here
Lucci Paula
@luccipaula
Nov 17 2018 04:43
@ezioda004 When I do this I get undefined in the console
await navigator.geolocation.getCurrentPosition((position) => {
    user.lat = position.coords.latitude;
    user.long = position.coords.longitude;

    user.sunAlt = getSunAlt(user.lat, user.long);
});
console.log(user.sunAlt);
Christopher McCormack
@cmccormack
Nov 17 2018 04:45
@JLuboff I see it
On a mac may be why
Aditya
@ezioda004
Nov 17 2018 04:48
@luccipaula I think it needs to be a promise
await new Promise((res, rej) => {
    navigator.geolocation.getCurrentPosition((position) => {
      user.lat = position.coords.latitude;
      user.long = position.coords.longitude;

      user.sunAlt = getSunAlt(user.lat, user.long);
      res();
    })
});
console.log(user.sunAlt);
Lucci Paula
@luccipaula
Nov 17 2018 04:49
@ezioda004 That worked!!
Now I need to get used to that syntax
Thanks again Aditya
Aditya
@ezioda004
Nov 17 2018 04:50
No problem, I'm still getting used to async await myself - I've been consumed by callbacks :D
Jason Luboff
@JLuboff
Nov 17 2018 04:52
@cmccormack hmm I sent it via my iPhone...maybe we’re onto something
Christopher McCormack
@cmccormack
Nov 17 2018 04:53
:mag: on the case!
Jason Luboff
@JLuboff
Nov 17 2018 04:53
How about these 🧙‍♂️🧟‍♂️
Christopher McCormack
@cmccormack
Nov 17 2018 04:53
tiny indiana jones, tiny zombie?
Aditya
@ezioda004
Nov 17 2018 04:53
Thats a wizard, harry!
Jason Luboff
@JLuboff
Nov 17 2018 04:53
I think the first one is a wizard
Christopher McCormack
@cmccormack
Nov 17 2018 04:53
very small on my screen sorry lol
Jason Luboff
@JLuboff
Nov 17 2018 04:53
Ah so you can see them too
@cmccormack change your resolution to old person
Christopher McCormack
@cmccormack
Nov 17 2018 04:54
I think it is already... haha
Aditya
@ezioda004
Nov 17 2018 04:54
:fire:
Christopher McCormack
@cmccormack
Nov 17 2018 04:54
oh no I'm on the smallest one
Jason Luboff
@JLuboff
Nov 17 2018 04:55
You got bad 👀
Christopher McCormack
@cmccormack
Nov 17 2018 04:55
20/15 son lasik
Jason Luboff
@JLuboff
Nov 17 2018 04:56
Man, 20/20 over here(with my contacts)
Christopher McCormack
@cmccormack
Nov 17 2018 04:56
image.png
Lucci Paula
@luccipaula
Nov 17 2018 04:56
Spoopy
Christopher McCormack
@cmccormack
Nov 17 2018 04:57
oh crazy it's much bigger in the image
Jason Luboff
@JLuboff
Nov 17 2018 04:57
Oh ya that’s me
Aditya
@ezioda004
Nov 17 2018 04:57
Its different on windows
Screenshot (167).png
Lucci Paula
@luccipaula
Nov 17 2018 04:59
And NOW I can save the await result in a variable for the position yay!
const pos = await new Promise((resolve, reject) => {
    navigator.geolocation.getCurrentPosition((position) => {
        resolve(position);
    });
});
console.log(pos);
user.lat = pos.coords.latitude;
user.long = pos.coords.longitude;

user.sunAlt = getSunAlt(user.lat, user.long);
console.log(user);
Jason Luboff
@JLuboff
Nov 17 2018 05:00
Huh it adds gender icons...interneting
Interesting*
Lucci Paula
@luccipaula
Nov 17 2018 05:01
@JLuboff Very...
Christopher McCormack
@cmccormack
Nov 17 2018 05:08
lol interneting
Night all!
Lucci Paula
@luccipaula
Nov 17 2018 05:09
Bye bye!
Aditya
@ezioda004
Nov 17 2018 05:10
:wave:
Shubham soni
@shubhamsoni2617
Nov 17 2018 07:24

Can someone explain me what is exactly happening in the code below:

function switchItUp(n){
  return ["Zero","One","Two","Three","Four","Five","Six","Seven","Eight","Nine"][n]
}

When provided with a number between 0-9, return it in words.
Input :: 1
Output :: "One".

Aditya
@ezioda004
Nov 17 2018 07:29
@shubhamsoni2617 ["Zero","One","Two","Three","Four","Five"...] is an array, and you access arrays by using bracket notation, like arr[0], arr[1]and so on. So in the above example you're returning the accessed value with [n]
["zero", "one"][1] // "one"
n is the nth element of the array.
Shubham soni
@shubhamsoni2617
Nov 17 2018 07:32
Ohh!! I got it thank you..creating and accessing array at the same time..
Aditya
@ezioda004
Nov 17 2018 07:34
Exactly
Richa
@richa-coder
Nov 17 2018 07:43
Hi guys ...needed help with react..
Is it possible to connect two components with different mapstatetoProps to my redux store within a file
alpox
@alpox
Nov 17 2018 07:47
@richa-coder ofc. You have to wrap both components in their own connect call where you can pass a different mapstatetoprops
Richa
@richa-coder
Nov 17 2018 10:16
I tried doing the same but getting error on build.. can u tell me the way to do so? I want to have two components with different mapstatetoProps in 1 file and wanna connect both to the redux store
@alpox please help
Richa
@richa-coder
Nov 17 2018 10:23
Also, if I have 50divs within a section tag,is there a way to re render only 2nd div?
Based on some props change
abraham anak agung
@padunk
Nov 17 2018 10:28
@richa-coder how you connect it?
Adel
@AdelMahjoub
Nov 17 2018 10:38
someone made a joke about this last year, but in the end it was added :laughing:
abraham anak agung
@padunk
Nov 17 2018 10:48
:laughing:
Richa
@richa-coder
Nov 17 2018 10:54
@padunk I have defined 2 mapstatetoProps, mapstatetoProps 1 and mapstatetoProps 2 in same mile and I try connecting..export default connect (mapstatetoProps 1) (ApplicationUser) and export connect (mapstatetoProps 2) (Application Admin)
abraham anak agung
@padunk
Nov 17 2018 11:02
@richa-coder what is the error? I usually write it like this, but i think it will be the same, make sure there is no typo there.
ApplicationUser = connect (mapstatetoProps1)(ApplicationUser)
ApplicationAdmin = connect (mapstatetoProps2)(ApplicationAdmin)
export default ApplicationUser
export ApplicationAdmin
Richa
@richa-coder
Nov 17 2018 12:12
@padunk , I ll check for any typo errors
Pagnito
@Pagnito
Nov 17 2018 16:32
hey anyone know what the site name is that has a list of pwa features, which native features we can access from the web
found it
Brad
@bradtaniguchi
Nov 17 2018 17:14
early morning coding, who am i
Christopher McCormack
@cmccormack
Nov 17 2018 17:16
@bradtaniguchi that some kind of riddle?
Brad
@bradtaniguchi
Nov 17 2018 17:17
no I'm just questioning my sanity, It's Saturday morning and I'm working. I might be going insane :D
Christopher McCormack
@cmccormack
Nov 17 2018 17:18
nah if you gotta get stuff done sometimes weekends are convenient
I often work Sunday nights just to thin out my workload for the rest of the week
it may suck losing that time but it may also reduce stress
Adel
@AdelMahjoub
Nov 17 2018 17:23
is it why do today what you can put off until tomorrow ?
or the other way around ?
Brad
@bradtaniguchi
Nov 17 2018 17:25
Yea, but I already work a lot, and I consider myself a pretty efficient worker. Even tho I'm here most of the day being distracted by you guys :P
Adel
@AdelMahjoub
Nov 17 2018 17:26
:smile: yeah it distract
Adel
@AdelMahjoub
Nov 17 2018 17:32
it looks like every game from the last decade is being ported to nintendo switch
and all selling very well
Christopher McCormack
@cmccormack
Nov 17 2018 17:35
Good old games are good too!
I'm playing a game that was ported that was released all the way back in 2015!!
I adore my Switch, finally not tethered to a TV and the screen doesn't look like it was made in 1980
Brad
@bradtaniguchi
Nov 17 2018 17:37
Man I bought a game I already had for my switch (doom) just so I can move around and play it. so awesome
Adel
@AdelMahjoub
Nov 17 2018 17:37
@cmccormack Dark Souls ?
Christopher McCormack
@cmccormack
Nov 17 2018 17:37
nah Disgaea 5
Adel
@AdelMahjoub
Nov 17 2018 17:37
@cmccormack wow you play that, that game is freaking complicated
Christopher McCormack
@cmccormack
Nov 17 2018 17:37
i've already 100% all of the demon/dark souls games on PS3/PC
yeah it's a great time killer
Brad
@bradtaniguchi
Nov 17 2018 17:38
Been playing that cooking game with my GF tho. I gotta admit playing with 1 controller reminds me of NES days, even tho I was like 5
Christopher McCormack
@cmccormack
Nov 17 2018 17:38
I barely understand any of the complicated stuff yet though
@bradtaniguchi overcooked?
Brad
@bradtaniguchi
Nov 17 2018 17:38
@cmccormack yes, going to by the first one (I got the second one first if that makes any sense haha) once we beat the game
Adel
@AdelMahjoub
Nov 17 2018 17:39
@bradtaniguchi is Doom playable on the switch ? Seems an overkill for the device
I mean, does it runs smooth enough to be enjoyable
Brad
@bradtaniguchi
Nov 17 2018 17:41
@AdelMahjoub Yea totally, works roughly as well as my computer. When things go crazy tho it does lag from time to time, but even my computer did that (my computer is lik 6 years old, higher middle specs)
90% it plays just fine tho, had to get used to the swiches sticks. I realized they are "smaller" than xbox ones
Adel
@AdelMahjoub
Nov 17 2018 17:41
I'll end up getting too then, I got Skyrim in almost every machine :laughing:
Christopher McCormack
@cmccormack
Nov 17 2018 17:41
@bradtaniguchi i've been wanting to play that with the wife
we used to both be into that Cake Mania game so probably a good fit
@bradtaniguchi how's the battery when playing games like that? I remember BotW drained it pretty quick but Disgaea sips battery
Brad
@bradtaniguchi
Nov 17 2018 17:43
Yo its a killer game, oh gotta run again (getting oil changed hehe)
Christopher McCormack
@cmccormack
Nov 17 2018 17:43
later
Kelechi Chinaka
@ke1echi
Nov 17 2018 17:43
how do i add font awesome to my codepen projec
Brad
@bradtaniguchi
Nov 17 2018 17:43
I haven't tried to play doom mobile yet ill have to try haha
Christopher McCormack
@cmccormack
Nov 17 2018 17:47
@ke1echi in the CSS in settings, or you can use the link syntax in head element
Adel
@AdelMahjoub
Nov 17 2018 17:48
codepen_editor.png
codepen_css_settings.png
@ke1echi add the fa cdn link to that field
Kelechi Chinaka
@ke1echi
Nov 17 2018 17:54
thanks @AdelMahjoub @cmccormack
css.JPG
Christopher McCormack
@cmccormack
Nov 17 2018 17:56
nope follow the example
in codepen CSS settings you just put the url not the link tag
normally you would add the CSS in a link tag in your html head though, Codepen is just adding a convenience
Kelechi Chinaka
@ke1echi
Nov 17 2018 17:58
i get an error when i try to save @AdelMahjoub @cmccormack
Christopher McCormack
@cmccormack
Nov 17 2018 17:59
@ke1echi :point_up: November 17, 2018 10:56 AM
Kelechi Chinaka
@ke1echi
Nov 17 2018 17:59
css.JPG
Christopher McCormack
@cmccormack
Nov 17 2018 18:00
@ke1echi :point_up: November 17, 2018 10:56 AM
put just the URL in
the href portion
as @cmccormack mentioned
and go nuts with icons
Kelechi Chinaka
@ke1echi
Nov 17 2018 18:03
<link rel="stylesheet" href="https:https://fontawesome.com/start what you mean @cmccormack
Adel
@AdelMahjoub
Nov 17 2018 18:04
in the css setting menu, add the font awesome cdn url to one of the fields
Kelechi Chinaka
@ke1echi
Nov 17 2018 18:07
okay @AdelMahjoub
Christopher McCormack
@cmccormack
Nov 17 2018 18:10
image.png
@ke1echi you can also just search for fontawesome in the codepen CSS settings and select it
Kelechi Chinaka
@ke1echi
Nov 17 2018 18:14
:thumbsup: @AdelMahjoub @cmccormack
Christopher McCormack
@cmccormack
Nov 17 2018 18:15
Codepen doesn't seem very good at surfacing the more recent versions of packages when you use the search though, so often better to search for the package CDN link and use that URL
Adel
@AdelMahjoub
Nov 17 2018 18:15
we've got you covered @ke1echi
DMZ
@DMZ011
Nov 17 2018 21:28
hi all!
Pagnito
@Pagnito
Nov 17 2018 22:33
Im thinking about using code splitting to load the initial home page but then have the rest of the bundle load in the background instead of loading chunks on diffirent clicks. Anyone done anything like that before?