These are chat archives for FreeCodeCamp/Help

8th
May 2018
Stephen Kunze
@kunze_stephen_twitter
May 08 2018 01:58
can anyone help with rotating elements in an array?
Amit Patel
@AmitP88
May 08 2018 02:04

hey guys, how do I tie the work and break timers together in my pomodoro? So that the user can set the work timer mins and break timer mins seperately, and when one timer goes off, the other one starts. Someone told me to try using states, but I can't figure out how to do that with my specific code

https://codepen.io/AmitP88/pen/KRyjLw

Claudio Restifo
@Marmiz
May 08 2018 02:19
@kunze_stephen_twitter what do you mean by rotating?
formatCEnter
@formatCEnter
May 08 2018 02:52
Hello all.
First time here.
Going to HelpFrontEnd, see ya.
Claudio Restifo
@Marmiz
May 08 2018 03:02
@AmitP88 I'm a fan of using OOP for this kind of stuff, but have you simply tried to call startBreak (or whatever) after the startWorking has expired?
Claudio Restifo
@Marmiz
May 08 2018 03:37

@AmitP88 A basic idea would be
https://jsbin.com/vediyiyaqe/edit?html,js,console,output

which I don't like it too much for the use of global variables :)

Ken Haduch
@khaduch
May 08 2018 04:17
@AmitP88 - The idea that I'm using (which I haven't completed, but the basic things work) is to have a timer mode that signifies either "work" or "break", and I have a timer status object that maybe I'm keeping in an array (can't quite remember without looking) and the mode flips between the two and sets up the state for the countdown, the timer color, etc. I'm still working toward an implementation that counts 5 work / break cycles before a big break, kind of like the end of a work period. Also I am just using a count of seconds ( minutes * 60 ) to avoid the tracking of minutes and seconds in separate variables. Makes things a little simpler in some respects. I should go back to mine and look... maybe tomorrow.
@formatCEnter - welcome!
Claudio Restifo
@Marmiz
May 08 2018 04:49
@khaduch this kind of stuff is way easier to make with classes :)
BuntyBru
@BuntyBru
May 08 2018 06:19

Hey guys
Quick question

When we are using Promises in Javascript how do we get know that we have to put this much of time (2000ms or 3000ms) in setTimeout function()?

Henry
@GitHub-Henry
May 08 2018 06:19
Depends on how much time you want to pass before doing something
BuntyBru
@BuntyBru
May 08 2018 06:21
okay,
thanks @GitHub-Henry
CamperBot
@camperbot
May 08 2018 06:21
buntybru sends brownie points to @github-henry :sparkles: :thumbsup: :sparkles:
:cookie: 551 | @github-henry |http://www.freecodecamp.org/github-henry
BuntyBru
@BuntyBru
May 08 2018 06:27
`const second = () =>{
setTimeout(()=>{
console.log("Asynchronous hey there");
},3000);
}
const first=() =>{
    console.log("Hey there");
    second();
    console.log("the End");
}`

so in the above code

Hey there
the End

will be printed and then after 3 seconds "Asynchronous Hey there" would be printed

that means that the code inside the second() function was executed simultaneously along with console.log("the End"); and console.log("Hey there");
It just got printed after 3000 ms
right ??
@GitHub-Henry
Aditya
@ezioda004
May 08 2018 06:36
@BuntyBru JS execution is single threaded so it executes code synchronously, so first a stack for first() is created and inside that console.log("Hey there");is added to stack, it resolves that, moves to the next line now it executes second();, now since second contains async code, it pushes the callback to "queue" and resolves second and after that console.log("the End"); is executed. After the first() is cleared, something called "event loop" checks the "queue" and executes it. In this case console.log("Asynchronous hey there");
Fahmi Syahrul yahya
@Fahmisyahya
May 08 2018 06:57
How to fixed Make Images Mobile Responsive. <img src="https://bit.ly/fcc-running-cats" class="img-responsive">
Henry
@GitHub-Henry
May 08 2018 07:30
@BuntyBru this might help you see what's happening with your code as it executes
BuntyBru
@BuntyBru
May 08 2018 07:32
@GitHub-Henry
yeah i got the idea, i looked for a lecture on youtube
Henry
@GitHub-Henry
May 08 2018 07:34
@BuntyBru good idea, understanding the event loop is a good idea when trying to figure out how js processes code
Henry
@GitHub-Henry
May 08 2018 08:02
@ezioda004 that's a nice summation of how that code is processed, :+1:
jingchengchen
@jingchengchen
May 08 2018 08:50
通过增加HTML标签的方式来强调 target4按钮的文本。
确保你更换的按钮为 target4。
不要更改任何文本。
how to sovle it?
Stephen James
@sjames1958gm
May 08 2018 09:47
@jingchengchen Try the chinese room
https://gitter.im/FreeCodeCamp/chinese
gishy1
@gishy1
May 08 2018 10:33
@sjames1958gm yes found that out the hard way gave me a null value at the end
Jesse
@ki4jgt
May 08 2018 12:22

