These are chat archives for FreeCodeCamp/HelpJavaScript

14th
Dec 2018
not sure what idToken is in this context tho, probably the idToken from google somewhere or something
Simon Cordova
@gbsimon87
Dec 14 2018 00:03
anybody here pretty good dealing with promises? JS promises that is
Pagnito
@Pagnito
Dec 14 2018 00:04
@bradtaniguchi it seems i have to use their auth process to get that token
Brad
@bradtaniguchi
Dec 14 2018 00:04
@gbsimon87 I'm alright with them
Simon Cordova
@gbsimon87
Dec 14 2018 00:06
@Pagnito
This course deals a lot with recat redux and firebase and is pretty damn good - you may be able to find your answer there somewhere
https://www.youtube.com/playlist?list=PL4cUxeGkcC9iWstfXntcj8f-dFZ4UtlN3
@bradtaniguchi give me a quick sec and I'll try and explain my issue at hand - thanks in advance :)
Pagnito
@Pagnito
Dec 14 2018 00:07
sweet thnx
Simon Cordova
@gbsimon87
Dec 14 2018 00:12

@bradtaniguchi
I've got this function that returns a promise...

export const getLocalStorageJWT = () => {
  const localStorageToken = localStorage.getItem('jwt_token');
  const error = new Error('jwt not found in local storage');
  return new Promise(
    (resolve, reject) => {
      // localStorageToken ? resolve(localStorageToken) : reject(console.log(error))
      resolve(localStorageToken);
      reject(error)
    }
  )
}

Once resolved - it extracts a JSON web token (not sure if you've ever used them)
This web token has data such as the time the token was issued, its expiry date, etc...

I look to accomplish the following:
If the user is logged in to the application, and then leaves the site, and comes back, I want to know if the session is still active.

I've created these two other functions to extract the data using a library (jwtDecoded)
export const jwtTokenExpiryTime = () => {
  return getLocalStorageJWT()
    .then(jwtToken => {
      const decodedToken = jwtDecode(jwtToken);
      const jwtTokenExpiryDate = new Date(decodedToken.exp * 1000).getTime();
      return jwtTokenExpiryDate;
    })
    .catch(() => console.log('jwtTokenExpiryTime --> no jwtToken found'));
}

export const jwtTokenIssueTime = () => {
  return getLocalStorageJWT()
    .then(jwtToken => {
      const decodedToken = jwtDecode(jwtToken);
      const jwtTokenIssueDate = new Date(decodedToken.iat * 1000).getTime();
      return jwtTokenIssueDate;
    })
    .catch(() => console.log('jwtTokenIssueDate --> no jwtToken found'));
}
oh man I should post this on codepen to not spam this app - let me build one quickly
Brad
@bradtaniguchi
Dec 14 2018 00:18
Ok, so whats the concern?
@gbsimon87
Simon Cordova
@gbsimon87
Dec 14 2018 00:20
see my last function? its working, but that looks like a mess though
Brad
@bradtaniguchi
Dec 14 2018 00:22
Yea, so does the getLocalStorageJWT method have to be a promise?
Seems like an extra complexity
Simon Cordova
@gbsimon87
Dec 14 2018 00:22
The isUserSessionActive() function - it's a mess
Brad
@bradtaniguchi
Dec 14 2018 00:25
Beyond that the last method can probably be done in parallel using Promise.all
export const isUserSessionActive = () => {
  Promise.all(jwtTokenExpiryTime(), jwtTokenIssueTime())
  .then(([tokenExpiryTime, tokenIssueTime]) => {tokenExpiryTime, tokenIssueTime})
  .then((data) => {
          console.log('data.tokenExpiryTime', data.tokenExpiryTime)
          console.log('data.tokenIssueTime', data.tokenIssueTime)
          const currentTime = getCurrentTime();
          if ( (data.tokenExpiryTime > currentTime) && (currentTime > data.tokenIssueTime) ) {
            inSession()
          }
  });
  })
}
dont mind the formatting, I did it in codepen which doesn't auto format hehe
Actually you don't even need that middle then...
Simon Cordova
@gbsimon87
Dec 14 2018 00:26
The reason that function returns a promise is because I'm using it for my axios interceptor - I've just added it to the link
https://codepen.io/gbsimon87/pen/QzyaEm
Brad
@bradtaniguchi
Dec 14 2018 00:26
Well, I guess you do so you don't have to worry about anything breaking hehe
Simon Cordova
@gbsimon87
Dec 14 2018 00:27
Promise.all - I'm going to research that a bit
Brad
@bradtaniguchi
Dec 14 2018 00:28
Promise.all is the killer function, also a good trick when using promise chaining is keep it flat. If you return from inside of a then you can attach another then after it to get whatever is returned. If your nesting things your probably doing something wrong for most common use-cases
Simon Cordova
@gbsimon87
Dec 14 2018 00:29
export const isUserSessionActive = () => {
  Promise.all(jwtTokenExpiryTime(), jwtTokenIssueTime())
    .then(([tokenExpiryTime, tokenIssueTime]) => { tokenExpiryTime, tokenIssueTime })
    .then((data) => {
      console.log('data.tokenExpiryTime', data.tokenExpiryTime)
      console.log('data.tokenIssueTime', data.tokenIssueTime)
      const currentTime = getCurrentTime();
      if ((data.tokenExpiryTime > currentTime) && (currentTime > data.tokenIssueTime)) {
        inSession()
      }
    })
}
I'm getting 'Uncaught (in promise) TypeError: #<Promise> is not iterable'
Is that syntax correct?
So it resolves all promises the iterates through it seems
Brad
@bradtaniguchi
Dec 14 2018 00:33
Oh forgot the square brackets around the promise.all arguments
Promise.all(jwtTokenExpiryTime(), jwtTokenIssueTime()) -> Promise.all([jwtTokenExpiryTime(), jwtTokenIssueTime()])
Basically promise.all waits for all promises to resolve before resolving, OR it rejects with the first failure (thats a gotcha)
So anytime your doing 2 or more async things that dont depend on each other you should probably use promise.all
Simon Cordova
@gbsimon87
Dec 14 2018 00:35
you're amazing bro thank you so much
Brad
@bradtaniguchi
Dec 14 2018 00:36
np :D
Simon Cordova
@gbsimon87
Dec 14 2018 00:36
So I can do my logic right in there I suppose
I'm going to work on it and send it in a bit if you're still around maybe you can take a quick look at it :)
Brad
@bradtaniguchi
Dec 14 2018 00:40
Yea sure anytime :D
Simon Cordova
@gbsimon87
Dec 14 2018 00:43

@bradtaniguchi - I've actually got a quick q

export const isUserSessionActive = () => {

  const currentTime = getCurrentTime();

  Promise.all([jwtTokenExpiryTime(), jwtTokenIssueTime()])
    .then(tokenTimes => { 
      console.log(tokenTimes);
    })
    // I want to implement the following pseudo code logic...
    // if ((tokenExpiryTime > currentTime) && (currentTime > tokenIssueTime)) {
    //   inSession()
    // }
}

