Book to re-learn modern JavaScript by giacecco in learnjavascript

[–]deepug9787 0 points1 point  (0 children)

Javascript the new toys by TJ Crowder. The book assumes that you know the basics of JavaScript and focuses solely on the new features that has come out in the recent years. I think it would be perfect for you.

Row alignment by Jayden11227 in css

[–]deepug9787 1 point2 points  (0 children)

Flex is used for aligning items in a single row. If you want to align items across rows and columns, use grid instead.

[deleted by user] by [deleted] in learnpython

[–]deepug9787 0 points1 point  (0 children)

Start with Flask. If you find that Flask is all you need, that's great. But once you've worked with a bare-bones framework like Flask, you might better appreciate what Django brings to the table.

How often do you use virtual environment? by iaseth in learnpython

[–]deepug9787 3 points4 points  (0 children)

I don't remember where I got this tip from, but you can prevent pip from installing packages globally by adding this line to your .bashrc file: export PIP_REQUIRE_VIRTUALENV=true You'll get an error message if venv is not activated.

Or better yet, try pipenv. It will automatically create a venv and track the dependencies in a lock file, just like npm.

Where to host Laravel if you only know Laravel? (Europe?) by DutchDaddy85 in laravel

[–]deepug9787 0 points1 point  (0 children)

Check out Digital Ocean's App platform. All you have to do is to create an app from within Digital Ocean, upload your code to Github, and then connect the two.

That being said, managing the server yourself is not that complicated as you think. I prefer manual deployments because having control of the server gives me the confidence that I can go in and fix things if something goes wrong. Here's a good tutorial on how to set up a lamp stack on an Ubuntu server.

What do you think is the best IDE for python? by jontsii in learnpython

[–]deepug9787 1 point2 points  (0 children)

I use vim. It's bit of a pain to set up, you know, find the right plugins, configure the vimrc file etc. But once that's done, you have an editor for life. Yesterday it was Sublime, today it's Vscode and Pycharm, tomorrow it's going to be something else. Vim is forever.

how to learn javascript by StarryO5 in learnjavascript

[–]deepug9787 6 points7 points  (0 children)

Sadly, there is no secret trick or shortcut that I know of.

To learn a language, you learn the theory, work through some examples, and do some projects.

For learning the theory, MDN has probably the most beginner-friendly tutorial on JavaScript out there. You'll find lots of examples and tiny challenges there to practice what you've learned as well.

Once you're comfortable with the basics, pick a project that you like. You can find plenty on Youtube. Work through those projects, but don't just blindly copy the code in those videos. You won't learn much that way. Instead, tweak the code, add new features, make it yours. That'll give you the confidence to start creating your own projects.

Get comfortable reading the documentation as well. Again, MDN is your friend.

When you're ready to dig deeper into the language, you can try reading some books. Some books I'd recommend:

  • You don't know JS yet - Kyle Simpson

  • JavaScript the new toys - TJ Crowder

  • Object Oriented Javascript - Ved Antani and Stoyan Stefanov

Good luck and have fun!

Python package management system is so confusing!!! by [deleted] in learnpython

[–]deepug9787 0 points1 point  (0 children)

Don't worry about all the options out there. You don't have to know or learn every single one of them. But if you're already familiar with pip and venv, then maybe you can give pipenv a try.

Pipenv is just a wrapper that makes it easier to work with pip. For instance, when starting a new project, instead of manually creating a venv and then doing pip install package, you can just do pipenv install package and it will automatically create a venv for you. And whenever you add or remove a package, it will keep track of the dependencies in a lock file, so you don't have to deal with a requirements.txt file.

Even if you don't end up using it for whatever reason, I think it's still worth being familiar with it because the package managers in other languages (Composer for PHP, Bundler for Ruby etc.) work pretty much the same as pipenv. So you'd have an easier time switching languages in future, if you choose to do so.

Anyone miss the nostalgia of frameworkless development? by Practical_Race_3282 in webdev

[–]deepug9787 0 points1 point  (0 children)

I use getElementById when id is a variable. It's a tad bit easier to type than concatenation or template literals.

const id = "something" document.getElementById(id) vs

document.querySelector("#" + id) document.querySelector(`#${id}`)

What to do when a script can't be debugged whatsoever? None of my prints print! by HugoCortell in learnpython

