/wdg/ - Web Development General

NEET edition

Previous 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
youtu.be/Zftx68K-1D4 - Web Development in 2018

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

Attached: bn-gp883_lab_il_j_20150126115808.jpg (959x639, 223K)

Other urls found in this thread:

developer.mozilla.org/en-US/docs/Web/API/IDBDatabase/transaction
developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API
youtu.be/Zftx68K-1D4
blacked.com
npmjs.com/package/mssql#input-name-type-value
jda.com/
stackoverflow.com/questions/29116942/use-jolokia-to-monitor-jmx-endpoint-of-webapp-on-same-tomcat-server
gdprchecklist.io/
twitter.com/NSFWRedditImage

yeah that sounds tricky. maybe indexeddb and/or webworkers api can help somehow?
developer.mozilla.org/en-US/docs/Web/API/IDBDatabase/transaction
developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API
>Shared workers are workers that can be utilized by multiple scripts running in different windows, IFrames, etc., as long as they are in the same domain as the worker.

maybe a dumb question but if someone wants to become a hacker is it necessary to go deep in javascript? or only the basic are needed and should focus on any other programming language

>if someone wants to become a hacker
Go deep in Assembly or go home.

A hacker wouldn't be asking your question. Javascript is the least of the things a good hacker needs to master and they need to go deep in everything they do because they need to know it better than the people that wrote the stuff that is being hacked.

asm, C, python, ruby, and js
I also like golang for writing tools. goroutines are a joy to work with when you're doing multithreaded network scanning

I needed a whole lot of JS when I was exploiting a dahua cam login portal :^)

made myself a tool to keep focus and work in a flow

what do you think?

Attached: Screen Shot 2018-05-08 at 10.03.53-fullpage.png (755x3142, 322K)

>friend gets me hired in the company he's working
>think it's fucking great since I didn't even have to search for a job
>second day of work, they show me the files of the php software i'll work on
>they never used git and only worked in production
>more than 650 php files
>all in the same folder
>mixed html, js, css and php
>no classes
>no comments
>files included one in another many times
>php 5.6
>mysql queries not sanitized
>hundreds of Notices
help

Is that tl:dr; saying you fap every 25 minutes?

Sounds like low-hanging fruit.
That's not a hard thing to fix, it just takes a while. A long-term, easy project sounds great to cut your teeth on and earn some cred in the company.

Imagine how much better it will look when you're all done and everyone will have you to thank for it.

/sqt/ here

1
2

how the fuck does querySelector know which one I'm referring to? my source doesn't explain that for some reason

that is true in a way, but the company is made by 7 people, the programmer doesn't seem like he cares much, and the boss cares only about the look of the interface.
I want to clean all the code but it will take a lot of time only to understand what each file does and how they are related to one another.
the main reason why I want to do it is that I'm afraid to break everything if I change something in a file that then I discover is used in many other places for different purposes

Someone make me a quick code snippet of a react form with functionality to add input groups and states
Some pseudish code
this.state ={
name: '',
last_name: '',
likes: [{
car: '',
maker: ''
}] //adding more should make another object in this array, pushing delete button should do the oposite
}


What I like
add more

delete entry

It selects the first one, which should be 1.

You add classes and IDs to be able to select things better

you use querySelectorAll() which gives you a nodelist of all the matching elements

>youtu.be/Zftx68K-1D4 - Web Development in 2018
How far can we take the Embeds gentlemen

oh god

Attached: Screenshot_2018-05-09_12-03-44.png (471x107, 5K)

>I want to clean all the code but it will take a lot of time only to understand what each file does and how they are related to one another.
You can break things up a bit in the mean time. Grep is your friend.

Create an assets folder, move a single non-php file into it and then grep for the filename across the codebase and update the path.
Rinse and repeat.

It's probably a better strategy to fix all the warnings first because then if you do break something, fixing it will be way easier.

I once inherited an api framework which was well structured but had pages of warnings on every api call. It took me a while but I chipped away at those warnings until I had eliminated every one, initially, I just did it when debugging anything else that required looking at the framework, I'd pick one warning at random, open that file and fix it. After a while, I got a sense of what kind of shit was broken and why (missing files that contained profiling functions which were disabled, stuff like that), that made it quicker to fix other warnings and I got into a roll and cleaned up a dozen warnings in two hours that I skimmed off an unrelated debugging task when nobody was looking.

