These are chat archives for FreeCodeCamp/HelpFrontEnd

23rd
Dec 2017
Henry
@GitHub-Henry
Dec 23 2017 00:05
@muzakparov reminds me of the Packleds
kerafyrm02
@kerafyrm02
Dec 23 2017 00:07
Anyone stuck or need help?
Bakhtiiar Muzakparov
@muzakparov
Dec 23 2017 00:07
@GitHub-Henry yeah :D but it is works even when it is broken, it just slows me down a lot haha
Henry
@GitHub-Henry
Dec 23 2017 00:09
@muzakparov good luck on your 14k css project, :smile:
Xarri Jorge
@xarrijorge
Dec 23 2017 00:14
:wave:
Ruben Abraham
@BuBBRBbr1
Dec 23 2017 00:15
I am stuck.
Bakhtiiar Muzakparov
@muzakparov
Dec 23 2017 00:16
@GitHub-Henry do you think it is doable?
in short time
Bakhtiiar Muzakparov
@muzakparov
Dec 23 2017 00:21
@GitHub-Henry I should give time estimation to manager so appreciate it
kerafyrm02
@kerafyrm02
Dec 23 2017 00:21
what are you stuck on Bubbbrbb1
Bakhtiiar Muzakparov
@muzakparov
Dec 23 2017 00:48
@gothamknight very good job
for (var i=0;i<programCurPosWin.length;i++){ if(programCurPosWin[i].length ===1){ $('#grid .'+userIcon).css('opacity','0.5'); setTimeout(function(){ $('#contain').hide(); $('#endOfLine').html(<p><span id=endSpan></span><span class=cursor>_</span></p>).show(); typewriter('END OF THE LINE', '#endSpan','#endOfLine p', function(){ $('#endOfLine').hide(); $('#contain').show(); }); },500); setTimeout(function(){ $('#resetDiv, #soundDiv').hover(resetSoundHover);//added gridIsLoaded(); },1000); }
and it worked , not sure why probably toggling of mouseover event is happening in jquery
Ruben Abraham
@BuBBRBbr1
Dec 23 2017 00:48
I am having trouble on the personal portfolio zipline on free code camp. I cannot seem to give icons to the buttons on my pen on codepen. Font Awesome does not work either.
Bakhtiiar Muzakparov
@muzakparov
Dec 23 2017 00:49
 for (var i=0;i<programCurPosWin.length;i++){
    if(programCurPosWin[i].length ===1){
      $('#grid .'+userIcon).css('opacity','0.5');
      setTimeout(function(){
        $('#contain').hide();
        $('#endOfLine').html(`<p><span id=endSpan></span><span class=cursor>_</span></p>`).show();
        typewriter('END OF THE LINE', '#endSpan','#endOfLine p', function(){
          $('#endOfLine').hide();
          $('#contain').show();
        });
      },500);
      setTimeout(function(){
          $('#resetDiv, #soundDiv').hover(resetSoundHover);
        gridIsLoaded();
      },1000);
    }
just added $('#resetDiv, #soundDiv').hover(resetSoundHover); after setTimeout
@gothamknight
iso
@iso1048
Dec 23 2017 00:51
@muzakparov awesome. Thanks bro!
CamperBot
@camperbot
Dec 23 2017 00:51
gothamknight sends brownie points to @muzakparov :sparkles: :thumbsup: :sparkles:
:cookie: 236 | @muzakparov |http://www.freecodecamp.org/muzakparov
Bakhtiiar Muzakparov
@muzakparov
Dec 23 2017 00:52
@gothamknight np you have done a nice job with scss etc, how long did it take just curious?
Maduro-BL
@Maduro-BL
Dec 23 2017 00:52
giving accurate estimates is one of the toughest things. i fall short constantly
i spent 4 weeks on a project i estimated 1 week on
i thought i was going to lose my job, most stress i've ever been under
pull through at the end though
is there anyway to improve accuracy of estimates. i think it boils down to experience.
Bakhtiiar Muzakparov
@muzakparov
Dec 23 2017 00:56
@Maduro-BL thanks I think I am gonna lose my job and it was my first job, dammit I am f*
CamperBot
@camperbot
Dec 23 2017 00:56
muzakparov sends brownie points to @maduro-bl :sparkles: :thumbsup: :sparkles:
api offline
Maduro-BL
@Maduro-BL
Dec 23 2017 00:56
haha @muzakparov , no no no. it wont come to that
you'll pull through
sucks you're working through xmass though
do you guys have a release planned?
why the deadline during holiday season?
iso
@iso1048
Dec 23 2017 01:00
@muzakparov thanks man. Couldn't really give you a good estimate to be honest, but it would have been a while since I do not get to code that much each day.
CamperBot
@camperbot
Dec 23 2017 01:00
gothamknight sends brownie points to @muzakparov :sparkles: :thumbsup: :sparkles:
api offline
iso
@iso1048
Dec 23 2017 01:01
@Maduro-BL @muzakparov did you guys get hired after completing the fCC course?
Bakhtiiar Muzakparov
@muzakparov
Dec 23 2017 01:03

@Maduro-BL no release date but when he asks for additional feature on a website, I struggle to implement it because I am not sure what is gonna happen, for instance I will share one css rule from real codebase

.flip-clock-meridium {
  background: none !important;
  box-shadow: 0 0 0 !important;
  font-size: 36px !important; 
}

do you see how fancy the code is with all these !Important s :D

when I add something it seems like whole thing is going to collapse and since javascript code interferes too, it makes things even worse

Maduro-BL
@Maduro-BL
Dec 23 2017 01:03
@gothamknight , correct in my case. I switched careers and FCC was a BIG part of my self learning journey
but this was ages ago, when FCC was shorter (still using angular)
Bakhtiiar Muzakparov
@muzakparov
Dec 23 2017 01:04
@gothamknight I didnt even finish it lol
iso
@iso1048
Dec 23 2017 01:05
@Maduro-BL oh wow that is awesome. What was your initial career if you don't mind me asking?
@muzakparov what a legend haha
Maduro-BL
@Maduro-BL
Dec 23 2017 01:07
ouch @mzmls ! important < ---- not good. i feel your pain. so there's the legacy code base and the holiday season... this is okay to give a conservative estimate imo
@gothamknight , i was a social worker
iso
@iso1048
Dec 23 2017 01:08
oh yeah cool. what made you decide to switch careers? @Maduro-BL
Bakhtiiar Muzakparov
@muzakparov
Dec 23 2017 01:10
@Maduro-BL and we have three $(document).ready() in one huge javascript file along with some "clever" setTimeout() to fight asyncronocity ,I really just wanna take my things and flee :D
Maduro-BL
@Maduro-BL
Dec 23 2017 01:10
@gothamknight , i enjoy programming more than social work. I never considered comp sci/software development as a career while in school (regret). I discovered programming later in life.
Bakhtiiar Muzakparov
@muzakparov
Dec 23 2017 01:11
@Maduro-BL how old are you if not a secret ofc
Maduro-BL
@Maduro-BL
Dec 23 2017 01:13
hahaha @muzakparov what were they thinking! I'm 33
are you guys using git?
do a git blame, see who wrote that. i'd wager its different people
Bakhtiiar Muzakparov
@muzakparov
Dec 23 2017 01:14
@Maduro-BL yes we use private repo at work
Maduro-BL
@Maduro-BL
Dec 23 2017 01:14
thats a real mystery, are there any tests around that code?
Bakhtiiar Muzakparov
@muzakparov
Dec 23 2017 01:14
no not at frontend
some test on backend
Maduro-BL
@Maduro-BL
Dec 23 2017 01:15
:( thats tough!
Bakhtiiar Muzakparov
@muzakparov
Dec 23 2017 01:15
but they hired tester week ago
Maduro-BL
@Maduro-BL
Dec 23 2017 01:18
i understand, it's a tough codebase to maintain. I had a similar situation: inherited a large codebase with bad test coverage. We ended up rewriting most of it. upgraded the framework
used jasmine/karma for frontend test
made things easier. but you dont have that sort of time.
Bakhtiiar Muzakparov
@muzakparov
Dec 23 2017 01:29
@Maduro-BL yep, have to come up with some clever solution
Muzamil
@mzmls
Dec 23 2017 01:36
hey! feedback for this is appreciated:
https://codepen.io/mzmls/pen/RxGmGm
Maduro-BL
@Maduro-BL
Dec 23 2017 01:37

@muzakparov , i feel anxiety hearing about your situation. I've been in a similar spot. I'm a junior developer, but i'll try to share what i learned from retrospect.
1) If you're stuck, walk away from the code. Go for a jog (some fitness activity).
2) Elicit requirements: get the details of what the client wants (sometimes they dont know what they want)
3) Design, use UML's and plan it out. I often dove into implementation before properly planning and it caused pain.
4) Write unit tests then refactor <---- maybe not possible on your timeline

Best of luck to you my friend. We're rooting for you!

Bakhtiiar Muzakparov
@muzakparov
Dec 23 2017 01:49
@Maduro-BL thank you very much my friend
CamperBot
@camperbot
Dec 23 2017 01:49
muzakparov sends brownie points to @maduro-bl :sparkles: :thumbsup: :sparkles:
api offline
kerafyrm02
@kerafyrm02
Dec 23 2017 01:58
anyne stuck need help?
kerafyrm02
@kerafyrm02
Dec 23 2017 02:08
important in css isnt necessarily bad. if it's just for a class thats added on via JS it should be ok.
Sorin Ruse
@sorinr
Dec 23 2017 02:59
@muzakparov you have missing some " in here: $('#endOfLine').html('<p><span id=endSpan></span><span class=cursor>_</span></p>').show(); it needs to be like $('#endOfLine').html('<p><span id="endSpan"></span><span class=cursor>_</span></p>').show();
kerafyrm02
@kerafyrm02
Dec 23 2017 03:02
Anyone need help?
VaseJS
@VaseJS
Dec 23 2017 03:08
@kerafyrm02 always looking to help :D
Nick Karnik
@theoutlander
Dec 23 2017 03:41
LOL
Why is JS not working on codepen?
Nick Karnik
@theoutlander
Dec 23 2017 03:49
@huyingjie take a look at the console for errors
Yingjie (Iris) Hu
@huyingjie
Dec 23 2017 03:50
I do not understand the error in the console
Can I submit github url instead of codepen url?
It seems that external link forjson must use https instead of http.
@theoutlander
Nick Karnik
@theoutlander
Dec 23 2017 03:53
sure
looking at your pen
@huyingjie to get over the issue, make sure you run codepen with http
so seems like console errors have gone
Yingjie (Iris) Hu
@huyingjie
Dec 23 2017 03:56
Because I put json on github. GitHub will give https
Nick Karnik
@theoutlander
Dec 23 2017 03:57
np … ok, so the content is retrieved
the problem is it’s not shown, is that correct ?
Yingjie (Iris) Hu
@huyingjie
Dec 23 2017 03:57
Nick Karnik
@theoutlander
Dec 23 2017 03:58
I think your url’s are reversed
Sorin Ruse
@sorinr
Dec 23 2017 03:58
@huyingjie think you should call the raw version of the files when loading content from github
@huyingjie ^
Yingjie (Iris) Hu
@huyingjie
Dec 23 2017 03:59
@sorinr They are raw
Sorin Ruse
@sorinr
Dec 23 2017 04:00
@huyingjie take a look at this post
Nick Karnik
@theoutlander
Dec 23 2017 04:02
@huyingjie did you see the pen above? Your problem is solved.
She is calling the raw version @sorinr
The calls url’s were mixed up … i just had to swap them
Yingjie (Iris) Hu
@huyingjie
Dec 23 2017 04:05
@theoutlander Thank you. I pasted correct raw urls. There are two json files. I exchanged them when pasting, then this led to undefined results.
CamperBot
@camperbot
Dec 23 2017 04:05
huyingjie sends brownie points to @theoutlander :sparkles: :thumbsup: :sparkles:
api offline
Sorin Ruse
@sorinr
Dec 23 2017 04:05
@theoutlander :+1: still on my morning coffee
Nick Karnik
@theoutlander
Dec 23 2017 04:06
Haha , np
primuscovenant
@primuscovenant
Dec 23 2017 05:06
@heroiczero thx
CamperBot
@camperbot
Dec 23 2017 05:06
primuscovenant sends brownie points to @heroiczero :sparkles: :thumbsup: :sparkles:
:star2: 2114 | @heroiczero |http://www.freecodecamp.org/heroiczero
Joseph A. Sangine
@HTML-joe
Dec 23 2017 06:40

@HTML-joe
can someone help me with something really quick?
why wont this display the current longitude?
$(document).ready(function(){

var api="https://fcc-weather-api.glitch.me/api/current?lat=35&lon=139";

$.getJSON(api, function(data) {
alert(data.coord.lon);

});

});
the api is coming from here https://fcc-weather-api.glitch.me/

Shubham Sharma
@shubham1604
Dec 23 2017 07:20
Hey guys. I am using the forismatic api for my random quote machine but I am getting the "access control allow origin error". Now I know what the error is but I have no idea how to solve it. Can anyone help me out?
Nick Karnik
@theoutlander
Dec 23 2017 07:51
@shubham1604 you need to set access control headers in your request
You can test the request here first https://www.test-cors.org/
And then add the headers to your request object
Shubham Sharma
@shubham1604
Dec 23 2017 08:19
@theoutlander Can you please elaborate?
basically the browser blocks requests to other domains if the server states that you need to specify certain headers
Quantomistro3178
@Quantomistro3178
Dec 23 2017 09:37
Guys, can I perform common array methods like filter(), map(), sort() etc. on the arguments object? If not, then what kind of functions can I perform?
Markus Kiili
@Masd925
Dec 23 2017 09:45
@Quantomistro3178 You can transform arguments object into a real array, or use for example call method that makes it so that you can call array methods straight on an array-like object.
Array.prototype.slice.call(arguments) is an example.
Quantomistro3178
@Quantomistro3178
Dec 23 2017 09:47
whats the best way to transform arguments into an array?
Markus Kiili
@Masd925
Dec 23 2017 09:48
@Quantomistro3178 In ES5, it is the line I just posted, or a simple for loop. In ES6 there are other (better) options.
Quantomistro3178
@Quantomistro3178
Dec 23 2017 09:49
@Masd925 Ok, got it. Thanks!
CamperBot
@camperbot
Dec 23 2017 09:49
quantomistro3178 sends brownie points to @masd925 :sparkles: :thumbsup: :sparkles:
:star2: 4624 | @masd925 |http://www.freecodecamp.org/masd925
Hammad
@newnewb
Dec 23 2017 09:51
guys, I wanna work on the leaderboard RXJS challenge... but the links are not working :worried:
Quantomistro3178
@Quantomistro3178
Dec 23 2017 09:55
Just wondering, is it possible to nest an image inside a <p> tag, or any of the header tags?
Nick Karnik
@theoutlander
Dec 23 2017 09:56
that should be fine
why would you want to render it in a header tag though ?
@newnewb you might want to file a bug
Shubham Sharma
@shubham1604
Dec 23 2017 10:12
@theoutlander I am using an API i dont have control of. What should I include in my request header
?
Nick Karnik
@theoutlander
Dec 23 2017 10:13
oh, when you said header tags, I thought you meand h1, h2, etc.
Shubham Sharma
@shubham1604
Dec 23 2017 10:13
@Quantomistro3178 You sure can in the <p> tag
Nick Karnik
@theoutlander
Dec 23 2017 10:13
Well, you fetch the img as one operation
Argh…confusing again with diff questions here
:D
@shubham1604 you probably need something like AccessControl: *
Shubham Sharma
@shubham1604
Dec 23 2017 10:14
$.ajax({method:"GET",url:'http://api.forismatic.com/api/1.0/method=getQuote&key=457653&format=jsonp&lang=en',headers:{
"Access-Control-Allow-Origin":"*",
'Content-Type':'application/x-www-form-urlencoded'
},success:function(){alert('hello');}});
this is the code i am using
@theoutlander
Nick Karnik
@theoutlander
Dec 23 2017 10:17
let me check
i’m not sure if that URL even works …
have you tried it via insomnia?
Shubham Sharma
@shubham1604
Dec 23 2017 10:21
Insomnia?
Nick Karnik
@theoutlander
Dec 23 2017 10:21
the CORS / JSONP stuff is for the browser
url should work through a rest client
so ensure it works there first
Shubham Sharma
@shubham1604
Dec 23 2017 10:23
ok lemme check
Quantomistro3178
@Quantomistro3178
Dec 23 2017 10:24
So if i can nest it inside a <p> tag, could I align the image using text-align on the <p> tag?
Nick Karnik
@theoutlander
Dec 23 2017 10:25
you can do anything you want
play with it in the dev tools
Quantomistro3178
@Quantomistro3178
Dec 23 2017 10:26
I was just wondering, in case I ever need to...
Nick Karnik
@theoutlander
Dec 23 2017 10:27
they’re all dom elements at the end of the day
you can make them do anything
they have default styles pretty much
that’s what distinguishes a paragraph from a div for instance
in most cases ...
Quantomistro3178
@Quantomistro3178
Dec 23 2017 10:29
but what I need to know is how to use the filter() function, because I need to pass the Seek & Destroy challenge which I've been holding off for weeks now.
It keeps saying TypeError: true is not a function (or false)
Nick Karnik
@theoutlander
Dec 23 2017 10:32
arr.filter(function(item) { return item.val == true})
look it up on mdn
Quantomistro3178
@Quantomistro3178
Dec 23 2017 10:34
MDN is difficult to understand.
If I try to write a function inside filter(), it keeps saying functions declared within loops referencing outer scoped variables may lead to confusing semantics
Nick Karnik
@theoutlander
Dec 23 2017 10:41
that’s true, you shouldn’t reference anything outside that function
Ramy
@ramynabil
Dec 23 2017 11:05
Hi guys! Could someone please explain why this pic isn’t being responsive? https://codepen.io/ramynabil/pen/YYpXzR
Daria Doronina
@Skidle
Dec 23 2017 11:08
hello everyone, I've got a question. Is it okay to take designs from behance for projects? Of course with attribution to the author. I mean, do I have to show my design skills (or rather lack of them) to potential employer in the portfolio if I want to get a JS job?
SakisBal
@SakisBal
Dec 23 2017 11:08
@ramy you should try removing the jumptron class and instead put everything inside rows and columns
Ramy
@ramynabil
Dec 23 2017 11:09
i tried that. not sure if i removed the jumbotron or not, but ill give it a shot
SakisBal
@SakisBal
Dec 23 2017 11:09
you can as well just remove jumbotron
and put row instead it kinda works as well
but i suggest putting everything inside a col and row system
@Skidle most people take designs from other people, its something that website designers do a lot , of course they give them then a personal touch they dont actual just copy the work
Ramy
@ramynabil
Dec 23 2017 11:12
one sec, ill see if that changes anything.
Daria Doronina
@Skidle
Dec 23 2017 11:14
@ramynabil it doesn't work cause you included bootstrap 4
and they use .img-fluid in 4 version
Ramy
@ramynabil
Dec 23 2017 11:14
ohhhh
lemme try that
@Skidle that did it :D thx a lot!
CamperBot
@camperbot
Dec 23 2017 11:15
ramynabil sends brownie points to @skidle :sparkles: :thumbsup: :sparkles:
:cookie: 316 | @skidle |http://www.freecodecamp.org/skidle
Daria Doronina
@Skidle
Dec 23 2017 11:17
@SakisBal thank you, I'll try and look up something
CamperBot
@camperbot
Dec 23 2017 11:17
skidle sends brownie points to @sakisbal :sparkles: :thumbsup: :sparkles:
api offline
Ramy
@ramynabil
Dec 23 2017 11:20
sure, tyt :smile:
Quantomistro3178
@Quantomistro3178
Dec 23 2017 11:25

function destroyer(arr) {
  // Remove all the values
  var d = [];
  for (var z=1;z<arguments.length; z++) {
    d.push(arguments[z]);
  }
  function remove(val) {
    for (var i=0;i<d.length; i++) {
    if (val === d[i]) {
      return false;
    }
      else {return true;}
    }
  }

return arr.filter(remove);
}

destroyer([1, 2, 3, 1, 2, 3], 2, 3);
Now, I know that the problem is that my remove function ends before running twice (or as long as d.length), but I can't figure out how to fix that...
I don't wanna hardcode it for 3 arguments either...
dinesh
@1532j0004kg
Dec 23 2017 11:57
i cant able to download mongo db ,,,
https://www.mongodb.com/download-center?jmp=nav#atlas this page is not loading anybody knows why?
if u can pls help me to download!
hensn5250
@hensn5250
Dec 23 2017 12:00
hello
Ramy
@ramynabil
Dec 23 2017 12:00
hi
hensn5250
@hensn5250
Dec 23 2017 12:01
Can i get some help with CSS? Anyone?
Ramy
@ramynabil
Dec 23 2017 12:01
ask your problem and ppl will help :)
Quantomistro3178
@Quantomistro3178
Dec 23 2017 12:02
could anyone help me with mine?
Ramy
@ramynabil
Dec 23 2017 12:02
Just post your problem, guys
fatiulikhaer
@fatiulikhaer
Dec 23 2017 12:02
Ask and people will render assistant
Quantomistro3178
@Quantomistro3178
Dec 23 2017 12:03
Already did, just scroll up a bit
hensn5250
@hensn5250
Dec 23 2017 12:03
@Quantomistro3178 Sure
what is the problem agian. Lazy scroller
Quantomistro3178
@Quantomistro3178
Dec 23 2017 12:03

```

function destroyer(arr) {
// Remove all the values
var d = [];
for (var z=1;z<arguments.length; z++) {
d.push(arguments[z]);
}
function remove(val) {
for (var i=0;i<d.length; i++) {
if (val === d[i]) {
return false;
}
else {return true;}
}
}

return arr.filter(remove);
}

destroyer([1, 2, 3, 1, 2, 3], 2, 3);

```

Now, I know that the problem is that my remove function ends before running twice (or as long as d.length), but I can't figure out how to fix that...

wait
hensn5250
@hensn5250
Dec 23 2017 12:04
What is your current result?
SakisBal
@SakisBal
Dec 23 2017 12:04
i didnt use any function they told me to use, do you want to see my way?
Quantomistro3178
@Quantomistro3178
Dec 23 2017 12:05
output is [1,3,1,3]
@SakisBal I wanna try to do it on my own first, then I'll have a look at others' solutions....I always try to do that
SakisBal
@SakisBal
Dec 23 2017 12:06
yeah thats good, i just think that it cant be solved with this approach because you will always be able to return just one value
hensn5250
@hensn5250
Dec 23 2017 12:06
if the arg is < arr > why is it not being used in the destroyer()???
SakisBal
@SakisBal
Dec 23 2017 12:06
i might be wrong however
dinesh
@1532j0004kg
Dec 23 2017 12:07
is mongodb supports 32 bit os ?
?
Quantomistro3178
@Quantomistro3178
Dec 23 2017 12:07
@hensn5250 It's at the last resturn statement.
@1532j0004kg The link you shared is working for me, so idk what the problem is on your end...
@SakisBal What approach did you use?
dinesh
@1532j0004kg
Dec 23 2017 12:09
32 bit os will supports or not? @Quantomistro3178
SakisBal
@SakisBal
Dec 23 2017 12:09
with 2 for statements nested
dinesh
@1532j0004kg
Dec 23 2017 12:09
for downloading mongodb
SakisBal
@SakisBal
Dec 23 2017 12:09
and without any additional function
Quantomistro3178
@Quantomistro3178
Dec 23 2017 12:10
@1532j0004kg That should be specified wherever you download it from, IF it needs to be specified. I'm not the best person to ask though...
dinesh
@1532j0004kg
Dec 23 2017 12:10
ok
Quantomistro3178
@Quantomistro3178
Dec 23 2017 12:10
@SakisBal I tried the 2 for loops approach, but how did you remove the values from arr? That's the bit im having trouble with.
other than filter(), of course
SakisBal
@SakisBal
Dec 23 2017 12:11
i didnt use filter
i just said delete newArray[j]
well i gotta post the code here
Quantomistro3178
@Quantomistro3178
Dec 23 2017 12:12
wait
SakisBal
@SakisBal
Dec 23 2017 12:13
kk
Quantomistro3178
@Quantomistro3178
Dec 23 2017 12:13
whats delete? A new keyword?
SakisBal
@SakisBal
Dec 23 2017 12:13
yeah
you delete elements
with that from an array
hensn5250
@hensn5250
Dec 23 2017 12:13
@Quantomistro3178 can you link the page for the problem
so the arguments are an array, a number, another number?
wait...
how to i even share the link
yeah, that one
SakisBal
@SakisBal
Dec 23 2017 12:16
yea but you cant see my code like this
hensn5250
@hensn5250
Dec 23 2017 12:16
got it
will give it a go
SakisBal
@SakisBal
Dec 23 2017 12:17
i sent it privately
Quantomistro3178
@Quantomistro3178
Dec 23 2017 12:24
@hensn5250 Its okay, I got it!
hensn5250
@hensn5250
Dec 23 2017 12:26
oh ok, the basic premise was
//filter arg1 for arg 2 and 3
//assign above filter as value of arg1
//return arg1
did you use the above logic?
or something else
Shubham Sharma
@shubham1604
Dec 23 2017 12:43
Hey. Has anyone here used the mashape api for the random quote machine ?
hensn5250
@hensn5250
Dec 23 2017 12:46
No. I believe you have to register for it
there are other free quote api's
Shubham Sharma
@shubham1604
Dec 23 2017 12:47
The forismatic api doesn't work
that's what i used
works with codepen (https)
Quantomistro3178
@Quantomistro3178
Dec 23 2017 12:50
@hensn5250 I nested a for loop inside another for loop and used delete to remove the values, and then filtered out the null values
Shubham Sharma
@shubham1604
Dec 23 2017 12:51
What do you mean it works with codepen ?
Quantomistro3178
@Quantomistro3178
Dec 23 2017 12:51

function destroyer(arr) {
  // Remove all the values
  var d = [];
  for (var z=1;z<arguments.length; z++) {
    d.push(arguments[z]);
  }

    for (var i=0;i<d.length; i++) {
    for (var x=0;x<arr.length;x++) {
      if (arr[x] === d[i]) {
        delete arr[x];
    }}
    }
  function clear(val) {
    return val !== null;
  }
return arr.filter(clear);
}

destroyer([1, 2, 3, 1, 2, 3], 2, 3);
Here
Shubham Sharma
@shubham1604
Dec 23 2017 12:51
Isn't it normal that any API works with codepen?
Stephen James
@sjames1958gm
Dec 23 2017 12:53
@shubham1604 Since codepen is https it won't work with any http APIs
Shubham Sharma
@shubham1604
Dec 23 2017 12:55
Ohh Okay
Cross domain thing right ?
Stephen James
@sjames1958gm
Dec 23 2017 12:56
No, in this case just insecure domain from secure domain.
Ken Haduch
@khaduch
Dec 23 2017 12:56
Cross domain and secure vs insecure transfers
You run into both frequently
hensn5250
@hensn5250
Dec 23 2017 12:58
@shubham1604 yes
Stephen James
@sjames1958gm
Dec 23 2017 12:59
I have gotten forismatic to work with jsonp
$(document).ready(function() {
  var req = $.ajax({
    url:
      "https://api.forismatic.com/api/1.0/?method=getQuote&key=457653&format=jsonp&lang=en&jsonp=?",
    accepts: {
      jsonp: "application/json"
    },
    dataType: "jsonp"
  });

  req.done(function(data) {
    document.querySelector("#p").textContent = JSON.stringify(data);
  });
});
Shubham Sharma
@shubham1604
Dec 23 2017 13:00
I couldn't understand from the documenting
Documentation*
hensn5250
@hensn5250
Dec 23 2017 13:01
//for making AJAX request
let requestObj = new Request(URL, {
method: "GET",
headers: headersObj,
mode: "cors",
origin: "https://codepen.io/USER-NAME/pen/PAGE-NAME"
});
Shubham Sharma
@shubham1604
Dec 23 2017 13:01
About how the forismatic and mashape works
Stephen James
@sjames1958gm
Dec 23 2017 13:01
It took me a couple of tries, I saved this code in codepen so I could pull it up
Shubham Sharma
@shubham1604
Dec 23 2017 13:02
Is is just me or anyone else who could not figure out how to use the apis even after reading everything?
hensn5250
@hensn5250
Dec 23 2017 13:02
@shubham1604 i used the code i posted on with quotes on design api
Shubham Sharma
@shubham1604
Dec 23 2017 13:03
Okay
hensn5250
@hensn5250
Dec 23 2017 13:03
@shubham1604 its confusing at first but once you use one API they all kinda seem similar afterwards
the structure of them
Shubham Sharma
@shubham1604
Dec 23 2017 13:04
Well, thats relaxing. I spent the entire day exploring different APIs
Couldn't get any of them to work
At last i saw the code from codeine
Codeine
Codepen*
The mashape api doesn't have the code sample for JQUERY or JS
So I had no idea what to do
Plus I ran into cross domain issues
Stephen James
@sjames1958gm
Dec 23 2017 13:07
@shubham1604 API challenges are like learning to swim by jumping in the deep end
hensn5250
@hensn5250
Dec 23 2017 13:07
Well for the quote machine you can also use another pen as your Psedo server and keep the JSON data( your quotes) in it and then make the AJAX requests within the codepen site
that way you accomplish the task of making AJAX request but not have no worry about API keys and CORS issues
Shubham Sharma
@shubham1604
Dec 23 2017 13:10
I think I am gonna create a much simpler version of random quote api for new folks so they dont get stuck just like i did.
hensn5250
@hensn5250
Dec 23 2017 13:10
the QuotesOnDesign api is pretty simple
Shubham Sharma
@shubham1604
Dec 23 2017 13:10
That's a great idea @hensn5250
hensn5250
@hensn5250
Dec 23 2017 13:10
its just on url in your code
the rest is making the request
which i posted above
its just 1 url*
Shubham Sharma
@shubham1604
Dec 23 2017 13:12
The url is same as given on their site ?
that's it
//for making AJAX request
let requestObj = new Request(PUT_URL_HERE, {
method: "GET",
headers: headersObj,
mode: "cors",
origin: "https://codepen.io/USER-NAME/pen/PAGE-NAME"
});
Shubham Sharma
@shubham1604
Dec 23 2017 13:13
Well, thats the same as given on their site
Great
hensn5250
@hensn5250
Dec 23 2017 13:14
but you have to edit the url to your desired needs
Shubham Sharma
@shubham1604
Dec 23 2017 13:14
Okay
Thanks for helping me mate
hensn5250
@hensn5250
Dec 23 2017 13:15
no prob
Shubham Sharma
@shubham1604
Dec 23 2017 13:15
I owe you one 😉
hensn5250
@hensn5250
Dec 23 2017 13:19
almost forgot. in case you run into issues with codepen
ismail
@ismail2009
Dec 23 2017 13:45
hi everyone
I want some help in css
hensn5250
@hensn5250
Dec 23 2017 13:50
sure
whats the problem
Quantomistro3178
@Quantomistro3178
Dec 23 2017 13:57
var b = /[A-Z]/;
Is this the correct RegExp for all captial alphabets?
capital*
hensn5250
@hensn5250
Dec 23 2017 14:10
yes
Quantomistro3178
@Quantomistro3178
Dec 23 2017 14:11
@hensn5250 thnx
CamperBot
@camperbot
Dec 23 2017 14:11
:cookie: 282 | @hensn5250 |http://www.freecodecamp.org/hensn5250
quantomistro3178 sends brownie points to @hensn5250 :sparkles: :thumbsup: :sparkles:
imemoje
@imemoje
Dec 23 2017 21:33
hello

can someone help me with one line of css in this example

<!DOCTYPE html>

<html>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<style>
body {margin:0;}

.icon-bar {
width: 100%;
background-color: #555;
overflow: auto;
}

.icon-bar a {
float: left;
width: 20%;
text-align: center;
padding: 12px 0;
transition: all 0.3s ease;
color: white;
font-size: 36px;
}

.icon-bar a:hover {
background-color: #000;
}

.active {
background-color: #4CAF50 !important;
}
</style>
<body>

<div class="icon-bar">
<a class="active" href="#"><i class="fa fa-home"></i></a>
<a href="#"><i class="fa fa-search"></i></a>
<a href="#"><i class="fa fa-envelope"></i></a>
<a href="#"><i class="fa fa-globe"></i></a>
<a href="#"><i class="fa fa-trash"></i></a>
</div>

</body>
</html>

i do not understand how overflow in this example works? if i remove that line it wont work, when i add that line it is all ok?

imemoje
@imemoje
Dec 23 2017 21:39

final product is horizontal menu and I understand everything except

overflow: auto;

why without that line wont work?

anyone?
Aditya
@ezioda004
Dec 23 2017 22:06
@imemoje Because the height of the <div> containing all of the icons is 0, so even though the icons are still there due to lack of background color and no overflow, they don't appear. overflow: auto in this case is making their heights equal and giving the icons appropriate background color from the div and they become visible again.
imemoje
@imemoje
Dec 23 2017 22:18
@ezioda004 I do not understand how overflow make their heights equal and appropriate color? i have problems with concept of overflow. I taught that overflow is for something else?
0nly169
@0nly169
Dec 23 2017 22:18

Hi guys having issues with media queries not working i want to give a <p> a margin of 3% on larger screen sizes .... tried everything been stuck for 4/5 days :( @media all and (min-width: 800px) {

.paragraph3 {
margin-top: 8%;

}

}

Dan Lafferty
@DanLaff
Dec 23 2017 22:33
@0nly169 That CSS gives a top margin of 8% on screens wider than 800px. Perhaps you have a typo in your HTML? Share your full project.