P2P video sharing site is going great. It's probably the most fun I've ever had on a project but I don't know how to monetize it.

Basically it works as follows: Viewers go to the site and see your videos. Your videos are shared (torrented) via a node.js server you can host on your own computer or private server. You can link other videos to your video in the sidebar via the private server as well (if you get paid for this, there's no problem on my end).

My problem is, I don't know whether to charge people with channels 1-2 USD/month or just advertise to everyone. This is probably the funnest project I've ever built and I'd hate to see it go to waste but I need it to be sustainable.

Stephen James
@sjames1958gm
May 08 2018 13:36
@gishy1 :+1:
May Kittens Devour Your Soul
@diomed
May 08 2018 16:27
who knows pugging jade?
pug = jade
Kyle Holm
@thekholm80
May 08 2018 16:33
i never got the point of pug
what problem does it solve?
May Kittens Devour Your Soul
@diomed
May 08 2018 16:38
solves the problem of brackets
and repeating things multiple times
Kyle Holm
@thekholm80
May 08 2018 16:38
hmm
May Kittens Devour Your Soul
@diomed
May 08 2018 16:38
on the other hand, when it's not written right creates more problems than it solves
and this is what happened to me when I converted html to pug [don't ask] and removed smth
Kyle Holm
@thekholm80
May 08 2018 16:39
i was talking to someone the other day that loves pug, i wish i could remember who it is
don't ever get old, cat - once the memory starts slipping it's all downhill
May Kittens Devour Your Soul
@diomed
May 08 2018 16:41
pffft. what memory?
Kyle Holm
@thekholm80
May 08 2018 16:44
i've decided that VS Code doesn't open any faster than Atom. it does get stuff on your screen sooner, but it's all 'perceived speed' since it's still churning away loading stuff in the background
not sure it was worth the switch
Gulsvi
@gulsvi
May 08 2018 16:58
I used Atom since the start, up until a few months ago. Happy with VS Code now - on Windows it's a no-brainer. Microsoft developers are pretty good at building developer tools on their OS.
Ken Haduch
@khaduch
May 08 2018 16:58
@thekholm80 - Hi Kyle - I've been happy with VS code so far? I haven't used Atom in a while, my recollection of it was that it was slow. VS Code seems to be rel;atively fast, but maybe I haven't really loaded it with many plugins or something?
Kyle Holm
@thekholm80
May 08 2018 16:58
i've never even tried to write code on windows, setting up the environment is too big a hassle for me
@khaduch VS Code is pretty okay, I've not seen anything that makes me think it's better than Atom, but I've not seen anything that makes me think it's worse either
Ken Haduch
@khaduch
May 08 2018 17:00
@thekholm80 - I was playing with Pug for my calculator keyboard, for example... I was getting a nice little keyboard layout, at least for the rows of keys. Not sure if I could make it do everything... and I haven't played with it too much, anyway.
May Kittens Devour Your Soul
@diomed
May 08 2018 17:00
@khaduch u know pug?
Ken Haduch
@khaduch
May 08 2018 17:02
@diomed - not too much... my first bit of tinkering with it was just to do some simple loops. But do you have a question / problem that you've posted? I'm keen to find something to wake my brain up today (but I don't want it to explode... :) )))
May Kittens Devour Your Soul
@diomed
May 08 2018 17:02
eh, it won't explode
it's just a simple indenting problem ,I guess
I stupidly removed something and clicked save, and now it's bananas

I've set up my Sublime Text font and no other editor has that font, dont know why
Ken Haduch
@khaduch
May 08 2018 17:11
@diomed - I don't know if this is a hint, but I deleted everything after the navbar, and then "de-dented" the navbar code by one tab, and then that compiled?
@diomed - oh, yeah, just did the entire page and it then formatted it! In the CodePen, selected everything in the HTML panel, and then CTRL-{ shortcut to shift it all over one tab space.
Kyle Holm
@thekholm80
May 08 2018 17:57
man eslint is brutal. i feel bad every time i 'turn off' a rule but some of these seem a bit excessive
like this one
May Kittens Devour Your Soul
@diomed
May 08 2018 17:59
@khaduch thank you
CamperBot
@camperbot
May 08 2018 17:59
diomed sends brownie points to @khaduch :sparkles: :thumbsup: :sparkles:
:star2: 3910 | @khaduch |http://www.freecodecamp.org/khaduch
Kyle Holm
@thekholm80
May 08 2018 17:59
the airbnb config requires it - i hate the way it looks
May Kittens Devour Your Soul
@diomed
May 08 2018 17:59
lets not lint anything
or check anything
lets live in delusion and be happy
I mean, customers wont notice anyway
Kyle Holm
@thekholm80
May 08 2018 18:00
linting would catch your pug mess
diomed @diomed whistles
May Kittens Devour Your Soul
@diomed
May 08 2018 18:00
It seems everywhere I go I leave mess , coz I'm one big mess :worried:
Kyle Holm
@thekholm80
May 08 2018 18:01
i say if you're good at something, stick with it
May Kittens Devour Your Soul
@diomed
May 08 2018 18:01
okay
I'm good at being human Wreck-It Ralph
Kyle Holm
@thekholm80
May 08 2018 18:04
lol
i've just spent 4 days writing 3 react components. i'm not feeling like i'm all that great at getting good results myself
May Kittens Devour Your Soul
@diomed
May 08 2018 18:07
what are components for/about`
Kyle Holm
@thekholm80
May 08 2018 18:07
each of these components is a tiny chunk of UI
image.png
that's one of them
May Kittens Devour Your Soul
@diomed
May 08 2018 18:09
  • is it modal?
  • is it functional?
yes modal, and it works if that's what you mean by functional
May Kittens Devour Your Soul
@diomed
May 08 2018 18:11
cool
u making bookclub?
Kyle Holm
@thekholm80
May 08 2018 18:13
yeah
trying, anyway
Matthew McKenzie
@mkenzie87
May 08 2018 19:43
Hey someone help me with some simple css issue?
http://wyndhammills.flywheelsites.com/executive-assessments/
the middle section with white a red box I need them equal heights
mustimuu
@mustimuu
May 08 2018 20:06
Anybody familiar with loco trnalste?
Ken Haduch
@khaduch
May 08 2018 20:06
@mkenzie87 - it's kind of hard to play around with the code without having the code, but https://scotch.io/bar-talk/different-tricks-on-how-to-make-bootstrap-columns-all-the-same-height this page might have something that will help you.
Matthew McKenzie
@mkenzie87
May 08 2018 20:07

<div class="row row-eq-height">
<?php if(get_field('areas_assessments')): ?>

<?php while(has_sub_field('areas_assessments')): ?>

<div class="col-md-4 assessements-columns ">
<?php if( get_sub_field('featured_link') ): ?>
<a href="<?php the_sub_field('featured_link'); ?>">
<?php endif; ?>
<div class="value-backgrounds <?php if( get_sub_field('featured_assessment') == "yes" ){ echo "red-background";}?> ">
<h5 class="red-titles"><?php the_sub_field('assessment_title'); ?></h5>
<?php the_sub_field('assessment_description'); ?>
</div>

        <?php if( get_sub_field('featured_link') ): ?>
            </a>
        <?php endif; ?>
    </div>

<?php endwhile; ?>

<?php endif; ?>

</div>

bold

'<div class="row row-eq-height">
<?php if(get_field('areas_assessments')): ?>

<?php while(has_sub_field('areas_assessments')): ?>

    <div class="col-md-4 assessements-columns ">
        <?php if( get_sub_field('featured_link') ): ?>
            <a href="<?php the_sub_field('featured_link'); ?>">
        <?php endif; ?>
            <div class="value-backgrounds <?php if( get_sub_field('featured_assessment') == "yes" ){ echo "red-background";}?> ">
                <h5 class="red-titles"><?php the_sub_field('assessment_title'); ?></h5>
                <?php the_sub_field('assessment_description'); ?>
            </div>


        <?php if( get_sub_field('featured_link') ): ?>
            </a>
        <?php endif; ?>
    </div>

<?php endwhile; ?>

<?php endif; ?>

</div>'

found out its bootstraps 3 so its hard
Ken Haduch
@khaduch
May 08 2018 20:09
@mkenzie87 - yeah, well, that's got PHP code in it, so it would be hard to work with, as well. Which version of bootstrap are you using? I just see that. You can still try to use a flexbox solution, I think. Bootstrap 4's grid is based on flexbox so you would have an easier time there. But you can work flexbox into your code with some class definitions, etc. Or you should be able to.
May Kittens Devour Your Soul
@diomed
May 08 2018 20:11
@khaduch how are u with modals and js?
gishy1
@gishy1
May 08 2018 20:13
@sjames1958gm mate, you about?
Ken Haduch
@khaduch
May 08 2018 20:22
@diomed - not sure... I've only used bootstrap modals, but why not give it a shot?
Kyle Holm
@thekholm80
May 08 2018 20:26
i like bootstrap's modals
Norvin Burrus
@ndburrus
May 08 2018 22:01
@Frediflexta these may be helpful: :seedling: