These are chat archives for FreeCodeCamp/HelpJavaScript

5th
Dec 2018
Tom
@moT01
Dec 05 2018 00:00
╭╮
╰╯
whats the problem @yayne ???
Jason Luboff
@JLuboff
Dec 05 2018 00:00
Well repeatedly posting ??? isn't going to get you any help. You should ask an actual question but as it seems, it doesn't appear anyone in this chatroom nows much about them
Pagnito
@Pagnito
Dec 05 2018 00:01
anyone posted a pwa app in the google store yet?
or did they take disallow that ?
seems diffirent people are saying different things
Brad
@bradtaniguchi
Dec 05 2018 00:05
@Pagnito WHICH google store are we talking about? (Chrome store, android play, some other market place?)
Pagnito
@Pagnito
Dec 05 2018 00:06
google play store
android play i guess?
i know there is a appsco.pe for pwa specifically
but i wanna try and upload onto google play store
i think it would b goo for da portfolio >:)
yayne
@yayne
Dec 05 2018 00:08
@moT01 I am building small project with web components that is given by my teacher and i build some part of it but i can't finalize. It is an image game
Tom
@moT01
Dec 05 2018 00:11
check line 20
Brad
@bradtaniguchi
Dec 05 2018 00:12
@Pagnito There was word to add PWAs to the store itself? I know there's support for PWAs thru chrome, but like how does the play-store version work in terms of paid/un-paid/ other native stuff like permissiosn?
Jason Luboff
@JLuboff
Dec 05 2018 00:18
Argh... I can PDF my template page...but its not getting rendered properly. Almost like it thinks the page size should be something other than letter (its putting everything within the first 20% of the left side column.. )
(Renders fine in browser and at 100% scale print preview is correct..)
Brad
@bradtaniguchi
Dec 05 2018 00:23
ew, pdf rendering
Jason Luboff
@JLuboff
Dec 05 2018 00:23
Ya ya..I think we had a conversation like this the other day :P
Brad
@bradtaniguchi
Dec 05 2018 00:26
Yes, and earlier today my boss was talking with the dev that is struggling with pdf rendering haha
it nasty
Jason Luboff
@JLuboff
Dec 05 2018 00:27
It just doesn't make sense what its doing lol
Jason Luboff
@JLuboff
Dec 05 2018 00:32
@bradtaniguchi You know what package he is using (assuming node)
Brad
@bradtaniguchi
Dec 05 2018 00:33
@JLuboff I mentioned this before, he is using some chromium related package, let me see if I can find it
Jason Luboff
@JLuboff
Dec 05 2018 00:33
oooh...thats right
don't worry about it homie
Jason Luboff
@JLuboff
Dec 05 2018 00:38
Hmmm....looks complicated :joy:
Brad
@bradtaniguchi
Dec 05 2018 00:40
probably the most complicated option, but the most powerful no doubt.
Jason Luboff
@JLuboff
Dec 05 2018 00:40
True
Jason Luboff
@JLuboff
Dec 05 2018 00:46
@bradtaniguchi Hmm...here's a simplified version https://www.npmjs.com/package/pdf-puppeteer not many weekly downloads though
Brad
@bradtaniguchi
Dec 05 2018 00:50
@JLuboff Looks like that whole repo is really just 1 file: https://github.com/westmonroe/pdf-puppeteer/blob/master/src/convertHTMLToPDF.js
gosh that one file has some terrible indentation...
they even say they use prettier haha what the
Jason Luboff
@JLuboff
Dec 05 2018 00:52
So far...it doesn't work. I'll have to play with it more tomorrow
Pagnito
@Pagnito
Dec 05 2018 00:59
anyone can help me figure some stuff out with deploying to firebase?
Brad
@bradtaniguchi
Dec 05 2018 01:00
@Pagnito firebase deploy done
Pagnito
@Pagnito
Dec 05 2018 01:00
lol
ya i know but i want to understand some things
i alrdy made a project and deployed on firebase
but i dont understand how the index.js in functions knows what request is coming in
Brad
@bradtaniguchi
Dec 05 2018 01:03
are you talking about firebase functions?
Pagnito
@Pagnito
Dec 05 2018 01:08
yea
Brad
@bradtaniguchi
Dec 05 2018 01:09
so what do you now understand about what request is coming in? It's just like express
Pagnito
@Pagnito
Dec 05 2018 01:10
yea but in express, we specify the routes
in the course project i worked on, it doesnt specify routes
Brad
@bradtaniguchi
Dec 05 2018 01:10
It should specify the first part of the route, the rest of it can be done using express
Pagnito
@Pagnito
Dec 05 2018 01:11
so i can use express on that firebase server for the functions?
Brad
@bradtaniguchi
Dec 05 2018 01:11
firebase server? Aren't firebase functions just google cloud functions? But regardless yes you can use express on each of the firebase function routes, giving you full control over how you process the route/data from there on out
Pagnito
@Pagnito
Dec 05 2018 01:14
arent clouds still servers tho?
"This is fine for simple functions, but what if you want complete control over your URL routing? Well we got you, fam. You can actually pass in a normal Express app to handle your function calls."
"Well we got you fam"
lol
if i wrote an article like that my "proffesional" brother programmer would be reading me lectures why its "unattractive"
Pagnito
@Pagnito
Dec 05 2018 01:20
i completely disagree
Brad
@bradtaniguchi
Dec 05 2018 01:21
uh yea
Jefferson
@jeffersonnnn
Dec 05 2018 11:55
hey guys, i have a question on gitflow
yayne
@yayne
Dec 05 2018 12:16
Someone can help me on Web components please?
angelacabri
@angelacabri
Dec 05 2018 12:23
someone review my code thanks u
sweetycy
@sweetycy
Dec 05 2018 13:36
is there any chinese?
Christopher McCormack
@cmccormack
Dec 05 2018 14:56
Tom
@moT01
Dec 05 2018 15:07
:morning:
Christopher McCormack
@cmccormack
Dec 05 2018 15:08
@moT01 heya morning
Tom
@moT01
Dec 05 2018 15:12
these little challenges are tough
Christopher McCormack
@cmccormack
Dec 05 2018 15:13
yeah I thought they were decent until yesterday when it ended up taking me much longer to complete than anticipated
Christopher McCormack
@cmccormack
Dec 05 2018 15:21
@moT01 were you able to catch up to today's?
Tom
@moT01
Dec 05 2018 15:24
no
but it looks like I can skip to todays, if you want to try and tackle it together
Christopher McCormack
@cmccormack
Dec 05 2018 15:25
I pretty much finished today's just now
just need to test puzzle 2
wasn't as hard as yesterdays
Tom
@moT01
Dec 05 2018 15:25
so you must have done this one pretty quick
Christopher McCormack
@cmccormack
Dec 05 2018 15:26
today it was sort of simple string manipulation
and the second part you can import your first solution, which is nice
not a great running time on my second on though, Running time: 1361.644ms
if you look at the leaderboards, these people must be wizards in scripting to knock out the times they have
Tom
@moT01
Dec 05 2018 15:32
so the time starts when that countdown ends I suppose?
yea, that's fast
2 minutes to do both parts of day 2?
Christopher McCormack
@cmccormack
Dec 05 2018 15:34
yeah it starts at Midnight EST I believe
00:03:38 to get BOTH stars today
Tom
@moT01
Dec 05 2018 15:36
well, that sucks
Christopher McCormack
@cmccormack
Dec 05 2018 15:40
we could probably make our own but I'm not sure what hooks to AoC exist to make something legitimate and not just taking their word for it
Tom
@moT01
Dec 05 2018 15:43
make our own challenge?
Christopher McCormack
@cmccormack
Dec 05 2018 15:43
leaderboard
Tom
@moT01
Dec 05 2018 15:44
like with just me and you?
Christopher McCormack
@cmccormack
Dec 05 2018 15:45
haha no probably not, but maybe if others were to participate
Tom
@moT01
Dec 05 2018 15:45
well, I'm in last
all my times are at the max
>24h
or at least that's what is displayed
Christopher McCormack
@cmccormack
Dec 05 2018 15:49
sucks to see 0 points, kind of discouraging
not that points mean anything but still
Tom
@moT01
Dec 05 2018 15:53
no, what's discouraging is seeing these people finish in 2 minutes
Christopher McCormack
@cmccormack
Dec 05 2018 15:55
My guess is either they are cheating/seen the problem before, or they do a LOT of algorithm problems and are quickly able to adapt
Jason Luboff
@JLuboff
Dec 05 2018 16:10
Morning
Christopher McCormack
@cmccormack
Dec 05 2018 16:11
@JLuboff yo gm
Jason Luboff
@JLuboff
Dec 05 2018 16:12
What up
Christopher McCormack
@cmccormack
Dec 05 2018 16:15
just playing with certs, yourself?
Tiago Correia
@tiagocorreiaalmeida
Dec 05 2018 16:16
Hello everyone
Christopher McCormack
@cmccormack
Dec 05 2018 16:16
@tiagocorreiaalmeida hi!
Tiago Correia
@tiagocorreiaalmeida
Dec 05 2018 16:16
does anyone know why the ignore flag is not working
Christopher McCormack
@cmccormack
Dec 05 2018 16:16
long time
Tiago Correia
@tiagocorreiaalmeida
Dec 05 2018 16:16
"build": "rm -rf dist && babel ./src --out-dir dist --ignore ./src/dev-starter.js --copy-files",
indeed @cmccormack how's everything?
Christopher McCormack
@cmccormack
Dec 05 2018 16:18
@tiagocorreiaalmeida try removing ./
good good things are slower now that it's close to the holiday's so I'm not working as hard which is nice. You?
Tiago Correia
@tiagocorreiaalmeida
Dec 05 2018 16:28
tried this
"build": "rm -rf dist && babel ./src --out-dir dist --ignore './*' --copy-files",
still wont work
also tried what you pointed @cmccormack
Also good, almost holidays :D
Jason Luboff
@JLuboff
Dec 05 2018 16:30
@tiagocorreiaalmeida Hey man! How's it going?
@cmccormack Working on finishing this SQL query. Got everything I need. Than will move on to other things after that
Tiago Correia
@tiagocorreiaalmeida
Dec 05 2018 16:32
@cmccormack the issue is related to the --copy-files it seems, if I remove it it ignores that file but doesnt copies all the other things I need sadly :\
Hey, all great @JLuboff, how about you? its been really quite a while
Jason Luboff
@JLuboff
Dec 05 2018 16:33
Doing well man, just been staying busy! Ya you don't come here all too often anymore
Christopher McCormack
@cmccormack
Dec 05 2018 16:39
@tiagocorreiaalmeida have you thought about doing it in a way that doesn't require the first and last steps?
for example, I use HTMLWebpackPlugin to build my html file from a template, so I don't have to copy any files from src to build
Tiago Correia
@tiagocorreiaalmeida
Dec 05 2018 16:41
I pretty much deleted the file, cause for what I readed the --ignore flag only works for file that babel compiles or so
Christopher McCormack
@cmccormack
Dec 05 2018 16:42
right, only .js by default I believe
@tiagocorreiaalmeida are you using webpack?
or parcel or any bundler?
Tiago Correia
@tiagocorreiaalmeida
Dec 05 2018 16:43
nah its on the server side and no im not using any bundler atm
Jason Luboff
@JLuboff
Dec 05 2018 16:50
Stupid html-pdf package..
Pagnito
@Pagnito
Dec 05 2018 16:53
is there a way to have div element with text in it, and draw that onto the canvas instead of using fillText?
Jason Luboff
@JLuboff
Dec 05 2018 16:53
...Think I just discovered my issue.. it appears it doesn't play nice with flexbox which is what Bulma CSS uses..
Christopher McCormack
@cmccormack
Dec 05 2018 16:57
@Pagnito I don't believe canvas accepts any kind of html
Pagnito
@Pagnito
Dec 05 2018 16:57
nOoooooooooooooooo
oh well
Christopher McCormack
@cmccormack
Dec 05 2018 16:58
there may be libraries that can convert it though
Pagnito
@Pagnito
Dec 05 2018 17:04
true, i think im findin similar stuff ppl did on stack overflow
Pagnito
@Pagnito
Dec 05 2018 17:10
i found this
Pagnito
@Pagnito
Dec 05 2018 17:27
man i wanna build something as useful as this html2canvas thing >.<
Jorge
@OrangeKulture
Dec 05 2018 17:27
hey whats up guys
Pagnito
@Pagnito
Dec 05 2018 17:27
supski
Jorge
@OrangeKulture
Dec 05 2018 17:27
anyone here using react n redux?
Pagnito
@Pagnito
Dec 05 2018 17:28
ya
Jorge
@OrangeKulture
Dec 05 2018 17:32
const defaultState = {
  arr1: [item1, item2, item3],
  arr2: [item1, item2, item3],
  arr3: [item1, item2, item3]
}
i would need something like that .. is that ok, or just kinda like a mess?
object of arrays as a piece of state
Pagnito
@Pagnito
Dec 05 2018 17:33
i dont see why not, if u need that data on load or w/e
Jorge
@OrangeKulture
Dec 05 2018 17:34
how would you set up the reducer tho, if you spread return {...state, }
Pagnito
@Pagnito
Dec 05 2018 17:34
whato do u mean?
so u need to add on to the default state?
Jorge
@OrangeKulture
Dec 05 2018 17:35
yeah defaultState is just the name, a bad one in this case probs
but yeah, lets say u have an action that needs to add on to a specific list
say arr2 .. ud have to return the whole state, and then add on to arr2
Pagnito
@Pagnito
Dec 05 2018 17:37
so yea u use the spread operator
Jorge
@OrangeKulture
Dec 05 2018 17:38
what about the second argument?
im probs not making much sense, sry .. i guess ill figure it out eventually
Pagnito
@Pagnito
Dec 05 2018 17:39
oooh
i think im being unclear actually

