<wdg/> - Web Development general

Prev thread: →

>Free beginner resources to get started
Get a good understanding of HTML, CSS and JavaScript.
developer.mozilla.org/en-US/docs/Learn - a good introduction (independent of your browser choice)
freecodecamp.com
codecademy.com
hackr.io

>Further resources
developer.mozilla.org/en-US/docs/Web - excellent documentation for HTML, CSS & JS
github.com/kamranahmedse/developer-roadmap - Frontend+Backend learner-path suggestions
youtube.com/watch?v=Zftx68K-1D4&feature=youtu.be

jsfiddle.net - Use this and post a link, if you need help with your HTML/CSS/JS

Attached: wdg.png (822x552, 868K)

Other urls found in this thread:

glebbahmutov.com/blog/angularjs-inside-jade-templates/
babeljs.io/docs/en/babel-register
npmjs.com/package/interpret
stackoverflow.com/questions/1256593/why-am-i-getting-an-options-request-instead-of-a-get-request
twitter.com/SFWRedditGifs

>how do i into $100k web dev?

This question gets asked every single thread so I'll try and head it off now.
Yes, some high-profile bloggers etc have senior developer jobs without every going to university/college. They generally invented significant technologies though, or founded successful startups or otherwise made contributions that are recognised across the industry, especially by the big players.
You can get a job without a degree if you're someone like that, which you're not because you're asking how to be successful...without hard work...on Jow Forums.

The other way is basically nepotism, if your uncle owns a little software company, he might give you a job. If your family friend needs a website, they might pay you to build it, if your buddy is a developer somewhere, he might recommend you for an internship. Once you have some experience, it gets easier to get a job regardless of your formal qualifications (whether you can do the job is another matter).

If you don't have solutions like these available to you then you probably can't actually get a web dev job without a degree, sorry. You can argue about whether degrees teach you to be a developer and you can argue about whether the student debt is worth it but from an employer perspective, nobody hires someone because they have 'pluck' or have watched some online courses. And those online courses have a narrow focus that won't equal the breadth of skills and knowledge that university teachs, if you want some examples, check back a few threads for the user that tried to get a PHP job and failed the technical interview because they didn't have database skills as well. You need a lot more than just a language or two to be a developer.

Stay salty, my friends.

Attached: wdg-everyDamnDay.png (2140x405, 74K)

What do I do if I really only learn by doing things instead of listening to some asshole ramble at me about the theory of doing it?
What hope is there for someone who is intelligent but despises and flounders in traditional education?

Id rather work on something interesting than getting 100k for braindead web dev, thanks

So I just learnt about JS templating engines, and this looks much more manageable than just appending strings to the HTML.
However since I'm trying to learn Node, I want to use it both in my backend and frontend, but when I try to render some HTML on my backend, all the markups I want to send to the frontend are converted to HTML, and thus lost.

My only solution would be using 2 different engines - e.g. EJS in the backend and Mustache on the frontend. How stupid is this? What am I doing wrong?

In PHP, if I iterate through an array manually using a for loop it doesn't do anything to the array's internal pointer right? Like how foreach actually uses/changes the internal point?

>too intelligent for education
You're gonna have a problem. If you're really that smart, invent something new, find a flaw in existing technology and fix it. It worked for people like Dan Abramov.

You could always just submit patches to a bunch of open-source projects. If you're an active member of the open-source community then education will be way less important.
More likely though, it's just the Dunning-Kruger effect in action.

>thanks
You're welcome.

>what actually IS the Result Set? What does it actually look like and is it possible to just print it out in plaintext somehow (like for debugging)?
See: It's a resource ID, that's the result set, or at least an identifier that refers to it. You use that identifier to ask the DB to get you the result set rows, one by one (or even row by row by column, if you wanted).
There isn't any way to get the entire result set as one object because result sets can be massive. You can ask how many rows are in the result set though, there's functions for that. Read the manual here:

>join a small size digital marketing company to train in analytics
>employer have me chunk out small websites since im capable to google
>wordpress & plugins kek
>self learn frontend, minor backend stuff
Pretty sure Im missing out on working in an actual team

You can't argue with experience though, just get them to change your job description so that when you move on, people can call and ask if you were a web dev there and they'll say yes.