How can I get the individual values resolved by jwtTokenExpiryTime() and jwtTokenIssueTime() so that I can implement that if statement?

Brad
@bradtaniguchi
Dec 14 2018 00:45
@gbsimon87 The resolved value from Promise.all will be an array so you can do:
tokenTimes[0] and tokenTimes[1]
Simon Cordova
@gbsimon87
Dec 14 2018 00:45
wow that's a beauty, you honestly have no idea how much time you've just saved me
I've really got to learn promises in-depth
Simon Cordova
@gbsimon87
Dec 14 2018 00:53

@bradtaniguchi
This is what I've ended up with

export const isUserSessionActive = () => {

  const currentTime = getCurrentTime();

  Promise.all([jwtTokenExpiryTime(), jwtTokenIssueTime()])
    .then(tokenTimes => { 
      console.log(tokenTimes);
      const tokenExpiryTime = tokenTimes[0]
      const tokenIssueTime = tokenTimes[1]
      const isActive = ((tokenExpiryTime > currentTime) && (currentTime > tokenIssueTime));
      return isActive
    })
}

Lastly - how can I return isActive to use it elsewhere?

Sorry, silly question, did a ternary and called the other function, it worked! :)
Pagnito
@Pagnito
Dec 14 2018 01:03
is there a way to set authorization header on the server. Im trying to use res.set but its not showin up in the headers
Simon Cordova
@gbsimon87
Dec 14 2018 01:14

@Pagnito if you use axios you can do so easily

Do a search for interceptors
https://github.com/axios/axios

Pagnito
@Pagnito
Dec 14 2018 01:14
k thnx
Brad
@bradtaniguchi
Dec 14 2018 01:15
@gbsimon87 nice, and I was going to mention you can use the destructuring operator on tokenTimes so you rnot running around with just array indexes
Simon Cordova
@gbsimon87
Dec 14 2018 01:20
@bradtaniguchi would it be too much a bother to show me?
Brad
@bradtaniguchi
Dec 14 2018 01:20
Yea I was going to, but then I got called to help out which is why I kinda ghosted hehe. give me one sec
Promise.all([jwtTokenExpiryTime(), jwtTokenIssueTime()])
    .then([tokenExpiryTime, tokenIssueTime] => { 
      console.log(tokenTimes);
      // const tokenExpiryTime = tokenTimes[0]
      // const tokenIssueTime = tokenTimes[1]
      const isActive = ((tokenExpiryTime > currentTime) && (currentTime > tokenIssueTime));
      return isActive
    })
