/wdg/ - Web Development General

Don't fuck up the OP edition.
Previous thread: >COMPLETE BEGINNERS GUIDE
github.com/kamranahmedse/developer-roadmap

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

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

>PHP resources
pastebin.com/gfBPg24A

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

Other urls found in this thread:

learnxinyminutes.com/docs/html/
learnxinyminutes.com/docs/css/
learnxinyminutes.com/docs/javascript/
learnxinyminutes.com/docs/php/
learnxinyminutes.com/docs/typescript/
unifi-mesh.ubnt.com/#antennas
developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/arguments
en.wikipedia.org/wiki/FastCGI
github.com/google/tink/issues/104#issuecomment-417512050
twitter.com/NSFWRedditVideo

First for Angular!

Hey, I think you actually didn't fuck up the OP!

My current project:
Haruhi problem verifier. It's pretty shitty and inefficient, but it works for small stuff.

Attached: Screen Shot 2018-10-26 at 11.58.37 PM.png (1350x1094, 121K)

third for snakes

>spent the last 6 hours debugging why WP won't let me set or remove featured images(/post thumbnails)
>everytime I try, I just get a 403 Forbidden on admin-ajax.php
>debug minified JS for a few hours
>figure out that the global Post -object isn't being set in wp-admin directory, or is being unset somewhere
>look through every file I've ever touched on the project, JS and PHP
>can't find shit
>start verifying checksums on all the files on the whole core and plugins and theme
>can't find shit
>figure i'll need to do a whole clean installation, and just migrate the databases and stuff over
>try one last thing before I start
>disable all plugins
>fucking works

Motherfucker, it's ALWAYS the plugins. ALWAYS!

Best part; this was just something I stumbled upon. I wasn't supposed to fix this to begin with, so I won't really be able to ask for payment for these hours..

Attached: fghkfhj.jpg (415x423, 23K)

>what are the "Need to know" fundamentals before diving into laravel?

>php session handler, streams, reflections, headers, PHP OOP Basics ( namespaces, objects/classes, traits, interfaces, abstract classes .. etc )
Thanks PHPguy, this will keep me busy for a while

>HTML
>CSS
>JS
>PHP

Tell me why you would need anything else

That's why I have been slowly replacing all Wordpress plugins with my own code.

But the problems is I still have some vital ones, like for ordering posts. Which would be a pain to replace entirely.

PHP/HACK HELP FOR GENERATING A SQL QUERY

So, my Hack endpoint has a bunch of filter params coming into it, such as start date, end date, and a bunch of IDs. I have a SQL database I need to query based off of that. Is there a good solution for this? The sprintf function to build the SQL query is starting to look a little gross.

I'm also a bit of a SQL n00b. Is there anything I can do to at least modularize my query? Like:

SELECT * from table
WHERE ... (stuff with first filter)
WHERE ... (stuff with second filter)
WHERE ... (stuff with other filter)
and so on

To like, make this string easier to generate and not as hacky

I’m having trouble understanding your question. I think you’re asking how to add a swap after system installation. Is that correct?

It wasn't a question. Just a comment. But thanks anyway.

Thanks for trying to help, but your edit isn’t what I meant. I’ve removed your edit, and have updated my question so it’s clearer

Attached: believeit.jpg (720x439, 47K)

I don’t think this is a duplicate. My question is about cement board, while the question you linked is about drywall

only one WHERE is allowed, chain your filters with AND-s and use prepared statements for gods sake

I'm assuming you're using tables that references other tables through foreign keys. If that's the case (and I really hope it is) use INNER JOIN tablename ON... to avoid nested SELECTs. Also, if you really can't use JOIN then do nested select but make sure you ONLY GET ONE RESULT, otherwise your query will hit the crapper. Like the other user said, use only one WHERE and additional conditions with AND.

Because PHP is terrible

Attached: 1534223518856m.jpg (849x1024, 122K)

real men take care of referential integrity on their own

Is there a way to handle a nodejs script in php?

