These are chat archives for FreeCodeCamp/HelpFrontEnd

3rd
Mar 2018
Adam Bohannon
@abohannon
Mar 03 2018 00:58
I figured it out for anyone who might find it helpful. Had to explicitly set a min-width property on the column container.
Nate Mallison
@NJM8
Mar 03 2018 02:35
anyone have experience with images on github pages? I have read that you are supposed to supply the image url with the url to the image file (github/image/whatever), but I have a site that just has it in the project directory and it works fine. Well I have another page with the same structure and the image doesn't load.
Eric Weiss
@eweiss17
Mar 03 2018 02:37
recheck you have the right directory
Nate Mallison
@NJM8
Mar 03 2018 02:38
No, I mean I have a page loading the image with no path specified and it works, but you aren't supposed to be able to do that on github pages. I can't figure out how to do it again
Gulsvi
@gulsvi
Mar 03 2018 02:39
@NJM8 It's hard to help without more details. The image needs to be in a gh-pages branch or a subdirectory of your <username>.github.io repository
Otherwise, you can use rawgit to get a hostable link to the file: https://rawgit.com/
Sometimes, it just takes a while for the image to propagate - in my experience though, never more than 10 minutes or so
Images can't load without a path specified, but happy to take a closer look if you want to point to the repo
Check out the image source for the background in the css
in the random quote generator I have the image src just as the image name, because it's in the same directory, same as normal hosting
but in the thank you page I have to specify the whole url, it wouldn't work with just the name
Nate Mallison
@NJM8
Mar 03 2018 02:51
ahhhhhhh myyyyy gooood. On my portfolio page I made the email link a mailto: link until I got an email form working. I keep loading the wrong version of the website and opening mac mail. I should just delete that app
Eric Weiss
@eweiss17
Mar 03 2018 02:52
i'v done mailing in php
Nate Mallison
@NJM8
Mar 03 2018 02:52
I used a mailing service. no php on github pages
super easy, just send a post request to their website with your email address and it sends whatever was in the form to you
HerbiScript
@HerbiScript
Mar 03 2018 02:54
'''
$(document).ready(function(){
var url = "https://fcc-weather-api.glitch.me/api/current?";
var api;
if (navigator.geolocation){
navigator.geolocation.getCurrentPosition(function(pos){
api = url + "lat=" + pos.coords.latitude + "&" + "lon=" + pos.coords.longitude;
$.getJSON(api, (function(data){
$("#loc").html(data.name + ", " + data.sys.country);
$("#temp").html(data.main.temp + "<button id='C' class='btn btn-default'><b>C</b></button>");
$("img").attr("src", "http://openweathermap.org/img/w/" + setIcon(data.weather[0].id) + ".png");
function setIcon(num){
if (200 <= num && num <= 232){
return "11d";
} else if ((300 <= num && num <= 321) || (520 <= num && num <= 531)){
return "09d";
} else if (500 <= num && num <= 504){
return "10d";
} else if (num == 511 || 600 <= num && num <= 622){
return "13d";
} else if (num == 800){
return "01d";
} else if (num == 801){
return "02d";
} else if (num == 802){
return "03d";
} else if (num == 803 || num == 804){
return "04d";
} else {
return "01d";
}
}
}));
});
}
$(".btn").css("color", "orange");
});
'''
CamperBot
@camperbot
Mar 03 2018 02:54
:bulb: to format code use backticks! ``` more info
HerbiScript
@HerbiScript
Mar 03 2018 02:55
$(document).ready(function(){
  var url = "https://fcc-weather-api.glitch.me/api/current?";
  var api;
  if (navigator.geolocation){
    navigator.geolocation.getCurrentPosition(function(pos){
      api = url + "lat=" + pos.coords.latitude + "&" + "lon=" + pos.coords.longitude;
      $.getJSON(api, (function(data){
        $("#loc").html(data.name + ", " + data.sys.country);
        $("#temp").html(data.main.temp + "<button id='C' class='btn btn-default'><b>C</b></button>");
        $("img").attr("src", "http://openweathermap.org/img/w/" + setIcon(data.weather[0].id) + ".png");
        function setIcon(num){
          if (200 <= num && num <= 232){
            return "11d";
          } else if ((300 <= num && num <= 321) || (520 <= num && num <= 531)){
            return "09d";
          } else if (500 <= num && num <= 504){
            return "10d";
          } else if (num == 511 || 600 <= num && num <= 622){
            return "13d";
          } else if (num == 800){
            return "01d";
          } else if (num == 801){
            return "02d";
          } else if (num == 802){
            return "03d";
          } else if (num == 803 || num == 804){
            return "04d";
          } else {
            return "01d";
          }
        }
          }));
     });
   }
  $(".btn").css("color", "orange");
});
Why is my final jQuery statement not effecting the button after it is created in the initial function?
Nate Mallison
@NJM8
Mar 03 2018 02:55
@HerbiScript backticks not single quotes, probably the tilde button, top left corner of keyboard
ah got it
HerbiScript
@HerbiScript
Mar 03 2018 02:56
My bad, thanks! @NJM8
CamperBot
@camperbot
Mar 03 2018 02:56
herbiscript sends brownie points to @njm8 :sparkles: :thumbsup: :sparkles:
:cookie: 316 | @njm8 |http://www.freecodecamp.org/njm8
Nate Mallison
@NJM8
Mar 03 2018 02:56
getJson is asynchronous
so it sends the request, you get the response from weather api, THEN it creates the button. but that all happens inside the getjson call
The response can take some time.so what the browser sees is
var url
var api
getJson
make button orange
receive json
make button
HerbiScript
@HerbiScript
Mar 03 2018 02:59
ahh I see
Nate Mallison
@NJM8
Mar 03 2018 02:59
does that make sense?
HerbiScript
@HerbiScript
Mar 03 2018 02:59
So youre saying I need to mess with the button inside of the getJSON call?
Eric Weiss
@eweiss17
Mar 03 2018 02:59
well you need to 100% make sure it is created before you can mess with it
Nate Mallison
@NJM8
Mar 03 2018 03:00
Nope, change it after the call!
HerbiScript
@HerbiScript
Mar 03 2018 03:00
It is made, I have everything working fine. My last user story I need to add is the button that transfers it to Fahrenheit and vic versa
Nate Mallison
@NJM8
Mar 03 2018 03:00
checkout .done() about halfway down the page
Eric Weiss
@eweiss17
Mar 03 2018 03:01
make an event if the button is clicked?
Nate Mallison
@NJM8
Mar 03 2018 03:03
so you'll do
$getJson(
  getMyInfo)
.done(
  gotMyInfo so I can use it);
more or less
that may not work if you copy it. :smile:
HerbiScript
@HerbiScript
Mar 03 2018 03:04
hmm ok I think I see what you're getting at. I'll be back if I can't figure it out with all the new info. Thanks for the guidance @NJM8 and @eweiss17 : )
CamperBot
@camperbot
Mar 03 2018 03:04
herbiscript sends brownie points to @njm8 and @eweiss17 :sparkles: :thumbsup: :sparkles:
api offline
:cookie: 613 | @eweiss17 |http://www.freecodecamp.org/eweiss17
Eric Weiss
@eweiss17
Mar 03 2018 03:05
look here
that is what he was talking about with .done
Nate Mallison
@NJM8
Mar 03 2018 03:08
man I got gipped on some points
lol
Eric Weiss
@eweiss17
Mar 03 2018 03:10
how good you are as a dev is proportional to how many points you have
Nate Mallison
@NJM8
Mar 03 2018 03:13
:worried: I have a ways to go
Eric Weiss
@eweiss17
Mar 03 2018 03:13
there are people in the main fcc channel that have like 2k-3k points
Ravishasthri
@ravi6112
Mar 03 2018 06:54

function getLength(str) {
"use strict";

// change code below this line
var leng = {length:str.length};
const {length:len} =leng ;
// change this
// change code above this line

return len; // you must assign length to len in line

}

console.log(getLength('FreeCodeCamp'));

what is the wrong in this code
its not working

function getLength(str) {
"use strict";

// change code below this line
var leng = {length:str.length};
const {length:len} =leng ;
// change this
// change code above this line

return len; // you must assign length to len in line

}

console.log(getLength('FreeCodeCamp'));

ES6: Use Destructuring Assignment to Assign Variables from Objects
Aditya
@ezioda004
Mar 03 2018 07:49
@ravi6112 You dont need another variable, the expression on RHS is treated as an object, so you can just do const {length:len} = str; which will evaluate to const len = str.length
krckyboy
@krckyboy
Mar 03 2018 09:42
I need to find photos of specific car models. Any suggestions for source of free photos of those kind?
h1tag
@h1tag
Mar 03 2018 10:09
@krckyboy try pixabay
grelon
@grelon
Mar 03 2018 11:55

Hi all, I'm having trouble positioning divs within a flex container. I want the two divs on top of each other, but they keep appearing inline. Can anyone tell my why, and how I can fix it?

My codepen

what I want:
. . .
. i .
. l .
. . .

what I currently have:
. . . .
. i l .
. . . .

If anything is unclear about my question, please ask to clarify.

Teo
@Teo03
Mar 03 2018 11:58
Can someone take a look here: https://github.com/Teo03/game_of_life .
I'am getting this error: Uncaught TypeError: Cannot read property 'grid' of undefined Please help!
Stephen James
@sjames1958gm
Mar 03 2018 12:13
@Teo03 Do you have a line number where that error is produced?
@Teo03 If it is in your select function - then it is probably because your variable is wrong.
@Teo03 <Grid grid = {this.state.grid} cols = {this.cols} rows = {this.rows} select={this.select.bind(this)}/>
mustimuu
@mustimuu
Mar 03 2018 12:18
Hello guys

How do i create a child theme on a wordpress theme?

If the developer sends a update everything will be deleted

Suyash
@pstrings
Mar 03 2018 12:21
Why the text coming below the image and not side by side?
<div class = "row">
<div class = "col-xs-6">
<div class = "well" id = "left-well">
<img class = "center" src = "https://cdn.europosters.eu/image/750/posters/michael-jackson-king-of-pop-i11251.jpg" alt = "King of Pop">
</div>
</div>
<div class = "col-xs-6">
<div class = "well" id = "right-well">
<p class = "text-center">Michael Joseph Jackson (August 29, 1958 – June 25, 2009) was an American singer, songwriter, actor, philanthropist, and dancer. Dubbed the "King of Pop", he was one of the most popular entertainers in the world, and was the best-selling music artist during the year of his death</p>
This message was deleted
Stephen James
@sjames1958gm
Mar 03 2018 12:22
@grelon Try using
flex-direction: column;
@pstrings Do you have a link to this ?
grelon
@grelon
Mar 03 2018 12:24
@sjames1958gm Thanks man! Totally worked. I'll start researching why now :p
CamperBot
@camperbot
Mar 03 2018 12:24
grelon sends brownie points to @sjames1958gm :sparkles: :thumbsup: :sparkles:
:star2: 9053 | @sjames1958gm |http://www.freecodecamp.org/sjames1958gm
Stephen James
@sjames1958gm
Mar 03 2018 12:25
@grelon :+1:
Ken Haduch
@khaduch
Mar 03 2018 12:29
@pstrings - are you loading bootstrap.css in your code?
Suyash
@pstrings
Mar 03 2018 12:30
yes?
wdym?
I've added bootstrap 4 in css
@khaduch
Stephen James
@sjames1958gm
Mar 03 2018 12:31
@pstrings You are using bootstrap 3 column indicators in boot strap 4 it is col-6 not col-xs-6
Suyash
@pstrings
Mar 03 2018 12:32
Oh so bootstrap 3 and bootstrap 4 have different column indicators?
Stephen James
@sjames1958gm
Mar 03 2018 12:33
@pstrings yes
Suyash
@pstrings
Mar 03 2018 12:33
So they taught bootstrap 3 in freecodecamp
Stephen James
@sjames1958gm
Mar 03 2018 12:34
https://getbootstrap.com/docs/4.0/layout/grid/ there are breakpoint indicators, but they are different
Suyash
@pstrings
Mar 03 2018 12:34
Thanks it is working now!
btw which one is better b4 or b3? By version b4 should be better
Ken Haduch
@khaduch
Mar 03 2018 12:36
@pstrings - bootstrap 4 has not been finalized, still in beta. It’s hard to make lessons based on something that is still changing.
Suyash
@pstrings
Mar 03 2018 12:37
yeah ig
LydaTech
@lydatech
Mar 03 2018 12:37
no bs4 is finalized
Ken Haduch
@khaduch
Mar 03 2018 12:37
You can use 4, but you have to rely on the online documents for the correct info
Suyash
@pstrings
Mar 03 2018 12:37
so there's going to be an update in bootstrap lesson in the future?
LydaTech
@lydatech
Mar 03 2018 12:37
in fcc beta
Ken Haduch
@khaduch
Mar 03 2018 12:38
Oh it is? I haven’t kept up, thanks @lydatech - but I’m sure that the lessons will take a while to change...
CamperBot
@camperbot
Mar 03 2018 12:38
khaduch sends brownie points to @lydatech :sparkles: :thumbsup: :sparkles:
:star2: 2675 | @lydatech |http://www.freecodecamp.org/lydatech
Ken Haduch
@khaduch
Mar 03 2018 12:38
good, I haven’t checked the beta site either... :)
Stephen James
@sjames1958gm
Mar 03 2018 12:39
@pstrings If you want to create your own new things BS 4 is probably better, but realize if you end up in the industry that
BS 3 is probably going to be prevelant for a while yet.
Suyash
@pstrings
Mar 03 2018 12:39
Thanks for the info guys!
@sjames1958gm so you can create your own stuffs in bs 4? That's pretty good
Stephen James
@sjames1958gm
Mar 03 2018 13:12
@pstrings sure you can
mustimuu
@mustimuu
Mar 03 2018 13:24
can someone help me
im trying to create a child theme, but it doesent appear under my themes in wordpress
mustimuu
@mustimuu
Mar 03 2018 13:33
can someone help me out?
alpox
@alpox
Mar 03 2018 13:47
@mustimuu I don't think that many people here work with wordpress. But you might have some luck :)
Ken Haduch
@khaduch
Mar 03 2018 13:53
@mustimuu - I haven't done that, but I'm looking at this page https://optimizerwp.com/wordpress-child-theme/ - it has step-by-step instructions, but you might already have done something like this? They mention a step Step 5: Now Zip the folder and upload it via Appearance -> Themes -> Add New - looks like that should add it, then you activate it? (I'm also looking at my wordpress.com site, I see the menu for doing this but have no examples.) Actually, I don't see the "Add New" - maybe there is more to it than this. They also mention plugins to do this kind of thing?
Ken Haduch
@khaduch
Mar 03 2018 14:01

@mustimuu - probably better documentation https://codex.wordpress.org/Child_Themes at the wordpress site... They have a note there:

Note: You may need to re-save your menu (Appearance > Menus, or Appearance > Customize > Menus) and theme options (including background and header images) after activating the child theme.

Anyway, very detailed information there, if you have not gone through it? Hope that it helps...

mustimuu
@mustimuu
Mar 03 2018 14:04
i allready did
ahhhhhhhhh
zip folder
let me try with the zip folder then
LydaTech
@lydatech
Mar 03 2018 14:19
@mustimuu i work with WP
mustimuu
@mustimuu
Mar 03 2018 14:20
@lydatech i made a child theme with a plugin, but its not the same
for me i like my stylesheet and functions.php a folder but let go
LydaTech
@lydatech
Mar 03 2018 14:21
you need style.css in the child folder and need to edit the header of the css pointing to the parent
mustimuu
@mustimuu
Mar 03 2018 14:21
i did
i can try again if you have time
can you hang on?
LydaTech
@lydatech
Mar 03 2018 14:22
/*
 Theme Name:   Twenty Fifteen Child
 Theme URI:    http://example.com/twenty-fifteen-child/
 Description:  Twenty Fifteen Child Theme
 Author:       John Doe
 Author URI:   http://example.com
 Template:     twentyfifteen
 Version:      1.0.0
 License:      GNU General Public License v2 or later
 License URI:  http://www.gnu.org/licenses/gpl-2.0.html
 Tags:         light, dark, two-columns, right-sidebar, responsive-layout, accessibility-ready
 Text Domain:  twenty-fifteen-child
*/

A couple things to note:

    You will need to replace the example text with the details relevant to your theme.
    The Template line corresponds to the directory name of the parent theme. The parent theme in our example is the Twenty Fifteen theme, so the Template will be twentyfifteen. You may be working with a different theme, so adjust accordingly.
mustimuu
@mustimuu
Mar 03 2018 14:22
i used this example
but i maybe replaced with some wrong tuff
information*
hang on
do i create a folder under theme og under the parent theme?
LydaTech
@lydatech
Mar 03 2018 14:24
under theme not in parent
mustimuu
@mustimuu
Mar 03 2018 14:24
hang on sir
image.png
i created a child theme. twentyfifteen-child
LydaTech
@lydatech
Mar 03 2018 14:26
@mustimuu does the parent exist?
mustimuu
@mustimuu
Mar 03 2018 14:26
so what do i insert
yes
its in the theme folder
LydaTech
@lydatech
Mar 03 2018 14:27
looks right
copy screenshot.png from the parent and place it in the child
mustimuu
@mustimuu
Mar 03 2018 14:31
So annoying
nvm i created a child in wordpress
with a plugin
not gonna waste more time
LydaTech
@lydatech
Mar 03 2018 14:33
??? @mustimuu
mustimuu
@mustimuu
Mar 03 2018 14:33
@lydatech
LydaTech
@lydatech
Mar 03 2018 14:33
did you activate it?
mustimuu
@mustimuu
Mar 03 2018 14:33
@lydatech i used a plugin to create a child theme
not manually
im gonna take a look tomorrow, gotta put a website up
LydaTech
@lydatech
Mar 03 2018 14:34
once you create it you need to activate the child
mustimuu
@mustimuu
Mar 03 2018 14:34
manually it didnt pop up under my themes
in wordpress
the child-theme
LydaTech
@lydatech
Mar 03 2018 14:35
take a snapshot of your themes directory
mustimuu
@mustimuu
Mar 03 2018 14:35
sec
image.png
LydaTech
@lydatech
Mar 03 2018 14:36
@mustimuu no your directory. Not in your editor
mustimuu
@mustimuu
Mar 03 2018 14:37
in cyberduck?
or the wp folder itself
LydaTech
@lydatech
Mar 03 2018 14:39
Capture.PNG
mustimuu
@mustimuu
Mar 03 2018 14:39
ksec
image.png
image.png
LydaTech
@lydatech
Mar 03 2018 14:40
@mustimuu you have a typo in your css. The name of your child theme
mustimuu
@mustimuu
Mar 03 2018 14:41
typo?
yes this one -
where?
lol cant see the typo
LydaTech
@lydatech
Mar 03 2018 14:44
in your directory it says twentyfifteen-child in your css it says twenty-fifteen-child
mustimuu
@mustimuu
Mar 03 2018 14:44
still same result
same result
LydaTech
@lydatech
Mar 03 2018 14:46
one second
mustimuu
@mustimuu
Mar 03 2018 14:46
image.png
Ivan Ngundela
@ingundela
Mar 03 2018 14:50
hello everyone.. may you please help fixing the bug I have with the hero slide image in this project https://ingundela.github.io/fore/ , when sliding it down to a device screen size the slide image move up and I’m not getting the full hight as I have it with a normal screen
LydaTech
@lydatech
Mar 03 2018 14:55
Capture.PNG
mustimuu
@mustimuu
Mar 03 2018 14:56
@lydatech what did you do?
LydaTech
@lydatech
Mar 03 2018 14:56
Capture.PNG
/*
 Theme Name:   Twenty Fifteen Child
 Theme URI:    http://example.dev/twenty-fifteen-child/
 Description:  Twenty Fifteen Child Theme
 Author:       John Doe
 Author URI:   http://example.dev
 Template:     twentyfifteen
 Version:      1.0.0
 License:      GNU General Public License v2 or later
 License URI:  http://www.gnu.org/licenses/gpl-2.0.html
 Tags:         light, dark, two-columns, right-sidebar, responsive-layout, accessibility-ready
 Text Domain:  twenty-fifteen-child
*/
```
mustimuu
@mustimuu
Mar 03 2018 14:57
whats that png file
LydaTech
@lydatech
Mar 03 2018 14:57
i did a local install of wp
i went into the themes folder and created a folder twenty-fifteen-child
i added style.css to the folder
i copied screenshot.png from the twentyfifteen parent into the folder
i went into word press themes
done
mustimuu
@mustimuu
Mar 03 2018 14:59
is the screenshot.png
in the parent
LydaTech
@lydatech
Mar 03 2018 14:59
yes i told you above to copy it from the parent
mustimuu
@mustimuu
Mar 03 2018 15:00
i just did
maybe its the theme URI
i did wrong
still same result
man
ec
sec
so annoying
nvm
LydaTech
@lydatech
Mar 03 2018 15:03
whats the url to your site?
mustimuu
@mustimuu
Mar 03 2018 15:03
my domain?
or the wordpress site
LydaTech
@lydatech
Mar 03 2018 15:04
@mustimuu add me as an admin and pm me the login
mustimuu
@mustimuu
Mar 03 2018 15:04
k sec
LydaTech
@lydatech
Mar 03 2018 15:10
@mustimuu ?
James Bream
@JamesBream
Mar 03 2018 15:15
const buildList = data => {
    data.forEach(user => {
      const { id, name } = user;
    })
};
In this code, can someone tell me if I'm right in thinking that const { id, name } = user is creating two variables, id and name, with the values contained in user.id and user.name respectively? i.e. it's just shorthand for const id = user.id?
Where data is just a bunch of json data
LydaTech
@lydatech
Mar 03 2018 15:19
@mustimuu what are you doing?
Riadh
@KWFE
Mar 03 2018 15:19
hey guys i need someone to help me with this project
rtl.png
when i tried to translate it into my language which is arabic
i used a global rtl tag to do that
but still have problem with answers are hidden with the checkbox
Ken Haduch
@khaduch
Mar 03 2018 15:38
@KWFE - do you have your project in a place where it can be easily run, like a CodePen pen?
@JamesBream - yes, you are correct. That should be creating two variables id and name, and copying the values from your user object. Check to see ( use console.log(user) within your .forEach loop) to see if user is getting the values that you are expecting.
Riadh
@KWFE
Mar 03 2018 15:55
@khaduch tbh its just in github
Darren
@DarrenfJ
Mar 03 2018 16:49
morning fCC.. how goes the code?
:wave: @khaduch
coderNewby
@coderNewby
Mar 03 2018 16:50
morning
Darren
@DarrenfJ
Mar 03 2018 16:50
@coderNewby hey buddy! how goes it?
coderNewby
@coderNewby
Mar 03 2018 16:50
still learning
slowly
Darren
@DarrenfJ
Mar 03 2018 16:51
yah i hear yah :D
Ken Haduch
@khaduch
Mar 03 2018 16:55
@DarrenfJ :wave: - how are things with you?
Darren
@DarrenfJ
Mar 03 2018 16:56
:D goodGood.. about to go run and do podcasts...
my usual weeeknd thang
you?
Ken Haduch
@khaduch
Mar 03 2018 16:57
@DarrenfJ - just sitting here checking out chats, trying to clear some email, having a slow day... enjoy the day!
Darren
@DarrenfJ
Mar 03 2018 16:57
i hear yah :D
off for podcasts and :tea: :D
have a good one everyone and code on!
coderNewby
@coderNewby
Mar 03 2018 16:59
you too thanks @DarrenfJ have fun
CamperBot
@camperbot
Mar 03 2018 16:59
codernewby sends brownie points to @darrenfj :sparkles: :thumbsup: :sparkles:
:star2: 2411 | @darrenfj |http://www.freecodecamp.org/darrenfj
coderNewby
@coderNewby
Mar 03 2018 16:59
I'm up to the bootstrap stuff now
Darren
@DarrenfJ
Mar 03 2018 16:59
cool! happy hunting ;)
later @khaduch brutha have a good weekend day :D
Ken Haduch
@khaduch
Mar 03 2018 17:02
@DarrenfJ - thanks, you too!
CamperBot
@camperbot
Mar 03 2018 17:02
khaduch sends brownie points to @darrenfj :sparkles: :thumbsup: :sparkles:
:star2: 2412 | @darrenfj |http://www.freecodecamp.org/darrenfj
Riadh
@KWFE
Mar 03 2018 17:03
@khaduch did you check the links !
Ken Haduch
@khaduch
Mar 03 2018 17:06
@KWFE - do you mean your github links, or did you send something else?
Teo
@Teo03
Mar 03 2018 17:07
@sjames1958gm Here is the full error: Life.js:29 Uncaught TypeError: Cannot read property 'grid' of undefined at start (Life.js:29)
Teo
@Teo03
Mar 03 2018 17:19
@sjames1958gm Nevermind I fixed it
Riadh
@KWFE
Mar 03 2018 17:23
@khaduch yes the github link
Stephen James
@sjames1958gm
Mar 03 2018 17:29
@Teo03 :+1:
Ken Haduch
@khaduch
Mar 03 2018 18:34
@KWFE - I haven't gotten an in-depth look at the github, too many pieces to put together! I might try to download it and run it locally and see what it looks like as a functioning webpage?
Ken Haduch
@khaduch
Mar 03 2018 19:24
@KWFE - well, I downloaded the github repo and ran it in my local browser. It seems to work just fine. I don't think that it has any of your attempted modifications in it - so how could I see those? I saw a fully functioning English-language based version of the site.
matty001
@matty001
Mar 03 2018 20:35
Hey guys, I have a quick question. Does adding custom fonts to a website slow down it's loading time?
Brad
@bradtaniguchi
Mar 03 2018 20:37
@matty001 Yes, most popular fonts (like roboto from google) are cached by browsers. So if you have a custom one the browser will need to download it. This isn't critical if you provide a backup font, the website will load properly (afik they load async to the page)
matty001
@matty001
Mar 03 2018 20:40
@bradtaniguchi I am planning to use 2 different custom fonts for an important header but I don't think they are popular therefore are less likely to be cached. I know little things add up for loading time which is really important so would it be a bad idea?
Brad
@bradtaniguchi
Mar 03 2018 20:42
@matty001 Depends how important loading time is for you, there are ways around this. (I did a little googling) you can load the font async, so your page will load just as fast, but the fonts will be applied after they are downloaded
So you might see the fonts applied later, but the performance will be basically the same
matty001
@matty001
Mar 03 2018 20:43
@bradtaniguchi thanks for the help so far one more question, would it be even worse for loading time if I just put it in as an image?
CamperBot
@camperbot
Mar 03 2018 20:43
matty001 sends brownie points to @bradtaniguchi :sparkles: :thumbsup: :sparkles:
:cookie: 406 | @bradtaniguchi |http://www.freecodecamp.org/bradtaniguchi
Brad
@bradtaniguchi
Mar 03 2018 20:45
@matty001 Np, and depending on how large your image is probably. Idk the comparison between a font library and an image though honestly. Again there are ways around this to load the image async to keep the page loading fast, but that might be too much work for minimal gain.
Obviously if your image is high res it will be worse.
matty001
@matty001
Mar 03 2018 20:47
@bradtaniguchi thanks again, I guess i'll just try out both and see the best results
CamperBot
@camperbot
Mar 03 2018 20:47
matty001 sends brownie points to @bradtaniguchi :sparkles: :thumbsup: :sparkles:
api offline
Brad
@bradtaniguchi
Mar 03 2018 20:48
@matty001 Yea that would be the best, np :D
Ken Haduch
@khaduch
Mar 03 2018 21:47
@KWFE - I'm playing around with the site, I think that the structure of the HTML has to be changed? I won't be able to work on it any more for a few hours, but I'll try to get back to you if I make a breakthrough... unless you let me know that you've found a solution.
James Diaz
@clanmaster
Mar 03 2018 21:54
Good day all!
for this line of code:
svar scores = this.quizScores.length > 0 ? this.quizScores.join(","): "No Scores Yet";
what is the use of ? in that line?
Ken Haduch
@khaduch
Mar 03 2018 21:57
@clanmaster - look up the https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Conditional_Operator - Conditional ternary operator. It is a concise way to write an "if then else" statement.
James Diaz
@clanmaster
Mar 03 2018 21:57
thanks @khaduch
CamperBot
@camperbot
Mar 03 2018 21:57
clanmaster sends brownie points to @khaduch :sparkles: :thumbsup: :sparkles:
:star2: 3770 | @khaduch |http://www.freecodecamp.org/khaduch
Matej Bošnjak
@mbosnjak01
Mar 03 2018 21:58
if(this.quitScores.length > 0) { this.quizScores.join(","); } else { return "No scores yet"; }
Ken Haduch
@khaduch
Mar 03 2018 21:58
so if the length > 0 you do the first action immediately after the ? otherwise you do the action after the :
Greg Gordon
@greggordoncode_twitter
Mar 03 2018 22:22
https://codepen.io/papageg/pen/yvGYQM?editors=1100 under my contact me section i want to have first name last name a country going top to bottom then have the message to the right im little confused on the way to do it
Manan Shah
@mananshah51
Mar 03 2018 22:58
var count = 0;

