« first day (3585 days earlier)      last day (1349 days later) » 

12:58 AM
Anyone?
 
Well, I usually display all fields in the same document if I am going to use them together
 
I have to use "campaigns" on another page
Only need to load them if the user visits that page
Also
I was thinking that if in the future I need to get campaigns of all users to show in the admin panel, will nesting still work?
or will it fail?
 
If you are only going to read the data when they visit another page, then I would probably consider using a root collection, that way you won't be reading the user's info, increasing the bill a little more because once you read a doc, you read everything
 
@Unbreachable I read that sub-collection is just a reference and isn't expanded right away, is that right?
 
Of course, nesting will still work. There are a lot of factors here. You can either do a subCollection, root collection or just put it in the same doc
What do you mean by that?
 
1:09 AM
When the user logs in, I initially get the user name from that document so that document is always read at the first level. Now the question is, should I put campaigns at root collection or a sub-collection of that user document?
But the campaign's data only needs to be loaded when the user visits a specific page
and 1 last question:
If I make a root level collection, should I store its document ID as the user ID and start to store the campaigns inside it? OR adding just a "uid" field would be enough?
 
If I were in your position I would store it all together. Another reason is that you don't want to make your docs too small or too big either
I would probably store it at the root if I am going to make a read to ALL documents
 
okay
How to specify which user ID does it belong to?
Should I add "uid" ?
 
use the uid to specify which doc is which
 
@ZahidSaeed Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq. You have 25 seconds to edit and format your message properly before it will be removed. Please separate code blocks from your actual question. Put your question in 1 message and then your code in a 2nd and format it.
 
@Unbreachable long time no see o/
 
1:17 AM
like this?
 
Every time I make a new collection, I use the users uid
 
That's what I was asking
 
1 message moved to Trash can
 
Okay, thank you @Unbreachable
 
Hey @JBis how is it going?
 
1:18 AM
I appreciate it
 
not bad, how about yourself?
 
Anytime @ZahidSaeed
Nice, I am doing pretty good, been pretty busy and stuff
How is React going for ya?
 
Nice to hear, so have you finished creating your language? hehehe
HTML? lol
 
yes i did
fully functioning github.com/jbis9051/HiAPL
 
1:26 AM
dope
might take a piece of that soon lol
 
<fs>
<readFileSync><arg>./text.txt</arg></readFileSync>
</fs>
Isn't this adding more keyword hits?
 
lol, i wanted to make a hiapl website powered by hiapl but never got to it
@ZahidSaeed ?
 
This is JS writing but with tags, right?
 
yeah basically, whats your question?
 
How would you convince that this is more friendly than JS? :)
or lets you type less
and do more
 
1:30 AM
who said it does?
 
Nobody. I'm just asking
 
But with TypeScrpt, you can't do more than JS can do and you type more.
 
Agree
 
lol its a joke langauge
 
hmmm
 
1:32 AM
Which one?
TS?
 
hiapl is the Future!
 
hehe
I prefer TS over JS
 
soon soon.....
 
@Unbreachable it is!
@ZahidSaeed hehe
Just need TypeHiAPL now
 
lmao
yesss exactly that
 
 
3 hours later…
4:40 AM
@JBis swapping the roles of markup and scripting be like...
 
@AlexErtl Welcome to the JavaScript chat! Please review the room rules. If you have a question, just post it, and if anyone's free and interested they'll help. If you want to report an abusive user or a problem in this room, visit our meta.
 
 
1 hour later…
6:02 AM
is there a way to replicate the viewbox like positioning in html? ie I want to have a 100 x 100 div that I can position elements inside with % then the % sizes scale the same way as the div changes size as if they were a viewbox?

I was thinking I might be able to so with with absolute positioning
 
 
4 hours later…
10:08 AM
0
Q: Using Parallax.js in React