handle script?
what do you mean

if you mean like, run, then no.
you can spawn an instance of node, but it's a horrible option unless you can't avoid it

php7.1 is fine, the only thing I want in it is the possibility to do continous work and async stuff, but hey

Handle an instance of node that run fetches some data in a infinite loop until it finds a correct set of data, i know i can do crontab, but its not an option (because im using a webscraper inside the node script that has to login to a website)

Solution: git gud and stop using WP

Remove php and replace it by something that isn't actually filled with security vulnerabilities (some which have been known since 2015)

>2018
>Literally no reason to use SQL over NoSQL masterrace
>Tries out SQL anyway

You can use HEREDOC for very long strings:

$str =

Reposting for input.

Some kind user already suggested me javascript.info, which looks pretty good, thanks again.

Attached: inputpls.jpg (1220x1267, 178K)

I help you fucks all the time, now help me.
What are some good resources for learning the MERN stack?

learnxinyminutes.com

Also, I have one doubt.
I settled for fcc (already used it some time) as my starting point, for a bit of handholding at the beginning.
I'm not sure if I should finish it first, then expand info on my own, or, what I think it could a good approach, expand as I go. I mean, finish the HTML/CSS section, then expand it, build websites and shit, and when I'm comfortable with that, then move to JS, and so on.

Specifically:

learnxinyminutes.com/docs/html/
learnxinyminutes.com/docs/css/
learnxinyminutes.com/docs/javascript/
learnxinyminutes.com/docs/php/
learnxinyminutes.com/docs/typescript/

Lmao I got that email too

I take the bait.
most NoSQL software is in memory, if you have a large amount of data you straight up can't use it. another big disadvantage is there is no rollback functionality via transaction logs, if something goes wrong due to a race condition or something similar you are fucked beyond and can't recover by undoing the operation

>react

that's gonna be a yikes from me

i just want a job in 6 months

Attached: JFMSU.jpg (560x768, 50K)

I used that in the past, but usually to refresh concepts instead of learning. Great site though.

Good luck user, I gave myself 12.
If it fails, we can team up and make an amateur VR niche porn site.

hola lads,
i'm a full stack dev, soon to be project lead in one the leading products of it's field and I'm 23. Need any help? I'm self thought btw
cheers

taught* :'(

Also petition to remove that fucking deprecated jQuery away from /wdg/

I have been going through the MDN tutorials. Now I understand HTML/CSS but have trouble writing it from scratch. How do I pass that threshold and make a landing page or something?

Also, can I start JavaScript even if I don't understand HTML/CSS fully? If they are used alongside JS maybe I'll learn them better that way.

29 here, if you could give some input on Not going to bore you but when I was younger I was just a lazy bastard and did a stupid degree, so I'm a bit late to the party.

On a side note, I've got enough money saved, already worked on improving my English to a decent level, and my ultimate goal would be working remote.

at this very stage of web development JS isn't used alongside html/css it's the main focus. HTML and CSS are so simple to grasp that you're doing something wrong if you don't understand them. Think of HTML/CSS as the materials when building a house, but javascript is the heavy machinery and workers. Make a responsive page just with HTML/CSS now. Don't worry about JS. Don't give a shit about JS untill you understand the basic concept of HTML and CSS. They're not programming languages, they're actually markup and stylesheets respectively. JS is a programming language, and a very powerful one at that. In JS you can program logic, but in HTML/CSS you can't do that. tl;dr make landing page with html/css right now using media queries and someone else's design then move on to js.

I really didn't know how to use SQL until I accepted this job. Now I'm writing 100+ line queries. Just make personal, passion projects and get a shitty junior position job and work on real life projects. Or alternatively just simulate real world projects. Make your own, solve a problem you had. Make a todo list that handles RESTful APIs with lumen on the back end and VUE on the front.