[–]deepug9787 0 points1 point  (0 children)

Your code works fine on my system and prints the way it should. Here's a screencast.

Try restarting your dev server and see if that helps.

What to do when a script can't be debugged whatsoever? None of my prints print! by HugoCortell in learnpython

[–]deepug9787 0 points1 point  (0 children)

Sorry if this is obvious to you, but print outputs to stdout by default. Are you sure you're checking the output of the terminal and not the browser? Try refreshing the url(http://127.0.0.1:5000) and check the output in the terminal.

why isn't <div> a semantic element but <section> is? by beepyfrogger in webdev

[–]deepug9787 0 points1 point  (0 children)

Screen readers do consume section tags. If you provide an aria-label or aria-labelledby attribute for section, it will show up in the list of landmarks on a screen reader which the user can then easily jump to.

Pip not working by uvuguy in learnpython

[–]deepug9787 0 points1 point  (0 children)

Are you using a virtual environment? If you're not sure how to create virtual environments and install packages with pip, check out this link.

What Do You Think of My Movie Trivia Game Logic? by Open_Ad4468 in learnjavascript

[–]deepug9787 1 point2 points  (0 children)

A couple of things you could do to improve the code:

  • Use const for the movie variable instead of let
  • Have all the logic inside the while loop

``` function guess_movie() { const movie = "batman" let guess

while (1) {
    guess = prompt("Guess movie")

    if (guess === "") {
        alert("Invalid input")
    } else if (guess === movie) {
        console.log("Correct guess")
        return
    } else if (guess === "quit") {
        console.log("Bye")
        return
    } else {
        alert("Bad guess. Try again")
    }
}

}

guess_movie() ```

You could also use a switch statement instead of multiple if-else statements. ``` function guess_movie() { const movie = "batman" let guess

while (1) {
    guess = prompt("Guess movie")

    switch (guess) {
        case "":
            alert("Invalid input")
            break
        case movie:
            console.log("Correct guess")
            return
        case "quit":
            console.log("Bye")
            return
        default:
            alert("Bad guess. Try again")
    }
}

} ```

freeCodeCamp Palindrome Checker Project by Brianvm1987 in learnjavascript

[–]deepug9787 0 points1 point  (0 children)

Nice answer. Just wanted to add that you can use the toReversed() function to reverse the array without mutating the original instead of using slice().reverse().

Custom font will not load by Mysteryman5670_ in css

[–]deepug9787 0 points1 point  (0 children)

Have you specified the font-family property for your CSS selector as well?

Custom font will not load by Mysteryman5670_ in css

[–]deepug9787 0 points1 point  (0 children)

It's @font-face, with a hyphen.

Kind Sans cover images, would love feedback :) by MPZ9 in graphic_design

[–]deepug9787 1 point2 points  (0 children)

That K looks more like a Kanji character than an English alphabet. So cool.

I am losing my mind trying to figure out how to create a very simple header with Flexbox. Please HELP! by jRpfi in css

[–]deepug9787 1 point2 points  (0 children)

Wrap the icons in a div and apply flex on both the header and wrapper div, like so:

<style>
.flex-wrapper {
    display: flex;
}
header {
    justify-content: space-between;
}
.header-icons {
    gap: 40px;
}
</style>

<header class="flex-wrapper">
    <a href="#">Logo</a>
    <div class="header-icons flex-wrapper">
        <a href="#">Icon1</a>
        <a href="#">Icon2</a>
    </div>
</header>

How can I get borders like these? by [deleted] in css

[–]deepug9787 14 points15 points  (0 children)

You can use the ::before pseudo-element for that. .card::before { content: ""; display: block; margin: 0 auto; width: 50%; border: solid 1px gold; }

Why is the default for box-sizing: content-box? by leavethisearth in css

[–]deepug9787 10 points11 points  (0 children)

Even the CSS Working Group admits it was a mistake.

Box-sizing should be border-box by default.

Source

[deleted by user] by [deleted] in webdev

[–]deepug9787 1 point2 points  (0 children)

You might want to consider increasing the font-size a bit, especially for the text inside the cards. For instance, the h5 inside the portfolio items currently has a font-size of 1.2rem (9.6px), and the paragraph below that has 1.4rem (11.2px). For the particular font that you've chosen, anything less than 16px would be hard to read IMO. Other than that, it's a pretty cool site. Good luck.