[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

/wdg/ - Web Development General

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 73
Thread images: 6

File: 1462453773600.png (747KB, 824x553px) Image search: [Google]
1462453773600.png
747KB, 824x553px
/wdg/ - Web Development General

Previous Thread: >>56336286

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

>IRC Channel
#/g/wdg @ irc.rizon.net
Web client: https://www.rizon.net/chat

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

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

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

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

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

>How to get started
https://youtu.be/sBzRwzY7G-k - "2016/2017 MUST-KNOW WEB DEVELOPMENT TECH - Watch this if you want to be a web developer "
https://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
https://lowendbox.com
https://www.digitalocean.com/
https://www.linode.com/
https://www.heroku.com/
https://www.leaseweb.com
>>
>>56379282

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


<% items.forEach(function(item) { %> 
<article class="item">
<div>Title: <%= item.title %></div>
<div>Content: <%= item.content %></div>
<div>Author: <%= item.author %></div>
<div>ID: <%= item.id %></div>
</article>
<% }) %>


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?
>>
>>56379419
Thanks for the links, I'll check those out.
>>
>>56379419
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?
>>
>>56379588

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 https://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?
>>
>>56379710
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!
>>
>>56379408
Please respond.
>>
>>56379408
I'm not sure I understand what you want to fix.
Do you want the items without clicking the button or?
>>
>>56380139
It's only been like 45 minutes, fuck off.
>>
>>56379472
>>56379472
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?
>>
>>56379857

> i was just shortening it
>by using the name of a totally different language
>>
File: Captudre.png (27KB, 239x704px) Image search: [Google]
Captudre.png
27KB, 239x704px
>>56380261
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.
>>
>>56380468
What's your button code? Show us how you make the call to /get?
>>
>>56380604
<section>
<h3>Get Data</h3>
<a href="/get">GET DATA</a>
<div>
<% items.forEach(function(item) { %>
<article class="item">
<div>Title: <%= item.title %></div>
<div>Content: <%= item.content %></div>
<div>Author: <%= item.author %></div>
<div>ID: <%= item.id %></div>
</article>
<% }); %>
</div>
</section>


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('/');
});
});
>>
>>56379710
>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.
>>
>>56380684
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???
>>
>>56380847
References>Degree>portfolio>Wordpress theme installing>HTML>CSS>Javascript
>>
>>56380822
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.

<% if (typeof items == 'object' && items) { %>
<% items.forEach(function(item) { %>
<article class="item">
<div>Title: <%= item.title %></div>
<div>Content: <%= item.content %></div>
<div>Author: <%= item.author %></div>
<div>ID: <%= item.id %></div>
</article>
<% }); %>
<% } %>
>>
>>56380914
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
>>
>>56380357
There are people on occasionally. I think most people just hang out in the thread though.

>>56380376
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



>>56380695
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.

>>56380847
Watch the "Watch this if you want to be a web developer" youtube video in the OP.
>>
>>56380989
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?
>>
>>56381261
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?
>>
>>56381286
>Aside from transportation, are cars useful?

>>56381377
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.
>>
>>56381377
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.
>>
>>56381436
>>56381412
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.
>>
>>56381767
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.
>>
>>56379419
Coding rainbow. I love the coding challenges
>>
File: plsHelp.png (52KB, 1808x172px) Image search: [Google]
plsHelp.png
52KB, 1808x172px
Alright /g/, how do I allow accentuated characters on the preg_match function? (Like ã, Ã, é)

> pic related
>>
>>56381767
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.

>>56382000
Alright, added.

>>56382248
http://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.
>>
>>56382421
>Does node do things client-side?
No.
>>
>>56382421
>Does node do things client-side?
nope. It's not backend like php or asp, lad.
>>
>>56382421
What kind of tools?
>>
>>56382535
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.
>>
>>56381148
>let

Should I be using this instead of var?
>>
>>56382700
Disregard.
>>
>>56382520
Node *is* for backend.

>>56382700
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?
>>
I once saw someone do this in a form

<input type="text" id="title" name="item[item1]">


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.
>>
>>56384097
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.
>>
File: aa.png (104KB, 1233x969px) Image search: [Google]
aa.png
104KB, 1233x969px
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?
>>
File: bike.jpg (193KB, 666x1000px) Image search: [Google]
bike.jpg
193KB, 666x1000px
>>56382497
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.
>>
>>56384707
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:
https://github.com/MichaelFroelich/FAP.React/blob/master/README.md
https://www.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
}
>>
>>56382497
I mean do you really want to require something everytime you need to check a password? You only need to do it once.
>>
>>56387073
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
>>
>>56387584
What kind of project do you need to host?
>>
>>56382497
>not using import
>>
>>56387584
Cock box
>>
When will web components (html spec) start seeing use?
>>
>>56387584
Go to lowendbox and find one relatively close. Sites are most impressive when they respond quickly.

>>56387958
What is ReactJS?

>>56387073
>>56387532
>people are still using PHP around me
>>
File: howwouldi.png (601KB, 1366x667px) Image search: [Google]
howwouldi.png
601KB, 1366x667px
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
>>
>>56383939
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".
>>
>>56386004
>>56387426
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?
>>
>>56388860
Run a script in the background that writes to a file within your web directory, then attach that file like
<?php $d = file_get_contents('127.0.0.1/output.txt'); 
echo $d;

Then learn to dev and uninstall PHP from your webserver.

>>56388822
Any advice advertising for clients? How does one get their name out there?

>>56388780
Remove all borders entirely and 100% everything. Bang.
>>
>>56388918
So i have problem anon. 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
>>
>>56389089
Your server might be dead.
>>
>>56388918
>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.
>>
>>56389162
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.
Thread posts: 73
Thread images: 6


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.