These are chat archives for FreeCodeCamp/HelpJavaScript

11th
Jun 2018
Mukul Agrawal
@mukul09
Jun 11 2018 09:03
Hello. Any one knows how can we change the attribute value on a live website?
Dhaval Vira
@dhavalveera
Jun 11 2018 09:05
specify your concern
Mukul Agrawal
@mukul09
Jun 11 2018 09:06
ok. Yellow Pages australia is a website which shows only 35 results per page. I want to see more results like 50 results per page. how can i do that?
Then I went to inspect element and found that there is a division tag with attribute "data-search-results-per-page"=35, I changed this to 50. Next step I don't know to make it apply?
Dhaval Vira
@dhavalveera
Jun 11 2018 09:11
save & try it that it is working or not
and if not working & if you get any Error, Paste Error here
Mukul Agrawal
@mukul09
Jun 11 2018 09:14
I don't know how to save. I right clicked on that attribute and clicked "edit attribute". put the value and then pressed the enter. Is it the process for save?
Dhaval Vira
@dhavalveera
Jun 11 2018 09:14
are you a developer ?
Mukul Agrawal
@mukul09
Jun 11 2018 09:15
no
Dhaval Vira
@dhavalveera
Jun 11 2018 09:15
Mr. Mukul plz text me directly
Simon Cordova
@gbsimon87
Jun 11 2018 09:16
Hey all!
Dhaval Vira
@dhavalveera
Jun 11 2018 09:16
hey
Simon Cordova
@gbsimon87
Jun 11 2018 09:16
Wondering if anyone could help out with a small algorithmic like pickle I'm in
Claudio Restifo
@Marmiz
Jun 11 2018 10:03
@gbsimon87 ask your question, sure someone will try to help ^^
Blauelf
@Blauelf
Jun 11 2018 11:52
Oh, how I love those meta questions :imp:
I mean, this is the HelpJavaScript channel. We're here for discussing JavaScript problems.
Jason Luboff
@JLuboff
Jun 11 2018 15:15
@tiagocorreiaalmeida I am now, but looks like @sjames1958gm saved ya
Christopher McCormack
@cmccormack
Jun 11 2018 15:20
@JLuboff yo :wave:
Jason Luboff
@JLuboff
Jun 11 2018 15:21
@cmccormack What up? How was the weekend?
Christopher McCormack
@cmccormack
Jun 11 2018 15:22
Good man worked on my nightlife app quite a bit, played some video games. First time I got a weekend at home in a while :)
@JLuboff How was yours?
Jason Luboff
@JLuboff
Jun 11 2018 15:24
Not too bad. A lot of running around. Needed to be longer hah
Christopher McCormack
@cmccormack
Jun 11 2018 15:30
@JLuboff just make every weekend a three day weekend!
Jason Luboff
@JLuboff
Jun 11 2018 15:34
Sure would be nice! But then I'm sure I'd start to say that wasn't long enough either hah
Christopher McCormack
@cmccormack
Jun 11 2018 15:36
@JLuboff you're almost certainly right :)
Jason Luboff
@JLuboff
Jun 11 2018 15:37
Oh well..
Nate Mallison
@NJM8
Jun 11 2018 15:43
@JLuboff what is wrong with my query here:
db.Polls.update({ id: 5b1a49f44ce1f74177a0f463 }, {$pop : { options: 1 } } )
?
using mongo shell, just input some bad data to one of my polls and trying to pop it off
[thread1] SyntaxError: identifier starts immediately after numeric literal @(shell):1:22
Jason Luboff
@JLuboff
Jun 11 2018 15:45
@NJM8 id should be _id?
Nate Mallison
@NJM8
Jun 11 2018 15:45
tried that too, same
Jason Luboff
@JLuboff
Jun 11 2018 15:45
Try putting options in quotes
Nate Mallison
@NJM8
Jun 11 2018 15:45
I was thinking either the id or options should be in quotes?
same
this is from the documentation: db.students.update( { _id: 1 }, { $pop: { scores: 1 } } )
doing it by name gives me no errors but also no results
Markus Kiili
@Masd925
Jun 11 2018 15:48
Evening.
Jason Luboff
@JLuboff
Jun 11 2018 15:48

Can you do

db.Polls.find({ _id: 5b1a49f44ce1f74177a0f463 })

and show the results