Then, when we weren't very busy one week, I sat down and spent an entire day going through Apache logs and fixing every warning I saw. After that, most API calls no longer had warnings. It made debugging actual problems much easier.

I'm not sure I understand the first part, or maybe you didn't clearly understood what I said, the 600 files are pretty much all php

Attached: 1503449142354.png (1365x654, 116K)

First fix the warnings. I'd start by moving the non-php files out before trying to do anything with the codebase, maybe you'll still end up with 600 php files in a directory.

But, once the warnings are fixed, in your development environment, execute something like this.
mkdir -p assets/css
mv bottoni.css assets/css/
grep -ls 'bottoni.css' * | xargs sed -ie 's!bottoni.css!assets/css/bottoni.css!g'


Bam, your css file is moved to a subdirectory and every direct reference to it has been edited in-place.
This won't catch some really stupid things like this: (I didn't really test this so it might not be 100% valid)
// Add style sheet for whatever is in $class


...so you'll need to do a little digging to make sure that there isn't anything like that.

Once you have a better idea of the codebase and how it's put together, you could write a bash script that did half this and really get things moving.
I'd still fix all the warnings first, that will have dividends right off the bat.

How do I stop being a brainlet?

what the context here, retard?

Stop thinking like one.

very good ruski

Decide not to be, start thinking hard things even though it hurts.

thx

thanks, I will try. Need to get over it.

Has anyone here actually made it to a massive body of knowledge appreciably faster than the people you look up to?

What the FUCK is your method?

When can I start applying for work or doing freelance work? I just finished the basic algortithms on the front end part of freeCodeCamp.

Does anyone here have any freelance experience?

Can I do everything web dev only on lelnux?

No but you'll suck at some things if you don't and there aren't many jobs in pure MS webdev. They're around but they're in short supply compared to the jobs in linux stacks.

of course you can

>pure MS webdev
So its actually possible to be one then? The .net asp stuff I assume.

lelno

This
There's a reason why any and all web deving are done on OS X, if you don't have a Macbook you can't be taken seriously.

>if you don't have a Macbook you can't be taken seriously.
lelno

>tfw have Macbook, Linux laptop, and Windows desktop

Feels good

Are you ready to go SUPER deep?

Attached: 13952972_e853[1].jpg (200x200, 18K)

>The .net asp stuff I assume.
Yeah, I see jobs for .net and asp every day, it's just that I see 10x more jobs for LAMP/MERN/MEAN. Technically, MERN/MEAN could be windows server but it never is.

>There's a reason why any and all web deving are done on OS X, if you don't have a Macbook you can't be taken seriously.
Well not CAN'T be taken seriously, more like aren't taken seriously. By the hipsters anyway.
There are a lot of hipsters in PM roles, they're doing things like "Agile Coach", "Scrum Master", "Product Owner" and my favourite, "Vision Champion". You need to blend in with these tools, they're often decision makers.

>got 2 clients, doing their Wordpress sites and netting something like $40 a month hosting their sites
>only been learning for 5 months

I know wordpress is low tier and I still got a way to go but now that I'm making a bit of money off this I can really justify taking time off to learn real web development. I think I'm gonna try and pick up a few more small business owners who don't have the overhead to drop $500 on a website but would happily pay me $50 a month to maintain their site. No question really, just feeling good and wanted to share.

Attached: feelsbad.png (40x37, 3K)

max is cute CUTE

holy shit what a mess

what do I have to know from Linux other than console commands for webdev?

Can someone give me a very simple breakdown of redux for absolute retards?
I think I get some parts of it but it feels like another layer of abstraction and I hate it. However, the tutorial I'm following is using it and given the personal project I want to do, I'll probably have to use it there too.

So, redux is sort of like a container where you store the state so any component can access it without worrying about passing it from parent to child, am I right?
And what produces the state is the reducer which has two parameters; the initial state and the action.
When the store gets triggered by the action, it notifies the reducer that then calculates the next state with a switch statement based on the action type.

Did I get it right?