Simon Cordova
@gbsimon87
Dec 14 2018 01:21
thx buds I so appreciate it you have no idea
hmmm - sure that's the right destructuring syntax?
hold on I may be mistaken myself
Brad
@bradtaniguchi
Dec 14 2018 01:36
I forgot the outer parenthesis haha
.then([tokenExpiryTime, tokenIssueTime] => { -> .then(([tokenExpiryTime, tokenIssueTime]) => {
Simon Cordova
@gbsimon87
Dec 14 2018 01:52
Dude, that promise all has changed my life
@bradtaniguchi
lol, you have no idea, I just got soooo much done thanks to it
Brad
@bradtaniguchi
Dec 14 2018 01:52
Haha good to hear :D
Pagnito
@Pagnito
Dec 14 2018 01:52
im using cookie session because firebase strips all cookies that are not named session, i name my cookies session in the options, but passport.sessions seems to only recognize 'session' anyone know how to config that? i tried passing options to passport.session({name:__session}), but still a no go
Brad
@bradtaniguchi
Dec 14 2018 01:53
@Pagnito Check with the docs/google support. I know google cloud strips some headers, but idk the details
Pagnito
@Pagnito
Dec 14 2018 01:54
yea i did, it seems they strip all cookies all cookies that arent named __session, but the problem im havin isnt rly there, its that passport doesnt seem to except another keyword besides session
with out the __
wait no it does
but when i name my cookies with __
it doesnt work T.T
passport wont take session, firebase wont take anything other than session
__session
Amit Patel
@AmitP88
Dec 14 2018 01:56
hey, have you guys gotten stuck on the recipe box before using react/redux? I feel kinda dumb for getting stuck on this one. I thought it would be easier
Pagnito
@Pagnito
Dec 14 2018 01:57
i have gotten stuck on everythin i do lol
Amit Patel
@AmitP88
Dec 14 2018 01:57
lol same here
this is my 3rd react/redux project
Pagnito
@Pagnito
Dec 14 2018 01:57
there is a lot of memes out there that say "programming is 10% writing code, and 90% trying to figure out why its not working"
Amit Patel
@AmitP88
Dec 14 2018 01:58
first one was unbeatable tic tac toe (took me 3 weeks to do) and second was simon game (took 1 week)
lol yeah, I'm starting to get that a lot
Pagnito
@Pagnito
Dec 14 2018 01:58
haha
what r u stuck on
Amit Patel
@AmitP88
Dec 14 2018 01:58
do you think 5 react/redux projects is enough to start applying for react jobs?
well, I'm trying to display the recipe whenever the user clicks on one of the list items in the recipe list
I may have to rethink my entire project
Pagnito
@Pagnito
Dec 14 2018 01:59
whats the problem?
Amit Patel
@AmitP88
Dec 14 2018 02:00
I'm not sure how to display the correct data once the user clicks on a recipe from the list
hang on, i'll create a sandbox real quick
Pagnito
@Pagnito
Dec 14 2018 02:00
k
it seems passport takes anything BUT 'session', whilee firebase takes nothing BUT 'session'
alskdnalkjfhbskjgbsdkljbsdflkjabFLKJBDFLKJBSDF
__SESSION
__session
Pagnito
@Pagnito
Dec 14 2018 02:03
i dont see a resipe list
Amit Patel
@AmitP88
Dec 14 2018 02:04
oh, I don't have any preloaded data yet
I figure I would do that last
once I get the functionality done
Pagnito
@Pagnito
Dec 14 2018 02:05
well anything
anyways
u know about actions right?
Amit Patel
@AmitP88
Dec 14 2018 02:05
yeah
oh, I added some recipe items to the purple box
does it show on your end?
Pagnito
@Pagnito
Dec 14 2018 02:07
no
send me a new link
Amit Patel
@AmitP88
Dec 14 2018 02:09
are you able to add items using Edit Recipe button?
Pagnito
@Pagnito
Dec 14 2018 02:10
yea
Amit Patel
@AmitP88
Dec 14 2018 02:12
hey, um, could we just chat on sandbox? it's kind of disorienting going back and forth lol
Pagnito
@Pagnito
Dec 14 2018 02:15
yea makes sense
Simon Cordova
@gbsimon87
Dec 14 2018 02:20
@AmitP88 whats happening buds long time
Amit Patel
@AmitP88
Dec 14 2018 02:34
@gbsimon87 hey man, yeah it's been a while lol
been coding in react/redux
i'm on my 3rd project - recipe box
Simon Cordova
@gbsimon87
Dec 14 2018 02:37
nice man :)
i'll check them out, happy you're still at it!
I'm working on the same stack actually, it can be fun but can get highly complicated too, but I'm up for it
currently building a form / management system for a client at my work - can be pressuring but definitely worth the learnings
Amit Patel
@AmitP88
Dec 14 2018 02:41
ah nice! yeah, I'm trying to stick to just react/redux for now. I figure I should get more practice before even attempting to learn the rest of the mern stack
oh btw, the simon game isn't fully responsive on mobile yet (the responsiveness got messed up when I updated my Chrome browser, so I have to redo it)
I'm hoping I'll be job ready by beginning of January lol
Simon Cordova
@gbsimon87
Dec 14 2018 02:43
fair enough
You should take this, https://university.mongodb.com/certification
It's over 4 weeks and will teach you MongoDB and using Compass, plus a certification from MongoDB itself - don't worry, its not overwhelming and it'll open your eyes to databases as well
If you've finished the simon game and tic tac toe and doing react and redux believe you me you're job ready already
A couple of us here have completed this - it's not very overwhelming and will get you a certificate over four weeks from MongoDB company itself
https://university.mongodb.com/certification
It will also open your eyes to databases
Amit Patel
@AmitP88
Dec 14 2018 02:44
lol thanks man! I've been having some doubts on whether I'd be ready (I was actually aiming to get a total of 10 react/redux projects by the end of this month, but each project takes longer than expected)
lol the unbeatable tic tac toe took me 700+ lines of code, and simon game probably 1000+ haha
Simon Cordova
@gbsimon87
Dec 14 2018 02:46

I personally wouldn't take that approach, you'll learn a lot hands on at a job

here are two of the best free react/redux courses I have found so far, the second one uses firebase too
https://www.youtube.com/playlist?list=PL4cUxeGkcC9ij8CfkAY2RAGb-tmkNwQHG
https://www.youtube.com/playlist?list=PL4cUxeGkcC9iWstfXntcj8f-dFZ4UtlN3

I'd do the first one first, then the second - you'll feel way more comfortable after

Amit Patel
@AmitP88
Dec 14 2018 02:47
ohhh yeah, the Net Ninja. I've seen a few of his videos. They're pretty good - short and concise
You should check out Programming with Mosh channel too, he explains concepts super simple with great visuals
Simon Cordova
@gbsimon87
Dec 14 2018 02:50
I will indeed, thx buds :)
oh seen that guy, I think on Udemy actually
Amit Patel
@AmitP88
Dec 14 2018 02:51
oh yeah, I forgot he had some courses lol
Do you think 5 react/redux projects will be enough?
to apply to jobs I mean. I'm not sure if having these two are good enough to apply to a react job specifically
Simon Cordova
@gbsimon87
Dec 14 2018 02:52
yes - and es6 knowledge as well
I got a great job without knowing redux
but you're not going to get a job with the 'I'm not ready for it attitude' - drop that brosky
Remember when we used to talk 2-3 years ago? Where are you now compared to then?
Amit Patel
@AmitP88
Dec 14 2018 02:53
lol a lot farther haha
Simon Cordova
@gbsimon87
Dec 14 2018 02:53
I think you see my point
Start applying everywhere so you get a hang of the interviews too, it helps
Amit Patel
@AmitP88
Dec 14 2018 02:53
I even completed the d3 cert
oh definitely
Simon Cordova
@gbsimon87
Dec 14 2018 02:53
Amazing, show that off!
Amit Patel
@AmitP88
Dec 14 2018 02:54
Oh, I also heard that it's better to apply out of state (i'm in California) since there's a lot less competition for tech jobs
Simon Cordova
@gbsimon87
Dec 14 2018 02:55
I have no idea what the market is like in the US tbh
I've gotten all three of my programming jobs on LinkedIn though I'll tell you that
Amit Patel
@AmitP88
Dec 14 2018 02:56
I know LA and California in general are competitive to get in
oh yeah, a friend of mine was telling me to add a bunch of connections on there. I have 8500 so far haha
Simon Cordova
@gbsimon87
Dec 14 2018 02:58
Whoa thats way more than me haha
Amit Patel
@AmitP88
Dec 14 2018 02:59
lol eventually ppl just started sending me connection requests
Simon Cordova
@gbsimon87
Dec 14 2018 02:59
I'd start applying, forget the I'm not ready complex, get the portfolio set and get out there
you'll be fine
Amit Patel
@AmitP88
Dec 14 2018 02:59
even with just the tic tac toe and simon game as my only redux projects? lol
I still have the front end libraries projects using plain react though (although the pomodoro is just plain js)
Simon Cordova
@gbsimon87
Dec 14 2018 02:59
I got mine with even less than that, just one react project without redux
Amit Patel
@AmitP88
Dec 14 2018 03:00
oh damn
Simon Cordova
@gbsimon87
Dec 14 2018 03:00
Companies aren't just looking at what you've built, but at your dedication, your will to learn, your vision as a programmer in the future
your ability to communicate and embrace technologies
skill level of course is important, but the adequate team member is many times more valuable
Amit Patel
@AmitP88
Dec 14 2018 03:01
For sure. I've heard that, but I'm also heard that I need to be more unique to stand out from the other applicants
I'm planning on completed the udemy course on adv css and sass, and applying that to revamping my portfolio site (it's been a while)
Aditya
@ezioda004
Dec 14 2018 03:02
In my experience, the first thing your potential employer would see is your github/portfolio and then your resume
An active github would give good impression and portfolio would make you stand out
Amit Patel
@AmitP88
Dec 14 2018 03:03
that's what I've heard as well
this what my github looks like so far: https://github.com/AmitP88
I got caught up in study mode in some months, so there are some gaps
Aditya
@ezioda004
Dec 14 2018 03:04
Not bad - I'd highly suggest contributing to open source project, let it be just fixing some typos
Amit Patel
@AmitP88
Dec 14 2018 03:04
ah ok, so it could just be purely updating their docs?
Simon Cordova
@gbsimon87
Dec 14 2018 03:05
I second that comment, my first two open source contributions were exactly that
Aditya
@ezioda004
Dec 14 2018 03:05
Yes, and you can easily start with fcc itself, maybe even mention in your resume if need it be ;)
Amit Patel
@AmitP88
Dec 14 2018 03:05
ah ok. That shouldn't take too long lol
I was thinking of doing that actually. There's this annoying bug in the fcc curriculum page on loadup - it shows the HTML section expanded on default, even after previously being on different challenge pages
Aditya
@ezioda004
Dec 14 2018 03:07
Oh yeah
Amit Patel
@AmitP88
Dec 14 2018 03:07
that bug always drives me nuts lol. I may try to fix that one
Simon Cordova
@gbsimon87
Dec 14 2018 03:07

Tackle that!

Anyways great catch up, I'm sure you'll be fine.