function cc(card){
  // Only change code below this line
  switch(card){
    case 2:
    case 3:
    case 4:
    case 5:
    case 6:
      count++;
      answer = count + " " + "Bet";
      break;

    case 7:
    case 8:
    case 9:
      count = count + 0;
      answer = count + " " + "Hold";
      break;

    case 10:
    case 'J':
    case 'Q':
    case 'K':
    case 'A':
      count--;
      answer = count + " " + "Hold";
  }
  return answer;
  // Only change code above this line
}

// Add/remove calls to test your function.
// Note: Only the last will display
cc(2); cc(3); cc(7); cc('K'); cc('A');
Can someone help me out with the Counting Card Challenge ?
Stephen James
@sjames1958gm
Mar 03 2018 23:02
@mananshah51 The instructions say that Bet vs Hold depends on the value of count - but you are not checking the value of count
Manan Shah
@mananshah51
Mar 03 2018 23:03
Can I go for if else look to check the count ?
Stephen James
@sjames1958gm
Mar 03 2018 23:04
@mananshah51 Yes, and you can do it once after the switch statement
Manan Shah
@mananshah51
Mar 03 2018 23:04
@sjames1958gm Will I be needing 3 if else loop statements?
Stephen James
@sjames1958gm
Mar 03 2018 23:05
@mananshah51 If you put it after the switch , before you return, you only need one
Riadh
@KWFE
Mar 03 2018 23:06
@khaduch thank you sir as i told you the project is okay but when i try to change the global tag RTL it break
CamperBot
@camperbot
Mar 03 2018 23:06
kwfe sends brownie points to @khaduch :sparkles: :thumbsup: :sparkles:
:star2: 3771 | @khaduch |http://www.freecodecamp.org/khaduch
Manan Shah
@mananshah51
Mar 03 2018 23:14
@sjames1958gm ```
var count = 0;

function cc(card){
  // Only change code below this line
  switch(card){
    case 2:
    case 3:
    case 4:
    case 5:
    case 6:
      count++;
      break;

    case 7:
    case 8:
    case 9:
      count = count + 0;
      break;

    case 10:
    case 'J':
    case 'Q':
    case 'K':
    case 'A':
      count--;
      break;
  }

  if (count <= 0){
    return (count +" "+ "Bet");
  }
  else {
    return (count + " " + "Hold");
  }
  // Only change code above this line
}

// Add/remove calls to test your function.
// Note: Only the last will display
cc(2); cc(3); cc(7); cc('K'); cc('A');
the fbi agent watching you
@krennical_twitter
Mar 03 2018 23:15
I'm doing the Profile Lookup challenge and for some reason it's turning No Such Contact for contacts outside of Akira, like Sherlock. Here's my code:
https://repl.it/@rumlows/WheatForsakenCoin . Any idea why this is happening?
@mananshah51 I believe you need if (count >= 1) instead of (count <= 0)
Manan Shah
@mananshah51
Mar 03 2018 23:19
@krennical_twitter Yeah I was able to figure that out.
the fbi agent watching you
@krennical_twitter
Mar 03 2018 23:20
Nice!
Manan Shah
@mananshah51
Mar 03 2018 23:20
@krennical_twitter Thanks for the help though.
CamperBot
@camperbot
Mar 03 2018 23:20
mananshah51 sends brownie points to @krennical_twitter :sparkles: :thumbsup: :sparkles:
api offline
Stephen James
@sjames1958gm
Mar 03 2018 23:27
@mananshah51 :+1:
Manan Shah
@mananshah51
Mar 03 2018 23:28
@sjames1958gm Thank you so much.
CamperBot
@camperbot
Mar 03 2018 23:28
mananshah51 sends brownie points to @sjames1958gm :sparkles: :thumbsup: :sparkles:
:star2: 9054 | @sjames1958gm |http://www.freecodecamp.org/sjames1958gm
Stephen James
@sjames1958gm
Mar 03 2018 23:28
@mananshah51 No problem
Donnie
@Donnie-D
Mar 03 2018 23:44
hi my code is returning a quote but it doesn't change it. Upon pressing the button again, it returns the same quote. Could anyone point out where it needs correction please?
https://codepen.io/Donnie-D/pen/BJBoZd
Gulsvi
@gulsvi
Mar 03 2018 23:48
@Donnie-D The response is getting cached. You can disable cache in getJSON/Ajax with:
$.ajaxSetup({cache: false})
Or, just add a random number after the callback= in your URL and it will treat it like a different request every time you call the API