Yep. Even more than on Windows or MacOS.
Every webdev languages and tools work out of the box

Attached: 31870301_1089832801156923_398038452093845504_n.png (489x749, 444K)

Kind of unrelated, but I'm looking for design inspiration for my new website. I want it to be minimal but not so much to the point of making it a black-on-white simple html.
Post your favorite minimal websites.

Anyone have an idea of how I fix this? Rails worked out of the box on my Debian install. On Ubuntu 18.04 everything runs fine except for the rails console. As soon as I run it, I get pic related and back to the bash prompt. No other rails command has given me any problems.

Attached: 2018-05-09-115927_1881x222_scrot.png (1881x222, 50K)

> go deep
Are we talking "balls deep"? Cos, like, that would mean learning elite HTML skillz. Not just JavaScript mastery.

>followed tutorials
>look mom im a programmer now

fuck off

How deep will he go? Will it burn? Will I taste feces?

Hey, just in case anyone encounters this, the solution is to not use the Ubuntu repository for rails. I don't know the exact details of why it didn't work, but completely removing it and using the rubygems repository to install rails fixed it.

> black on white
Use blacked.com as a template starting point, and tailor it to your needs.
However, make you to reuse the images and videos from that site, as your traffic will be much higher.

> B on W
Here, use this example: blacked.com

kys

User.findOne({ email: req.body.email }).then(user => {
if (user) {
errors.email = 'Email already exists';
return res.status(400).json(errors);
}
const avatar = gravatar.url(req.body.email, {
s: 200, // Size
r: 'pg', // Rating
d: 'mm' // Default Image
});
const newUser = new User({
name: req.body.name,
email: req.body.email,
avatar,
password: req.body.password
});
bcrypt.genSalt(10, (err, salt) => {
bcrypt.hash(newUser.password, salt, (err, hash) => {
if (err) throw err;
newUser.password = hash;
newUser
.save()
.then(user => res.json(user))
.catch(err => console.log(err));
});
});
});
});


Why in this case do I need to res.json the user and not newUser? Whenever I console.log(user) during any point it just returns null, I don't understand

"user" is whatever is in the Promise that findOne() returns, but within newUser.save().then() you shadow it and "user" is now whatever is in the Promise that newUser.save() returns

take your own advice for once

I'm following the same course, kind of stuck on the redux section.
the user is whatever you call it, it just returns the saved data of the newUser

I see..So what I name the saved user doesn't matter? I renamed it to newSavedUser and it works exactly the same, and the same if I do
newUser
.save()
then(() => res.json(newUser))
.catch(err => console.log(err));


Is that way better? my eslint isn't complaining anymore if I do that

Hey.

I'm working on a project. 'The Alpha Hub'. It's a website with a bunch of pornsites listed for your "Alpha Entertainment".

[name] with an href link to it and such.

Is there any way to force open an incognito window upon clicking the link??

The point of the website is "Stop laying tracks. It’s all anonymous."

you're targeting the wrong audience with that product, rename it to beta hub

the variable name doesn't matter, but in the code you posted you're doing something different, because you're now responding directly with the object you've created and not with whatever save() gives you back.
but that doesn't matter IF save() returns the saved object unchanged, because then the two are the same

Looking for programming advice, not some alpha bsing me

Where kind and what version of a browser is being used by webview in react native?
I made a shitty wrapper android app for my website using react native. Everything works fine except a canvas I made that isn't working well.

Attached: Untitled Note - May 9, 2018 8.48 PM.png (1178x698, 75K)

I get it, so naming it newSavedUser makes the most sense for making it readable for me at least. I can't stand when people name things the same as other things but they are actually becoming something else, makes it incredibly confusing when reading it back.

yep, you're right

ruski?

aren't you Russian?

>Where kind and what version of a browser is being used by webview in react native?
literally what

bumpy

What dependencies do I need to upload files from my nodejs server to an S3 bucket?

When we get a new Internet I hope they figure out how to handle naming.

Obviously we probably won't have extensions but intent metadata.

So like if some asshole buys "jobs" and just tries to sell it, it will get recycled after a year and they can't buy it back.

I would say if there is not meaningful content attached to the name within 3 months then it should get recycled.