If you're the only one with any clue then transition to more modern techniques, at least frontend js frameworks, that experience will be way more useful to you than wordpress. You can tell your boss that it's more modern and will help with SEO or something.

>JS templating engines
I'm not sure that you really understand what you're doing with wanting the same template back and front end but it's possible I don't either, I'm not strong in JS templating.
It sounds like you want to make a backend JS template that gets built into a frontend JS template that gets built (in the browser) into an HTML page, is that right?

For what purpose? Templates are designed to render into HTML.
Are you wanting to make backend templates that build into Angular or something?

Am I retarded or does React look object oriented? Each (class) component takes care of its state, methods and rendering, and you emit changes from one object to the next. You can also inherit components with extends and compose new ones with higher order components and render props.

Is this what you're trying to do?
glebbahmutov.com/blog/angularjs-inside-jade-templates/

fucking hell js build steps are a nightmare
>need to load static files as bundles
>use stealjs
>works but need to automate it during build
>naive. try grunt. unending configuration, plugins, relative paths that dont work
>try gulp. has breaking changes with some of its dependencies and it asks you to audit each of its dependencies one by one.
>try browserify. crashes if you use es6 imports
>install babel to convert the imports before browserify. configuration out the ass with environment presets.
>try parcel. crashes if you use django templating syntax(edited)
now im onto brunch...

Attached: 200% swimming mad pepe.jpg (600x595, 20K)

>Am I retarded or does React look object oriented?
In OOP, objects are usually peers whereas React is focused on a hierarchy of nested components. That's a fairly minor nitpick though, React does share a lot of ideas with OOP and they're certainly conceptually related.

There's inheritance, encapsulation, emphasis on external interfaces, reuse...these concepts are pretty well embedded into React so it's a pretty fair description.

remove codecademy from the pasta. its shit and hasnt updated its angular tutorial since angular 1

>gulp
>browserify
Webpack is a more modern tool that will do all that stuff a bit easier. I won't claim that it has lighter configuration though.