You really need to get rid of that I'm not ready attitude though, that's a motivational killer and nobody wants that, believe in yourself, as cheesy as it sounds

Aditya
@ezioda004
Dec 14 2018 03:08
^^
Simon Cordova
@gbsimon87
Dec 14 2018 03:08
Night gentlemen :)
Aditya
@ezioda004
Dec 14 2018 03:08
See ya @gbsimon87
Amit Patel
@AmitP88
Dec 14 2018 03:08
lol thanks Simon! :)
Simon Cordova
@gbsimon87
Dec 14 2018 03:09
I'd stay back but I'm in Chile for a bit it's midnight and I start work at 7am and still haven't finished my weekly sprint :\
Amit Patel
@AmitP88
Dec 14 2018 03:09
no worries man, and Chile sounds awesome :)
i'm in a burrito myself
Simon Cordova
@gbsimon87
Dec 14 2018 03:10
?!?
Amit Patel
@AmitP88
Dec 14 2018 03:10
lol
since you're in Chile
Simon Cordova
@gbsimon87
Dec 14 2018 03:11
maybe I've been dealing with too much logic today but I still dont' quite get it... :\
oooooh
chili
oh man
Aditya
@ezioda004
Dec 14 2018 03:11
/r/woosh
Simon Cordova
@gbsimon87
Dec 14 2018 03:11
I need a nap lolol
night guys
Amit Patel
@AmitP88
Dec 14 2018 03:11
lol good night man :)
Aditya
@ezioda004
Dec 14 2018 03:12
@AmitP88 BTW if you wanna fix docs, check https://guide.freecodecamp.org/
You'll find bunch of typos and stuff, you can even create your own article
Amit Patel
@AmitP88
Dec 14 2018 03:14
ohh shoot ok. I think i'll jump on this actually and put the recipe box on hold
I haven't done any contributions to other repos, so I'll get on it
thanks man :)
Aditya
@ezioda004
Dec 14 2018 03:14
You can do whenever, just letting you know where to look ;)
Amit Patel
@AmitP88
Dec 14 2018 03:14
for sure :)
oh, btw, for junior react/front end positions, would the technical interviews be heavy on whiteboarding algorithms and completing take home projects? or are they more like answering standard conceptual questions about different technologies?
I know for mid/sr level jobs it's like that but for junior level jobs i'm not sure
Aditya
@ezioda004
Dec 14 2018 03:19
Depends on the company honestly, if they are purely looking for React dev then you'll get away with React/JS and basic questions
But still expect atleast basic algorithm questions
Like 6, 7, 8kyu types
Amit Patel
@AmitP88
Dec 14 2018 03:20
ah ok. I'm comfortable doing those
I think i'm on 7th kyu atm, but I stopped to do more projects
and I've done the basic algorithms on fcc already
although I struggled a bit on the last 3-4 of them
Claudio Restifo
@Marmiz
Dec 14 2018 03:30

as far as my experience goes, both from candidate and interviewer, you don't have to know how to solve algorithms (except for specific positions - roles), but shows that you know "how" to think @AmitP88

Be more confident. You can do this, you are definitely job ready!

Amit Patel
@AmitP88
Dec 14 2018 03:32
@Marmiz thanks man! I really appreciate that! :)
I guess I was just worried about competition since web dev is more popular these days. I keep thinking I have to reach this milestone to be ready lol
But you're right, I gotta shed this attitude
I think I'm just gonna do the udemy course, revamp my portfolio site, and do the github contributions on fcc
then I'll start applying :)
Claudio Restifo
@Marmiz
Dec 14 2018 03:38

personal opinion: you'll never "feel" ready. And that's ok.

If you feel like you reached your goal, to me only means your goals are either too low or you are not evolving them as you grow.
So stop wasting time on waiting, either for something or to do something.

And this goes for every aspect of your life. Not only coding.
Amit Patel
@AmitP88
Dec 14 2018 03:40
Understood. I just gotta go for it
I've been waiting for 3 years. I gotta just dive in
ok man, I g2g to bed. Goodnight @Marmiz @ezioda004 Thanks for the advice guys. I really appreciate it :)
Claudio Restifo
@Marmiz
Dec 14 2018 03:46
have a good rest :sparkles:
Mirkan Çalışkan
@mirkancal
Dec 14 2018 05:57
@cmccormack I've tried https://cors-anywhere.herokuapp.com too but proxy doesnt seem to work with github jobs api. Why they have an api without pricing or authentication on their site if there is no way for me to get that request? :d
Uros Tadic
@urketadic
Dec 14 2018 09:00
anyone here that can help me out with node/express
Kaz Baig
@kbaig
Dec 14 2018 09:05
@urketadic what do you need help with
Uros Tadic
@urketadic
Dec 14 2018 09:46
nvm
Johnny
@JohnnyBizzel
Dec 14 2018 12:04
Yes
Unfortunately, I did not see a question so I can't help.
tundeiness
@tundeiness
Dec 14 2018 12:38
hi guys a little help here please:
I know something must be wrong with my bindings because all i want to do is get values from the input tag, add it to the message state and as well display it. My code is below:
class DisplayMessages extends React.Component {
  constructor(props) {
    super(props);
    this.state = {
      input: '',
      messages: []
    }


  }
  // add handleChange() and submitMessage() methods here

  handleChange(event){
    this.setState({
      input: event.target.value
    })

  }


  submitMessage(event){
    event.preventDefault()
    this.state.messages.push(this.state.input);
    event.target.reset()
  }

  render() {
    return (
      <div>
        <h2>Type in a new Message:</h2>
        { /* render an input, button, and ul here */ }
        <ul>
        {this.state.messages.map((msg)=>{
          return <li>{msg}</li>
        })}
        </ul>
        <input value = {this.state.input} onChange = {this.handleChange.bind(this)}/>
        <button  onClick = {this.submitMessage.bind(this)}>Add message</button>
      </div>
    );
  }
};
tundeiness
@tundeiness
Dec 14 2018 12:47
well this seems to clear the previous input:
submitMessage(event){
    event.preventDefault()
    this.state.messages.push(this.state.input);
    this.setState({ input : ""});
  }