i just realized that when i was using it for my use case, my api would always return all the posts so this workd

case UPDATE_POSTS:
            return {
                ...state,
                posts: action.payload
            };

but now im thinking about, if ur api is return only one item and u need to add it onto the state.arr, it owuld be a lil diffirent

maybe
Pagnito
@Pagnito
Dec 05 2018 17:47
let defaultState.arr2 = defaultState.arr2.push(newItem);
return { 
    ...state
}
This seems like something i would get bashed on >.<
Jorge
@OrangeKulture
Dec 05 2018 17:49

yeah .. lets say i have a list of contacts, each contact is an object right, so

cont1 = {
  name: 'something',
  company: 'comp1',
  email: 'some_email@test.com'
}

so i have several contacts, and lets say company, can only be 1 of 3 options, either comp1, comp2 or comp3 ...

what im trying to do is build a piece of state with lists of email addresses, depending on the company .. so if contact3 has comp1 and contact13 has comp1, for instance, then they belong in the same array. The piece of state i want would be:

list = {
  comp1: ['contact3', 'contact13'],
comp2: ['contact5', 'contact105']
}
Christopher McCormack
@cmccormack
Dec 05 2018 17:49
push returns length of array
Jorge
@OrangeKulture
Dec 05 2018 17:49
yeah the problem is not the method on the array, which i would use concat btw ..
my problem is how to set up the return statement for the reducer handling the building of the "list" piece of state
Pagnito
@Pagnito
Dec 05 2018 17:50
Object.assign?
Jorge
@OrangeKulture
Dec 05 2018 17:54
i think something like
return {...state, [action.contact.company]: action.contact.email}
but im kinda stuck
Pagnito
@Pagnito
Dec 05 2018 17:54
i think u can use Object.assign
it can create a copy of ur default state without mutating the default state
Jorge
@OrangeKulture
Dec 05 2018 17:54
but you would have to return something in order for the reducer to save state to the store, no?
Pagnito
@Pagnito
Dec 05 2018 17:55
ya u would return the copy of the default state WITH the new arr2 in it
Jorge
@OrangeKulture
Dec 05 2018 17:56
yah was reading on that when u mentioned it
Pagnito
@Pagnito
Dec 05 2018 17:56
make sure the first argument i an empty object so it doesnt mutate default state
Jorge
@OrangeKulture
Dec 05 2018 17:59
awesome stuff, thanks man
Pagnito
@Pagnito
Dec 05 2018 18:01
np
Aditya
@ezioda004
Dec 05 2018 18:04
{...}, desugars to Object.assign anyway
@OrangeKulture How does your state look like? Because {...state, [action.contact.company]: action.contact.email} would update the state to have a direct property of [action.contact.company]
Jorge
@OrangeKulture
Dec 05 2018 18:08
yeah thats probably why
action.contact.company is a direct property of the object lists
not a direct property of state'
Brad
@bradtaniguchi
Dec 05 2018 18:09
@ezioda004 I heard they function slightly differently, mainly around es6 class getters (object assign will get the value, spread doesn't) or at least so I heard
Jorge
@OrangeKulture
Dec 05 2018 18:10
so its
state = {
  contacts:  array of objs,
  filters: //some filters,
  lists: {
    company1: [],
    company2: []
  }
}
something along those lines
obvs the contacts and filters are populated by their respective reducers
Jason Luboff
@JLuboff
Dec 05 2018 18:11
@bradtaniguchi Dude...this PDF shit is not going well lol. Apparently it doesn't like flexbox.. :angry:
Brad
@bradtaniguchi
Dec 05 2018 18:12
Hehe I ran into that, but my use-case was super easy to fix hehehe
Jason Luboff
@JLuboff
Dec 05 2018 18:12
That was with puppeteer?
Brad
@bradtaniguchi
Dec 05 2018 18:13
It was with Chrome, so yea pretty much
Jason Luboff
@JLuboff
Dec 05 2018 18:13
Erg.. was going to try puppeteer...
Aditya
@ezioda004
Dec 05 2018 18:13
@bradtaniguchi You got an example? I remember reading that they wanted to change how {...} works but tc39 didnt come to consensus because Object.assign() wouldnt match with how object spread would work
Jason Luboff
@JLuboff
Dec 05 2018 18:13
Did you just switch to not using Flexbox?
Aditya
@ezioda004
Dec 05 2018 18:14
@OrangeKulture So which part of that state you need to update?
Jorge
@OrangeKulture
Dec 05 2018 18:15
i basically want to have a reducer that would add an email to either company1 or company to array, depending on the contact information
Brad
@bradtaniguchi
Dec 05 2018 18:15
@JLuboff Yea we used some media queries to fix it I think. Thinking back I think it had something todo with the page size "shrinking" when printing using pdf, so it might be different but its hard to remember.
Jorge
@OrangeKulture
Dec 05 2018 18:16
so i would map the contacts, and for each contact, read the property company, if it's company 1, have the reducer add the email for that particular contact to the lists object, but for the company1 array
lists: {
  company1: [contact1.email],
company2: []
}
something like that
Jason Luboff
@JLuboff
Dec 05 2018 18:18
@bradtaniguchi Even when I scale to 100% in print preview..it looks fine but the resulting pdf does not. Retarded ass shit
Aditya
@ezioda004
Dec 05 2018 18:18
@OrangeKulture You could maybe do:
{...state, lists: {...state.lists, [action.contact.company]: action.contact.email}}
Brad
@bradtaniguchi
Dec 05 2018 18:18
@JLuboff Yea, sounds dumb :/
Jason Luboff
@JLuboff
Dec 05 2018 18:19
But... I'm starting to think...there is really no point to the PDF generation...I just need to render based on the template and they can print that.. I don't think they actually need to save the PDF anywhere.. (I think you sort of called me out on that a week or two ago)
Jorge
@OrangeKulture
Dec 05 2018 18:19
@ezioda004 awesome stuff, thanks .. gonna try that for sure and see it wants to work with me a lil bit
Aditya
@ezioda004
Dec 05 2018 18:20
Sure, I'm not 100% sure if it'll work, but with tweaking it might
Brad
@bradtaniguchi
Dec 05 2018 18:21
@JLuboff Adding a "print-preview" page, rendering a nice print page and providing a "print" button that opens the print dialog is prolly the best UX, and least amount of work
Yea they need to click on a few things but... they get to review hehe
Jason Luboff
@JLuboff
Dec 05 2018 18:21
@bradtaniguchi Ya...I'm going to check with project originator and see if that works. I don't see why it wouldn't
Brad
@bradtaniguchi
Dec 05 2018 18:22
Do it, gives them the option to print directly too :P
Jason Luboff
@JLuboff
Dec 05 2018 18:23
Think I will. Lol
Aditya
@ezioda004
Dec 05 2018 18:49
@bradtaniguchi Ohh I just read about Object.assign() and {...}, so both of them uses [[Get]] semantics on the object and if theres a get accessor descriptor then its changed into a data descriptor but with if an object have setter in prototype then it would be triggered by Object.assign() but not by {...}
Brad
@bradtaniguchi
Dec 05 2018 18:50
@ezioda004 So its the setters that are handled differently between the two?
Aditya
@ezioda004
Dec 05 2018 18:50
Yes, heres the source
But for our intent and purposes, they both work the same
Brad
@bradtaniguchi
Dec 05 2018 18:54
Ill need to play around with that edge case to get a better understanding, hehe
Aditya
@ezioda004
Dec 05 2018 19:15
@bradtaniguchi Any good resource for typescript?
Jason Luboff
@JLuboff
Dec 05 2018 19:16
Guh.. damn custom order by in SQL
Brad
@bradtaniguchi
Dec 05 2018 19:16
@ezioda004 For general usage I'd check the site for the most part: https://www.typescriptlang.org/docs/home.html
Once your setup it depends on your use-case (nodejs, front-end, Angular/react/vue, etc)
Aditya
@ezioda004
Dec 05 2018 19:18
Oh I just want to learn more OOP with typescript, is there something like fcc for it? Like interactive challenges?
Pagnito
@Pagnito
Dec 05 2018 19:23
This message was deleted
hey anyone know why this doesnt break the line
this.state= {
      text:"thistext\nmoretext"
}
Adel
@AdelMahjoub
Dec 05 2018 19:25
@JLuboff have you tried wkhtmltopdf module
Brad
@bradtaniguchi
Dec 05 2018 19:26
@ezioda004 Not that I know of, Typescript isn't "more OOP" than just plain Javascript, you could write everything in plain es6+ javascript and typescript will automatically help during linting and compile-time
Pagnito
@Pagnito
Dec 05 2018 19:27
nvm
guess it doesnt work in divs
Brad
@bradtaniguchi
Dec 05 2018 19:27
You could mess with it in some FCC environment, but I think you won't gain as much value without more complex use-cases.
Like this is nice and all:
let num: number = 23;
num = "hi" // typescript will throw an error
Jason Luboff
@JLuboff
Dec 05 2018 19:28
@AdelMahjoub No..but just confirmed with the project originator that it actually doesn't need to be in PDF format. I can instead do like what @bradtaniguchi mentioned where I just create a "print-preview" with a print button within the page
Brad
@bradtaniguchi
Dec 05 2018 19:28

But you could do this:

let num = 23;
num = "hi"

But that's pretty damn obvious with or without typescript.

Aditya
@ezioda004
Dec 05 2018 19:28
@bradtaniguchi I meant more OOP in the sense that I believe typescript supports more OOP constructs out of the box? Like abstract classes, generic etc
Christopher McCormack
@cmccormack
Dec 05 2018 19:29
@ezioda004 exercism.io has some TypeScript challenges
but not learning
Brad
@bradtaniguchi
Dec 05 2018 19:30
@ezioda004 Yes your right
Aditya
@ezioda004
Dec 05 2018 19:30
@bradtaniguchi That is nice indeed
@cmccormack Checking that, thanks. I believe you suggested me that earlier too :P
Brad
@bradtaniguchi
Dec 05 2018 19:31
@JLuboff Create a button that runs some JS: window.print();
Adel
@AdelMahjoub
Dec 05 2018 19:31
@JLuboff yes, I used wkhtmltopdf to convert html code to pdf files to download or preview, it works fine, but print-preview works too
Jason Luboff
@JLuboff
Dec 05 2018 19:31
@bradtaniguchi Is that all I need, window.print()?
Christopher McCormack
@cmccormack
Dec 05 2018 19:31
it was nice last time I used it, the mentor mode encourages others to provide good guidance/feedback which helped me learn a lot of good Python techniques
Brad
@bradtaniguchi
Dec 05 2018 19:31
Yea, that should open the print dialog window in the browser (throw it into the console to check hehe)
edriany
@edriany
Dec 05 2018 19:31
Hallo, is anyone free to help here? I post my question on freecodecamp forum but doesn't get answer so far. here is the link https://www.freecodecamp.org/forum/t/need-help-to-understand-the-function-behavior-challenge-sorted-union/243949
Jason Luboff
@JLuboff
Dec 05 2018 19:32
@bradtaniguchi :thumbsup:
I had to use a CASE statement to create custom ordering in my SQL query. Its gross. That is all
Adel
@AdelMahjoub
Dec 05 2018 19:33
but the wkhtmltopdf cli must be installed in your system,
Jason Luboff
@JLuboff
Dec 05 2018 19:33
Ya.. if I really needed it I would check it out...but it seems most of the PDF creators have an issue with Flexbox :shrug:
Aditya
@ezioda004
Dec 05 2018 19:36
@edriany uniteUnique([1, 3, 2], [5, 2, 1, 4], [2, 1]); is passing 3 arguments to the function but your declaration only accepts one parameter
function uniteUnique(arr)
You could use the rest parameter to fix it, function uniteUnique(...arr)
Brad
@bradtaniguchi
Dec 05 2018 19:38
@ezioda004 The one other cool thing Typescript does is give you is all the new ES features out of the box, just turn on a flag that you want them and bam.
Christopher McCormack
@cmccormack
Dec 05 2018 19:39
@bradtaniguchi does it need plugins like babel, or do you use babel plugins instead?
Aditya
@ezioda004
Dec 05 2018 19:39
@bradtaniguchi Yass, I want to use ESNext features like decorators and stuff without worrying about implementation changing
Christopher McCormack
@cmccormack
Dec 05 2018 19:41
someone should make babel plugins that remove a bunch of functionality to make coding a real challenge
like get rid of statements
Brad
@bradtaniguchi
Dec 05 2018 19:42
@cmccormack AFAIK Typescript does it itself, since you already need to compile down to JS, you don't need babel. It might use it under the hood tho, but I can't say for sure.
Hehe challenge programming, with uber strict linting rules. hehe
Aditya
@ezioda004
Dec 05 2018 19:43
@cmccormack Back to assembly language we go
Adel
@AdelMahjoub
Dec 05 2018 19:43
no need of babel with typescript, I used it a while ago with phaser / cordova (template), it really helps
Christopher McCormack
@cmccormack
Dec 05 2018 19:44
@ezioda004 I do enjoy games that have a very limited instruction set
Adel
@AdelMahjoub
Dec 05 2018 19:44
but it can whine a lot, everything should be strict
Christopher McCormack
@cmccormack
Dec 05 2018 19:45
TIS-100 and Shenzen IO are two great ones
Aditya
@ezioda004
Dec 05 2018 19:46

@cmccormack

It’s the assembly language programming game you never asked for!

I'm sold

Christopher McCormack
@cmccormack
Dec 05 2018 19:46
lol
it's a good challenge
Brad
@bradtaniguchi
Dec 05 2018 19:49
I liked TIS-100, but I kinda sucked haha
Pagnito
@Pagnito
Dec 05 2018 19:52
hey anyone know how i can give a stroke to the text in canvas?, i know there is strokeText but thats a seperate one that only creates a stroked text, but i need text wit stroke and it being filled
Jason Luboff
@JLuboff
Dec 05 2018 19:53
Thats awful that you want to give the text a stroke. A stroke is a very serious ailment
Pagnito
@Pagnito
Dec 05 2018 19:54
oof
i wanna give it a good type of stroke
with a 100 iterations if u know what i mean ;)
Christopher McCormack
@cmccormack
Dec 05 2018 19:54
jeeze
Pagnito
@Pagnito
Dec 05 2018 19:54
lmao
Christopher McCormack
@cmccormack
Dec 05 2018 19:55
@bradtaniguchi I thought I had gotten pretty good, then I reviewed some of the other solutions and it was like we were coding in a different language even with only a very small instruction set
Brad
@bradtaniguchi
Dec 05 2018 19:56
It reminded me of my batch file days (with gotos) and assembly, both of which I was terrible at haha
Christopher McCormack
@cmccormack
Dec 05 2018 19:57
it's like the difference between brute forcing a rubiks cube and knowing the permutations
I've only done a little assembly in MIPS, was pretty fun
Aditya
@ezioda004
Dec 05 2018 19:58
@cmccormack You have to use CLI for exercism? No way to do it online?
Christopher McCormack
@cmccormack
Dec 05 2018 19:59
@ezioda004 last time I did it, it was local
edriany
@edriany
Dec 05 2018 19:59
@ezioda004 many thanks, finally I know the reason :)
Aditya
@ezioda004
Dec 05 2018 20:00
@cmccormack Aw that sucks, it looked interesting
@edriany No problem :thumbsup:
Christopher McCormack
@cmccormack
Dec 05 2018 20:03
@ezioda004 command line is almost as good :)
Aditya
@ezioda004
Dec 05 2018 20:04
It is, I'm just too lazy to open an editor make changes and push
Too much work!!
Christopher McCormack
@cmccormack
Dec 05 2018 20:06
nodemon
Jorge
@OrangeKulture
Dec 05 2018 20:15
@ezioda004 if you're interested at all :
return {...state, [action.contact.company]: [...state[action.contact.company], action.contact.email] };
Aditya
@ezioda004
Dec 05 2018 20:17
@cmccormack But I still have to open the editor
@OrangeKulture That works?
Jorge
@OrangeKulture
Dec 05 2018 20:18
yeap that really works .. if you do return {...state, lists: ... } that would add a new array onto the lists object
Jason Luboff
@JLuboff
Dec 05 2018 21:35