@Masd925 Yo
Nate Mallison
@NJM8
Jun 11 2018 15:49
same error? but its in there
Jason Luboff
@JLuboff
Jun 11 2018 15:49
Are in the in the correct database?
Nate Mallison
@NJM8
Jun 11 2018 15:49
here is a find all
Mois├ęs Man
@moigithub
Jun 11 2018 15:49
5b65456465454 should be on quotes.. or probably wrap in mongoObject function(or wathever its called)
Nate Mallison
@NJM8
Jun 11 2018 15:50
uhhhh
polls is lowercase
Jason Luboff
@JLuboff
Jun 11 2018 15:50
that would help ;)
And
Ya as @moigithub said, we do need to wrap it in ObjectId
Nate Mallison
@NJM8
Jun 11 2018 15:52
> db.polls.update({ _id: "5b1a49f44ce1f74177a0f463"}, { $pop : { options: 1 } })
WriteResult({ "nMatched" : 0, "nUpserted" : 0, "nModified" : 0 })
>
Jason Luboff
@JLuboff
Jun 11 2018 15:52
I had to jump into my Mongo shell...I'm a little rusty
Nate Mallison
@NJM8
Jun 11 2018 15:52
as in ObjectId("blagblagblag"
Jason Luboff
@JLuboff
Jun 11 2018 15:53
db.polls.update({ _id: ObjectId("5b1a49f44ce1f74177a0f463")}, { $pop : { options: 1 } })
Nate Mallison
@NJM8
Jun 11 2018 15:53
got it
thank you @JLuboff @moigithub
Jason Luboff
@JLuboff
Jun 11 2018 15:55
:+1:
Said that I'm that rusty but..oh well. Lol
Nate Mallison
@NJM8
Jun 11 2018 15:55
just trying to keep you ready. haha
Jason Luboff
@JLuboff
Jun 11 2018 15:59
Thanks hah
Kudzu
@czhower
Jun 11 2018 16:08
@shijiezhou1 Which thread? I see the tag but not sure what its in reference too.
Jason Luboff
@JLuboff
Jun 11 2018 17:22
Wierd. I had to reinstall Gitter app due to token being revoked..
Christopher McCormack
@cmccormack
Jun 11 2018 17:33
@JLuboff that is odd
poor planning/reminder system I guess :)
Brad
@bradtaniguchi
Jun 11 2018 17:36
There was a security vulnerability, in v3 gitter
so they force you to upgrade to fix it hehe
Jason Luboff
@JLuboff
Jun 11 2018 17:38
I thought Gitter auto-updated..
Kudzu
@czhower
Jun 11 2018 17:38
@JLuboff Same here. It didnt auto update and forced me to do it manually.
Brad
@bradtaniguchi
Jun 11 2018 17:39
maybe because its a new version? (v4 is latest)
Jason Luboff
@JLuboff
Jun 11 2018 17:44
Dunno. Not a huge deal regardless
Brad
@bradtaniguchi
Jun 11 2018 17:47
Yea, I just went to the web-app version, until they update the repo I get my gitter from I'll just use the web interface :D
Jason Luboff
@JLuboff
Jun 11 2018 17:48
Never cared for the web-app version. I like having it as a standalone
Brad
@bradtaniguchi
Jun 11 2018 17:49
Yea same here, but I wont' mind, I already have like 9 tabs pinned :P
Christopher McCormack
@cmccormack
Jun 11 2018 17:49
I'm the opposite, I can't reload the app if it's doing something wonky so I prefer the webapp
Jason Luboff
@JLuboff
Jun 11 2018 17:50
Sure you can...just close and reopen it :smile:
Brad
@bradtaniguchi
Jun 11 2018 17:55
My system is kinda dumb, I can open gitter multiple times and each instances appears in my system tray haha
Jason Luboff
@JLuboff
Jun 11 2018 17:55
Mine does too
Its annoying, but I close out Gitter daily via the system tray
Also..its annoying when you email the users who requested an application and now of them reply..
Brad
@bradtaniguchi
Jun 11 2018 17:55
Hmm I thought it was linux being dumb, good to know its dumb for everyone haha
Nate Mallison
@NJM8
Jun 11 2018 18:05
@JLuboff https://natethedev-votingappfrontend.herokuapp.com you can add options now
Jason Luboff
@JLuboff
Jun 11 2018 18:09
@NJM8 :+1: Good job
Nate Mallison
@NJM8
Jun 11 2018 18:57
what's the best way to include bootstrap to an express app. using pug for templates (grossssss). just pop a link in the base html page or is there a module?
Jason Luboff
@JLuboff
Jun 11 2018 19:00
@NJM8 You can do either. I usually still use a CDN since I like to use a different theme than default, along with CDN gets cached where as local doesn't (IIRC)
Nate Mallison
@NJM8
Jun 11 2018 19:00
there is a pug-bootstrap plugin, looks miserable, I'll use cdn
Jason Luboff
@JLuboff
Jun 11 2018 19:01
I'm not sure why you'd need a template engine specifc version.
Given I use handlesbars, but I've always just used a regular version of Bootstrap or Bulma
Nate Mallison
@NJM8
Jun 11 2018 19:03
just thought it might be better to serve from my app not a cdn, if it's pre-rendered won't it be faster?
Nate Mallison
@NJM8
Jun 11 2018 19:07
wow, that answer update answered about 4 lingering questions I had about bundlers. haha
Jason Luboff
@JLuboff
Jun 11 2018 19:09
:+1:
Jason Luboff
@JLuboff
Jun 11 2018 22:52
Almost done with this project...can smell the electrons
Christopher McCormack
@cmccormack
Jun 11 2018 22:52
@JLuboff maybe turn on a fan?
Jason Luboff
@JLuboff
Jun 11 2018 22:54
@cmccormack Psh...
I like the smell!
Christopher McCormack
@cmccormack
Jun 11 2018 22:56
image.png
Jason Luboff
@JLuboff
Jun 11 2018 22:56
Hmmm... that doesn't seem accurate...shouldn't it be "Tastes...like burning..."
Christopher McCormack
@cmccormack
Jun 11 2018 22:59
Now you're eating them??
Jason Luboff
@JLuboff
Jun 11 2018 22:59
...is that not what I'm supposed to do with them..?
Christopher McCormack
@cmccormack
Jun 11 2018 23:00
You don't have to taste everything that smells funny
Jason Luboff
@JLuboff
Jun 11 2018 23:01
Oh...well..shoot
:smile:
Christopher McCormack
@cmccormack
Jun 11 2018 23:01
"Put that down young @JLuboff !"
Jason Luboff
@JLuboff
Jun 11 2018 23:02
Well.. cron job is working... just need to actually throw some logic/query into it
Christopher McCormack
@cmccormack
Jun 11 2018 23:02
@JLuboff cron on server or in app?
Jason Luboff
@JLuboff
Jun 11 2018 23:02
In app
Christopher McCormack
@cmccormack
Jun 11 2018 23:03
nice is it easy? I considered doing that with my nightlife database to clean it up every 24 hours or whatever
Jason Luboff
@JLuboff
Jun 11 2018 23:06
When you have the pattern correct, ya
Thats the package I'm using