update: so after effecting the last change, I could type in the input box and click on Add message for the message to be listed However FCC keeps showing me this Clicking the Add message button should call the method submitMessage which should add the current input to the messages array in state. this means I am yet to pass it. any help further?
voyage092
@voyage092
Dec 14 2018 13:50
what is gulpjs?
tundeiness
@tundeiness
Dec 14 2018 14:23
any help please?
Christopher McCormack
@cmccormack
Dec 14 2018 15:03
@tundeiness you never push to state like that - you should use setState
@mirkancal hey sorry I forgot about the proxy yesterday, had some last minute work I had to get done. Github probably expects you to use the API locally and not as a frontend service
Mohammed Boudad
@matrixersp
Dec 14 2018 15:14
@tundeiness Do not change state directly, your submitMessage method should be something like this:
submitMessage(event){
    event.preventDefault()
    const messages = [...this.state.messages];
    messages.push(this.state.input);
    this.setState({messages, input: ''});
}
Christopher McCormack
@cmccormack
Dec 14 2018 15:16
@mirkancal should work now, let me know
Simon Cordova
@gbsimon87
Dec 14 2018 15:35
hey all! :)
Christopher McCormack
@cmccormack
Dec 14 2018 15:35
@gbsimon87 yo good morning or afternoon or whatever!
Simon Cordova
@gbsimon87
Dec 14 2018 15:35
lol, you know me always in a different timezone - got 12:40PM right now
hows it going buddy
Christopher McCormack
@cmccormack
Dec 14 2018 15:36
good man getting some last minute work done today before my holiday vacation starts this afternoon!
tundeiness
@tundeiness
Dec 14 2018 15:38
@cmccormack thanks for bringing it up again...I was so lost I just wanted it to work. I watched something like that yesterday but I never sort of internalised it. Anyways it's stuck in me now.
Christopher McCormack
@cmccormack
Dec 14 2018 15:38
@gbsimon87 how are you doing? What timezone you in?
@tundeiness no worries, I hope stuck is a good thing :)
tundeiness
@tundeiness
Dec 14 2018 15:40
@matrixersp thanks Mohammed... I was thinking it was only the input that I needed it setState not knowing it's for both messages and input.
@cmccormack yup it is!!!
Mohammed Boudad
@matrixersp
Dec 14 2018 15:41
@tundeiness no worries :smile:
Simon Cordova
@gbsimon87
Dec 14 2018 15:57
@cmccormack I'm in Stgo Chile with my mother - hadn't seen her in far too long (don't ask)
Came with the lady actually
Christopher McCormack
@cmccormack
Dec 14 2018 15:57
@gbsimon87 that's awesome man, is it summer there right now?
Simon Cordova
@gbsimon87
Dec 14 2018 15:57
Going to see some friends tomorrow from Uni (I went to Uni in Vina del Mar, Chile) that I haven't seen them for about 10-11 years - I'm so so amped for it
Christopher McCormack
@cmccormack
Dec 14 2018 15:58
@gbsimon87 sometimes your life sounds like one big vacation haha
Simon Cordova
@gbsimon87
Dec 14 2018 16:01
it's summer here indeed yeah
'vacation' - I've been working like a dog this week but I'm so excited
I love being able to be abroad and work, it's so good working remotely
I'm stuck on a part on the project that is honestly so complex fml
Christopher McCormack
@cmccormack
Dec 14 2018 16:02
I wasn't actually sure if you were working or not
Complex is good though, you're going to be way smarter after you solve it
Simon Cordova
@gbsimon87
Dec 14 2018 16:02
went to bed at 2:45 work up at 6:30 for scrum call
Oh yeah, I don't give up, demotivation is a thing of the past
Christopher McCormack
@cmccormack
Dec 14 2018 16:03
Demotivation is a thing of the past
-- Simon Cordova
I like it :)
Simon Cordova
@gbsimon87
Dec 14 2018 16:03
lolol - didn't even realise what I wrote
Christopher McCormack
@cmccormack
Dec 14 2018 16:05
You'll be the next web dev motivational speaker
Simon Cordova
@gbsimon87
Dec 14 2018 16:06

I like it too though - but I'll keep humble haha
hows work going for you these days?

And where's @JLuboff at?

