/wdg/ - Web Development General

/wdg/ - Web Development General

Previous Thread: > Discord
discord.gg/wdg
OR
discord.gg/0qLTzz5potDFXfdT
(they're the same)

>IRC Channel
#Sup Forumswdg @ irc.rizon.net
Web client: rizon.net/chat

>Learning material
codecademy.com/
bento.io/
programming-motherfucker.com/
github.com/vhf/free-programming-books/blob/master/free-programming-books.md
theodinproject.com/
freecodecamp.com/
w3schools.com/
developer.mozilla.org/
codewars.com/
youtu.be/JxAXlJEmNMg?list=PL7664379246A246CB - "Crockford on JavaScript" lecture series.

>Frontend development
github.com/dypsilon/frontend-dev-bookmarks

>Backend development
en.m.wikipedia.org/wiki/Comparison_of_web_application_frameworks
gist.github.com/dypsilon/5819528/

>Useful tools
pastebin.com/q5nB1Npt/
libraries.io/ - Discover new open source libraries, modules and frameworks and keep track of ones you depend upon.
developer.mozilla.org/en-US/docs/Web - Guides for HTML, CSS, JS, Web APIs & more.
programmableweb.com/ - List of public APIs

>NEET guide to web dev employment
pastebin.com/4YeJAUbT/

>How to get started
youtu.be/sBzRwzY7G-k - "2016/2017 MUST-KNOW WEB DEVELOPMENT TECH - Watch this if you want to be a web developer "
youtu.be/zf_cb_Nw5zY - "JavaScript is Easy" - If you can't into programming, you probably won't find a simpler introduction to JavaScript than this.

>cheap vps hosting in most western locations
lowendbox.com
digitalocean.com/
linode.com/
heroku.com/
leaseweb.com

Other urls found in this thread:

github.com/rails/actioncable-examples
stackoverflow.com/questions/2250567/how-do-i-match-accented-characters-in-preg-match#2250585
github.com/MichaelFroelich/FAP.React/blob/master/README.md
nuget.org/packages/FAP.React/
twitter.com/AnonBabble

router.get('/get', function(req, res, next) {
Collection.find({}, function(err, foundItems) {
res.render('index', {items: foundItems});
});
});




Title:
Content:
Author:
ID:


Ok I think I know why it isn't working. When the index page renders there isn't an items object yet, because I actually request them with a button. Does anyone know how to fix it in mongoose?

Thinking about adding a section in the OP on helpful youtube channels.

So far I have:
- funfunfunction
- learncode.academy
- derek banas
- thenewboston
- computerphile

Any other suggestions?

Thanks for the links, I'll check those out.

Also, I'm pretty sure the current template is close to the character limit. What can I get rid of that nobody will miss? I'm pretty sure at least a few of the links are dead anyway.

I'm thinking of making a website soon.
How long would you think it would take to make a 5 page website using Html, css and basic java?

Maybe a couple hours if you know what you're doing.

You most likely mean javascript, not java, by the way.They're two different things.

I cloned this github.com/rails/actioncable-examples and fired up the server and the redis-server but no requests go to redis' way and it doesn't work like what's shown in the gif. what do?

Yeah just was shortening it there, I'm still kind of rusty on the whole Javascript end and it's been a couple of months since I built a website and loss track of how long it took. Cheers for replying though!

Please respond.

I'm not sure I understand what you want to fix.
Do you want the items without clicking the button or?

It's only been like 45 minutes, fuck off.

Does anyone even go to the irc? I went a few times and there was nothing going on in there.

if (num%1 != 0) { alert ('not a whole number');}

Is this the best way to check?

> i was just shortening it
>by using the name of a totally different language

Want the items to show up when clicking the button, but before I get that request items is undefined in the view. I need to manually go to the /get route for it to work.

What's your button code? Show us how you make the call to /get?

Get Data
GET DATA



Title:
Content:
Author:
ID:


router.get('/get', function(req, res, next) {
Collection.find({}, function(err, foundItems) {
res.render('index', {items: foundItems});
});
});

router.post('/post', function(req, res, next) {

var item = {
title: req.body.title,
content: req.body.content,
author: req.body.author
};

Collection.create(item, function(err, newItem) {
res.redirect('/');
});
});

>a couple hours
Maybe if you use the default bootatrap theme, have all the content at the ready, and have nothing difficult to implemment.

Maybe I just put way too much effort into my shit, but I have spent the last 4 days on a basic 1 page app. It's pretty damn amazing though.

I think it's because your /get page get the items, then render the 'index' page with them.

While you want your button to call your /get which will return items but not render anything. I don't think href will work here.

Read on how to make an ajax call with ejs if that's possible, or use jquery or another frontend lib, so your GET DATA button on your index page will make a call to your /get page which will return items in json, that you will then process with ejs like you're doing.

I know this comes up all the time, so I apologize but what are some skill milestones you all consider to be required for a junior level front end dev?

Like html>css>js/jquery etc...

But what are some basic things I should be able to do???

References>Degree>portfolio>Wordpress theme installing>HTML>CSS>Javascript

Yeah i thought about ajax but this is a simple exercise rendering complete pages, I think I found the solution though. I'll move to ajax later I just want to learn basic crud requests first.




Title:
Content:
Author:
ID:

Cool. I can do all of that but my javascript is not on point. I took a course in it and had the basics a few years ago but I never used it so I don't remember dick.

Is WordPress always going to be super prevalent throughout a potential career? Is web dev dying??

Had a couple of beers some weeks ago with the developer of frontend.directory. chill guy. Talked about monads alot. What up, dimi

There are people on occasionally. I think most people just hang out in the thread though.

Yes. There's also parseFloat(n) which will return NaN if n isn't a float. It's buggy though, so I wouldn't use that. Your way is better.

You can also mutate the Number prototype and call it as a method if that's more your thing:

Number.prototype.isFloat = function () {
return (this % 1 != 0);
};

// then you can just do this:
let num = 4;
let anotherNum = 4.2

num.isFloat(); // returns false
anotherNum.isFloat(); // returns true

I meant more like a couple hours as the lower bound. I've been working on a personal portfolio site for almost a year and it's still not exactly how I want it.

Watch the "Watch this if you want to be a web developer" youtube video in the OP.

Most junior level jobs are wordpress, at least where I am at.

Web dev isn't dying, but it is going to be oversaturated in 5 years. Best to get in now and get the experience.

Aside from being a convention, is RESTful routing useful?

Yeah that's all I can find here too is WordPress. I'm glad I am getting in now, wish I would've got in 5 years ago instead of doing tech support...

Speaking of which do you think a tech support does anything for a resume other then show that km technologically inclined?

>Aside from transportation, are cars useful?

Shows that you have experience handling the dumb shit people do to their machines while conducting yourself in a professional manor. That's one of the most useful soft skills you can have anywhere in the IT industry.

Maybe if your tech support involved linux administration or something.

It's better to have than 'cashier'.

What's the best route for the learning material? The second lesson in Code Academy for CSS includes a lot of things they didn't cover in previous lessons, which makes it difficult to understand why the things I learn in the lesson aren't apply to my own test html page.

W3Schools has a similar problem by failing to thoroughly explain what each portion of the element they're discussion does. The test exercises for both of these sites are nice, though. I'd just prefer a real step-by-step method that covers everything rather than jumping into the deep end of the pool and try to figure things out that way.

Cool. Hey thanks guys for the help. There's a lot of doubting myself and my skills I just started putting in applications and so far I've gotten bites but nothing concrete. I was just making sure I wasn't completely over my head.

Go start a website right now. Copy code if you have to.

Very very few people learn and become competent through reading or being taught. You have to go out and start something. Even if it sucks.

Coding rainbow. I love the coding challenges

Alright Sup Forums, how do I allow accentuated characters on the preg_match function? (Like ã, Ã, é)

> pic related

You should get in the habit of always having google and some docs at your fingertips. Even if you've been a web developer for decades, you're still going to constantly come across things you don't know or remember how to do.

>W3Schools has a similar problem by failing to thoroughly explain what each portion of the element they're discussion does.
MDN is generally preferred to W3Schools for that reason. The docs are much more concise, accurate, and thorough.

Alright, added.

stackoverflow.com/questions/2250567/how-do-i-match-accented-characters-in-preg-match#2250585

Stupid question time.

Does node do things client-side? I make free tools in js but don't want anything eating my server. I want the client to eat it all.

In node, is it considered bad practice to require something inline and using it directly instead of setting it to a variable at the top of the file?

i.e.

// . . .
require('bcryptjs').compare(testPassword, matchPassword)
.then(isValid => {
// Do auth stuff
})
.catch(err => next(err));


versus:

const bcryptjs = require('bcryptjs');
// . . .
bcryptjs.compare(testPassword, matchPassword)
.then(isValid => {
// Do auth stuff
})
.catch(err => next(err));


Assuming that's the only place in the file I'm using bcryptjs.

>Does node do things client-side?
No.

>Does node do things client-side?
nope. It's not backend like php or asp, lad.

What kind of tools?

Tools for twitch streamers. There's a lot that doesn't exist yet and it adds to my portfolio, if even just a little bit.

>let

Should I be using this instead of var?

Disregard.

Node *is* for backend.

Yes. Or const if it's not supposed to be reassigned.

I'm changing text in a div. It's a single line of text changin to a small single line of text.

How can I animate the div when I change the textContent?

Not directly related, but apparently bcryptjs doesn't actually have support for promises. Wtf?

I once saw someone do this in a form


Doing bracket notation on the name of the input, then instead of creating an object out of individual inputs like

var item = {
item1: req.body.item1,
item2: req.body.item2,
item3: req.body.item3
};


They just passed the object like this into the function

Collection.findByIdAndUpdate({_id: req.body.id}, item, function(err, updatedItem) {
res.redirect('/');
});
});