While I'm still learning, I think I can help you with that.
Start building shit asap.
freecodcamp challenges are good for that because they give you certain rules to follow. Somethings is harder to figure what to do than how to do it. Eventually you will start seeing the pattern in many pages: design the navbar, sections, style a bit, boom, you got your landing page.
I'd say diving into JS is good as long as you keep working on CSS. One of my biggest mistakes is trying to tackle a lot of stuff at the same time. You'll get confused and forget shit. If your base is rock solid, you will move forward in a better way.

Building stuff is my main objective, and right now a couple of friends want help building a portfolio and a website for a well known sports podcast.
I think it's a good chance to push myself and showing my work, and maybe working on building a network. I've always been kind of an hermit because I don't care much about social stuff but luckily I've got a silver tongue so that's not a problem for me.
Where are you working now?

idk if I feel comfortable, but maybe I'll share my personal portfolio here with my full name and all my socials...

No one?

basically no and spawning a node instance in php is BADBADNOTGOODATALL

I know this is wdg but Im finally at a point where I sort of understand spring+java persistance and holy shit this is a million times better than writing api shit in node+express+mongo garbage.

I'm sure the honeymoon period will fall off soon but creating endpoints and linking them to entities in a jpa repository is so much easier, and dropping in security was so fucking simple. Spring boot is nice too. It all just works somehow? Can't believe I wasted so much time with node.

>Hey, I think you actually didn't fuck up the OP!
Epic stuff.

spring is ok, but java will die soon on the web. Also dont bad mouth node, express and mongo. I mean yea making endpoints can be easier. Like, you can pick up Lumen for php which is basically just a router that spits out JSON.

>and I'm 23
lucky yo

Not even when using the react-php/child_process? What would be your recommendation then?

When you're doing async stuff where do you even put all the .catch things?
on every single promise? I have like 5 of them and they all need their own .catch? it's absurdly messy

Something like this
try {
const foo = doFoo();
const bar = doBar();

const results = Promise.all([foo, bar]);
// do something with results
} catch (ex) {
// do some error handling
}

missing the await before Promise.all, my bad.

I kinda ended up using react as my front end, initially wanted to use a templating engine. My question is, where do I put my react files/components? Into the public or a private folder? I know that the create-react-app folder structure has a src/public and all that stuff.

I think I'm building my react structure from the ground up right now.

your front end goes in it's own folder usually called client

and you just work on it in there as an entirely separate thing.

You put components inside the src/component, views or pages inside src/views some even do a src/containers folder, when you're ready yo deploy just do the build command and it should output everything in a build folder which you paste to where youre deploying to

I make 40k as a full-stack webdev.

Guess I fucked up, huh?

I'd literally sell my soul to the devil for that salary.
Is it possible to make that working remote? I live in the shithole that is Spain.

How bad is the economy right now in Spain, worse than last year?

If you hit 20k you're pretty much considered rich here.
Gas and electricity are going up in price, lots of unemployement and younger people are prone to migrate.
There's less unemployement than last year (best numbers in 10 years actually) but most contracts are just temporary stuff and pay like shit.
Also the political scene right now is a joke.

I would happily pack my shit in a couple of years.

Where you located? Before or after taxes?

sup' Spaniard bro, how's your web dev experience? learning, working? tell me about it, I'm currently studying, and I've made 270 Eurobucks tweaking some wordpress's site CSS. How about you?

Attached: speedo-dude[1].jpg (350x476, 31K)

I've been proposed to fix a website and add some features, and I'll get paid if I do this.
Site is built with wordpress.
Will it be easy?

Studying on my own right now. It was a hobby at first but I´m going balls deep now.
Haven´t make any money out of it yet, currently on unemployment bux right now.

Define "fix" and add "some features", because if you have to make your own plugins it might take you some time

I think I did things backwards. I literally templated a div with the id root and put react as script tag. Been working with react without jsx because I didn't want to set up a compiler. Everything is on my server's public folder.

>not disabling plugins first thing

Depends what the fuck they want you to fix

>fix
They said that updating wordpress broke some plugins, and also updating plugins brought some issues. Also they don't like how main page has been done.
>some features
Basically they want a sub blog inside the site, and some internal discussion system about the posts on sub blog.

