These are chat archives for FreeCodeCamp/HelpJavaScript

28th
Nov 2018
DMZ
@DMZ011
Nov 28 2018 00:01
hola!
Christopher McCormack
@cmccormack
Nov 28 2018 00:01
Hi!
and just about bye, gotta make dinner :)
DMZ
@DMZ011
Nov 28 2018 00:02
have fun @cmccormack xD
Jason Luboff
@JLuboff
Nov 28 2018 00:02
Hi
DMZ
@DMZ011
Nov 28 2018 00:02
i haven't worked with JS for about 40 days
@JLuboff hi!
it's like I forgot everything
Jason Luboff
@JLuboff
Nov 28 2018 00:02
Er...haven't you been working with React?
DMZ
@DMZ011
Nov 28 2018 00:04
no
nothing at all
just admin stuff :S
Jason Luboff
@JLuboff
Nov 28 2018 00:05
Oh
DMZ
@DMZ011
Nov 28 2018 00:05
i just opened vscode
and wanted to write some react/typescript and was like whoaaa
Jason Luboff
@JLuboff
Nov 28 2018 00:09
Wowzers
Fabusuyi David Oluwasegun
@dav4thevid
Nov 28 2018 00:44
hello every, hello @JLuboff please i really dont understand why my code is not passing all the test #Functional Programming: Use the every Method to Check that Every Element in an Array Meets a Criteria

function checkPositive(arr) {
// Add your code below this line
arr.every(function(currentValue){
return arr < 0;

  if (arr > 0){
      return true;
  }

});

// Add your code above this line
}
checkPositive([1, 2, 3, -4, 5]);