But it seems to return undefined for me, do I need to do something else before?

I still don't understand why so many people find hosting expensive. You can get hosting for less than $5 a month yet when I told a client (my third ever) that it's going to cost around $50-$70 for hosting + domain she thought it's a lot.

the odin project has mentioned Macs several times so far since I started reading. there has been several implications that using a windows computer will be detrimental to learning ruby on rails. should I slap a copy of linux on my spare laptop or no?
also, a lot of blogs/bootcamps claim that with at least 40 hours a week, someone can be job ready with a language in about 6 months. is this a meme? I feel likes its a meme.

Ruby is fucky on Windows. Personally I got it up and running well on my Win7 machine but many people have had issues with it on varying versions of Windows. There's nothing to lose from dual booting Linux alongside Windows - when you're ready to code, boot into Linux.

About your second point. 40 hours a week for 6 months seems very excessive. You can learn a language inside out in less time than that.

Fuff I changed my package.json name and version and now I can't fucking run the server for some reason, even after reverting it back. What did I break?

Yeah because its easier to just change the top variable if something changes rather than delve into your code and try to fix it. Plus its better if you want to reuse it.

The error message says node cannot find your routes directory, so when you reverted you probably deleted the require for your routes

Guy from few days/week ago (lost count...)

Updated my server side rendering library, still haven't updated my site with it though since I have to use Linux for that.