Christopher McCormack
@cmccormack
Dec 14 2018 16:06
@JLuboff is off slackin somewhere
It's good for me, we're in our network freeze right now so NO CHANGES to the network until January
which means I can focus on documentation and working on scripts I've been meaning to make
much better pace :)
@gbsimon87 what kind of project you working on right now?
Simon Cordova
@gbsimon87
Dec 14 2018 16:09
My personal project has been put on pause for some time now, I'm building a custom templating and management system for a client
Its cool though, it includes custom forms, and eventually will be using mapping technology as well - seems so neat
Can't believe I'm working on this stuff 3 years after picking up my first HTML for Dummies book
Christopher McCormack
@cmccormack
Dec 14 2018 16:09
wow is this through an agency or are you on your own?
Simon Cordova
@gbsimon87
Dec 14 2018 16:10
My job, which is a tech agency
workplace that is
Christopher McCormack
@cmccormack
Dec 14 2018 16:11
that's very cool. Do the provide support if there is something you've never done or need help with?
Simon Cordova
@gbsimon87
Dec 14 2018 16:14
We're so short staffed at the moment that there is little support to be honest
There's only 3 front end devs at the moment and about 5 backend
But I've gotten so much independence and has forced me to learn to read documentation and learn at a very rapid rate
Christopher McCormack
@cmccormack
Dec 14 2018 16:15
If you aren't struggling, you aren't learning :)
Simon Cordova
@gbsimon87
Dec 14 2018 16:15
In 3 months I've learned Git, advanced React techniques, Redux, using Compass, Postman
Christopher McCormack
@cmccormack
Dec 14 2018 16:15
That's great, but I hope you also get some rest while trying to visit family and friends
Simon Cordova
@gbsimon87
Dec 14 2018 16:15
Fair enough, sometimes I wish I struggled less though
It's consuming a lot of my time and don't want it affecting my relationsihp
Christopher McCormack
@cmccormack
Dec 14 2018 16:15
You're building a foundation right now, that takes a lot, but it should all get easier over time I expect
Simon Cordova
@gbsimon87
Dec 14 2018 16:16
I didn't go out the past two nights and it's my lady's first time in South America, so I'll make sure to make up for it right now
The foundation, true that - I know it's going to pay off - perseverance is key
Christopher McCormack
@cmccormack
Dec 14 2018 16:18
I wish I had that kind of push to learn new things, I've kind of slumped lately as I don't have any projects I feel like I want to work on, other than a few small work projects
Simon Cordova
@gbsimon87
Dec 14 2018 16:19
Dude I feel you've touched everything, that sounds like serious push
Christopher McCormack
@cmccormack
Dec 14 2018 16:20
yeah but not lately
I finished FCC and it's kind of like when you finish school for the year and you aren't sure what to do with yourself
Vacation starts soon, I'll figure something out :)
I want to play more with Gatsby, as well as graphQL and maybe try out Vue
I also really want to start doing more testing, like with Jest, Puppeteer, Storybook, etc..
Simon Cordova
@gbsimon87
Dec 14 2018 16:23
There you go, you've got some stuff - check this out it was recently released
https://www.mongodb.com/products/charts
Jason Luboff
@JLuboff
Dec 14 2018 16:23
Don't worry...I'm here now
Christopher McCormack
@cmccormack
Dec 14 2018 16:23
Yeah, just need a project to actually apply it to :)
Jason Luboff
@JLuboff
Dec 14 2018 16:23
Catching up this morning, had taken yesterday afternoon off
Simon Cordova
@gbsimon87
Dec 14 2018 16:23
lol whats up @JLuboff
look at this guy taken afternoons off and all that
sweet life bro!
haha
Christopher McCormack
@cmccormack
Dec 14 2018 16:23
The only project I want to do is a game store aggregator, so you can see all the games you own on all the different platforms in one place. Problem is, many stores don't have APIs or they are no good
@JLuboff yo
Simon Cordova
@gbsimon87
Dec 14 2018 16:25
Interesting, what kind of games are we talking here? console stuff?
Jason Luboff
@JLuboff
Dec 14 2018 16:25
Eh...last minute thing to do. Had to help out the wife with watching the kid while she dealt with the labor board lol
Christopher McCormack
@cmccormack
Dec 14 2018 16:25
@gbsimon87 Console could be added but it would be manual
I'd probably have to do manual anyhow
but no, PC games
there are a ton of stores but none with a good API I've found
like Steam, GoG, Humble Bundle, etc...
Steam at least lets you get your own API key and view your items using it through their API, but for me to make that app they would have to provide the API key which is non-trivial for a lot of users
Console doesn't have the issue I'm trying to resolve - what games do I own where. Console, games only work for that console, usually
although I guess downloaded games could be cross platform...
and some are on PC... thanks for making me think of that :)
Simon Cordova
@gbsimon87
Dec 14 2018 16:28
You know I got you bro!
I'd assume steam has some crazy APIs no?
Christopher McCormack
@cmccormack
Dec 14 2018 16:28
But I don't think this tool already exists so I figured I'd try to make it
Christopher McCormack
@cmccormack
Dec 14 2018 16:29
@gbsimon87 I'll have to go look again but last I looked it wasn't really meant for other people to make tools against it. I don't think it supports oauth or similar
but I'll dig into it more
Notice the user has to fill out a form to get their API key, already not user friendly
something like oauth against their server for access that returns an api key would be a lot easier
Simon Cordova
@gbsimon87
Dec 14 2018 16:33
Call them and tell them you'll build it for the right price
none of that open source for them, they make enough money
Christopher McCormack
@cmccormack
Dec 14 2018 16:33
Hah very true
Simon Cordova
@gbsimon87
Dec 14 2018 16:33
lol, so cynical
of me that is
Christopher McCormack
@cmccormack
Dec 14 2018 16:34
no you're right, Valve is basically a cash making machine
Plus I'll only work for free for something worthwhile, like FCC
Simon Cordova
@gbsimon87
Dec 14 2018 16:35
image.png
Didn't know what Valve was check out the text I highlighted lololol
That's an aka do our work so we get paid
Christopher McCormack
@cmccormack
Dec 14 2018 16:36
/sigh
would probably be fun to work on too but hard to justify
Simon Cordova
@gbsimon87
Dec 14 2018 16:39
Why don't you work on an app to predict lottery tickets?
Thats justifiable
her: but you never have time for me!!!
him: just you wait when I buy you that island in the caribbean
Christopher McCormack
@cmccormack
Dec 14 2018 16:41
Predict lottery tickets eh? good idea
Jason Luboff
@JLuboff
Dec 14 2018 16:41
Once you predict it once...you'll never need to predict it again
Christopher McCormack
@cmccormack
Dec 14 2018 16:41
I've been listening to the Swindled podcast a lot lately, maybe I could write something that finds who is running the lottery and cheating it so I can take advantage :)
Kelechi Chinaka
@ke1echi
Dec 14 2018 16:43
you got full stack cert from fcc? @cmccormack
Christopher McCormack
@cmccormack
Dec 14 2018 16:44
@ke1echi yessir
Kelechi Chinaka
@ke1echi
Dec 14 2018 16:44
wow cool
how long did it take you to do it?
Christopher McCormack
@cmccormack
Dec 14 2018 16:45
way longer than it should have
little less than 2 years
Kelechi Chinaka
@ke1echi
Dec 14 2018 16:46
wow.. good job
maybe you might want to take cs50 or algo and ds @cmccormack
Christopher McCormack
@cmccormack
Dec 14 2018 16:46
@ke1echi I have a CS major and I've taken some of those already
I just do this for fun, for now...
Kelechi Chinaka
@ke1echi
Dec 14 2018 16:47
wow... you are the real MVP @cmccormack
Jason Luboff
@JLuboff
Dec 14 2018 16:47
@cmccormack Flexxing over here with his full stack
Christopher McCormack
@cmccormack
Dec 14 2018 16:48
💪
Kelechi Chinaka
@ke1echi
Dec 14 2018 16:48
lol @JLuboff
i've got my eyes on that cert
Christopher McCormack
@cmccormack
Dec 14 2018 16:48
is there no right arm bicep emoji?
I guess we just don't have the technology...
Kelechi Chinaka
@ke1echi
Dec 14 2018 16:48
because nerd use it to drink coffee
Christopher McCormack
@cmccormack
Dec 14 2018 16:49
haha
Jason Luboff
@JLuboff
Dec 14 2018 16:49
That is the right arm, isn't it?
Christopher McCormack
@cmccormack
Dec 14 2018 16:49
Guess it depends on which way you're looking?
Jason Luboff
@JLuboff
Dec 14 2018 16:50
Its the inner side of the arm
Christopher McCormack
@cmccormack
Dec 14 2018 16:50
🔬
Jason Luboff
@JLuboff
Dec 14 2018 16:51
Whats that, an iMac?
Kelechi Chinaka
@ke1echi
Dec 14 2018 16:51
i hope you would get your full stack cert soon @JLuboff
Christopher McCormack
@cmccormack
Dec 14 2018 16:51
It's a microscope, for your in-depth analysis of the bicep :D
Jason Luboff
@JLuboff
Dec 14 2018 16:52
@ke1echi I wont.. lol No free time to work on that stuff
I mean...I guess at night for about an hour..but.. I'd rather relax with some TV or videogames or model making lol
@cmccormack :joy:
So...whats everyone working on today?
Simon Cordova
@gbsimon87
Dec 14 2018 16:56
right arm lol - anybody ever watch family guy?
when quagmire finds out about internet porn?
Christopher McCormack
@cmccormack
Dec 14 2018 16:57
hehe yeah lol
What's the Internet
sooooooo good
check his left bicep lolol
Jason Luboff
@JLuboff
Dec 14 2018 17:00
haha...ya.. or when he finds out about Tinder..I think that one is worse
Simon Cordova
@gbsimon87
Dec 14 2018 17:00
so good as well
Jason Luboff
@JLuboff
Dec 14 2018 17:07
@gbsimon87 Aren't you supposed to be out having fun in Chile?
Simon Cordova
@gbsimon87
Dec 14 2018 17:07
still working til 6pm UK time, which is 1 more hour
then off two weeks :)
Jason Luboff
@JLuboff
Dec 14 2018 17:07
Ah
Simon Cordova
@gbsimon87
Dec 14 2018 17:09
how you been hows work
taking afternoons off and all that jazz
Jason Luboff
@JLuboff
Dec 14 2018 17:11
Works good, been busy. Between building new apps and database stuff...leaves little time for my other duties hah
Yesterday afternoon was a last minute thing (litterally asked my manager after 10 am to leave at 12)
Is your work still trying to get you a visa?
Simon Cordova
@gbsimon87
Dec 14 2018 17:23
yeah they are, we'll be submitting so the govt get it for jan 5th
if not, beyonce said I need to put a ring on it
whoa oh!
Jason Luboff
@JLuboff
Dec 14 2018 17:27
hah
Simon Cordova
@gbsimon87
Dec 14 2018 17:39
Guys I'm out for a bit, need to seriously concentrate
I'll check in later on :)
Jason Luboff
@JLuboff
Dec 14 2018 17:40
See ya man
Aditya
@ezioda004
Dec 14 2018 18:25
Gentlemen :wave:
Jason Luboff
@JLuboff
Dec 14 2018 18:26
Yo
Aditya
@ezioda004
Dec 14 2018 18:27
Whats up?
Jason Luboff
@JLuboff
Dec 14 2018 18:28
Just playing with React.. trying to create a print friendly form which is...coming along..
What about you?
Aditya
@ezioda004
Dec 14 2018 18:29
Oh nice, forms are so React academic :^
Finally got out of flight, in uber right now (1.5hrs before I reach the hotel)
Jason Luboff
@JLuboff
Dec 14 2018 18:30
Ah.. making your way to the new job location?
Aditya
@ezioda004
Dec 14 2018 18:30
Si
Jason Luboff
@JLuboff
Dec 14 2018 18:31
Awesome. For such a large city, I'm surprised it takes the long from the airport
Aditya
@ezioda004
Dec 14 2018 18:32
Oh yeah, the main city is like ~40 miles from the airport
My flight was cheaper than this uber man
Brad
@bradtaniguchi
Dec 14 2018 18:32
what city we talking about?
Aditya
@ezioda004
Dec 14 2018 18:32
Bangalore
Brad
@bradtaniguchi
Dec 14 2018 18:33
Ah I see
Jason Luboff
@JLuboff
Dec 14 2018 18:34
Lol really? Thats crazy
Aditya
@ezioda004
Dec 14 2018 18:35
Lol yeah, airport uber/taxi fares are crazy
Jason Luboff
@JLuboff
Dec 14 2018 18:35
The furtherest I've ever taken an uber is a couple miles
Brad
@bradtaniguchi
Dec 14 2018 18:36
The worst uber fair I saw was when I went to a concert. The uber there was like 30, which is fine since it was like 30 miles away. But leaving, hot damn it was $240
Jason Luboff
@JLuboff
Dec 14 2018 18:36
I would have just waited for the fare to go down..
Kelechi Chinaka
@ke1echi
Dec 14 2018 18:37
guys need help on this
Aditya
@ezioda004
Dec 14 2018 18:37
Or use lyft? Not sure how good is that (we dont have lyft)
Kelechi Chinaka
@ke1echi
Dec 14 2018 18:37
what i did grid-template-columns: minmax(90px, 1fr);
Jason Luboff
@JLuboff
Dec 14 2018 18:38
I've only ever used Uber...but.. then again..I've only ever used it when I was on vacation (SF)
Aditya
@ezioda004
Dec 14 2018 18:38
You live close to your work?
Or got a car?
Jason Luboff
@JLuboff
Dec 14 2018 18:39
I have a car, pretty standard for where I live. I do live fairly close to work though (~7 miles)
Brad
@bradtaniguchi
Dec 14 2018 18:39
@JLuboff It was like 12 midnight, called a friend gave him 40 and bought him a late dinner haha
Lyft always seems more expensive. Uber is probably doing something illegal to keep prices so low
Jason Luboff
@JLuboff
Dec 14 2018 18:40
Thats one way to do it haha
Aditya
@ezioda004
Dec 14 2018 18:40
@bradtaniguchi Yeah like paying the drivers less LOL
@JLuboff Owning a car in big city is a no for me, being stuck in traffic would drive me nuts
Brad
@bradtaniguchi
Dec 14 2018 18:42
I drive around it, or through it :P
Kelechi Chinaka
@ke1echi
Dec 14 2018 18:42
anyone wanna help.. thnx
Brad
@bradtaniguchi
Dec 14 2018 18:42
@ke1echi No idea sorry, I'm terrible with layout/css
Aditya
@ezioda004
Dec 14 2018 18:43
I did grid like once and forgot everything, sorry
Jason Luboff
@JLuboff
Dec 14 2018 18:43
@ezioda004 I don't live in a big city, so don't have to deal with traffic much. I used to work outside the city (SFV which is just before LA, and SB)... ya traffic was not fun
And I made pennies compared to what I make now having to pay for all that gas :satisfied:
Brad
@bradtaniguchi
Dec 14 2018 18:44
I drive a stick too, makes traffic more fun hehe
Jason Luboff
@JLuboff
Dec 14 2018 18:44
Automatic for me
still not enjoyable lol
Damn... I make 3.5X more now than I did at that job.. paying $240 a month in gas alone
Now I pay like $90 a mont hfor gas :joy:
Brad
@bradtaniguchi
Dec 14 2018 19:41
Wow, I pay 95$ a month for gas on average, and I'm driving pretty far haha. You must of been getting terrible MPG haha
Jason Luboff
@JLuboff
Dec 14 2018 19:41
Nah...averaged probably 28-29 mpg at the time
Christopher McCormack
@cmccormack
Dec 14 2018 19:46
You two are both driving me crazy!
@JLuboff switch to VS Code yet?
Jason Luboff
@JLuboff
Dec 14 2018 19:47
@cmccormack How are you not a dad yet? There some gold level dad jokes
And NO
Christopher McCormack
@cmccormack
Dec 14 2018 19:47
@JLuboff I'm of the age, maybe that's all that matters
Jason Luboff
@JLuboff
Dec 14 2018 19:47
Perhaps..
Jason Luboff
@JLuboff
Dec 14 2018 21:29
Random youtube link with no context...I aint clicking!
Christopher McCormack
@cmccormack
Dec 14 2018 21:33
Same
Jason Luboff
@JLuboff
Dec 14 2018 21:34
@cmccormack If I import a css file in my top most parent component...will that fall through to the children or do I need to import it in the children as well?
Christopher McCormack
@cmccormack
Dec 14 2018 21:35
@JLuboff can add it anywhere
your bundler just uses that to know it requires an import and processing
Jason Luboff
@JLuboff
Dec 14 2018 21:36
So...yes it'll fall through...?
Lets keep this nice and simple for me :P
Christopher McCormack
@cmccormack
Dec 14 2018 21:37
there isn't a fall through or anything like that
as long as your index file loads that CSS file it should work, all of your components should still be part of the same bundle loaded by your html file
Jason Luboff
@JLuboff
Dec 14 2018 21:38
Ok got it
Christopher McCormack
@cmccormack
Dec 14 2018 21:39
the import statement is only needed so webpack or parcel or whatever will load that file then do whatever loader magic on it so it can add it to your html or as a separate file
Jason Luboff
@JLuboff
Dec 14 2018 21:39
Ok, think I got it
(That means I don't got it, but got the gist of it)
Christopher McCormack
@cmccormack
Dec 14 2018 21:42
word
Jason Luboff
@JLuboff
Dec 14 2018 21:44
Trying to create a print ready page is stupidly difficult for some reason lol. It never wants to render how it looks on screen
Christopher McCormack
@cmccormack
Dec 14 2018 21:46
Pssh just add the printScreen function and be done
it's that easy right?
Jason Luboff
@JLuboff
Dec 14 2018 21:47
If only :)
Pagnito
@Pagnito
Dec 14 2018 21:50
is there a way to format a mp4 to play infinetiley?
Christopher McCormack
@cmccormack
Dec 14 2018 21:51
I believe the player determines that not the file
but there may be options or meta data, not totally sure
Pagnito
@Pagnito
Dec 14 2018 21:52
yea actually i had an idea, i can contrl that wit html
and if a person wants to download it, ill give them the link to the gif instead of the mp4
that way my app is downloading 14kb media file instead of 400-1000kb gif lol
Christopher McCormack
@cmccormack
Dec 14 2018 21:53
webm is smaller than gif
Pagnito
@Pagnito
Dec 14 2018 21:53
whats a webm
oh i see
tho isnt mp4 even smaller
Christopher McCormack
@cmccormack
Dec 14 2018 21:55
test it and see
Pagnito
@Pagnito
Dec 14 2018 21:55
true
i will later when i get to it, ill let u know if u want
Christopher McCormack
@cmccormack
Dec 14 2018 21:55
I've not done it myself sorry
yeah definitely
Pagnito
@Pagnito
Dec 14 2018 21:56
k got u
Christopher McCormack
@cmccormack
Dec 14 2018 21:56
Thanks
Jason Luboff
@JLuboff
Dec 14 2018 22:06
Gotta love when you get someone requesting a feature that is already there..
Christopher McCormack
@cmccormack
Dec 14 2018 22:09
it's your fault for not making it easy to discover!
Jason Luboff
@JLuboff
Dec 14 2018 22:10
Its a god damn sort option!
Christopher McCormack
@cmccormack
Dec 14 2018 22:11
sort by IQ of user
Brad
@bradtaniguchi
Dec 14 2018 22:11
My fav are bug reports that are like: "X is broken".... alright cool, thanks for helping me out there
Jason Luboff
@JLuboff
Dec 14 2018 22:12
@cmccormack This is the user who requested the app in the first place and has seen every iteration of the project >_<
css: [
        "https://cdnjs.cloudflare.com/ajax/libs/bulma/0.7.2/css/bulma.css",
        "https://use.fontawesome.com/releases/v5.5.0/css/all.css",
        "./App.css"
      ],
