These are chat archives for FreeCodeCamp/Help

22nd
Mar 2018
knight2
@knight2
Mar 22 2018 03:12
anyone have any idea why if your DNS pointing to your host works for .DOMAINNAME.com and works for www.DOMAINNAME.com, after you push an update to your host for the website, all of the sudden www.domainname.com doesn't point to the host anymore?
but now it looks like domainname.com is working
but www.domainname isn't working
even though you have CNAME and a pointing properly before?
or does this happen when you push a new build to the host?
now www.dommainname.com is working
I'll assume it has to do with pushing updates to the host.
knight2
@knight2
Mar 22 2018 03:34
whew website up and running on azure, domain pointing to azure, domain mx pointing to gsuite business email.
Kyle Holm
@thekholm80
Mar 22 2018 03:38
@knight2 you're a rockstar
knight2
@knight2
Mar 22 2018 03:44
@thekholm80 I had good and patient mentors on the complaint filled journey :P.
Kyle Holm
@thekholm80
Mar 22 2018 03:44
oh man i'm glad you found someone useful to help you, cause i was pure garbage lol
seriously though, well done
knight2
@knight2
Mar 22 2018 03:45
oh no i mean you and others who answered my questions on here (or tried to help debug)
right now I want to get deeper into CSS (a major weak spot for me, I notice a lot of websites look more 'crisp' when they use a lot of before and after styling transitions)
and of course get deeper into more complex web apps and databases
Kyle Holm
@thekholm80
Mar 22 2018 03:46
i'm always amazed by the cool things people do with css, i don't think i'll ever have the patience to learn much more than i already know
knight2
@knight2
Mar 22 2018 03:46
I find myself spending way more time battling with the CSS part of a website than the actual content and backend
yeah I agree with you, people can do crazy stuff with css, but I think getting a little more competent in css would go a long way.
i'll be satisfied with being a div/positional master, and getting basic before/after transition things down. That should be enough to make any website look crisp/nicer than a lot of others.
Kyle Holm
@thekholm80
Mar 22 2018 03:48
that's not a bad goal to shoot for
knight2
@knight2
Mar 22 2018 03:49
i aim to do much more on backend, so being able to pretty that up just upsells it :P
hbu? what are your current goals?
Kyle Holm
@thekholm80
Mar 22 2018 03:50
right now i'm cussing at chart.js and wishing i didn't have to use it lol. i have 3 more projects and i'm done with the current version of fCC, then i'll probably work on some python/django stuff for a while
knight2
@knight2
Mar 22 2018 03:51
dats why you gotta go with d3 :P
Kyle Holm
@thekholm80
Mar 22 2018 03:51
d3 is so big though, i wanted quick and easy
knight2
@knight2
Mar 22 2018 03:51
d3 is insanely easy to manipulate data points into charts
also i was under the impression that you already finished fcc XD
Kyle Holm
@thekholm80
Mar 22 2018 03:52
lol nah, i have Chart the Stock Market, Book Trading Club and Pintrest Clone left
knight2
@knight2
Mar 22 2018 03:54
hmmm looks like a less powerful version of d3
Kyle Holm
@thekholm80
Mar 22 2018 03:54
yeah
knight2
@knight2
Mar 22 2018 03:55
i'm not actually sure if it work be simpler, simple stuff is quite simple in d3
but if it works, that's good.
Kyle Holm
@thekholm80
Mar 22 2018 03:55
i used D3 for all of the D3 projects. it was neat and i'm impressed by everything it can do
but chart.js is like d3 for dummies
knight2
@knight2
Mar 22 2018 03:56
it doesn't look like you can customize the tooltips for chart.js though
but that is nbd if it is simple data
newluck
@newluck
Mar 22 2018 08:24
Your image should be 100 pixels wide. Browser zoom should be at 100%. doesnt work some ideas pls ?
gishy1
@gishy1
Mar 22 2018 08:28
hello world!!
need help here \
my image class is not responding
Claudio Restifo
@Marmiz
Mar 22 2018 08:38
@gishy1 what do you mean by "not responding?"
gishy1
@gishy1
Mar 22 2018 08:56
hold on bro let me get back to you @Marmiz
gishy1
@gishy1
Mar 22 2018 09:01
@Marmiz correction my twitter icon does not seem to work
have a look
Claudio Restifo
@Marmiz
Mar 22 2018 09:07
@gishy1 font awesome icon (aka fa) comes from an external package. You have to include that in your project as well.
There's the quick add option in settings
gishy1
@gishy1
Mar 22 2018 09:08
@Marmiz check my settings i thought i added\
Claudio Restifo
@Marmiz
Mar 22 2018 09:12
@gishy1 I don't see it. I see a different package fontawesome-iconpicker that I have no ida what it is.
try with:
https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css
or if you want to use the newer icons made with SVG refer to the documentation:
https://fontawesome.com/how-to-use/svg-with-js
Apollo
@enigmacipher
Mar 22 2018 09:21
Give the 2nd <p> inside the 3rd <div> a 5px white border. Which css selector should I use here?
Claudio Restifo
@Marmiz
Mar 22 2018 09:23
@enigmacipher I fear there's no way to tell you without giving you the answer.
What have you tried so far?
Apollo
@enigmacipher
Mar 22 2018 09:24
The only one I know that comes close is the nth-of-type
gishy1
@gishy1
Mar 22 2018 09:26
@Marmiz didnt work bro
Claudio Restifo
@Marmiz
Mar 22 2018 09:28
@enigmacipher if you are restricted to the usage of css (and not JS) then that's the selector that comes in my mind as well
@gishy1 just tried on your pen and worked for me
gishy1
@gishy1
Mar 22 2018 09:30
wait it the icon came out?
Claudio Restifo
@Marmiz
Mar 22 2018 09:31
@enigmacipher the :nth-of-type if probably the best suited for this :)
gishy1
@gishy1
Mar 22 2018 09:32
@Marmiz did the twitter icon show up?
Claudio Restifo
@Marmiz
Mar 22 2018 09:32
yes
Apollo
@enigmacipher
Mar 22 2018 09:34
@Marmiz I need to style only the 2nd <p> in the 3rd div. If I use div:nth-of-type(3) , the entire 3rd div will be changed?
gishy1
@gishy1
Mar 22 2018 09:35
@Marmiz i really dont know then
Claudio Restifo
@Marmiz
Mar 22 2018 09:37
@gishy1 perhaps you did something wrong.
I just added this https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css inside the CSS section
@enigmacipher no but you can chain it :)
Apollo
@enigmacipher
Mar 22 2018 09:39
@Marmiz got it!!!!!!!! Thanks :D
CamperBot
@camperbot
Mar 22 2018 09:39
enigmacipher sends brownie points to @marmiz :sparkles: :thumbsup: :sparkles:
:star2: 1189 | @marmiz |http://www.freecodecamp.org/marmiz
gishy1
@gishy1
Mar 22 2018 09:40
@Marmiz worked now , I hadnt exactly placed the correct external link i the css
Claudio Restifo
@Marmiz
Mar 22 2018 09:52
@enigmacipher :+1: :clap:
@gishy1 :fire: :sparkles:
gishy1
@gishy1
Mar 22 2018 09:53
@Marmiz gracias amigo
CamperBot
@camperbot
Mar 22 2018 09:53
gishy1 sends brownie points to @marmiz :sparkles: :thumbsup: :sparkles:
:star2: 1190 | @marmiz |http://www.freecodecamp.org/marmiz
Adam
@GoingAllTheWayUp
Mar 22 2018 13:12
I did start a new enviroment in cloud9 at c9.io I had to find the IDE but I found it and created a new enviroment
BuntyBru
@BuntyBru
Mar 22 2018 13:21
As much as i love doing backend I feel like i am shit at frontend
Any tips?
@community
Fabien SHAN
@X140hu4
Mar 22 2018 13:45
Practice more front end?
@BuntyBru Anything in particular?
Ken Haduch
@khaduch
Mar 22 2018 14:30
@BuntyBru - someone mentioned this site https://hackdesign.org - they email weekly lessons and information on design. (I have not taken the time to look at much of the info up to this point, but it's on my todo list...) It is focused on design.
Kyle Holm
@thekholm80
Mar 22 2018 15:59
good morning people of /help
Ken Haduch
@khaduch
Mar 22 2018 16:08
@thekholm80 - good morning back to you!
Henry
@GitHub-Henry
Mar 22 2018 17:49
@thekholm80 @khaduch good morning
Ken Haduch
@khaduch
Mar 22 2018 17:50
@GitHub-Henry - hello there!
Daniel
@dkapexhiu
Mar 22 2018 17:51
hello! please how can i get the value of this var placeId outside the function:
var placeId;

$('#getGoogleRestaurants').click(function(){
    fetch('https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=48.8587741,2.2069771000000173&radius=500&type=restaurant&key=key', {
        mode: 'cors',
        headers: new Headers({
            "Access-Control-Allow-Origin": "*"
        })
    })
    .then(
    function(response) {
      if (response.status !== 200) {
        console.log('Response error. Status Code: ' +
          response.status);
        return;
      }
      // Examine the text in the response
      response.json().then(function(data) {
        data.results.forEach(function(data_restaurant){
             placeId = data_restaurant.place_id;
        });
    });
    })

});
Kyle Holm
@thekholm80
Mar 22 2018 17:51
@GitHub-Henry hey hey
Henry
@GitHub-Henry
Mar 22 2018 17:53
@dkapexhiu how about defining placeId outside the function
hensn5250
@hensn5250
Mar 22 2018 17:53
@dkapexhiu what do you mean placed outside of the function? I am assuming that you are try to use a variable that is withing a async operation as a global varaible, correct?
Kyle Holm
@thekholm80
Mar 22 2018 17:54
i'm guessing placeId is being used before the fetch() resolves
hensn5250
@hensn5250
Mar 22 2018 17:54
right
Daniel
@dkapexhiu
Mar 22 2018 17:54
i am defining a variable outside the function then the value of that var changes inside the function, then i want to be able to access the variable outside the function with console.log
hensn5250
@hensn5250
Mar 22 2018 17:55
Won't happen since you can't pinpoint when the async will resolve
you are trying to conduct a sync operation with async data
One option you could do is use async and await
that way you can have some control over the order of the asynchronous operations
Kyle Holm
@thekholm80
Mar 22 2018 17:59
that's my favorite solution. i dislike sideways pyramids (callback hell) and promise chaining
hensn5250
@hensn5250
Mar 22 2018 18:01
yup. It just makes the code more readable
Daniel
@dkapexhiu
Mar 22 2018 18:01
and is there a way i can call it inside this fetch api:
$('#getGoogleReviews').click(function(){
    fetch('https://maps.googleapis.com/maps/api/place/details/json?placeid='+placeId+'&key=key, {
hensn5250
@hensn5250
Mar 22 2018 18:03
if placeId is defined globally before making the fetch call , I don't see any issues.
Daniel
@dkapexhiu
Mar 22 2018 18:03
because i am getting undefined
hensn5250
@hensn5250
Mar 22 2018 18:04
what is undefined?
Daniel
@dkapexhiu
Mar 22 2018 18:04
this var is declared globally then change value inside a fetch and then gets called inside another fetch
Kyle Holm
@thekholm80
Mar 22 2018 18:05
but the order things are happening is
  1. you declare a global variable
  2. you make your fetch call
  3. you console.log your global variable // undefined
  4. your fetch completes and updates the variable value
hensn5250
@hensn5250
Mar 22 2018 18:05
when are you requesting the value of the var. The request has to be inside of the async function or else you will get undefine
Exactly. @thekholm80 pretty much defined what may be occuring
Daniel
@dkapexhiu
Mar 22 2018 18:07
ok i understand thank you
@hensn5250 and @thekholm80
hensn5250
@hensn5250
Mar 22 2018 18:08
You have to understand that each line of sync code takes like 5 ms to execute. The async is probably taking 30ms. so by the time it is completed much of the other sync code has already been executed.
Daniel
@dkapexhiu
Mar 22 2018 18:15
does there exists a way to do a fetch request inside another and have that variable defined:
fetch('https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=48.8587741,2.2069771000000173&radius=500&type=restaurant&key=key', {
.then(
    function(response) {
      response.json().then(function(data) {
        data.results.forEach(function(data_restaurant){
          placeId = data_restaurant.place_id;
           fetch('https://maps.googleapis.com/maps/api/place/details/json?placeid='+placeId+'&key=key', {
Henry
@GitHub-Henry
Mar 22 2018 18:17
@dkapexhiu here's an example using fetch. like the weather app, it gets the location, then uses that info to get the weather, then it displays it. you can adapt it. it will not work with adblockers https://codepen.io/anon/pen/WzOraR?editors=1112
It is sequential code for async operations, first do this, then that, then the other.
Daniel
@dkapexhiu
Mar 22 2018 18:40
ok thanks
someone know how to serve gzip files with gulp?
Henry
@GitHub-Henry
Mar 22 2018 20:47
Almost reads like pseudo code
fetch(urlL)
  .then(parseResponse)
  .then(displayLocationGetWeather)
  .then(parseResponse)
  .then(log)
  .catch(log);