Yotam DahanI'm quite new to React, and I'm trying to use Parallax.js library in react. Now I have done the basics and installed the library using npm, I have imported the library and I have followed this topic that related to my question. But now I'm having difficulty to make parallax work, I recieve the fo...

 
10:34 AM
i trying to get src from an image using event.target.src, but it returns null or nothing : const imageSrc = e.target.getAttribute('src);

console.log(imageSrc);
the event.target.className returns fine, though. Do you have any tips?
 
Can u recommend me a course about integration testing with jest? Cuz I've got stuck with structuring my tests in the project
 
10:50 AM
or just give me a link to an example
 
 
5 hours later…
3:55 PM
A list of all HTML elements:
a, abbr, acronym, address, applet, area, article, aside, audio
b, base, basefont, bdi, bgsound, big, blink, blockquote, body, br, button
canvas, caption, center, cite, code, col, colgroup, command, content
data, datalist, dd, del, details, dfn, dialog, dir, div, dl, dt
element, em
fieldset, figcaption, figure, font, footer, form, frame, frameset
h1, h2, h3, h4, h5, h6, head, header, hgroup, hr, html
i, iframe, image, img, input, ins, isindex
kbd, keygen
label, legend, li, link, listing
main, map, mark, marquee, menu, menuitem, meta, meter, multicol
A list of (my) descriptions of all HTML elements:
https://github.com/LapysDev/Learning-Projects/blob/master/HTML/elements.txt
Thought I'd share... (Not sure if it's allowable to do so, though 🤔)
 
 
2 hours later…
6:03 PM
@Drax can you please provide an example to codepen for instance in order to see what's going on?
 
@YassineBelkaid Welcome to the JavaScript chat! Please review the room rules. If you have a question, just post it, and if anyone's free and interested they'll help. If you want to report an abusive user or a problem in this room, visit our meta.
 
@entithat integration testing simply means to test a bunch of functionalities together, instead of testing each functionality separately (unit testing) we test it in a wider context, let's say we have add(a, b) (which adds a to b) and sub(a, b) (which subtracts a from b)
we have both unit tests for each function but we need to create sum function which will add then subtract at the same time and we want to see how this two functions will behave, this is a very simple example how integration tests may look like
 
Yeah, but I wanted to see how to test express app, how to structure a folder with tests and etc
 
it's really up to you, I've seen many teams and how they organize their tests, either being in __ tests __ folder in each sub directory or just files ends with someTest.unit.js or someTest.integration.js, you see?
and from your jest config you can then target your test files
 
6:41 PM
ok
I thought there are recommendations on how to write it correctly, nvm
 
6:53 PM
I'm trying to be neutral here lol
each one will give their recommendations as they see it, that's why I said it's up to you to come up with what's comfortable for you
 
7:14 PM
thanks mate
 
20 Bonus Points to whoever can explain this output without looking it up
2
||> "10:01".split(":").map(parseInt)
 
[10, NaN]
what is that
 
3 messages moved to Trash can
@entithat Yes, why is it NaN and not 1?
 
cuz '01' is not a number xd
 
"10:1".split(":").map(parseInt)
 
7:21 PM
I think it's because 0 is read as octal number system's value
 
that still produces [10, NaN]
 
r u sure?
 
 
yeah, hm
split func returns ['10', '1']. then why map does not parse it φ(* ̄0 ̄)
 
@JBis because of the radix of parseInt as it doesn't default to 10, if we rectify it to "10:1".split(":").map(n =>parseInt(n, 10)), then we'll get [10, 1]
 
7:28 PM
@YassineBelkaid very close but no
 
what is the default value for radix in parseInt?
 
||> console.log(parseInt("10")); console.log(parseInt("1"));
 
@JBis undefined Logged: 10, 1 Took: 0ms
 
oh 8 ok
 
@YassineBelkaid see above, it parses properly
 
7:29 PM
Hmm I see
 
I know
 
@entithat did you look it up?
 
so, when we call parseInt with only one arg (number) we have radix as undefined value, right?
stoopp
then what about 10 (
what a tricky question
 
ok I see now, the second param passed by map to parseInt for 1 was 1 which lesser than 2 and not a 0 so it gives the NaN
console.log(parseInt("1", 1)) -> NaN
 
why it passes 1 as a second param?
 
7:35 PM
it's the index that map passes in each iteration
 
||> console.log(parseInt(10, 0));
 
@entithat undefined Logged: 10 Took: 0ms
 
so @JBis
:D
 
u r right
 
@YassineBelkaid BING BING BING!
nice job
 
7:36 PM
next question pls
 
hahaha
by the way, I didn't look it up, I just open up my console tab on Chrome and started analyzing it
 
@YassineBelkaid Good job
that is one of the more tricky problems i've come across in js
 
the most tricky problem for me was understanding why {} + {} is a string xd
 
yes it's tricky, it's my first time I see such question :)
 
7:51 PM
@JBis "10:1".split(':').map((x, i, o) => parseInt(x, i, o)) is similar if not functionally the same
to "10:1".split(':').map(parseInt)
 
8:03 PM
@Lapys yep
"10:1".split(':').map(function() { parseInt(...arguments) })
or that
 

« first day (3585 days earlier)      last day (1349 days later) »