Checking my email..see an error email.. with the message

Route: /reviewRequest/No ads Query/Error: (read)reviewRequest Error: RequestError: Validation failed for parameter 'rId'. Invalid number.

Hmmm... /reviewRequest/No ads... well.. thats not valid..and didn't come from my app.. lol (it should be something like /reviewRequest/50

Pagnito
@Pagnito
Dec 05 2018 21:57
cant unerstand why im getting this error Cannot read property 'postMessage' of null
when i refresh the page it dissappears but on initial load it always shows up
Jason Luboff
@JLuboff
Dec 05 2018 21:59
Sounds like postMessage is null? lol
Karma Drukpa
@coderkarma
Dec 05 2018 22:00
@cmccormack :wave:
Christopher McCormack
@cmccormack
Dec 05 2018 22:00
@coderkarma heya
Karma Drukpa
@coderkarma
Dec 05 2018 22:00
I need little help on this simple algorithms sorting challenge
Christopher McCormack
@cmccormack
Dec 05 2018 22:00
The object that should have the property postMessage is null
function sortByLength (array) {
  // loop through array
  // get the length of element of array and sort accordingly and return the result arr
  return array.map(ele => ele.length).sort((a,b) => a - b);
};
Pagnito
@Pagnito
Dec 05 2018 22:02
for some reason no matter how much i deploy to firebase the old bundle is bein served
Christopher McCormack
@cmccormack
Dec 05 2018 22:02
cache?
@coderkarma you're returning the length (integer) and not the strings
Karma Drukpa
@coderkarma
Dec 05 2018 22:04
@cmccormack I am actually suppose to return the the sorted array not integer
Christopher McCormack
@cmccormack
Dec 05 2018 22:04
just get rid of the map and compare the lengths of a and b
Pagnito
@Pagnito
Dec 05 2018 22:07
it seems i have to delete the old version via console
O.o
Jason Luboff
@JLuboff
Dec 05 2018 22:09
@cmccormack But if you get rid of the map, how will you find the treasure?!
Karma Drukpa
@coderkarma
Dec 05 2018 22:11

