• Breaking News

    Friday, February 28, 2020

    Week 3 Code Challenge: Days Between web developers

    Week 3 Code Challenge: Days Between web developers


    Week 3 Code Challenge: Days Between

    Posted: 28 Feb 2020 02:26 PM PST

    Last weeks top solution: Congrats!

    Snapstromegon : https://codepen.io/Snapstromegon/pen/XWbdKgK

    -----------------------------

    General Rules for the weekly challenges:

    1. Do not post full code here to avoid spoilers for others. Use a code playground of your choice to create your solution and provide only the link, and a fun link title in your comment on this thread.
    2. Only challenge submissions are allowed as top level comments. You may respond to submissions, but any non submission comments made at the top level will be removed. There is a top level comment to use for all non submission related replies and feedback.
    3. You may use whatever languages you want, but since this is a web dev sub, I encourage you to stick with common web languages (JS, PHP, CSS, HTML, etc). No libraries/frameworks allowed unless otherwise noted in the weekly challenge.
    4. Solutions must meet all challenge criteria to be submitted. No half done submissions.
    5. Upvote your favorite solutions. The solution with the most upvotes each week is crowned champion. But note: This really isn't about being #1. It is really about taking the opportunity to challenge yourself and learn. Winning is just icing on the cake!

    ------------------------------

    WEEK 3 CHALLENGE:

    A client needs to be able to determine how many days are between two dates, including the start date but NOT including the end date, and has hired you to produce a calculator for them. The solution must support previous calendar days.

    Test cases:

    March 12, 2020 - April 13, 2020 => 32 days

    June 27, 2016 - February 16, 2019 => 964 days

    July 2, 2021 - January 14, 2023 => 561 days

    Requirements:

    1. Must provide a way for users to input or select the start and end dates
    2. Must display the number of days between back to the user
    3. All 3 test cases must pass
    4. Good luck!
    submitted by /u/KorgRue
    [link] [comments]

    Monthly Getting Started / Web Dev Career Thread

    Posted: 28 Feb 2020 02:36 PM PST

    Due to a growing influx of questions on this topic, it has been decided to commit a monthly thread dedicated to this topic to reduce the number of repeat posts on this topic. These types of posts will no longer be allowed in the main thread.

    Many of these questions are also addressed in the sub FAQ.

    Subs dedicated to these types of questions include r/cscareerquestions/ for general and opened ended career questions and r/learnprogramming/ for early learning questions.

    A general recommendation of topics to learn to become industry ready include:

    HTML/CSS/JS Bootcamp

    Version control

    Automation

    Front End Frameworks (React/Vue/Etc)

    APIs and CRUD

    Testing (Unit and Integration)

    Common Design Patterns (free ebook)

    You will also need a portfolio of work with 4-5 personal projects you built, and a resume/CV to apply for work.

    Plan for 6-12 months of self study and project production for your portfolio before applying for work.

    submitted by /u/KorgRue
    [link] [comments]

    Why isn't this massive Grid layout regression in Chromium M79/80/81 being talked about?

    Posted: 28 Feb 2020 08:56 AM PST

    Why 543 KB keep me up at night

    Posted: 27 Feb 2020 11:34 PM PST

    What is the correct use of css grid?

    Posted: 28 Feb 2020 12:22 PM PST

    Is it a good idea to use css grid for absolutely all web layouts? What are the main aspects to consider when deciding whether to use css grid?

    submitted by /u/t0ggafu
    [link] [comments]

    I'm a dev but I suck at devopsing - how do I make my app available for public in a way that won't take me PHP_MAX_INT years to learn and use?

    Posted: 28 Feb 2020 12:21 PM PST

    I've got a sideproject in Symfony as a backend and Vue as a frontend. Now the time came and I want to deploy it somehow to wider audience. But I have no idea what should I use for it.

    I've tried with simple VPS with LEMP stack, but the deploys are hard and theres nothing like CI/CD anymore. So I've switched to GitLab pipelines, but got stuck on a step where the app is actually deployed.

    Then I thought about Kubernetes with DigitalOcean + Gitlab for deploying, but all these Ingresses, Helm Charts, templates and so on was too much for me.

    So there I am with my app.

    I think I'm looking for something between super-duper setup with K8S and manually deploying an app with git pull via ssh.

    Does anyone have some suggestions?

    submitted by /u/themaad
    [link] [comments]

    How to reduce costs for your HTTP(S) API on Amazon Web Services

    Posted: 28 Feb 2020 04:50 AM PST

    Is Toptal legit?

    Posted: 28 Feb 2020 06:15 AM PST

    I read some mixed comments online. Is anyone here works on the platform?

    How is your experience as a developer?

    What are the hourly rates are? Does it depend on your location?

    Is it worth it to go through their screening process?

    submitted by /u/bahadortheconquerer
    [link] [comments]

    How can I switch to a backend role?

    Posted: 28 Feb 2020 01:38 AM PST

    So I've been working as a frontend developer for almost 3 years now. I'm pretty good at what I do, and I feel a lot of people on my team look up to me for advice. The job is fulfilling in many ways, I feel valued and I enjoy mentoring other people.

    The issue is, I'm not really learning as much as I used to. The only days I really learn something new is when I'm working closer to the backend, deployments, CI etc..

    Theres definitely still lots more to learn in the frontend space but I'm just not as interested in it.

    I've had such an itch to change to backend, I'm fascinated by micro services and serverless but theres just no opportunity on my team to work on something like this.

    I feel a little stuck at the minute. The only other role I could transfer to would be another frontend role.

    Has anyone experienced something similar? I'm just not sure how to progress into backend from this point. I have tinkered with rust projects and AWS in my spare time but this will never compare to learning on the job.

    Any advice would be appreciated!

    submitted by /u/Turd_King
    [link] [comments]

    How HubSpot Manages a Giant Website With a Tiny Team

    Posted: 28 Feb 2020 10:22 AM PST

    Should I convert my vanilla JS code to jQuery?

    Posted: 28 Feb 2020 12:22 PM PST

    The project I'm currently working on at work we use jQuery for a few things, mainly Fancybox and Cycle from what I can tell. I recently wrote just a few lines on a couple of pages each in vanilla JS, about 10-15 lines on average so pretty small (it's a WordPress site, so I wrote it at the bottom of each block.PHP file).

    However, I'm being instructed to convert these small scripts to jQuery because we "can't have JavaScript code where everything else is jQuery on the site - consistency is important or we get developers that do things differently".

    The thing is, I never learned jQuery. I went straight to learning vanilla because I heard in every video and read in every article don't learn jQuery, learn vanilla. So I did. I can write these small scripts in vanilla very quickly. I have also been looking at the performance results of vanilla vs jQuery, and vanilla always wins. I've also looked into whether or not it's ok to mix jQuery and vanilla, and the consensus seems to be that yes that is ok. jQuery is just JavaScript so this question is apparently ridiculous on it's own. So I don't see the point in covering these small scripts, when the code I've written is perfectly sufficient and does what I need it to do, and I'd have to spend time fixing something that doesn't really need to be fixed, and learning the jQuery syntax.

    My main question is, what validity is there to this? If it's only a few lines, why bother switching it? Am I missing something here? I wish to present a respectful argument here, so please let me know if I'm adhering to "ignorance is bliss" or anything like that. I'm just genuinely curious about this too. Thanks.

    Apologies for any grammar/spelling, I wrote this on my phone rather quickly.

    submitted by /u/CanadianWhisk3y
    [link] [comments]

    Do you ever make a mockup page to try and lock down a sale?

    Posted: 28 Feb 2020 12:05 PM PST

    I have a potential client who wants to hire me, but they have a business partner that isn't convinced they need a new site. The site they're using right now is a barebones one page site built using the godaddy website builder. It's got a bunch of content but it isn't formatted at all.

    Because there's so much content already on there, it probably wouldn't take me more than 1-2 hours to mock up a homepage on one of my subdomains or just toss something together in photoshop.

    Does anyone ever do this for potential clients? I feel like it would help illustrate why a new site would be so much better for the client, but i'm worried that i'll be wasting my time and/or they might potentially take my design and try to go to someone cheaper or just do it themselves.

    submitted by /u/Akai-jam
    [link] [comments]

    Why databases use ordered indexes but programming uses hash tables

    Posted: 28 Feb 2020 03:00 AM PST

    Any way to generate course certificates (like udemy), payment receipt etc using bit|altcoin?

    Posted: 28 Feb 2020 11:42 AM PST

    I'm looking for decentralized, state-free ways to build a small platform for online courses.

    submitted by /u/flakesrc
    [link] [comments]

    How to think up of designs?

    Posted: 28 Feb 2020 04:33 AM PST

    Hello there! I'm pretty new to web development. I've taken the web development Bootcamp on udemy and I'm currently diving deeper into Javascript.

    My question is how do you folk come up with design ideas? Like is it ok for me to use UI design-builders? I know that I can definitely learn design patterns and what looks best on my own, but I'm by no means a designer. What do you guys do to come up with UI design ideas?

    submitted by /u/ma0407
    [link] [comments]

    Is fetching data based on the URL params a bad thing or not? (React)

    Posted: 28 Feb 2020 08:34 AM PST

    I'm currently working on a Movie app that fetches data from the MovieDB API but it's proving to be a lot more difficult than I thought initially.

    I'm using Redux and React-Router and fetch the data in the mount lifecycle method of my components.

    For instance, would it be bad if the fetching would happen based on the current URL params? If the initial page URL would be: discover/popular/?page=1 and whenever the user clicks the button the page would change to ?page=2, triggering a re-mount of my Movies component (using a key={props.match.params.id}) and thus fetching data based on that. Is this a good structure or not with Redux and Router?

    I'm sorry if this sounds all over the place. This is the first big project I've worked on and even though I took a course for React, I am unsure of how I would structure stuff like this. It's the biggest hurdle I'm facing throughout the whole thing. I don't know how to do it with Redux either, since my components are structured like so inside of another component called Dashboard:

    <Nav> <Movies> <Footer> 
    submitted by /u/xNotYetRated
    [link] [comments]

    I need advice on creating a website for my resume as a new grad

    Posted: 28 Feb 2020 11:19 AM PST

    I am a college grad seeking an internship or an entry/jr. level position as a web developer. My computer science knowledge is mostly in C# and python.. we did not do much with web dev or applications. I am only now teaching myself HTML/CSS and some javascript. I want to start building a website to help have something relevant to show employers.

    I notice many positions list Wordpress as a requirement/preference. However the more I look into Wordpress it seems like you can either:

    1. not touch code at all and use premade themes (unlikely to be useful as a dev)
    2. tweak the css etc on existing themes for personalization
    3. build your own theme from scratch

    As a new grad who wants a development position I am aware I need to do #2 or #3. My question here is, at my level should I still 100% do #3? Or should I take a template and overhaul it to personalize it?

    submitted by /u/damonian_x
    [link] [comments]

    To people working under contract/third party recruiter, what do you do about health insurance?

    Posted: 28 Feb 2020 08:28 AM PST

    Kelly Services got me a really cool job but the benefits through the temp agency suck. PTO doesnt kick in for a year and the health insurance is bad. This really makes me not want to do contract work and just find a full time job on a permanent basis. What do you guys think about this?

    submitted by /u/hansbrixe
    [link] [comments]

    Transition from established Freelance to Employee?

    Posted: 28 Feb 2020 05:08 PM PST

    I've been freelance now almost 6 years full time. Doing pretty well. So I had a random message from a HR recruiter online the other day. They were looking for a eCommerce administrator for a big name brand (Think Levi Jeans etc). I'm well qualified and told em I'd take a salary of 65-70k which seems average for a web developer in South Carolina (Tho I'll be functioning and using full stack skill sets). I'm past the skype interview on my way to two more interviews next week. They are moving really fast with the process.

    I'm weighing the pros and cons of the end game here. Its a two hour commute (1 hr each way) every day but its a straight shot. I wont make much more than I make now but it will be less stress (no client outreach, accounting, books, late night support calls etc) and I'll probably actually work less just working 9-5. Its a team environment. I've been working cabin fever for 6 years. My interactions are mainly sales, client outreach and support.

    For those that have transitioned back into a employee work role after years of self sustainment. How did it go? Did you have any issues with your work flow etc? What did you do with your portfolio website? Did you sell it? Keep it up? 301 it?

    What did you do with your client base? Refer them to others?

    Like I said. I'm not actively seeking employment. This kind of just unexpectedly fell in my lap. Thanks for the feedback.

    submitted by /u/clemsonwebdesign
    [link] [comments]

    Two Lessons I Learned From Making React Components

    Posted: 28 Feb 2020 05:01 PM PST

    Learning Path

    Posted: 28 Feb 2020 04:57 PM PST

    Hey r/webdev!

    I'm using a throwaway because I have classmates on here.

    I'll try to keep it short. I'm currently attending a coding bootcamp that focus on HTML, CSS, JS, and react. The classes, which happens 3 times a week for 2.5h, are basically us reading the materials on our laptops and attempting the exercises. There is no lecture, and the teacher is there to help you if need it.

    For JS we are reading chapters 1-7 from Eloquent JavaScript. I honestly struggled with this book but I'm slowly grasping the concepts a bit. Although, I still have no idea how I would implement what I learn when building a website. It's been extremely frustrating. We are moving to react after next week and we have a final project to present to the class.

    I know there are a lot of resources out there now but I'm wondering if I should stick to these 7 chapters or should I read something else instead? I started looking at JavaScript.info and I been feeling like I can actually see how this is implement in web developing.

    Before anyways says this bootcamp doesn't seem very good. It's a free bootcamp put together by a charity to help people find a job in web development. They help you with soft skills, resume writing and even talking to local companies on your behalf.

    Thanks everyone.

    submitted by /u/throwaway030391
    [link] [comments]

    "SPA (Single Page App)" with vanilla Javascript?

    Posted: 28 Feb 2020 07:51 AM PST

    Alright, loaded question ahead...

    I am well aware that JS frameworks exist, and I'm just curious how could something similar be achieved with vanilla Javascript.

    Below is the file structure, and I'd like to know the following...

    1. How to prevent the "view" functions from interfering with each other?
    2. How to split the code into separate "modules" and have them interact ex. have a utils.js that's shared among views.
    3. Why this is a bad idea?
      • The biggest problem I see here is that this is not even a SPA i.e. the browser reloads everything on page changes. I don't really care about this part.
    4. How can this bad idea be improved without a framework?

    template.js - Sends the HTML to the browser, along with the "SPA" Javascript file.

    var express = require("express"); var router = express.Router(); var components = require("../components"); router.get("/*", function (req, res) { let html = ` ${components.header('Page title')} <script src="/js/views.js"></script> </body > </html > `; res.send(html); }); module.exports = router; 

    components.js - All reusable components are here, used in the templates.

    module.exports = { header: (title) => { return ` <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>${title}</title> <link rel="stylesheet" type="text/css" href="/css/style.css" /> </head> <body> <div class="container"></div > `; }, } 

    views.js - The actual UI, dynamically created once the Javascript file loads in the browser.

    window.onload = () => { let path = window.location.pathname; if (path.includes("/foo")) initFoo(); if (path.includes("/bar")) initBar(); }; function initFoo() { document.getElementById("container").innerHTML = `<div id="content">FOO</div>` // Make API calls and update the UI } function initBar() { document.getElementById("container").innerHTML = `<div id="content">BAR</div>` // Make API calls and update the UI } 
    submitted by /u/8483
    [link] [comments]

    How do sites like Pornhub/Spankbang know which positions the people are in?

    Posted: 28 Feb 2020 04:12 PM PST

    On the video bar for skipping to X time, they have icons or a graph that represent different positions and scenes. Do they use machine learning on the server side to detect which is which when a user uploads a video?

    submitted by /u/throwaway_12424
    [link] [comments]

    How would I go about making this site for my client's business?

    Posted: 28 Feb 2020 04:07 PM PST

    So basically, it's a multivendor eCommerce site where users can post electronic devices to sell and whatever. I'm using WordPress, WooCommerace, and Dokan, so no problem there.
    My issue is when this client throws this "challenge" at me upon delivery. He says that his business works as a middleman between vendor and customer.
    The way it works is first requiring sellers to fill out detailed information about every item. Once someone decides on a thing that they like, it is sent to the business' HQ. They go over the device from top to bottom, verifying that it is precise as the seller described it. They check the functionality of every part of the device, such as screens, cameras, buttons, and speakers. Once this process is complete, and they have verified that the device is exactly as it was described, they send it out to the customer that initially ordered it.
    So as I said, I was able to set up the first part of the business with no problem. But I am quite perplexed on how to design and implement the functionality of the "middleman" part. I not even sure it's achievable with WordPress.
    I'll admit I am not the most experienced web developer. That's why I am asking for some possible guidance or suggestions here. If anyone has anything, I'd genuinely appreciate it.

    submitted by /u/OmanX
    [link] [comments]

    Can someone explain to me, why something that looks super simple, needs tons of external things imported to work?

    Posted: 28 Feb 2020 04:04 PM PST

    I'm new to the game of web development, and I'll probably never do it for more than a hobby. So I'm making a website for a friend, that's pretty basic but one of the more challenging things I've found to add is a language selector (Website will only be in two languages, and separated html files).

    There isn't many guides of this, but I came across this here;

    https://stackoverflow.com/questions/39722365/styling-language-select-button-in-html-and-css

    https://jsfiddle.net/manb0hzh/

    Which is perfect, but then I saw that to make this tiny thing to work, I need to import;

    • font-awesome.min.css - just for the tiny icon.

    • Latest compiled and minified Bootstrap CSS

    • jQuery library

    • Latest compiled Bootstrap JavaScript

    • As well as JavaScript inside the HTML, and a few lines of CSS in my style.css

    That's a significant increase of load time, just for one thing that takes up 50 pixels on the website. Saw the post on front page about 500KB website giving nightmares, well this tiny thing alone takes up 25% of that space (guess).

    Can anyone more knowledgeable explain why this the case, and if there is any steps I can take to just make sure I get what I need, if that's possible and not everything in those imports.

    submitted by /u/quirkyerror
    [link] [comments]

    No comments:

    Post a Comment