Read this:
github.com/MichaelFroelich/FAP.React/blob/master/README.md
nuget.org/packages/FAP.React/

Because who needs Ajax, amirite?

Anyone worked with Google OAuth/PHP sessions?

When accessing account pages for a user, is it required to check the access token every time the user loads the page?

At the moment the major point to check logins is this line of code as well as a database check for google id:

try {
$this->client->setAccessToken($_SESSION['access_token']);
} catch (Exception $e) {
// access token expired/invalid
}

I mean do you really want to require something everytime you need to check a password? You only need to do it once.

How long does the checking take?
If you find it a bit too heavy, you could set a granted_access (or whatever) boolean with an expiration time in your session. So for each page, it only check the $_SESSION instead of requesting Google checking? And you only re-check when it's expired.

hey guys what is best web host pls thanks

What kind of project do you need to host?

>not using import

Cock box

When will web components (html spec) start seeing use?

Go to lowendbox and find one relatively close. Sites are most impressive when they respond quickly.

What is ReactJS?

>people are still using PHP around me

How would I go about making the border radius property fit into the whole white space above the image? it's for a coding challenge, also making it responsive and adjust itself to fit for every monitor & smartphone

I once had a client that insisted on getting a high-tier (~$200/month) vps to host his shitty little wordpress 5-pager on because he was planning on "getting a lot of e-customers". (The site was just information about his physical business, so...)

I think it's because most computer-illiterate people have absolutely no idea what anything costs. They'd be equally sticker-shocked if you said it was $2000 vs $20. And anyone who's freelanced for any amount of time has probably gotten plenty of people thinking it'll be like $20 all in because "you just have to click a couple things. It shouldn't take you more than a few minutes".

I can't really think of any reason why I'd need to use bcrypt more than once in the same controller though.

Can someone help me, i want to get output of linux command in php.
So, i execute some command, for example working status of some app, mysql-server status.
How can i get status and output it with echo in php?

Run a script in the background that writes to a file within your web directory, then attach that file like

So i have problem user. Output in console and output in php are not same.
Im checking if server is running and in terminal i get: Server is running
in browser: Server seems to have died

Your server might be dead.

>Any advice advertising for clients? How does one get their name out there?
Get yourself out there. Craigslist, Facebook groups, knock on doors, shake hands, give out business cards, etc. If there's any kind of event where potential clients might be there (small business meetup for example), be there and make yourself known. And do a good job and conduct yourself professionally.

And I usually mention this when someone brings it up: There's a misconception that freelance web dev is a good job for a NEET beta. It's not. It's a sales job where you occasionally do some computer stuff. You have to be hyper-social and know how to read people and sell shit.

Also, it kind of sucks. I do it as a side thing because I keep weird hours, but you're better off working for an agency or company.

Agency won't accept me, friendo.

I might actually try Facebook, although I'd try my local area's tradesmen site before craiglist. My issue has been more meeting people with small businesses who would actually want a website.

Lastly, don't assume my social skills, not because of my other skills or where we're conversing. Assumptions is what's killing my career, not substance.