@cmccormack so something like

this

return array.sort((a,b) => { return a.length - b.length})
need to compare a and b's length.
Pagnito
@Pagnito
Dec 05 2018 22:16
i dont understand why firebase isnt updating my bundle version
Christopher McCormack
@cmccormack
Dec 05 2018 22:17
Yeah something like that
Karma Drukpa
@coderkarma
Dec 05 2018 22:18
that doesn't seems to be sorting correctly.
Pagnito
@Pagnito
Dec 05 2018 22:33
OMFGKALJSHDKJLASDHAKSJHDKJKJLSAKJASDGASKLD
why the fuck isnt firebase rewriting new bundle
Pagnito
@Pagnito
Dec 05 2018 22:48
i feel like pullin my hair out, this is not making any sense
Christopher McCormack
@cmccormack
Dec 05 2018 22:48
Worked for me, can you show the whole thing @coderkarma ?
Pagnito
@Pagnito
Dec 05 2018 22:49
i know google couldnt have made this so difficult, yet i know what my bundle is supposed to do since i can serve it on express local server, but yet when i deploy it to firebase it never replaces the old version
Karma Drukpa
@coderkarma
Dec 05 2018 22:50
@cmccormack that was it. since you told to remove map function so thought I could just do sorting function to get work done. but it didn't work
return array.sort((a,b) => { return a.length - b.length})
Christopher McCormack
@cmccormack
Dec 05 2018 23:17
@coderkarma there should be a function wrapping it as well... did you delete that?
Christopher McCormack
@cmccormack
Dec 05 2018 23:24