App.css is in the same folder as the file in which I have the above object key/value... that...that should be correct..right? It gets the CDN css no problem but doesn't seem to want to use my local css file
Christopher McCormack
@cmccormack
Dec 14 2018 22:16
@JLuboff what a maroon
@JLuboff what is that css property on?
Jason Luboff
@JLuboff
Dec 14 2018 22:18
print.js supposed to help with printer friendly html page
but you have to include the css files for it to read
Otherwise...it doesn't render the css
Christopher McCormack
@cmccormack
Dec 14 2018 22:21
@JLuboff where does your css file eventually get created after it's bundled?
it probably needs that path
Jason Luboff
@JLuboff
Dec 14 2018 22:23
Errr...I..I do not know.. How can I find out?
Christopher McCormack
@cmccormack
Dec 14 2018 22:24
when you load the page, where is the CSS?
if you aren't extracting it, it may be in the head of your html file
if you need to extract it, you may need to eject
Jason Luboff
@JLuboff
Dec 14 2018 22:26
It doesn't specify where it is on when looking at the inspector....I see it in the head of my html page but doesn't specify where its coming from
I wonder if I try and serve it from the backend if that would work..
Christopher McCormack
@cmccormack
Dec 14 2018 22:28
you could probably do that
you could also stop importing your css file but that means you would need to load it into your build folder somehow, maybe just a cp command or a utility
and there is the eject option
Jason Luboff
@JLuboff
Dec 14 2018 22:30
It literally only has one item in it just for printing
(I mention that just becuase I don't want to get all crazy for it hehe)
Christopher McCormack
@cmccormack
Dec 14 2018 22:33
any way to request it load it from your head?
Jason Luboff
@JLuboff
Dec 14 2018 22:33
It wants a url so not sure how I would do that
Serving from the backend worked :thumbsup:
Now just to figure out how to get it to keep from pushing a full row to the next page instead of breaking it apart...
Christopher McCormack
@cmccormack
Dec 14 2018 22:37
haha very nice
well I'm off for a bit, ttyl!
Jason Luboff
@JLuboff
Dec 14 2018 22:37
See ya
Pagnito
@Pagnito
Dec 14 2018 23:30
@cmccormack it seems webm is slightly bigger than mp4, an mp4 video that was 14kb in webm is 27kb
but is def still a big improvement from 400kb lol
Pagnito
@Pagnito
Dec 14 2018 23:35
im thinking about converting gifs on the server to mp4s then savin em to diff storage buckets to serve em on the page, for faster loading time, so im thinking about doing it after responding to a request, not so slow response time, but im concerned that, that too can create some issues
altho its only one gif per upload
now that i tihnk about it
Brad
@bradtaniguchi
Dec 14 2018 23:41
@Pagnito This is being done on cloud functions right?
Pagnito
@Pagnito
Dec 14 2018 23:41
yea
Brad
@bradtaniguchi
Dec 14 2018 23:41
I saw some pretty cool use-cases where you can upload the file to a bucket, and a cloud function listening to changes in the bucket goes out and converts them.
Pagnito
@Pagnito
Dec 14 2018 23:42
so like a diferent thread?
Brad
@bradtaniguchi
Dec 14 2018 23:43
Kinda sorta, think of it as an alternative to cron jobs, but on event rather than time based.
cloud functions can hook up to a lot of stuff on google so you can do smaller tasks based on events.
all part of that microservices approach and what not
Jason Luboff
@JLuboff
Dec 14 2018 23:45
Gah...making a webpage print friendly is not an easy task..
Brad
@bradtaniguchi
Dec 14 2018 23:46
@JLuboff Nope :D
Ever thought about making a page just for printing? (idk how complex the page is tho)
Jason Luboff
@JLuboff
Dec 14 2018 23:48
@bradtaniguchi I am purposesly creating a page for printing as it is. But heres my problem. I'm using bulma css which uses flexbox. So I have a row, which then contains nested row(s) so when I go to print, it wants to keep that entire parent row together as opposed to breaking up the children
Tried break-inside but I don't know that I'm using it correctly
Brad
@bradtaniguchi
Dec 14 2018 23:48
Oh yea thats right the flexbox issue :/
Jason Luboff
@JLuboff
Dec 14 2018 23:49
I don't understand why the print driver doesn't realize that it can break it apart lol