Use create-react-app, then eject (which unhides all the scripts and config and makes them as if you'd written them at root level).
Once you've got that, uninstall some of the react stuff that you don't want. What you're left with is a solid webpack configuration that will compile almost any project down to bundled/uglified/minified js.
Or even leave react in there and just don't use it, I don't think it will get bundled if you never reference it.

This doesn't have to be your end goal, it's just so that you've got a template that you can trim down until you've got a relatively light webpack configuration that works. It's arguably easier than writing it from scratch, especially if you're a noob to webpack.

Or just install
"devDependencies": {
"babel-core": "^6.26.3",
"babel-loader": "^7.1.4",
"babel-preset-env": "^1.7.0",
"babel-preset-react": "^6.24.1",
"babel-preset-stage-2": "^6.24.1",
"babel-preset-stage-3": "^6.24.1",
"html-webpack-plugin": "^3.2.0",
"webpack": "^4.12.1",
"webpack-cli": "^3.0.8",
"webpack-dev-server": "^3.1.4"
}

Thats solid advice. How does webpack handle es6 import syntax and npm require() syntax?

Boss is cool with it. I do want to try the pwa meme for ages, but going through PHP+mysql since I'm shit in backend

>Web Developer and Analysis
Barely look at chart kek

This desu

It's a pain in the ass if you want your webpack config to be in ES6 import and export syntax, you need babeljs.io/docs/en/babel-register and do some stuff I forgot what then name the config webpack.config.label.js so npmjs.com/package/interpret can do its magic. I just keep the webpack config on vanilla JS.

>How does webpack handle es6 import syntax and npm require() syntax?
When I do a CRA install, it handles all that stuff perfectly.

CRA is a VERY heavy install, it installs a metric fuck-ton of stuff that you won't want but after ejecting, you can trim that stuff out piece by piece and if you're not using it, it won't go into the production build anyway so it's not the end of the world.

Is there a way to shorten this kind of variable assignments?
const { username, password } = res.data
const user = { username, password }


I remember seeing somewhere something like this:
const { user = { username, password } } = res.data

But it doesn't work, maybe it was on a different language?

Welp, I didn't think someone would answer.
In the backend the engine can dynamically generate HTML pretty much the same way PHP does in this example.



While in the frontend I can do something like this instead. It's just a recomendation though, I could do it with raw strings too.


{{placeholder1}}
{{placeholder2}}
{{placeholder2}}


Mustache.render(document.getElementById('template'), {
placeholder1: 'This will replace placeholder1',
placeholder2: 'This will replace placeholder2',
placeholder3: 'This will replace placeholder3'
});

Yes, without fancy destructuring assignment.
const user = { username: res.data.username, password: res.data.password };

const user = res.data;

Nope, why's that?

I would recommend you try learning things by doing

I just got back from holiday and want to die. Full-time work is a fucking cancer.

What's the best way to go about working as little as possible as a web-dev? I had a vague idea of working remotely in a cheap area/ country and filling a niche. Could someone give me some direction/ pointers? I'm front-end, few years experience, willing to learn something to turn it into my main responsibility.

>What's the best way to go about working as little as possible as a web-dev?
Considering you are lurking a Vietnamese sock puppet board instead of working, you are already doing it

I'm at work. I want to not be at work. If I only worked 3 hours a day I'd actually focus on my work since it would be a small chunk of the day rather than dominating the entire day. I have to have some distractions to keep myself sane.

Hace you considered neet bux?

I'm a big noob at "modern" web devel and was looking into starting an SPA project. From what I can tell I should be looking into frameworks like Angular, Vue, React or Aurelia. I'm a .NET winforms developer by day so my dream is to basically treat the browser page like an MDI - I want to open/close multiple movable windows that contain simple controls with easily bindable events etc.
I read in some random thread a few weeks back that ElementUI is really good but a very brief look into it says it is built on top of Vue which I thought was a full fledged UI library in itself. My main question - what do frameworks like ElementUI provide that the base anguar/vue/react do not? Are all the "core" frameworks "missing" features that require layers on layers of libraries/frameworks on top of them? Forgive the ignorance but I really have no grasp of the current state of a web dev ecosystem

I don't know how to get them without being forced into a shit job.

>try to use some API
>images are like 40% 16:9, 40% 4:3 and 20% whatever the fuck else
>names are literally unlimited fucking length so you get outliers that are 200+ chars long and others that are like 10

why is this allowed, why who's idea was this

>My main question - what do frameworks like ElementUI provide that the base anguar/vue/react do not?
the components

mine

You stole that idea from me, you'd still be on 8.3 if you hadn't copied my idea that I was going to patent.

we use Parcel around here sweetie

Either you are trying to make yourself feel special, or you've never actually been in the job market, because what you said is absolute horse shit.

Sure you would, professor.

How about you grow a pair and do your fucking job. Once you reach an elite level, motherfuckers think you walk on water and you can do whatever the fuck you want.

Nobody wants to work you mong, get over it. Unless you're wealthy you can't afford "3 hours a day".

The image is true, but your comment is roleplaying trash.

So I got this job for a webshop, they want to make automatic orders to their provider when someone orders from their shop.

Now every order to their provider need to be single xml files and they need to get these xml files through a post.
I can do this easily with a cronjob but that would only send 1 order every minute which isn't a lot.
How can I make some php script that runs the form that sends the xml files 1 by 1?

I'm not sure I understand your problem, it sounds like you're using PHP to handle the order request, can't you just use PHP/curl to send a post with the xml?
You can fake a file upload in PHP easily enough.

Well I'm an inexperienced intern so there's a good chance I'm missing an easy fix.

The distribution company for the webshop need to get the orders in seperate xml files and they take it in as ' ($_POST[‘data’]) '

So I need something to send a form with input name data and with the value set as the xml files using file_get_contents.

I can send 1 every minute with my script with a cronjob but that's not fast enough.

I'll try to look into curl though, I don't have any experience with it yet.

You can make post requests in PHP using curl. Look up that. Then you just have the curl POST fire when the user does whatever triggers you needing to send the xml. Don't do it on a cron job, just respond to the user's activity or the purchase callback or whatever event is firing.

Thanks, I'll give it a try

That just makes a reference to res.data, which isn't the same as copying it. Also res.data might have keys other than username and password that you don't want to copy.

the only way is to man up and deal with it like everyone else, you aren't getting those papers otherwise

>try gulp. has breaking changes with some of its dependencies and it asks you to audit each of its dependencies one by one.
just downgrade if that's an issue

Is there some sort of template I can grab to quickly make a locally stored homepage with links of my choice?

Just write it from scratch, HTML isn't that hard.

OK, I'll give it a go.

can't be that hard

Man, dealing with spaghetti code is so annoying sometimes. It's not even that its wrong, I just hate how some people write stuff. It's not clean, or visually pleasing or fucking a e s t h e t i c. Take some goddamn pride in what you program.

Now I can't be bothered to waste time cleaning all this shit up, either. I'm just forced to write in the same format or else it will be even more confusing.

Attached: zzz.gif (500x282, 949K)

I decided to create a react app from 0 without the create-react-app cli, everything works but for some reason I sometimes get a 404 error when I restart the server, why the fuck?

Failed to load resource: the server responded with a status of 404 (Not Found)

What does the OPTIONS mean in morgan logger? I get requests like these

OPTIONS /api/resources 204 1.923ms
GET /api/resources 304 290.725ms

stackoverflow.com/questions/1256593/why-am-i-getting-an-options-request-instead-of-a-get-request

Self-awareness: 0

So the authorization token I sent through the headers is the one doing that? Morgan logger never did that before but I recently updated my dependencies.

>without the create-react-app
that's your problem

what does your package.json look like?
try putting this, and another dependencies you might need
{
"name": "client",
"version": "0.1.0",
"private": true,
"dependencies": {
"react": "^15.4.2",
"react-dom": "^15.4.2",
},
"devDependencies": {
"react-scripts": "0.9.4"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test --env=jsdom",
"eject": "react-scripts eject"
}
}

If you're talking about the way these people write some programs, then I do agree it's zero.

let independence; // declaration of independence

Yes I could use use cli but I want to create it myself to learn more about webpack and babel.

I have
babel-core
babel-loader
babel-preset-env
...preset-react
stage-2 and stage-3 for class properties and spreads/rest
html webpack plugin
webpack
webpack cli
webpack dev server

Was to

I have a truckload of cash to spend on studies.
I was considering starting with CCNA since my computing passing is more network related but feel tempted to do webdev stuff instead.
What should I start learning and get degrees in to secure a good webdev job in the future.

>I have a truckload of cash to spend on studies.
must be nice

i use that configuration without problems whatsoever

>must be nice
indeed it is, no rent or utilities to pay other than some food for my hikki lifestyle.
I just want a comfy job that I could do from home and webdev seems like it's a nice place to start looking.

what were you doing until now?

So Brad Traversy released a new series on the MERN stack and it's my first exposure to MongoDB. I want to find out for myself what it can be used for. But in the video Brad 'hosts' the database(?) on a private company's website called 'mLab'. I don't know how it all works together yet but I'm always suspicious of giving data to private businesses. Do MongoDB databases usually reside on your server or is it a private thing hosted elsewhere? Sorry for what may be a stupid question, I've always worked with SQL but have always heard shit about MongoDB, good and bad, and would like to understand how it works.

Shit, ignore me, literally a few seconds later he says I can set it up locally.

Databases/servers as services is the future, just accept it. mLab does all the physical configuration you might need for a database and does it better than any single person could. If you're worried about companies having your databases just think about how they've been hosting your web applications as well, same shit.

I used to repair stuff for banks, cardreaders and the things inside ATM's that check if the bills were legitimate among other things.
The money that they saved by not sending it to the repair vendor would go to our project savings.
However after 4 years without a raise at all even though we were making $200K savings a month for the company I told them I was leaving since I just couldn't see myself having any future there at all.
The work pressure was pretty much hell considering most parts are only $100 at most (some were only like $20), sometimes we'd get lucky and get some parts in that were worth like $1K but that was rare.
It was pretty much working at a helpdesk but with even stricter targets and you could never take leave or use your overtime.

Yeah, I've just seen the course although I have already completed his udemy mern course where he also uses mlab for database.

You can easily setup mongodb on whatever os you're running. If you're that wary of giving information to mlab which seems to be a legit company then use a secondary email or simply go the local db route.

MongoDB isn't bad at all. If you're doing a full stack js project then mongodb is easy to setup and learn. I wouldn't recommend it for some robust projects where a relational database would be more suited but to give you an answer, mongodb isn't bad if you know how to code properly and you know when to use it.

>mLab does all the physical configuration you might need for a database
Such as...?

~Programming is a very broad area. you could work in web dev, mobile apps, games, etc etc.

I would say to try a little bit of everything to see what you like/don't like and see yourself spending more time in the future.

You don't need to spend a dime since everything is already on the web, although some people need guiadance and can't do things alone.

good luck in your endeavors friend.

Attached: 1514060848051.jpg (2272x1704, 631K)

I mean it's nice to be able to put like a certification or whatever on your resume, shows that you actually went and did a standardized course and such.
I still know a bit of HTML5 and CSS3 from when I went to highschool.
Should I just focus on PHP and database stuff to start with ?

getting the hang of this web dev stuff.

you lads will be out of a job in a few months

Attached: Capture.png (1243x617, 472K)

How easy it is to work with SQL in react?

Hey /stackoverflow/,

Help a bro out if you happen to know. I want my AWS ec2 Jenkins server to have access to Mongo hosted on that server. What do? is it just as simple as opening up the right port in the security settings? Is it possible to restrict that so only the localhost has access to it?

How to use postman to send Post Request of Form in Laravel ? I want to avoid using UI for some purposes.

You just send it?

no. I have tried several times. i don't know what header should i use or where should i put my csrf_token, ...etc.

obviously you need to spy on a real form request to know what the server expects

Post your errors or something at least. Try sending something and receiving something without authentication.

"no"

>I decided to create a react app from 0 without create-react-app
That's definitely worth doing at least once, just so you appreciate what CRA does for you.

I have no idea why you'd get an intermittend 404 on something, you've told us nothing about the backend or even what request 404s.

>not hoisting a flag

>Help a bro out if you happen to know. I want my AWS ec2 Jenkins server to have access to Mongo hosted on that server. What do? is it just as simple as opening up the right port in the security settings? Is it possible to restrict that so only the localhost has access to it?
All of that is possible, easy even.
You don't need to use security groups for localhost stuff but that's the keyword to look for regarding securing AWS stuff generally though AWS tends to be pretty locked down by default.

>How to use postman to send Post Request of Form in Laravel ? I want to avoid using UI for some purposes.
You might find Insomnia or just cURL a bit simpler to use.

>You don't need to use security groups for localhost stuff but that's the
keyword to look for regarding securing AWS stuff generally though AWS tends to be pretty locked down by default.
Fun fact, I opened up port 8080 and 80 on my server when I made it. Jenkins runs on 8080 by default, I opened 80 in case I ended up running jenkins there anyhow. About two days after I started my server, AWS sent me an email saying there was a DDOS attack against my server on port 80 with some UDP traffic and that they'd closed down my port automatically. Amazon doesn't fuck around. At first I thought it was a scam email but pretty sure it was legit.

Anyhow, I did get Mongo running. The real trick was installing it. I dont know as much about Ubuntu as I should, but was able to follow some simple steps to download mongo using apt-get. Had to open port 11371 to allow GPG traffic in that process. I have port 27017 opened since that is what mongo runs on, though it might not be necessary. I saw an "access denied" error before but that was likely because nothing was running on port 27017 before I installed mongo

How can I structure a login system that has companies, and companies can make their own users? How would it look like in SQL and server?

>

Attached: sdasda.png (1502x400, 19K)

>do all the work for me

How can i create 2-dimensional array of nulls in js without loop? I tried new Array(height).fill(new Array(width).fill(null)), but it creates array with length of height of reference to the same array.

is NotANumber a Number? The answer may surprise you!

Attached: Screen Shot 2018-06-27 at 12.20.33 PM.png (730x350, 43K)

>needing require

typeof NaN // 'number'

>haha guys see this? Javascript is SHIT ahahahahaha NaN is a number this is hilarious
>>>/dpt/

var arr = new Array([]);

I need array of nulls, not an empty array. With w=2 and h =2 it should be [[null, null],[null,null]]

var arr = Array.from(Array(2), () => new Array(null,null));

output
[ [ null, null ], [ null, null ] ]

It does works, but it's still iterates.