So I have this

exports.startCron =
  new CronJob({
    cronTime: '00 00 6 * * 1-5',
    onTick: () => {
      console.log(chalk.bgYellowBright.black('Testing Cron job'));
      nodeMailer.testCron(*****', 'Testing Cron Job at 6:00 AM');
    },
    start: true,
  });

Which translates to send every week day at 6 AM

And I have this is app.js

app.listen(port, () => {
  console.log(chalk`Listening on port {redBright ${port}} running in {redBright ${process.env.NODE_ENV}} mode`);
  cron.startCron.start();
});

But...I don't think I actually need that due to have start: true

Christopher McCormack
@cmccormack
Jun 11 2018 23:09
@JLuboff missing a quote on nodeMailer.testCron?
Jason Luboff
@JLuboff
Jun 11 2018 23:09
@cmccormack technically... I just was blanking out my email
Christopher McCormack
@cmccormack
Jun 11 2018 23:09
oh haha
test it!
Cool looks easy enough to implement. I have to run to make dinner soon but I want to pick your brain about the nightlife app tomorrow if you're around
Jason Luboff
@JLuboff
Jun 11 2018 23:12
I did test it, and it works :smile: but going to actually leave my app running overnight to make sure it sends in the morning. Need to work on the query now though
Ya I'll be here
Christopher McCormack
@cmccormack
Jun 11 2018 23:12
@JLuboff just have it email you every 5 minutes :)
alright man ttyl
Jason Luboff
@JLuboff
Jun 11 2018 23:15
I get enough emails hah.. See ya