Yes, you are fucking up big time. That is not how react is supposed to be used

at least you got unemployment bux, I'm sitting next to what I made then and that's it. I hope you the best man, what are you studying now and what do you currently know?

>Will it be easy?
>Wordpress
it will be hell based on my experience, doable, but hell nontheless.

php here
say I have this controller that gets a request with bunch of data, from which some more data will be loaded from the db, all of which is then sent as input for another class that will render the stuff. So a pretty common occurrence.
How should I structure this? Do I make a class for the data with a field for each of the variables, or should I use a simple associative array to store those variables? The incoming data should probably be checked for validity too

any idea on what to use for these kinds of product showcases/animtions? unifi-mesh.ubnt.com/#antennas

I know the basics (probably a bit more) of HTML, CSS and JS (mainly algorithms, lacking in DOM manipulation). Also some PHP (including Laravel).
I just need to practice and go deeper overall.

Best of lucks to you as well man.

Attached: 33.jpg (500x375, 41K)

javascript

there are wordpress plugins that more or less do the whole thingy, but this would be a lot of work to do in js.
-on scroll events
-triggering animations
-revealing and animating svgs
-timing animations
-reseting animations on scroll
A lot of fucking work. But looks neat as fuck.

Complete beginner, how do I write stuff in sublime? Don't ask why sublime, I have to because of college. I don't know how to start an html document so the program actually formats it as html. Also how do I preview the changes in my browser? Thanks!

Ill take the bait
>Create file and name it index.html
>Edit such file with sublime
>Open such file in chrome or whatever browser youre using and reload whenever you make changes
>???
>Profit, and next google your shit

oh shit haha

Is there any diference between

export default function Component() {
return This is a component
}


and

const Component = () => {
return This is a component
}
export default Component;


?

When will PHP die?

something about parameters and this keyword... arrow function bind this to the current scope. but in your specific case I don't think it matters.

*arguments, not parameters
developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/arguments

arrow functions don't support arguments object.

Never

Where to pirate wordpress themes?

torrents? idk man

Why is he fucking up? React is just a bunch of classes and function. You can include it into a script tag and use it. If you are writing something small, then why bother with the create-react-app bullshit.

A PHP server usually have a LAMP stack.
How does a server written in something like Java, JS or Python work? Is there a replacement for Apache?

yes

en.wikipedia.org/wiki/FastCGI
You tell your webserver to run specific file extensions through other executables.
Some languages need their own server (.net core comes to my mind) where you just run your webserver as a reverse proxy.
It doesn't have to be apache, it's just the most popular choice.

PHP has its own server too, you don't NEED apache for it to run.

I've used wildfly (tomcat) for Java

Attached: index.png (225x225, 5K)

sorry ...
oh can you please tell me about those security vulnerabilities in php ? i'm interested
i suggest you take a look at this : github.com/google/tink/issues/104#issuecomment-417512050
you can do async with swoole extension ;)
>wordpress
delete their website and i pay you double
yes, you should have a repository to fetch users/articles/comments/products and shit like that, so in your controller you do `$repository->findAll()` or `$repository->find($id)`
not any soon, PHP 8 gets generics, FFI, Async, JIT Compiler and more, so it only getting bigger
HOLY FUCK, you people cant do back-end nor front-end ? what the fuck do you exactly do ?
you can create a server like node, python or java in php using ReactPHP, Amp or Swoole extension
the php builtin server is meant for development only, but you can use something like Swoole server for production.

>delete their website and i pay you double

why does wordpress shit on my code, like I'm not fully capable of doing that myself, are all CMS systems like that? when I search for a CMS, all I want is to send shit to the database, I'll handle the rest myself

use a framework then
you can use symfony + fos user bundle + admin bundle

make your own, it's seriously not that hard, I've done a mini cms myself, ez shit.

Because React.createClass is such a pain in the ass to use that he better just use vue

Hey any help with this?

try symfony/process or something like that, idk