Like .app was recently released and everything is bought and every single word name is taken by bots and many double word names.

It's just way out of hand. I've been looking for a job related domain name for hours and can't find anything. When you go to then they are either empty pages or listed for sale.

This should be dealt with or the Internet will die and nothing new will ever be made by anything other than companies that can afford to buy domains for 50k.

Attached: richard.jpg (800x533, 44K)

Google paid $25 million dollars to buy the entire '.app' web domain.

What's wrong with that?

isn't that easy for developers to release apps?

So far I've never felt the need to use classes or any OOP really outside of manipulating objects.
The most "complex" project I've worked on is the wiki viewer project on codecademy.
All it was is getting data from the wiki API and displaying it.

What's a good project idea that's a step above this?

Richard doesn't know websites on his new internet require new naming?

Currently using npm package 'mssql' since we initially were using windows servers and they were using TSQL
npmjs.com/package/mssql#input-name-type-value

They have the option to pass the input variables through .input() which you can specify the datatype (which you can omit, and they would determine by its JS datatype), but they included ES6 Tagged template literals, which they say is automatically sanitized from SQL injections, but I'm guessing they just interpret the datatype.

Should I stick with the .input so I can ensure correct types?

Attached: Screenshot from 2018-05-09 18-04-27.png (589x827, 76K)

Yo guys, I'm making a calendar app at the moment, and I got the front end completely finished, but I'm stuck. I'm confused on how to go about the back end and database. I've worked with both of these before, but I'm not sure how I should go about storing people's events. Imagine google calendar and how you have all those events.

The way I'm familiar with handling something like this would be assigning an id to each user and assigning an id to each event, and then using a third database for relationships between events and users. Is it the right way to go about this?

Why not use a JSON file for each day, that has all the events that happen in that day?

Attached: 1525697812964s.jpg (250x250, 8K)

Not strictly web dev, but anyone ever work with jda.com/ JDA? I'm trying to access a jolokia (parses internal jmx endpoint into JSON) endpoint within JDA. Problem is, when opening servername:port/jmx/ through chrome I am challeged by something. Could be jboss, but I'm not sure. I don't really expect anyone to answer this, but thanks for your time reading this long post lol

check the logs.

always check the logs.

stackoverflow.com/questions/29116942/use-jolokia-to-monitor-jmx-endpoint-of-webapp-on-same-tomcat-server

So wait.
You can't afford to buy a domain.
But you also want a super common domain name.
Hmmmmmmmmmmmmmmm
Maybe try actually having a useful product.

dumb frogposter. Posting pepe is evil. You shouldn't be evil when using JSON.

you a'ight

Is there any good resource summarizing all the shit you need to keep in mind when deploying your website? gdpr, cookie agreement all that shit

Attached: wtf.png (1920x1080, 377K)

just don't store user data.

there you go.

nice try, but cookies are autism food in europe too

gdprchecklist.io/

move to a free country :^)

thank you user, is there more of this for all the other things? I can't even list them all since all I know of is the cookie shit whenever somebody is from EU and the upcoming gdpr

bigdump.php

, in the end,

This might be a long shot (damn near impossible probably) but is there an easy way to set up multiple Twitter accounts and their respective developer configurations?
I've only done 2 so far and its a bit tedious. Ideally I would want at least 1,000.

Attached: 1.png (1181x486, 15K)

user....

>Ideally I would want at least 1,000.
you running a bot farm or what?

look up how to do with from the command line and write a script that does for you

trying too hard, user - the second you store a EU citizens data (e.g. an account on your website) or sell them something, you need to be gdpr compliant, so if you don't ban all people from EU, you're screwed

>you need to be gdpr compliant
yes I'm sure they'll send you a sternly-worded letter

>you running a bot farm or what?
Yes, something like that. Will check out how to do it via scripts, thanks

It's actually not bad advise, their site isn't bad looking.

>What's a good project idea that's a step above this?
University

Thank you EU.
What would I do without huge cookie banners that you now have to click away on every single website.

Though I guess someone will make an addon, that automatically clicks that shit.
Hopefully.

If someone doesn't want cookies.
Why not disable them in the browser.
Makes me so mad.

Attached: eu.png (512x512, 24K)