Jason Luboff
@JLuboff
Nov 28 2018 00:46
I haven't done that challenge, but you should be checking currentValue not arr would be my guess
DMZ
@DMZ011
Nov 28 2018 00:51
is there a way to get the exact dependency of a package by looking at github?
there's this package, it's using the latest version of react, but I want to use an older version, so I was looking at the releases section on github, but how do I check the react version each release is using?
Jason Luboff
@JLuboff
Nov 28 2018 00:54
wouldn't the package.json show the dependencies?
DMZ
@DMZ011
Nov 28 2018 00:54
yeah, is there another way? instead of going into each release and having to download the source?
Christopher McCormack
@cmccormack
Nov 28 2018 00:55
what package?
the latest bot framework package uses react 16.5
but my current project uses 16.3, so am getting errors regarding the context
"Object doesn't support property or method 'createContext'"
google tells me that it's something in react 16.5+, so I thought maybe I would get an older bot version with an older react version that would work with 16.3 that I have
Christopher McCormack
@cmccormack
Nov 28 2018 00:57
may need the api
DMZ
@DMZ011
Nov 28 2018 00:58
what api?
Christopher McCormack
@cmccormack
Nov 28 2018 00:58
npm or github to check dependencies
DMZ
@DMZ011
Nov 28 2018 00:59
I reached this page.. went to an older version, but all it says is that it depends on react, but doesn't mention which version of react
probably only way is to just install it and check
Christopher McCormack
@cmccormack
Nov 28 2018 00:59
is it a dependency of a dependency or a direct dependency?
Lia-Sue-Kim
@Lia-Sue-Kim
Nov 28 2018 01:00
Why when you get element by id
DMZ
@DMZ011
Nov 28 2018 01:00
direct dependency
Lia-Sue-Kim
@Lia-Sue-Kim
Nov 28 2018 01:00
display flex isnot possible
sorry display fixed *
why it doesn't work
Christopher McCormack
@cmccormack
Nov 28 2018 01:01
I'm not seeing that
@Lia-Sue-Kim what specifically are you doing?
Lia-Sue-Kim
@Lia-Sue-Kim
Nov 28 2018 01:02
a div usually displayed block
but when the screeen is less than 600px
there is a button
I want to use with JS to displayit fixed
Christopher McCormack
@cmccormack
Nov 28 2018 01:04
ok - there are a few ways to do it, why do you say it doesn't work?
one is to use a media query on the element, which is probably the best way to do it
with JS you can set a style if your event listener says the size is lower than x width or whatever
you can also create a class that sets the display to fixed and add that class when the width is less than x
The Element.classList API is pretty nice for doing the latter
Lia-Sue-Kim
@Lia-Sue-Kim
Nov 28 2018 01:07
function openMyFucntion(){
document.getElementById('open').style.display = "fixed";
}
Okay i will try
console says
[Violation] 'setTimeout' handler took 118ms
Christopher McCormack
@cmccormack
Nov 28 2018 01:09
codepen?
Lia-Sue-Kim
@Lia-Sue-Kim
Nov 28 2018 01:09
do you want me to show it there
Christopher McCormack
@cmccormack
Nov 28 2018 01:09
not really unless you're still having trouble
Lia-Sue-Kim
@Lia-Sue-Kim
Nov 28 2018 01:11
Maybe I should take time and learn a lil bit more
in order to do something with js
I was just trying to createa toggle menu
by giving onclick to the hamburger icon and with function
Christopher McCormack
@cmccormack
Nov 28 2018 01:13
that violation error is usually codepen or something similar
Lia-Sue-Kim
@Lia-Sue-Kim
Nov 28 2018 01:13
no it's with Atom and my browser
i mean I'm doing it in my atom text editor
Christopher McCormack
@cmccormack
Nov 28 2018 01:14
I see
Lia-Sue-Kim
@Lia-Sue-Kim
Nov 28 2018 01:15
<li class="open-mobile-icon"><span><a href="#" onclick="openSlideMenu()"><i class="fas fa-bars"></i></a></span></li>
here is the icon
Christopher McCormack
@cmccormack
Nov 28 2018 01:15
not sure about the timeout violation but I see that pretty often, can probably ignore
Lia-Sue-Kim
@Lia-Sue-Kim
Nov 28 2018 01:17
JS is interesting and confusing
Aditya
@ezioda004
Nov 28 2018 01:20
JS giveth, JS taketh away
Christopher McCormack
@cmccormack
Nov 28 2018 01:22
lol
Aditya
@ezioda004
Nov 28 2018 01:24
@cmccormack This is a chilling read.
Christopher McCormack
@cmccormack
Nov 28 2018 01:31
@ezioda004 I want that color module now!
Brad
@bradtaniguchi
Nov 28 2018 02:00
Has anyone here read the Gang of Four Design pattern book? I'm trying to think of a way to break down a massive class I have, and I feel like there's a design pattern for it.
Christopher McCormack
@cmccormack
Nov 28 2018 02:04
no have you?
Brad
@bradtaniguchi
Nov 28 2018 02:05
Nope, I've been skimming over the wiki page, looking into one of the patterns here. it's just the class I have builds a mongo-db aggregate pipeline, and the logic bloated the class-size to near 2k lines. I'm just trying to think is there a way to "split up" the code into different classes/files, without going insane.
Christopher McCormack
@cmccormack
Nov 28 2018 02:08
probably
2000 lines is so many
Brad
@bradtaniguchi
Nov 28 2018 02:09
Yea, its just the logic is really dense, but it's pretty separated. I don't want to move each method to its own file tho. But that seems like the "simplest" since each method takes in an arg and returns part of the aggregate.
Christopher McCormack
@cmccormack
Nov 28 2018 02:12
@bradtaniguchi how big would a section be?
Brad
@bradtaniguchi
Nov 28 2018 02:13
@cmccormack what do you mean a section?
Christopher McCormack
@cmccormack
Nov 28 2018 02:13
sorry method
Brad
@bradtaniguchi
Nov 28 2018 02:14
Depends, a lot of the methods are under 50 lines, when not accounting for documentation/typescript/logging. So very minimal logic. It's just there's like 20+ methods, with some going over 100 lines, but I don't split them up since there's so many damn methods
Looking back at the design pattern it doesn't look to help me much, id end up with more or less the same amount of code, just abstracted away.
Christopher McCormack
@cmccormack
Nov 28 2018 02:16
nothing wrong with abstracting things away though
Brad
@bradtaniguchi
Nov 28 2018 02:16
I COULD use a class to represent the actual aggregate pipeline, which should take-away some of the processing, but it also might create more of a headache and uneccessary abstraction
@cmccormack It would remove the actual database stuff from the model, but the "builder" class would be pushing 1k+ lines still since now it has all the logic
Christopher McCormack
@cmccormack
Nov 28 2018 02:19
sounds rough
why is the pipeline so long?
Brad
@bradtaniguchi
Nov 28 2018 02:20
It's the pipeline, since our app is very dynamic, the data is dynamic, all the inputs are dynamic, and thus the pipeline is very dynamic
I think I know of 1 approach I can use. I can use a nested builder/factory pattern or some hybrid (since I'm not dealing with classes)
Brad
@bradtaniguchi
Nov 28 2018 02:25
Eh I thought about it more, to convoluted.... I'm REALLY leaning to just creating a bunch of functions lying around
Christopher McCormack
@cmccormack
Nov 28 2018 02:27
@bradtaniguchi maybe that will help identify redundancies that can be moved into their own functions
Brad
@bradtaniguchi
Nov 28 2018 02:28
Yes, there are a few places, I'll probably take that route. It will help the test file too since it removes all the "class-state" crap that is going on, and allow me to make specific test-files for all the methods. (the test file is well over 2k lines already haha)
Christopher McCormack
@cmccormack
Nov 28 2018 02:32
@bradtaniguchi grab a beer and get crackin
Brad
@bradtaniguchi
Nov 28 2018 02:32
Im allergic to beer
Christopher McCormack
@cmccormack
Nov 28 2018 02:32
oh yeah :/
Dirty martini then?
Aditya
@ezioda004
Nov 28 2018 02:34
:cocktail:
Brad
@bradtaniguchi
Nov 28 2018 02:59
Not today, I had to fix a buncha bugs (as mentioned this morning) fixed it AND fixed another bug AND added a new feature all at the same time :sunglasses: today is a good productive day haha
Christopher McCormack
@cmccormack
Nov 28 2018 03:01
nice job
but the martini is to reward yourself for that hard work!
Brad
@bradtaniguchi
Nov 28 2018 03:03
thanks :hand: :cocktail:
Christopher McCormack
@cmccormack
Nov 28 2018 03:05
haha
Nate Mallison
@NJM8
Nov 28 2018 03:28
I wish programming people would stop using words from outside of programming to mean things in programming. It's like, oh I'm a programmer, let me use a word in this context that could be conceived as making sense and because it'll make me sound smart. No. Stop. Use words as they were meant to be used. Stop making shit up. End rant.
Blauelf
@Blauelf
Nov 28 2018 08:22
Can you provide an example of what you mean?
May Kittens Devour Your Soul
@diomed
Nov 28 2018 08:37
Github FINALLY introduced subscription to releases only.
Time to delete like dozen of repositories
Simon Cordova
@gbsimon87
Nov 28 2018 10:05
@JLuboff sorry buds had an early evening think I'm still a tad jet lagged
Jefferson
@jeffersonnnn
Nov 28 2018 11:49
hey guyss, what's up?
@NJM8 no way you are ending rant without giving an example. pretty, please?
@ezioda004 @cmccormack thanks for yesterday guys. i got my eslint fixed up and my code working properly.
@diomed if you are bringing that game again, please let me win some haha, i'm the newbie here.
Nate Mallison
@NJM8
Nov 28 2018 13:26
@Blauelf @jeffersonnnn Though I use something similar for module hydration from local storage. From a comment in the Vue forums
Is he filling his JS modules with water? 🤔🤔🤔
I certainly hope not
I understand what he is saying.
But just say populating module state
Blauelf
@Blauelf
Nov 28 2018 13:40
Sometimes such terms are common within a certain community (like "pickle" for "serialize" in the Python world, as that's the name of the module). No idea about that one. For an outside person, it indeed looks a bit weird.
Nate Mallison
@NJM8
Nov 28 2018 14:28
Ewwww
gross
Still he is talking about something different, having an initial state function in the client side store to reset default values from
Jefferson
@jeffersonnnn
Nov 28 2018 15:15
@NJM8 i'd argue that the reason for this to make something "complex" look normal. now there is a place for this - perhaps in the quest to make a more esoteric concept more accessible to dissertation - but if it the speaker is facing contemporaries, there is no need for all that.
filling the modules with water had me laugh out loud here.
Blauelf
@Blauelf
Nov 28 2018 15:36
Maybe they will grow when watered properly.
Christopher McCormack
@cmccormack
Nov 28 2018 16:02
istockphoto-649202726-1024x1024.jpg
Aditya
@ezioda004
Nov 28 2018 16:05
That was my old laptop, RIP HP, you were good while I didnt drop juice on you
Christopher McCormack
@cmccormack
Nov 28 2018 16:06
haha aww
They have channels for liquids to take on some modern laptops, so it doesn't get into the motherboard and other components
they being the keyboards
Aditya
@ezioda004
Nov 28 2018 16:08
Yeah...about that. I was hoping nothing happened and continued to play WoW (it was raid night!) and then it short circuited
Christopher McCormack
@cmccormack
Nov 28 2018 16:08
ohhhh ouch
did you even try to dry it first?
Jason Luboff
@JLuboff
Nov 28 2018 16:11
Morning
Christopher McCormack
@cmccormack
Nov 28 2018 16:18
heya
gm
Jason Luboff
@JLuboff
Nov 28 2018 16:19
Whats up
Christopher McCormack
@cmccormack
Nov 28 2018 16:19
messing around with some xml
you?
Jason Luboff
@JLuboff
Nov 28 2018 16:20
Ew... XML
Just getting started... waiting for my React app to start
Christopher McCormack
@cmccormack
Nov 28 2018 16:22
I agree, eww XML
for some reason the Palo Alto PanOS API uses only XML
Jason Luboff
@JLuboff
Nov 28 2018 16:23
I mean... XML actually isn't too bad...but definitely prefer JSON lol
Christopher McCormack
@cmccormack
Nov 28 2018 16:24
it's not, but in Node I have to actually do work to maniuplate the xml to then parse into my URL, whereas with JSON I can just change properties then parse it to a query string
Jason Luboff
@JLuboff
Nov 28 2018 16:30
Ah...ya XML won't be as easy to manipulate
Christopher McCormack
@cmccormack
Nov 28 2018 16:36
If you ever want to fully log an object in the Node console, with colors, I found this today:
const util = require('util')
console.log(util.inspect(object, false, null, true))
Aditya
@ezioda004
Nov 28 2018 16:37
@cmccormack No it happened in the middle of the game lol
Christopher McCormack
@cmccormack
Nov 28 2018 16:37
this package has been pretty useful, goes both ways
@ezioda004 man I hope you weren't the healer or tank :)
Aditya
@ezioda004
Nov 28 2018 16:38
I was the top DPS!! I used to play on US server so my guild used to raid 8 PM PST, that was like 7 AM for me
Christopher McCormack
@cmccormack
Nov 28 2018 16:39
what class?
Aditya
@ezioda004
Nov 28 2018 16:39
Frost DK
Christopher McCormack
@cmccormack
Nov 28 2018 16:40
that must have been after I quit, DK was relatively new and not all that great yet
holy crap that game is old I just realized
May Kittens Devour Your Soul
@diomed
Nov 28 2018 16:41
what up, folks?
Aditya
@ezioda004
Nov 28 2018 16:41
Yeah it was introduced in WoTLK and yes the game is very old :D
Like 14 years-ish old
May Kittens Devour Your Soul
@diomed
Nov 28 2018 16:42
@JLuboff just use XSLT, and you'll be fine :smiling_imp:
what does expression dissolving margins mean?
Jason Luboff
@JLuboff
Nov 28 2018 16:43
@cmccormack Had you not used util.inspect before? I've used it in the past when JSON.stringify wouldn't work (I think if there's objects within the object or something along those lines)
Christopher McCormack
@cmccormack
Nov 28 2018 16:44
@JLuboff nope
I guess console.log uses util.inspect internally but only shallow depth
Jason Luboff
@JLuboff
Nov 28 2018 16:45
Ya if I remember right..it enables you to view circular objects too (or whatever they're called
Christopher McCormack
@cmccormack
Nov 28 2018 16:46
@diomed never heard that term and Google keeps giving me a show or something
@JLuboff yeah like window/document
@ezioda004 I gotta say I do miss that game but quitting was the best thing I ever did haha
May Kittens Devour Your Soul
@diomed
Nov 28 2018 16:47
@cmccormack spooky @ezioda004
Christopher McCormack
@cmccormack
Nov 28 2018 16:47
@diomed love it!
Aditya
@ezioda004
Nov 28 2018 16:48
@cmccormack I agree, I was literally withering away. I'm glad I quit too
Christopher McCormack
@cmccormack
Nov 28 2018 16:49
now we wither away with this stuff :p
Aditya
@ezioda004
Nov 28 2018 16:49
Atleast I'll be making money while withering away
Christopher McCormack
@cmccormack
Nov 28 2018 16:51
nah this stuff is great, so many cool concepts and ways to use your brain productively
Jason Luboff
@JLuboff
Nov 28 2018 16:51
productively...sure
Christopher McCormack
@cmccormack
Nov 28 2018 16:51
well
depends on the definition lol
Jason Luboff
@JLuboff
Nov 28 2018 16:52
I'm trying to remind myself what my workflow is and how my functions are working....its...its not going great lol
Christopher McCormack
@cmccormack
Nov 28 2018 16:52
React app?
Jason Luboff
@JLuboff
Nov 28 2018 16:52
More so..trying to make a function handle two different scenarios
ya
Christopher McCormack
@cmccormack
Nov 28 2018 16:52
I feel like a good React app describes itself
May Kittens Devour Your Soul
@diomed
Nov 28 2018 16:53
would not be surprised if that's a thing
Christopher McCormack
@cmccormack
Nov 28 2018 16:53
@ezioda004 you on windows?
May Kittens Devour Your Soul
@diomed
Nov 28 2018 16:53
react app that describes itself
Jason Luboff
@JLuboff
Nov 28 2018 16:53
@cmccormack Well...its not a good react app :P
Not yet at least
Christopher McCormack
@cmccormack
Nov 28 2018 16:53
@diomed well made component names makes it very easy to understand what should be happening, provided you actually make the component do what you describe it as
Jason Luboff
@JLuboff
Nov 28 2018 16:54
Oh...no issue with the components...its my functions linked to said components
Christopher McCormack
@cmccormack
Nov 28 2018 16:54
@JLuboff we have no doubt you will iterate until it is though
@ezioda004 you on Windows?
May Kittens Devour Your Soul
@diomed
Nov 28 2018 16:54
methods, I believe they're called
Christopher McCormack
@cmccormack
Nov 28 2018 16:54
yeah!
May Kittens Devour Your Soul
@diomed
Nov 28 2018 16:57
R U _ _ _ _ S S
_ N
P U R P _ S _
_ N D
_ N S _ D _ _ U S
_ N
_ _ _ _ _ D
Christopher McCormack
@cmccormack
Nov 28 2018 16:59
U
May Kittens Devour Your Soul
@diomed
Nov 28 2018 16:59
:white_check_mark:
Christopher McCormack
@cmccormack
Nov 28 2018 17:03
C
May Kittens Devour Your Soul
@diomed
Nov 28 2018 17:03
nope
Christopher McCormack
@cmccormack
Nov 28 2018 17:09
T
May Kittens Devour Your Soul
@diomed
Nov 28 2018 17:09
R U T H _ _ S S
_ N
P U R P _ S _
A N D
_ N S _ D _ _ U S
_ N
_ _ T _ _ D
Jason Luboff
@JLuboff
Nov 28 2018 17:10
A
Christopher McCormack
@cmccormack
Nov 28 2018 17:10
H
May Kittens Devour Your Soul
@diomed
Nov 28 2018 17:11
yup yup yup - but also just one
:smile:
Christopher McCormack
@cmccormack
Nov 28 2018 17:11
dangit
just don't know that last word
L
Jason Luboff
@JLuboff
Nov 28 2018 17:12
E
O
Christopher McCormack
@cmccormack
Nov 28 2018 17:12
lots of them I bet :)
May Kittens Devour Your Soul
@diomed
Nov 28 2018 17:12
correct
R U T H L E S S
_ N
P U R P O S E
A N D
_ N S _ D _ O U S
_ N
_ E T H O D
Jason Luboff
@JLuboff
Nov 28 2018 17:12
I M
May Kittens Devour Your Soul
@diomed
Nov 28 2018 17:13
care to guess?
Jason Luboff
@JLuboff
Nov 28 2018 17:13
ruthless in purpose and insidious in method?
May Kittens Devour Your Soul
@diomed
Nov 28 2018 17:13
:congratulations: @JLuboff :tada:
well done! :smile_cat:
Jason Luboff
@JLuboff
Nov 28 2018 17:15
:thumbsup:
Aditya
@ezioda004
Nov 28 2018 17:17
@cmccormack Yes I'm on windows
May Kittens Devour Your Soul
@diomed
Nov 28 2018 17:17
@JLuboff it's season3-ep. 8
Jason Luboff
@JLuboff
Nov 28 2018 17:17
Never watched it
Aditya
@ezioda004
Nov 28 2018 17:22

More so..trying to make a function handle two different scenarios

You could make a function "overload" with using rest parameter, not sure if thats what you're going for though

Christopher McCormack
@cmccormack
Nov 28 2018 17:23
what sort of scenario we talking about @JLuboff ? same method to handle two different actions?
Jason Luboff
@JLuboff
Nov 28 2018 17:24
@cmccormack Similar actions but one is for initially adding some hazard/controls while the second action is to go back and edit that selection. I'm just breaking it into seperate functions to keep it cleaner
Christopher McCormack
@cmccormack
Nov 28 2018 17:25
probably best
Jason Luboff
@JLuboff
Nov 28 2018 17:26
:thumbsup:
May Kittens Devour Your Soul
@diomed
Nov 28 2018 17:40
how to make 2 column content?
Christopher McCormack
@cmccormack
Nov 28 2018 17:41
same heights?
May Kittens Devour Your Soul
@diomed
Nov 28 2018 17:41
yes
Christopher McCormack
@cmccormack
Nov 28 2018 17:42
I would probably use flexbox or grid, set them both to dynamically resize within the container on window resize, like flex: 1 1 auto;
May Kittens Devour Your Soul
@diomed
Nov 28 2018 17:44
so I use flex columns?
Christopher McCormack
@cmccormack
Nov 28 2018 17:52
probably just a row with multiple divs in it
DMZ
@DMZ011
Nov 28 2018 17:55
can't we have 2 IIFEs in the same file?
Christopher McCormack
@cmccormack
Nov 28 2018 17:55
DMZ
@DMZ011
Nov 28 2018 17:58
ouch, we can, was missing a semi colon for the 1st IIFE ...
Aditya
@ezioda004
Nov 28 2018 17:59
@DMZ011 Thats one of the gotchas of not using semicolons
DMZ
@DMZ011
Nov 28 2018 17:59
@ezioda004 yeah
i added semi colons everywhere in the 2nd IIFE
forgot to add one between the 2 IIFEs
Aditya
@ezioda004
Nov 28 2018 18:00
You dont use eslint?
DMZ
@DMZ011
Nov 28 2018 18:00
no
am editing source code on CDN
so am just opening the js file directly
Aditya
@ezioda004
Nov 28 2018 18:00
Ah gotcha
Jason Luboff
@JLuboff
Nov 28 2018 18:01
@cmccormack Is a semicolon hater
Christopher McCormack
@cmccormack
Nov 28 2018 18:02
I'm also an IIFE hater
haha
Jason Luboff
@JLuboff
Nov 28 2018 18:02
I don't use them either
Aditya
@ezioda004
Nov 28 2018 18:02
Why? IIFE so good
Christopher McCormack
@cmccormack
Nov 28 2018 18:02
The only time I've ever found them useful is in one-off scripts
and they really aren't much better than just calling the function
I would actually say they are less intuitive
Aditya
@ezioda004
Nov 28 2018 18:03
True, I'm just glad that libraries use them and dont pollute the global namespace
DMZ
@DMZ011
Nov 28 2018 18:03
i have something like this:
(function move(){
  var s = document.querySelector(".mercury-header-search"), p = document.querySelector(".o365cs-nav-centerAlign");
  (s && p && p.appendChild(s)) || setTimeout(move,50)

})();
i find it useful when i don't have anything else (no react project with typescript <3 )
May Kittens Devour Your Soul
@diomed
Nov 28 2018 18:04
I used column-count:2
Christopher McCormack
@cmccormack
Nov 28 2018 18:04

that would be the same as

function move(){
  var s = document.querySelector(".mercury-header-search"), p = document.querySelector(".o365cs-nav-centerAlign");
  (s && p && p.appendChild(s)) || setTimeout(move,50)
};
move();

correct?

Aditya
@ezioda004
Nov 28 2018 18:05
Yep except you're invoking the function explicitly
DMZ
@DMZ011
Nov 28 2018 18:05
yea
Aditya
@ezioda004
Nov 28 2018 18:05
@cmccormack Ok - my thingy finished with no errors on a fresh install
May Kittens Devour Your Soul
@diomed
Nov 28 2018 18:05
@ezioda004 join me on vue side
Christopher McCormack
@cmccormack
Nov 28 2018 18:05
@diomed oh you wanted the same div to wrap to another column?
DMZ
@DMZ011
Nov 28 2018 18:05
vue :S :S
Christopher McCormack
@cmccormack
Nov 28 2018 18:05
I made my first vue app the other day when testing a guide post on the FCC guides
was easy
It's all about Marko though now guys
Aditya
@ezioda004
Nov 28 2018 18:06
@diomed No can do amigo, I get paid for working on React :sunglasses:
Oops :D
Christopher McCormack
@cmccormack
Nov 28 2018 18:07
@ezioda004 ok so you copied the env, npm i, seeded, then npm run develop with no issues?
Aditya
@ezioda004
Nov 28 2018 18:07

It's all about Marko though now guys

Thats propaganda!

Christopher McCormack
@cmccormack
Nov 28 2018 18:07
MARKO! MARKO! MARKO!
Aditya
@ezioda004
Nov 28 2018 18:07
@cmccormack I also did npm run bootstrap after installed and before seeding
So copy .env file, then npm i => npm run bootsrap && npm run seed && npm run develop
Christopher McCormack
@cmccormack
Nov 28 2018 18:08
doesn't lerna already do that?
during npm i
Aditya
@ezioda004
Nov 28 2018 18:08
Yes but last time I had error for some reason
During after doing npm i and npm run seed
Christopher McCormack
@cmccormack
Nov 28 2018 18:09
probably same reason we did, the env copy was shown as being after the npm i in the old doc
so it wasn't populating the client/env.json
although that's a prebootstrap command
Aditya
@ezioda004
Nov 28 2018 18:10
Yeah probably, what step are you getting error at?
Christopher McCormack
@cmccormack
Nov 28 2018 18:11
not an error but when I run npm run develop from the root it isn't spawning the next process after the api server is loaded
Aditya
@ezioda004
Nov 28 2018 18:11
Oh thats weird
Christopher McCormack
@cmccormack
Nov 28 2018 18:12
yeah
Aditya
@ezioda004
Nov 28 2018 18:12
Whats was last message in the terminal?
Christopher McCormack
@cmccormack
Nov 28 2018 18:12
no message, just sits there after the babel-dev-server stuff finishes loading
but if it's working for you all the way up to where you can get to localhost:8000 then somethings probably wrong on my end
Aditya
@ezioda004
Nov 28 2018 18:13

I did get this:

\freeCodeCamp\api-server\common\models\challenge.js:22
        throw Error(err);
        ^

Error: Error: Timeout in connecting after 10000 ms
    at Error (...\freeCodeCamp\api-server\common\models/challenge.js:20:15)

During npm run develop

But it still completed compiling
Christopher McCormack
@cmccormack
Nov 28 2018 18:14
that's an odd error
May Kittens Devour Your Soul
@diomed
Nov 28 2018 18:15

MARKO! MARKO! MARKO!

POLO POLO POLO

Aditya
@ezioda004
Nov 28 2018 18:15
Yes - that could be just on my side though
Christopher McCormack
@cmccormack
Nov 28 2018 18:17
looks like a slow db lookup
    Challenge.find({ isPrivate: false }, (err, challenges) => {
      if (err) {
        throw Error(err);
      }
Aditya
@ezioda004
Nov 28 2018 18:18
Ah that'd explain
Christopher McCormack
@cmccormack
Nov 28 2018 18:18
is there a Node way of using fs methods as promises or do you need a module/code it yourself?
Aditya
@ezioda004
Nov 28 2018 18:20
Theres probably an npm library out there for that
Christopher McCormack
@cmccormack
Nov 28 2018 18:20
yeah I believe with bluebird you can use promisifyAll or whatever on fs
but the recent news is now making me hesitant to use external packages
Christopher McCormack
@cmccormack
Nov 28 2018 18:21
@ezioda004 🎉🎉🎉 thanks
Aditya
@ezioda004
Nov 28 2018 18:21
But its behind a flag
Christopher McCormack
@cmccormack
Nov 28 2018 18:21
experimental though
eh i'll just make my own I guess
Chris
@crokita
Nov 28 2018 18:22
I use require('util').promisify;
Aditya
@ezioda004
Nov 28 2018 18:23
const fsPromises = require('fs').promises;
async function openAndClose() {
  let filehandle;
  try {
    filehandle = await fsPromises.open('thefile.txt', 'r');
  } finally {
    if (filehandle !== undefined)
      await filehandle.close();
  }
}
As much as I like async-await, I really dislike try-catch blocks
Christopher McCormack
@cmccormack
Nov 28 2018 18:23
@crokita that's built in? I'll try it thanks!
Christopher McCormack
@cmccormack
Nov 28 2018 18:24
@ezioda004 at least the depth is only increased 1 for a try...catch
nesting callbacks is a lot uglier
and I'm doing local file stuff which can be quite deep
Aditya
@ezioda004
Nov 28 2018 18:25
True but it still kills the beauty of async await!
Christopher McCormack
@cmccormack
Nov 28 2018 18:25
@crokita that's fantastic!
Aditya
@ezioda004
Nov 28 2018 18:25
Oh well, cant win em all :disappointed_relieved:
Simon Cordova
@gbsimon87
Nov 28 2018 18:25
hey all :)
@cmccormack sorry I disappeared halfway through convo yesterday I passed out
Christopher McCormack
@cmccormack
Nov 28 2018 18:25
you can still use a .catch inside can't you?
Jason Luboff
@JLuboff
Nov 28 2018 18:25
@gbsimon87 Sup
Christopher McCormack
@cmccormack
Nov 28 2018 18:26
@gbsimon87 no worries at all I was about done at that point as well
Simon Cordova
@gbsimon87
Nov 28 2018 18:26
@JLuboff whats up buds
Adel
@AdelMahjoub
Nov 28 2018 18:26
Stability: 1 - Experimental. This feature is still under active development and subject to non-backward compatible changes or >removal in any future version. Use of the feature is not recommended in production environments. Experimental features are not >subject to the Node.js Semantic Versioning model.
Simon Cordova
@gbsimon87
Nov 28 2018 18:26
hows that smoke settled yet or what?
Adel
@AdelMahjoub
Nov 28 2018 18:26
better use promisify
Jason Luboff
@JLuboff
Nov 28 2018 18:26
@gbsimon87 Ya...it never really hit us too bad.
Christopher McCormack
@cmccormack
Nov 28 2018 18:28
honestly promisify doesn't even save all that much code over just making my own promise but I"ll use it anyway thanks :)
Adel
@AdelMahjoub
Nov 28 2018 18:28
yes, or your own promise
Chris
@crokita
Nov 28 2018 18:28
haha. yeah, it's just a little shortcut
Adel
@AdelMahjoub
Nov 28 2018 18:30
at least your own promise are backward compatible, unless u know your host node version
Christopher McCormack
@cmccormack
Nov 28 2018 18:30
that worked fabulous
@AdelMahjoub yeah good point
Jason Luboff
@JLuboff
Nov 28 2018 18:30
I've never even looked at promisify..
Chris
@crokita
Nov 28 2018 18:32
basically saves you typing out
Christopher McCormack
@cmccormack
Nov 28 2018 18:32
it has to have a callback that uses (err, value) but that's a lot of Node callbacks
Chris
@crokita
Nov 28 2018 18:33
invoking the error-style callback and resolving rejecting based on if the error exists
yea
when I found it I was like "...sweet"
Chris
@crokita
Nov 28 2018 18:36
sometimes there's a case where the function you're putting in uses that dumb this context, so sometimes you gotta bind your function like this:
return promisify(consul.kv.set.bind(consul.kv))(opts);
that's the only catch I can think of
Jason Luboff
@JLuboff
Nov 28 2018 18:36
That hurts my brain
Chris
@crokita
Nov 28 2018 18:36
lol
Simon Cordova
@gbsimon87
Nov 28 2018 18:49
hey guys, I know i can use git diff to view the differences between two branches
Whats the command for a prettier view of the differences?
Brad
@bradtaniguchi
Nov 28 2018 18:52
@gbsimon87 How pretty are we talking?
Christopher McCormack
@cmccormack
Nov 28 2018 18:52
they always looked fine to me
Jason Luboff
@JLuboff
Nov 28 2018 18:52
Maybe like a 7 out of 10?
Christopher McCormack
@cmccormack
Nov 28 2018 18:52
doesn't vs code offer diff support?
Jason Luboff
@JLuboff
Nov 28 2018 18:53
I know you can view it in Atom...so I imagine so
Nate Mallison
@NJM8
Nov 28 2018 18:53
@jeffersonnnn "perhaps in the quest to make a more esoteric concept more accessible to dissertation" Now you are doing it too! Speak English man!
Christopher McCormack
@cmccormack
Nov 28 2018 18:53
can you view a diff to an upstream repo?
Brad
@bradtaniguchi
Nov 28 2018 18:53
Yes, i personally never use diff in the terminal. No matter how good your CLI+git skills are, using ANYTHING else makes looking at and handling diffs easier
Christopher McCormack
@cmccormack
Nov 28 2018 18:53
@NJM8 right? That was some smarty pants wording
Nate Mallison
@NJM8
Nov 28 2018 18:54
lol
Simon Cordova
@gbsimon87
Nov 28 2018 18:54
git diff is ridiculous, I can barely make sense out of it
its just text
Jason Luboff
@JLuboff
Nov 28 2018 18:54
@cmccormack You know what...I was thinking about merging conflicts now that I think about it..
Christopher McCormack
@cmccormack
Nov 28 2018 18:54
I actually googled it because I wasn't sure if it was a quote or original
Simon Cordova
@gbsimon87
Nov 28 2018 18:54
There's a way that opens this window and shows it way more elegant
Nate Mallison
@NJM8
Nov 28 2018 18:54
what's wrong with git di?
Simon Cordova
@gbsimon87
Nov 28 2018 18:55
di? I'll try that
never heard of it
Nate Mallison
@NJM8
Nov 28 2018 18:55
oh
good luck haha
it's an alias
Simon Cordova
@gbsimon87
Nov 28 2018 18:55
oh man
lol
Christopher McCormack
@cmccormack
Nov 28 2018 18:55
for what
Nate Mallison
@NJM8
Nov 28 2018 18:55
diff
Christopher McCormack
@cmccormack
Nov 28 2018 18:55
lol
why not just gd
Simon Cordova
@gbsimon87
Nov 28 2018 18:55
I just got pure Italian results haha 'di' meaning of
Nate Mallison
@NJM8
Nov 28 2018 18:55
aint nobody got time for ff
Christopher McCormack
@cmccormack
Nov 28 2018 18:55
wait you can alias two words?
Nate Mallison
@NJM8
Nov 28 2018 18:56
dude
you can alias entire commands
Simon Cordova
@gbsimon87
Nov 28 2018 18:56
There's a more elegant way to see the difference between two branches
Christopher McCormack
@cmccormack
Nov 28 2018 18:57
┌─ 🍺  chris@Mack-GamingPC 11:56:32 [~]
└─► $ alias "git di"="git diff"
bash: alias: `git di': invalid alias name

┌─ 💥  chris@Mack-GamingPC 11:56:40 [~]
└─► $ alias git di="git diff"
bash: alias: git: not found
Simon Cordova
@gbsimon87
Nov 28 2018 18:57
chris mack gaming pc lololol love it
Christopher McCormack
@cmccormack
Nov 28 2018 18:57
oops tmi haha
@NJM8 so... how?
Jason Luboff
@JLuboff
Nov 28 2018 18:58
Technically its just Mack-Gaming PC, and his username is chris.. but..thats just being nitpicky lol
Christopher McCormack
@cmccormack
Nov 28 2018 18:58
now y'all know too much
Simon Cordova
@gbsimon87
Nov 28 2018 18:59
"gaming" - thats what he told the wife lolol
Adel
@AdelMahjoub
Nov 28 2018 18:59
chris_mack_gamin_pc.png
Christopher McCormack
@cmccormack
Nov 28 2018 18:59
I don't have to tell her anything haha we don't share any bank accounts
Simon Cordova
@gbsimon87
Nov 28 2018 18:59
How did you pull that off?
"Can I get a prenup" - AMEN! lolol
alright I'm done
Christopher McCormack
@cmccormack
Nov 28 2018 19:00
haha
we're both professionals with good income, never needed to
Simon Cordova
@gbsimon87
Nov 28 2018 19:00
hey guys seriously no idea how i can see the diff between two branches a little neater than git diff?
Christopher McCormack
@cmccormack
Nov 28 2018 19:00
she takes some bills, I take others
yeah I feel like @bradtaniguchi left us hanging
Simon Cordova
@gbsimon87
Nov 28 2018 19:00
I like that, 21st century standards
Like who the hell can make out git diff?
Brad
@bradtaniguchi
Nov 28 2018 19:01
:eyes: UUhhh no I didn't (quickly scrolling thru what happened the lasta 5 mins)
Nate Mallison
@NJM8
Nov 28 2018 19:01
Here are mine:
alias.st status
alias.ch checkout
alias.co commit
alias.br branch
alias.pu push
alias.cm commit
alias.today log --oneline --since=midnight --reverse
alias.di diff --exit-code
alias.yesterday log --since='1 day ago' --oneline --reverse
Christopher McCormack
@cmccormack
Nov 28 2018 19:02
@NJM8 ah so you lied to us
it's just di not git di
Simon Cordova
@gbsimon87
Nov 28 2018 19:02
@JLuboff thanks buds but that doesn't show the differences between two branches
Nate Mallison
@NJM8
Nov 28 2018 19:02
hm, no you still have to git di
Christopher McCormack
@cmccormack
Nov 28 2018 19:02
oh
Simon Cordova
@gbsimon87
Nov 28 2018 19:02
I'll just open two instances of vs code sighs
Christopher McCormack
@cmccormack
Nov 28 2018 19:02
these are git aliases?
Nate Mallison
@NJM8
Nov 28 2018 19:02
yes
Christopher McCormack
@cmccormack
Nov 28 2018 19:02
I didn't know git had them
neat
Simon Cordova
@gbsimon87
Nov 28 2018 19:03
Anybody here us zsh?
Christopher McCormack
@cmccormack
Nov 28 2018 19:03
@bradtaniguchi :point_up: November 28, 2018 11:53 AM
@gbsimon87 yes
Christopher McCormack
@cmccormack
Nov 28 2018 19:03
oh forgot about gitlens
Brad
@bradtaniguchi
Nov 28 2018 19:03
git diff <BRANCH_NAME_HERE?>
Nate Mallison
@NJM8
Nov 28 2018 19:04
@gbsimon87 Why is git diff hard to use? Too many changes?
Simon Cordova
@gbsimon87
Nov 28 2018 19:04

@JLuboff thanks I'll take a look

If you use zsh and want to shave off some milliseconds, the cd command is unnecessary

Christopher McCormack
@cmccormack
Nov 28 2018 19:04
@bradtaniguchi you said you don't use it in the terminal
@gbsimon87 you're reading those twitter posts too?
Brad
@bradtaniguchi
Nov 28 2018 19:04
Oh.. I don't use the terminal for git diff, hehehe
Simon Cordova
@gbsimon87
Nov 28 2018 19:04
@NJM8 yeah I can't make it out
I'm doing a PR and it's all over the place
@cmccormack yeah man! wes bos I think tweeted it
Nate Mallison
@NJM8
Nov 28 2018 19:05
Ah. Yeah, large commits will be hard to figure out
Christopher McCormack
@cmccormack
Nov 28 2018 19:05
@gbsimon87 I think my favorite new cmd is wd from those threads
Nate Mallison
@NJM8
Nov 28 2018 19:06
I keep all my commits to one char so they are easier to track
v
commit
a
commit
r
commit
=
commit
see?
Simon Cordova
@gbsimon87
Nov 28 2018 19:06

@cmccormack whats wd?

@NJM8 lolololol

Christopher McCormack
@cmccormack
Nov 28 2018 19:06
@NJM8 you still use var??
Simon Cordova
@gbsimon87
Nov 28 2018 19:06
We're such nerds to be laughing at that
Christopher McCormack
@cmccormack
Nov 28 2018 19:06
@gbsimon87 I think warp directory
Simon Cordova
@gbsimon87
Nov 28 2018 19:06
still use var lolololol
Christopher McCormack
@cmccormack
Nov 28 2018 19:07
lets you save directories you commonly use and jump to them quickly
Simon Cordova
@gbsimon87
Nov 28 2018 19:07
oh true I read about that - I may take his course on Git actually
Nate Mallison
@NJM8
Nov 28 2018 19:08
@cmccormack Only for noob spotting
congrats you passed the test
Christopher McCormack
@cmccormack
Nov 28 2018 19:09
@NJM8 lol
@gbsimon87 bos course?
you missed the black friday 50% off sale
Simon Cordova
@gbsimon87
Nov 28 2018 19:09
They say var is back, like pogs, better than ever, its the new const
"you missed the black friday 50% off sale" word you are killing me today lolool
Christopher McCormack
@cmccormack
Nov 28 2018 19:10
wd is awesome!
 chris@Mack-GamingPC  /mnt/h/projects  wd add projects
 * Warp point added
 chris@Mack-GamingPC  /mnt/h/projects  cd ~
 chris@Mack-GamingPC  ~  wd projects
 chris@Mack-GamingPC  /mnt/h/projects 
var is the the new const
-- @gbsimon87
Simon Cordova
@gbsimon87
Nov 28 2018 19:11
quoted printed framed
Christopher McCormack
@cmccormack
Nov 28 2018 19:11
gitter doesn't support powerline fonts and ligatures??
Simon Cordova
@gbsimon87
Nov 28 2018 19:11
Just remember where you heard it first lol
Christopher McCormack
@cmccormack
Nov 28 2018 19:13
does that look like crap in gitter?
Simon Cordova
@gbsimon87
Nov 28 2018 19:14
I remember those commercials
Chris
@crokita
Nov 28 2018 19:14
if you click it it displays correctly. weird
lol
Simon Cordova
@gbsimon87
Nov 28 2018 19:14
yeah it looks horrible but fine when clicked
well in the new window that is
Jason Luboff
@JLuboff
Nov 28 2018 19:14
Just a white box with a bit of grey in lower right corner
Simon Cordova
@gbsimon87
Nov 28 2018 19:14
that's what i see
I tried making out where it is on the image but can't
Christopher McCormack
@cmccormack
Nov 28 2018 19:15
weird even tried a different format
franks.bmp
Jason Luboff
@JLuboff
Nov 28 2018 19:16
that works
Simon Cordova
@gbsimon87
Nov 28 2018 19:16
There you go
Christopher McCormack
@cmccormack
Nov 28 2018 19:16
bmp
/shrug
Simon Cordova
@gbsimon87
Nov 28 2018 19:16
Everybody heard my nerd joke the other day?
the knock knock joke?
damn comedy
I'll take that as a no in case you haven't
Christopher McCormack
@cmccormack
Nov 28 2018 19:17
something to do with interrupting cows?
Simon Cordova
@gbsimon87
Nov 28 2018 19:17
Knock knock
Christopher McCormack
@cmccormack
Nov 28 2018 19:17
"come in"
oops I mean
"who's there?"
Simon Cordova
@gbsimon87
Nov 28 2018 19:17
lol
Brad
@bradtaniguchi
Nov 28 2018 19:17
LUL
Simon Cordova
@gbsimon87
Nov 28 2018 19:17
recursion
Christopher McCormack
@cmccormack
Nov 28 2018 19:17
"recursion who"
whom?
Simon Cordova
@gbsimon87
Nov 28 2018 19:17
knock knock
LOLOLOLOLOLOLOLOL
Christopher McCormack
@cmccormack
Nov 28 2018 19:18
"who's there?"
Simon Cordova
@gbsimon87
Nov 28 2018 19:18
damn comedy
Christopher McCormack
@cmccormack
Nov 28 2018 19:18
lol
where is your base case
I don't want to exceed the maximum stack size
Simon Cordova
@gbsimon87
Nov 28 2018 19:18
lol
i'm headed to a pub I'll catch you guys in a bit
Christopher McCormack
@cmccormack
Nov 28 2018 19:18
i'm headed to make lunch myself, see ya
Brad
@bradtaniguchi
Nov 28 2018 19:20
Gotta fix a bug I wrote a test-case for this is the test case:


it('test the critical feature', () => {});
Adel
@AdelMahjoub
Nov 28 2018 19:23
ajax_callstack.jpg
Christopher McCormack
@cmccormack
Nov 28 2018 19:27
@bradtaniguchi nice and concise I like it haha
Brad
@bradtaniguchi
Nov 28 2018 19:28
Yes, excellent passing test, can't get any cleaner :D
May Kittens Devour Your Soul
@diomed
Nov 28 2018 19:41
@gbsimon87 your fixed images make me dizzy
Aditya
@ezioda004
Nov 28 2018 19:42
Pfff npm amirite
May Kittens Devour Your Soul
@diomed
Nov 28 2018 19:43
if only someone would download my malicious code from npm
and by malicious I mean buggy
Christopher McCormack
@cmccormack
Nov 28 2018 19:44
we saw that yesterday and the fcc devs updated the packages right away to remove that module
May Kittens Devour Your Soul
@diomed
Nov 28 2018 19:44
damnit, I'm in wrong room again
Christopher McCormack
@cmccormack
Nov 28 2018 19:45
Aditya
@ezioda004
Nov 28 2018 19:46
I wonder if deno is using npm, I remember Ryan saying that he doesnt like npm
Yeah that or find a library whose author isnt interested in maintaining it and then mail him asking you to make the owner, worked for the other guy
Christopher McCormack
@cmccormack
Nov 28 2018 19:50
The comments were spot on, the original maintainer should have put the package in deprecated status or whatever and the new maintainer could fork it
Aditya
@ezioda004
Nov 28 2018 19:51
/shrug
May Kittens Devour Your Soul
@diomed
Nov 28 2018 19:52
@cmccormack yeah. I've seen that months ago. probably where someone got inspiration from :smiling_imp:
Pagnito
@Pagnito
Nov 28 2018 20:57
are we not allowed to setState ina catch?
alpox
@alpox
Nov 28 2018 20:57
@Pagnito i dont see a reason why not
Pagnito
@Pagnito
Nov 28 2018 20:58
weird im tryin to set state from indexdb on failed fetch request
Jason Luboff
@JLuboff
Nov 28 2018 20:58
Theoritically you can do anything in a catch can't you?
Pagnito
@Pagnito
Nov 28 2018 20:58
it console logs the data after i read it
but it doesnt set state
.catch(err =>{
      if('indexedDB' in window){
          helpers.readData('patterns')
          .then(function(data){
              console.log('FROM IDB', data[0])
              this.setState({
                data:data[0]
              }, ()=>{
                renderChart1(this.state.data.pattern3);
                renderChart2(this.state.data.pattern2);
                this.setState({chart1Rendered:true});
              })
          })
        }
    })
Christopher McCormack
@cmccormack
Nov 28 2018 21:01
@Pagnito you have another place you should be adding .catch in that code
Pagnito
@Pagnito
Nov 28 2018 21:02
oh wait
Chris
@crokita
Nov 28 2018 21:02
is it because this doesn't point to where it should anymore?
Pagnito
@Pagnito
Nov 28 2018 21:02
i think it might be 'this'
Christopher McCormack
@cmccormack
Nov 28 2018 21:02
use arrow function
see if that works
Chris
@crokita
Nov 28 2018 21:02
^
Jason Luboff
@JLuboff
Nov 28 2018 21:03
Its always confused me how arrow functions handle this differently (or a regular function declaration I dunno)
Christopher McCormack
@cmccormack
Nov 28 2018 21:03
there is no this, so just pretend this falls through
Jason Luboff
@JLuboff
Nov 28 2018 21:04
Ah.. see I was under the impression that this does not exist inside arrow functions, but I was not aware that it will fall through
Aditya
@ezioda004
Nov 28 2018 21:04
this is bound to lexical scope of the function, arrow function just doesnt have a lexical scope
Pagnito
@Pagnito
Nov 28 2018 21:04
the arrow function didnt quite fix it
.catch(err =>{
      var that = this;
      if('indexedDB' in window){
          helpers.readData('patterns')
          .then((data)=>{
              console.log('FROM IDB', data[0])
              that.setState({
                data:data[0],
                jacakss:'oy'
              }, ()=>{
                renderChart1(this.state.data.pattern3);
                renderChart2(this.state.data.pattern2);
                that.setState({chart1Rendered:true});
              })
          })
        }
    })
i dunno if doing the that=this is a good practice
but it seems to have fixed my problem
Christopher McCormack
@cmccormack
Nov 28 2018 21:05
@Pagnito why run setstate twice in a row like that?
Pagnito
@Pagnito
Nov 28 2018 21:06
because one has to come after the other
Aditya
@ezioda004
Nov 28 2018 21:06
setState in the callback function of setState?
Christopher McCormack
@cmccormack
Nov 28 2018 21:06
why?
Pagnito
@Pagnito
Nov 28 2018 21:06
because the charts need the information and because setstate is async i need to render them in a callback, and only once they render i set chart1Renderd to true
Christopher McCormack
@cmccormack
Nov 28 2018 21:06
the way your nesting this much logic in a catch statement worries me
Adel
@AdelMahjoub
Nov 28 2018 21:07
I guess better write an error handler
Christopher McCormack
@cmccormack
Nov 28 2018 21:09
are either renderChart functions setting state as well?
Adel
@AdelMahjoub
Nov 28 2018 21:11
whats in data[0]
Pagnito
@Pagnito
Nov 28 2018 21:11
no
just some arrays and objects with numbers and strings
Aditya
@ezioda004
Nov 28 2018 21:11

Could do something like:

someFunc = () => {
   renderChart1(this.state.data.pattern3);
   renderChart2(this.state.data.pattern2);
   that.setState({chart1Rendered:true});
}
  .catch
    ..
    .then((data)=>{
              console.log('FROM IDB', data[0])
              that.setState({
                data:data[0],
                jacakss:'oy'
              },  this.someFunc())
           });

Atleast looks better

Adel
@AdelMahjoub
Nov 28 2018 21:12
clone it don't assign the same ref
Pagnito
@Pagnito
Nov 28 2018 21:13
@ezioda004 i need it in a catch tho, because it will only run if there is no network
Christopher McCormack
@cmccormack
Nov 28 2018 21:13
you should consider rendering your charts based on props so you don't have to do it in a setState callback
@Pagnito update state in the catch with some failure value and use that to render everything as offline
Pagnito
@Pagnito
Nov 28 2018 21:14
@cmccormack im not sure what you mean by based on props
Aditya
@ezioda004
Nov 28 2018 21:14
@Pagnito Its suppose to be in .catch()
Christopher McCormack
@cmccormack
Nov 28 2018 21:15
state/props should determine how/what is rendered, you shouldn't have to do that as a side effect
Adel
@AdelMahjoub
Nov 28 2018 21:15
get rid of the setState callback and force update maybe
a component re-render on state change, if renderChart is a global function, call it in a hook
shouldComponentUpdate or I don't remember
Pagnito
@Pagnito
Nov 28 2018 21:17
@AdelMahjoub oh ya i think i can use that
im still a bit lost as to what you guys are tryin to get through me, but the reason im doing that is i dont wan multiple charts rendering
Adel
@AdelMahjoub
Nov 28 2018 21:19
is it rendering in a canvas ?
Pagnito
@Pagnito
Nov 28 2018 21:20
ya, im using d3
Adel
@AdelMahjoub
Nov 28 2018 21:20
try rendering on componentDidMount
Pagnito
@Pagnito
Nov 28 2018 21:21
ya im
without setState({chartREnderd: true}) it renders multiple
Adel
@AdelMahjoub
Nov 28 2018 21:21
or make it a child of another component and render on componentWillReceiveProps
setState in the hook where you call render
Pagnito
@Pagnito
Nov 28 2018 21:22
i think i get what you mean
so are u guys basically trying to tell me make my app not rerender over and over?
Adel
@AdelMahjoub
Nov 28 2018 21:22
cmpare the component state with the newProps
if different setState and re-render
Pagnito
@Pagnito
Nov 28 2018 21:24
cuz i just want to understand what the flaw in the current code are. As im seeing at the moment from what you guys are saying is that, im makin it rerender needlessly?
Adel
@AdelMahjoub
Nov 28 2018 21:26
the problem is the canvas must re-render after the parent node re-rendered
Adel
@AdelMahjoub
Nov 28 2018 21:31
or make more stateless child components and feed them
Pagnito
@Pagnito
Nov 28 2018 21:33
ok i reread everything u guys said, thnx
Brad
@bradtaniguchi
Nov 28 2018 21:37
Yo guys having loads of ram is great :D
just had to state how I felt hehe
Pagnito
@Pagnito
Nov 28 2018 21:37
hey does anyone use the mobile gitter app?
Jason Luboff
@JLuboff
Nov 28 2018 21:37
How much is loads? @bradtaniguchi
@Pagnito
I occasionally do
Kudzu
@czhower
Nov 28 2018 21:37
@Pagnito on occasion
it sucks
Jason Luboff
@JLuboff
Nov 28 2018 21:38
Ya... its not great lol
Pagnito
@Pagnito
Nov 28 2018 21:38
for some reason it isnt workin for me atm
Adel
@AdelMahjoub
Nov 28 2018 21:38
:+1: @czhower
Brad
@bradtaniguchi
Nov 28 2018 21:38
16 gb from 6gb. Life changing
Adel
@AdelMahjoub
Nov 28 2018 21:38
it really sucks (gitter app)
Pagnito
@Pagnito
Nov 28 2018 21:38
it keeps thinking i have no network and jus quits on me
Kudzu
@czhower
Nov 28 2018 21:38
of course the desktop one isnt that great to begin with.. .and its less great.
Pagnito
@Pagnito
Nov 28 2018 21:38
even if i unisntall and reinstall
Brad
@bradtaniguchi
Nov 28 2018 21:38
Yea it's very very bad
Jason Luboff
@JLuboff
Nov 28 2018 21:38
@bradtaniguchi Ah...ya 16GB is the minimum I'd go with on any new computer now
Kudzu
@czhower
Nov 28 2018 21:38
and thats just to load Chrome or run an Electron app. :)_
Adel
@AdelMahjoub
Nov 28 2018 21:39
that double the sucks
Pagnito
@Pagnito
Nov 28 2018 21:39
while im here on my 2011 macbook pro with 4g lol
Brad
@bradtaniguchi
Nov 28 2018 21:39
@JLuboff Yes, I just updated my main computer, since it had 8gb to 16gb. My laptop was struggling todo almost anything significant.
Kudzu
@czhower
Nov 28 2018 21:39
at any given time Chrome or FF are almost guaranteed to be the top 2 memory users. And I run piggy software.. but they beat it all.
Chrome and FF contribute greatly to global warming Im sure with all their CPU usage.
Its cryptomining, followed by web browsing :(
Jason Luboff
@JLuboff
Nov 28 2018 21:40
I'm currently using 8.2/16GB...which is low for me
Brad
@bradtaniguchi
Nov 28 2018 21:43
Due to my ram dieting on my laptop, I haven't gone over 8gb so far. But I'm starting to get addicted to opening everything an anything hehee
Adel
@AdelMahjoub
Nov 28 2018 21:45
nativescript with a couple of devices syncd and you can easily use over 16GB
or even Phaser with some memory leaks
without destroying the pew pew properly
But the most ram hungry are react apps
Kudzu
@czhower
Nov 28 2018 21:49
people wonder why I use Delphi for so many things.. speed and memory....... massive differences.
Brad
@bradtaniguchi
Nov 28 2018 21:49
@AdelMahjoub You mean Angular apps :P
Christopher McCormack
@cmccormack
Nov 28 2018 21:49
@ezioda004 drop everything we're working on this now https://twitter.com/ossia/status/1067822698087120898
Brad
@bradtaniguchi
Nov 28 2018 21:50
@cmccormack Thinking about NES theme? Wheres my dark theme :_(
Christopher McCormack
@cmccormack
Nov 28 2018 21:50
@bradtaniguchi I LOVE pixel art, I would jump on this in a second
dark theme for FCC?
there is one isn't there?
Brad
@bradtaniguchi
Nov 28 2018 21:51
:open_mouth:
Christopher McCormack
@cmccormack
Nov 28 2018 21:51
it may still need some work with contrast iirc
Aditya
@ezioda004
Nov 28 2018 21:56
@cmccormack That looks sweet, when do we start :D
Christopher McCormack
@cmccormack
Nov 28 2018 21:57
pixelated divs may be a bit harder
might be like the old days where you had to make a table with at least 9 cells so you could put pretty borders on your content
Aditya
@ezioda004
Nov 28 2018 22:00
I'm glad I didnt know web dev in those days
Christopher McCormack
@cmccormack
Nov 28 2018 22:00
@czhower do you use the community edition?
@ezioda004 it was rough, I remember making a starcraft site that used in-game graphics like the hud they had in cutscenes, was so tough
there was always something that messed up the rendering, causing like a pixel offset or something
Aditya
@ezioda004
Nov 28 2018 22:02
Starcraft site? Is that still around? Would love to see
Kudzu
@czhower
Nov 28 2018 22:05
@cmccormack No. I've written parts of Delphi and am a vendor partner, so I get it for free. But the community edition is pretty good and has a lot to offer.
@ezioda004 Ive been doing web dev since when we had to compile NCSA Mosaic parts and stacks just to get running. It was a tough ride.
Christopher McCormack
@cmccormack
Nov 28 2018 22:08
@czhower that looks so much like the visual studio I used to use in the late 90s
or something like it, can't remember the name 100%
Kudzu
@czhower
Nov 28 2018 22:10
Delphi predates the modern VS by several years. It was the first native rad tool in existence. It was basicaly adapted Object Pascal, modeled after VB's RAD at the time. The code name was "VB Killer" in the mid 90s.
so if anything, VS looks like Delphi. :)
I use VS Ent and VS Code a lot too.
Christopher McCormack
@cmccormack
Nov 28 2018 22:11
it may have been a different tool it was a long time ago
Kudzu
@czhower
Nov 28 2018 22:11
Depends on which project Im on, but last months mostly VS Code for TS and Delphi for other parts.
Christopher McCormack
@cmccormack
Nov 28 2018 22:13
why jump around? Are each better for certain pieces?
Jason Luboff
@JLuboff
Nov 28 2018 22:13
Different programming languages I would assume
Kudzu
@czhower
Nov 28 2018 22:13
yes.
Brad
@bradtaniguchi
Nov 28 2018 22:13
Damn, I just opened sublime for some note taking (it's main purpose) and it takes up 100% CPU >.>
Kudzu
@czhower
Nov 28 2018 22:13
In fact right now I use TS, JS, PHP, Delphi, C++, C#, and asm all pretty much routinely for our projects.
Jason Luboff
@JLuboff
Nov 28 2018 22:14
@bradtaniguchi Thats awful lol
Kudzu
@czhower
Nov 28 2018 22:15

My prime ones are TS, Delphi, C#. The others I only use when needed. PHP for our WordPress plugin which then hands off to our TS code or Delphi in some cases.

Assembly as I do some low level work on one project. C++ for some interop, but I avoid C++ when possible, but a bit of it is needed on one of our .NET projects.

Brad
@bradtaniguchi
Nov 28 2018 22:15
Yea no idea why, I have no extensions or anything. Poor sublime, can't even be a notepad :(
Kudzu
@czhower
Nov 28 2018 22:16
And JS, well because so many fo the libs that TS uses are JS, but otherwise use TS for all of our code now thankfully. 20+ years of raw JS was enough for me.
Christopher McCormack
@cmccormack
Nov 28 2018 22:16
@czhower and here I am just futzing around with some tiny node project lol
oh yeah JS is about 20 years old now isn't it
Kudzu
@czhower
Nov 28 2018 22:16
yep. I was doing webdev before it existed, so have been doing it since it was released.
around 1993/4
Christopher McCormack
@cmccormack
Nov 28 2018 22:18
mine was netscape, not too far off
I sure miss those crude navigation buttons and animated logos
Kudzu
@czhower
Nov 28 2018 22:18
before that I was building gopher apps. And before that, BBS doors. :)
Adel
@AdelMahjoub
Nov 28 2018 22:18
my first web app ran on this
Christopher McCormack
@cmccormack
Nov 28 2018 22:19
lol
forgot the S
Jason Luboff
@JLuboff
Nov 28 2018 22:19
Yup.. ypu I did
ninja delete!
lol
BBS Doors = Big Black Sturdy Doors? (there we go!)
Kudzu
@czhower
Nov 28 2018 22:21
A door was a "loadable program" that a BBS user could launch and interact with in the context of being logged into the BBS. Most were games, but many were used for messaging and other purposes.
Christopher McCormack
@cmccormack
Nov 28 2018 22:21
bulletin boards right?
Jason Luboff
@JLuboff
Nov 28 2018 22:21
Ah
Kudzu
@czhower
Nov 28 2018 22:21
yes. Dialup modems used to directly connect to them before internet was public or even known about by most users.
started on BBSes in 1984.
Wrote some full BBS systems too that I ran on my own after doing doors.
Ran on floppy disks.... had several drives for extra storage all daisy chained.
noisy as heck when a user logged in too as it had to use disks etc.
at least it wasnt a IBM PC Jr which had a world record noise on its floppy. Will never forget one major magazine review "its floppy drive clucks away like a noisy chicken and is headache inducing"
Christopher McCormack
@cmccormack
Nov 28 2018 22:24
I don't miss those times much but I sure do wish I had the time to read up on and understand how all the old systems worked
Kudzu
@czhower
Nov 28 2018 22:24
Feel free to ask any time you are curious. :)
Christopher McCormack
@cmccormack
Nov 28 2018 22:24
will do :)
Jason Luboff
@JLuboff
Nov 28 2018 22:25
So member earlier when I was all like "Psh..I don't use IIFE's"...I lied.
Christopher McCormack
@cmccormack
Nov 28 2018 22:25
@JLuboff you're a liar
Adel
@AdelMahjoub
Nov 28 2018 22:25
Programming is an art form that fights back
Chad Z. Hower aka Kudzu
Jason Luboff
@JLuboff
Nov 28 2018 22:25
@cmccormack Yes yes
Christopher McCormack
@cmccormack
Nov 28 2018 22:28
@AdelMahjoub @czhower was that you? I see a sweatshirt for sale with that on it
Kudzu
@czhower
Nov 28 2018 22:28
Yes. Thats me.
Adel
@AdelMahjoub
Nov 28 2018 22:28
There is some fun stuff too
Kudzu
@czhower
Nov 28 2018 22:29
I didnt say the absolute original - someone said a variant of it, it languished in obscurity... I saw it, liked it, reworded it and have been using it for 20+ years... Ive been credited with popularizing it, if not inventing the orignal one.
gtg.... .back later.
Adel
@AdelMahjoub
Nov 28 2018 22:34
A manager says
-If it will take you 4 weeks, 4 of you can do it in a week, right?
What a manager means:
-4 weeks = 4 developers x 1 week = 4 weeks x 1 developer. Why not? It computes! Algebra does not lie.
What a developer hears:
-I guess he thinks 9 women can make one baby in 1 month.
Christopher McCormack
@cmccormack
Nov 28 2018 22:34
@czhower see ya
Christopher McCormack
@cmccormack
Nov 28 2018 22:34
That's the Mythical Man Month right?
Adel
@AdelMahjoub
Nov 28 2018 22:36
maybe, it is from that link
Zaza
@ForkInSpace
Nov 28 2018 22:37
hey folks, idk what's your experience with wordpress but I was wondering I could pick your brain on using react with wordpress
Christopher McCormack
@cmccormack
Nov 28 2018 22:37
0 experience here (me)
Zaza
@ForkInSpace
Nov 28 2018 22:37
wordpress isn't something I normally do and I don't wanna use monolith html/css/jquery
Adel
@AdelMahjoub
Nov 28 2018 22:38
wordpress make me depressive
Zaza
@ForkInSpace
Nov 28 2018 22:38
Tell me about it
Adel
@AdelMahjoub
Nov 28 2018 22:38
:laughing:
Zaza
@ForkInSpace
Nov 28 2018 22:40
ok screw wp. What stack do you guys do? just out of curiosity
Christopher McCormack
@cmccormack
Nov 28 2018 22:40
stay?
ah
Zaza
@ForkInSpace
Nov 28 2018 22:41
What you mean stay?
jk
Christopher McCormack
@cmccormack
Nov 28 2018 22:41
I do whatever I feel like mostly :) React, nginx, node/express
Zaza
@ForkInSpace
Nov 28 2018 22:41
ma man. the good stuff right
Christopher McCormack
@cmccormack
Nov 28 2018 22:41
although we're all switching over to Marko amirite??
Jason Luboff
@JLuboff
Nov 28 2018 22:42
Node/Express/MS SQL/Handlebars
Node/Express/MS SQL/React
Zaza
@ForkInSpace
Nov 28 2018 22:43
I always like get caught off guard when clients ask for a CMS because I don't have a go to CMS
Jason Luboff
@JLuboff
Nov 28 2018 22:43
Oh... and Node/Express/Mongo/Handlebars
Zaza
@ForkInSpace
Nov 28 2018 22:44
I was tweaking a ghost blog sometime ago, afaik it was in handlebars
Christopher McCormack
@cmccormack
Nov 28 2018 22:44
scary 👻👻👻
Zaza
@ForkInSpace
Nov 28 2018 22:44
haha handlebars is cool.
Anyways, thx guys. I better do some research
Christopher McCormack
@cmccormack
Nov 28 2018 22:46
enjoy
Jason Luboff
@JLuboff
Nov 28 2018 22:46
I like it. I use hbs technically but... it is handlebars but I see it hasn't been updated for a few years now
Christopher McCormack
@cmccormack
Nov 28 2018 22:46
I'm out for a bit ttyl
Jason Luboff
@JLuboff
Nov 28 2018 22:46
See ya
Zaza
@ForkInSpace
Nov 28 2018 22:47
I thought hbs stands for handlebars, doesn't it?
Brad
@bradtaniguchi
Nov 28 2018 22:48
anyone every do code reviews? I'm new to the concept, but trying to push it since our code quality is garbage. Anyone got tips?
Jason Luboff
@JLuboff
Nov 28 2018 22:49
@ForkInSpace hbs is specific to express it looks like
Anybody have a favorite npm package for creating PDF's? Essentially I'll be creating it from a template file. html-pdf is looking promising
Zaza
@ForkInSpace
Nov 28 2018 22:53
right,
I feel like its one of those things that depend on your frontend build tools and bundler config. Like how you can use .jsx and .js interchangeably if you config it that way @JLuboff does that make sense?
Jason Luboff
@JLuboff
Nov 28 2018 22:54
Is that in reference to my other comments in HelpBackEnd?
Zaza
@ForkInSpace
Nov 28 2018 22:55
haha no, that was in regards to my hbs vs handlebars confusion
about html-pdf I think that's the best one around on npm
Jason Luboff
@JLuboff
Nov 28 2018 22:56
Oh gotcha lol I got confused
But ya, I think you would use handlebars with node, but since express introduces template engines, hbs handles that
Zaza
@ForkInSpace
Nov 28 2018 22:58
;)
Jason Luboff
@JLuboff
Nov 28 2018 22:59
As of right now..I think html-pdf will be my go to..
DMZ
@DMZ011
Nov 28 2018 23:01
:S
am downloading a repo from github, run npm i, but getting errors ...
what to do in this case?
Zaza
@ForkInSpace
Nov 28 2018 23:06
whats the repo?
you should probably run npm i <pkg name>
Brad
@bradtaniguchi
Nov 28 2018 23:18
@DMZ011 wat r dah errurs
it's an old version of that project, but i have to use it because i have an older version of react
Zaza
@ForkInSpace
Nov 28 2018 23:21
It seems this is not an npm package m8
so no need to do npm i or anything of that sorts
DMZ
@DMZ011
Nov 28 2018 23:21
it is published on npm
but it has its own dependencies
so to use it, once u download it, u'll have to run npm i
Zaza
@ForkInSpace
Nov 28 2018 23:22
it asks to clone the repo and then do npm install within the dir
which is how you run any repo locally
DMZ
@DMZ011
Nov 28 2018 23:22
yea
i was trying to do that, but got errors
Brad
@bradtaniguchi
Nov 28 2018 23:22
@DMZ011 VHAT ER DAH EWWORRS, instead of guessing what todo, I'd like to know what is wrong, or at least gain more context to whats wrong ya know?
DMZ
@DMZ011
Nov 28 2018 23:23
:joy_cat:
npm WARN optional Skipping failed optional dependency /chokidar/fsevents:
npm WARN notsup Not compatible with your operating system or architecture: fsevents@1.2.4
npm ERR! Windows_NT 10.0.16299
npm ERR! argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "i"
npm ERR! node v6.0.0
npm ERR! npm v3.8.6
npm ERR! code ELIFECYCLE
npm ERR! botframework-webchat@0.15.1-0 prepublish: npm run build-css && tsc && webpack --progress --config webpack.production.config.js
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the botframework-webchat@0.15.1-0 prepublish script 'npm run build-css && tsc && webpack --progress --config webpack.production.config.js'.
Zaza
@ForkInSpace
Nov 28 2018 23:24
backward slashes gives me chills
:D
DMZ
@DMZ011
Nov 28 2018 23:25
reading about fsevents, a post says run with --no-optional
tried that, no luck
i went inside package.json, deleted everything related to tslint
same thing

I remember now, I opened an issue on their repo, but the guy that was helping me had no idea:

Microsoft/BotFramework-WebChat#1158

Zaza
@ForkInSpace
Nov 28 2018 23:26
Why do you wanna use the deprecated version anyways?
DMZ
@DMZ011
Nov 28 2018 23:26
because am working on this project, and it uses react v15 or smth
the new version of bot framework, uses a new version of react
Zaza
@ForkInSpace
Nov 28 2018 23:27
gotcha
sry m8, i'm afraid that q is beyond my pay grade
DMZ
@DMZ011
Nov 28 2018 23:27
it's ok man @ForkInSpace
Christopher McCormack
@cmccormack
Nov 28 2018 23:29
@DMZ011 do you have more error text above that? I get the fsevents thing all the time, I think it's Mac only
DMZ
@DMZ011
Nov 28 2018 23:30
let me paste it somewhere
Christopher McCormack
@cmccormack
Nov 28 2018 23:31
your issue is probably unrelated to fsevents
it says somewhere make sure u have the latest version of node and npm
which I also can't do, because of that other projcet
Christopher McCormack
@cmccormack
Nov 28 2018 23:36
@DMZ011 what happens if you walk through these one by one? Which step do you get this error on?
DMZ
@DMZ011
Nov 28 2018 23:36
i get all of this when i run npm i
no steps
Christopher McCormack
@cmccormack
Nov 28 2018 23:37
can you break up the prepublish script then and see? remove webpack for example, then if that still gives the error remove tsc, etc...
Jason Luboff
@JLuboff
Nov 28 2018 23:39
Whats the proper way to have form elements be required in react? In HMTL its as simple as just having <input type="text" required > but seeing as my form elements aren't actually in a <form> required doesn't work. I guess I need to do my own validation?
Christopher McCormack
@cmccormack
Nov 28 2018 23:41
required should work
oh not in a form?
why not?
Jason Luboff
@JLuboff
Nov 28 2018 23:42
Doesn't really need to be.. but I had tried changing my <> </> to <form> </form> and didn't work either
Christopher McCormack
@cmccormack
Nov 28 2018 23:43
yeah you're right seems like it doesn't work without a form
if you don't need the browser chrome to show the popup you can work around it but if you want it put it in a form
Brad
@bradtaniguchi
Nov 28 2018 23:45
Hmm, having validation on inputs, but no form to validate seems like the wrong way to go about things (with or without React)
Jason Luboff
@JLuboff
Nov 28 2018 23:45
you have no submit
Ah...enter
Its just a few input fields (specifically one text, one date, one select, one textarea) and those each have methods to setState
the button than moves you to the next part (another textarea)
Wierd.. works in codesandbox..
Jason Luboff
@JLuboff
Nov 28 2018 23:52
Ok..so..if I disable the button method it works..

This is all my button method does though

  continue = event => {
    this.setState({
      jsaFormComplete: true
    });
  };

Thus changing components...

so.. its hiding the form even though it has required fields I guess
Zaza
@ForkInSpace
Nov 28 2018 23:54
Can you post the entire component with the form ?
Jason Luboff
@JLuboff
Nov 28 2018 23:55
It seems I would still need to perform my own validation within continue to keep it from changing state if not all fields have been inputted.
Zaza
@ForkInSpace
Nov 28 2018 23:55
I'd do my own validation
exactly
something like
validate = (data) => { const errors = {}; if (!data.password) errors.password = "Can't be blank"; if (data.password !== data.passwordConfirmation) errors.passwordConfirmation = "Passwords must match"; // etc etc etc return errors; }
sry that's messy
Jason Luboff
@JLuboff
Nov 28 2018 23:57
I'm storing the form data in an object, I can check each prop in the object for a value