@coderkarma

function sortByLength (array) {
  // Return an array containing the same strings, ordered from shortest to longest
};

Put your code in that function

@coderkarma also, if you're going to use an arrow function, you can use the implicit return for more concise code:
return array.sort((a,b) => a.length - b.length)
Karma Drukpa
@coderkarma
Dec 05 2018 23:27
@cmccormack even after doing that codewars test cases doesn't pass.
Christopher McCormack
@cmccormack
Dec 05 2018 23:27
@coderkarma post your whole code block
Karma Drukpa
@coderkarma
Dec 05 2018 23:28
oh wait... it did worked
thanks
function sortByLength (array) { return array.sort((a,b) => a.length - b.length); };
Christopher McCormack
@cmccormack
Dec 05 2018 23:29
:thumbsup:
Karma Drukpa
@coderkarma
Dec 05 2018 23:29
@cmccormack if is one liner then we don't need return statement right
at the beginning i thought i have to loop through so that was the main reason why i did mapping
Christopher McCormack
@cmccormack
Dec 05 2018 23:30
@coderkarma you only need the curly braces if what you want to return is an object (in that case you must also wrap the curly braces in parenthesis) or if you need to perform more than a single action. The curly braces are a block, but if you use a block you must then provide a return inside the block
Karma Drukpa
@coderkarma
Dec 05 2018 23:35
@cmccormack in React when we do onChange handler something I get confuse when we return something like onChange={onChange()}, or sometime using this.props.OnChange?
Christopher McCormack
@cmccormack
Dec 05 2018 23:35
you wouldn't invoke the onChange method in the onChange attribute unless for some reason your onChange method returned another function you want to use when onChange is triggered
I would need to see an example to understand what you are asking though, sorry
Karma Drukpa
@coderkarma
Dec 05 2018 23:37
@cmccormack in React we use curly braces for jsx right but at the same time we also use for js variables, am I asking correct.
let me pull out some code
Christopher McCormack
@cmccormack
Dec 05 2018 23:37
@coderkarma ah the curly braces represent a Javascript expression in JSX
so when the JSX is converted to a React.createElement anything in those curly braces is evaluated
Karma Drukpa
@coderkarma
Dec 05 2018 23:40
class SearchBar extends React.Component {
  state = { term: '' };

  onFormSubmit = event => {
    event.preventDefault();
    this.props.onSubmit(this.state.term);
  };

  render() {
    return (
      <div className="ui segment">
        <form onSubmit={this.onFormSubmit} className="ui form">
          <div className="field">
            <label>Image Search</label>
            <input
              type="text"
              value={this.state.term}
              onChange={e => this.setState({ term: e.target.value })}
            />
          </div>
        </form>
      </div>
    );
  }
}

export default SearchBar;
Pagnito
@Pagnito
Dec 05 2018 23:40
anyone used firebase authentication?
Jason Luboff
@JLuboff
Dec 05 2018 23:40
I think @tiagocorreiaalmeida has..but don't think he is around
yayne
@yayne
Dec 05 2018 23:41
@coderkarma ... are you familiar with Web components?
Christopher McCormack
@cmccormack
Dec 05 2018 23:43

@coderkarma

in React we use curly braces for jsx right but at the same time we also use for js variables

Not sure what you mean we use curly braces for JSX - we use curly braces within JSX to evaluate Javascript expressions

Karma Drukpa
@coderkarma
Dec 05 2018 23:43
@cmccormack in my SearchBar component, onSubmit when we do {this. onformSubmit}, why we don't need to give parenthesis to onFormSubmit()
Christopher McCormack
@cmccormack
Dec 05 2018 23:44
because onSubmit is not a function, it's only an attribute that React does something with prior to building the DOM element
Karma Drukpa
@coderkarma
Dec 05 2018 23:44
@yayne nope sorry, I am just a beginner in React? sorry!!
Christopher McCormack
@cmccormack
Dec 05 2018 23:44
you use the curly braces to provide that attribute a value that is derived from the evaluted JavaScript
@coderkarma sorry I gotta run to start making dinner but I think @JLuboff and @Pagnito should be able to answer your questions if they are still around
Jason Luboff
@JLuboff
Dec 05 2018 23:48
Thats a tall order to handle
Karma Drukpa
@coderkarma
Dec 05 2018 23:48
it's all good. Thank you for the explanation @cmccormack
Christopher McCormack
@cmccormack
Dec 05 2018 23:48
np
see ya
Pagnito
@Pagnito
Dec 05 2018 23:49
this dude maximilian just made a course about
i dunno how specific it is, i just recieved an emial about it
but i like this guys courses
the course is only 10 bucks right now so its proly worth it
@coderkarma
Karma Drukpa
@coderkarma
Dec 05 2018 23:50
what is it all about.
I have so many udemy courses to finish.
lol