/wdg/ - Web Development General

3rd attempt at creating the thread correctly edition

Previous thread: (Cross-thread)

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

> Discord
discord.gg/0qLTzz5potDFXfdT

>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/
youtube.com/watch?v=JxAXlJEmNMg&feature=youtu.be&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
youtube.com/watch?v=pB0WvcxTbCA - "WATCH THIS IF YOU WANT TO BECOME A WEB DEVELOPER! - Web Development Career advice"
youtube.com/watch?v=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:

youtube.com/watch?v=fo5BmoMkT7E
jsfiddle.net/Lfho10eg/
disqus.com/
restapitutorial.com/
stealherstyle.net/tattoos/
programmableweb.com/
twitter.com/AnonBabble

ok looks good now :^)

Why is every youtube tutorial made by an indian, hard to understand that shitty poo accent.

Almost makes me want to go look somewhere else for a tutorial made by a NORMAL WHITE PERSON

What accent are you talking about?

Like this bro?

youtube.com/watch?v=fo5BmoMkT7E

The best place to look for video tutorial is Lynda, Pluralsight or Tutsplus

Viewing this fiddle in latest Chrome Dev vs. latest Nightly Firefox show very different results.
How can I make Firefox display the fiddle the same way as Chrome does? jsfiddle.net/Lfho10eg/

To clarify, the problem is that firefox does not let the user scroll the list.

So, I got a new job.

First ticket involves getting to know the full stack. I need to modify the front-end, back-end and database.

Is it OK if it takes me 4-5 days to get it done and tested?

I am starting to use ASP.NET MVC at work.

Am I now considered a web developer?

Where do I sign up to get some sweet web dev hipster pussy?

Good job! But you have to work for pussy too, user. Here's how:

- Spend part of your web dev money on your image (haircut, clothes)
- Learn some social skills, read books, read Plato
- Get friends
- Get a car
- Go dancing
- Learn to talk with girls
- Talk to girls
- ????
- Profit

Being a web dev hiptster is only step one.

I always ask my employers for a minimum of two weeks for jobs involving me looking at other peoples code and modifying it. Nobody really wants to fix code made by others.

Even if it's a simple job.

What. I thought being a web dev meant I could avoid all of that.

I was supposed to be able to just sit in Starbucks and pussy would just gently ease itself onto my erected penis sticking out of my lowered fly?

That only works if your macbook has javascript stickers

Interesting. That's a nice perspective.

Meaning you don't actually write any code for the first 2 weeks? I'm not sure if I could get that kind of deal, but it makes sense.

> start a react project
> six months in, my chosen flux library stops development
> too late to switch to redux

lel

Pretty much, my employers aren't really programmers themselves so I get off scott free since I always deliver the results.

Is there an active /wdg/ github project going on?

I want to do more open source stuff. Maybe we can get something going? I'm doing a lot in Node.js/Express

>.NET
>Where do I sign up to get some sweet web dev hipster pussy?

No you're a corporate drone. You can't develop .NET on a Macbook Pro. You probably don't even have a beard, or wear flannel.

Also girls only talk to webdevs who use Node.js

I did a pluralsight course on CouchDB, it was by a Pajeet. There is no escape.

>have React component that handles uploads
>get TinyMCE for textareas
>modify tinymce image plugin to add upload functionality (use the React Component)
>seems to work


Is it a good idea to use React components inside of other components (like Tinymce plugins)?

>read Plato

Your fedora is showing

I dunno, I don't use that meme framework because I don't like to needlessly overengineer my projects.

Its not bad, makes complex code much more readable, also prevents rerendering and you can reuse the components for other things.

I obviously could copy all the code that handles uploads to the tinymce plugin, but than I would have duplicate code and would waste 2-3h on doing that. Other option would be to create a jquery plugin, but its also a time waste.

Are you saying you don't like Plato? What's wrong with you?

What's the best/easiest way to implement a working Contact form with validation?

What's the proper syntax if I want to prepare a statement that uses a subquery for a user ID?

The subquery must select the user's ID to fill out the remaining tables containing their data.

Also, would this be better code, or should I just query once and store that number?

In addition, I'd like to know if it's a good idea to use prepared statements for my database, or is it overkill if I already have a function that does this:
function cleanseString($conn, $str){
$out = stripslashes(
strip_tags(
htmlspecialchars(
htmlentities($str)
)
)
);

return mysqli_real_escape_string($conn, $out);
}


Does the prepared statement add any extra security at that point?

what stack? In MEN stack I do validation via mongoose in modelschemas. Laravel has built in validation. Wordpress has contact plugins.

They should just do them in Hindi and be done with it because not only is it hard to hear what they're saying, its also annoying. There's this one guy who kept saying "doroper" instead of developer, pissed me off senpai.

I think he's saying that someone who reads Plato in order to try to make themselves more attractive to girls, is also the type of person who would think that wearing a fedora makes them classy.

Although really "your fedora" is now pretty much used as a dismissal of anyone else's post.

Use PDO instead of mysqli, it provides natural protection against SQL injection. You'll still need to sanitize it though, in case the user inputs some HTML code, for example.

Whatcha need to validate?

here's a template for you:
if(isset($_POST['FIELD']) && trim($_POST['FIELD']) != "")


If you need to validate email
if(!isset($_POST['EMAIL']) || trim($_POST['EMAIL']) == "" ){
//things
}elseif(filter_var($_POST['EMAIL'], FILTER_VALIDATE_EMAIL)){
//is all good
}else{echo "You a dumb fuck. That ain't no real email"}


The above method works starting with a negation test, because if EITHER of those is wrong, it shouldn't go further.
Use the email format to also test for numeric, just change filter_var to is_numeric

I've looked at PDO, and I really don't get that syntax. I can afford to throw in a bit of extra injection-tests, but this is a project that is WAY overdue to be launched. I can't actually bother to learn PDO.

I'm asking if what I did would prevent injections, and if the prepared statement is necessary or even beneficial at that point.

No stack. I haven't learned any backend language or framework yet, this is for a family member who downloaded a basic website template and wants contact form functionality on it.

Thanks. I'll probably use this unless I find a quicker way to begin doing this.

OH, you don't know any backend?

The answer I gave you was in PHP.
Did you want a JavaScript answer instead?

>I'm asking if what I did would prevent injections
Yes, I don't have time to test it but it looks good.

ok, thanks.

well, maybe some 3rd party contact form provider, since he has no clue. maybe there is somethig like disqus, but for forms

Heh, um, IDK what disqus is. Templates?

I'll look it up, but I don't use any kind of 3PS templates for my stuff. I write it all from scratch (although, I'll copy a good function here and there).

how will they send you the contact form info without backend? where will it get saved to?

I'm not that guy. I'm the guy who was offering the PHP solution. IDK what that other guy is doing with the data.

disqus is the 3rd party commenting system which you can implement in basic html sites.

disqus.com/

maybe there is something like that, but for forms.

Heh, that's actually kinda interesting.

Where does it store the data, though? Like, if a user comments, how does that end up in my database, if I were actually to consider using it?

Or is the comment stored ON Disqus? (btw, is this pronounced "Discuss" or "Discus" (like the Greek throwing thing)?)
If it's actually stored on THEIR network, I definitely don't want it.

I dont know, never used it. I'd guess its something like the integrated facebook commenting system, they handle everything, you probably just paste a javascript snippet in the place where you want the comments rendered.

Hmmmm...

Yeah, no fuck that then lol.
The project I'm working on is a social network in itself, so I can STOP using Facebook, haha!

I wanna make something not run by dirt bags.

So I wrote a website that's like pastebin, in the paste overview I use Pygments to generate the HTML with highlighting and what not, the problem is that the content is wrapped in a tag and when a line is too long to fit into the pre, it will word-wrap and then it's misaligned with line number column, I tried adding overflow-x: scroll to the pre tag but it only adds a dummy scrollbar and still wraps down, what gives?

Nah, i'm just looking for the quickest way possible (besides using a 3rd party). It'd be nice to learn some light backend stuff before taking it up seriously. I'm familiar with programming basics, so your PHP made sense and I'll probably use it.

From what I can tell, abstractions are pretty big in webdev nowadays, so if you know of a quicker method I'd love to hear it.

Considered using a third-party but stuff like phpmailer/swiftmail seem simple enough on their own.

This user isn't me btw.

Hi /wdg/. I'm from /dpt/, and I only came here to say that, despite still thinking you're all a tier below us, I now have more respect for you after trying to use javascript to write a little browser program for a few days. It's absolutely awful, I hate it and don't intend on doing it ever again. If I was open to the possibility of weak typing before, I am now its most ardent opponent. I don't understand how a language running on an interpreter, which should, at least in theory, be able to give very descriptive errors due to having runtime information to base its descriptions off of, can fail so fucking cryptically at runtime.

Thank you for your time and peace unto you.

Can you guys list me all the projects you had before a first job? I want to know how bad I have it.

so I want to make a simple web game in js, multiplayer only with chat room, voting system and simple interactions with the canvas, what framework/environment should I use? or pure js is an option?

>mfw learning Laravel and it's better than anything I've used for making websites

At last I truly see.

yeah, its very organized and documentation is good. the dude who made it does a good job

Quick question:
Suppose I have a list of things, each with some buttons that do things related to that particular one (e.g. delete, view, rename).
Is it better to:
1. Use a closure to attach a new onclick function to each one with the parameters baked in?
2. Attach the same onclick to all of them and use an HTML attribute to store necessary info, and have the onclick function read that from the element?

id say 1 for sure, and use the fat arrow function => so you don't have to do var that = this stuff

I was just doing something like
function get_delete_func(name) {
return function del_click() {
...
}
}

Is that fine?

It's the best thing which PHP has got and it's led by a disgusting shill.

>tfw I fell in love with Laravel
>My boss still insists on doing C# MVC 5 because he only knows C#

I had zero

Only my shitty final year project

>tfw added added tinymce, image upload, progressbar and backend implementation and it all fucking works

am I pajeet level yet

is this a good tutorial? restapitutorial.com/

Feels fud mayn.

Yeah I'll have a shitty news portal as my final (I mean not shitty, but basically just a simple frontend on top of a wordpress, because it's just an example for my thesis) and some other simple 100-200 loc stuff. Oh well. Still time to build shit but I'm going in the obligatory internship with only that. I don't think they give a fuck.

I see people post their OS projects from time to time, but none that qualify as a "/wdg/ project".

Good? Laravel is buttfuck slow.

one word
typescript

Didn't say it's good, but it's actually easier to work with. To hell with performance if the clients only want a website that werks.

maybe you could even boost performance with PHP 7, or even more with HHVM

>boost performance with PHP 7
Legit question here does PHP7 really improve performance? by how much?

dont know how much in production environment. but in dev environment ap resposn went from 180ms to 120ms an mermory usage from 12MB to 2-4 MB (on OS X)

but I've testetd php5 on linux virtual machine with hhvm and it was significantly more (app response about 24ms)

How would you react to an angular ember thrown at your backbone?

So guys, I want to start to learn Javascripts from the basics. Until now I have only worked on [spoiler]JSF[/spoiler]

Eat some vanilla ice cream and laugh at the memers.

Pure JS is possible since you can do the server with Node.js and some kind of websocket framework. Or Meteor.

>JSF
I don't even know what that is. What's your question and why aren't you using the resources listed in the OP to answer it?

>Using meteor unironically

i'm pretty sure components are supposed to work anywhere

>Good job! But you have to work for pussy too, user. Here's how:

>- Spend part of your web dev money on your image (haircut, clothes)
>- Learn some social skills, read books, read Plato
>- Get friends
>- Get a car
>- Go dancing
>- Learn to talk with girls
>- Talk to girls
>- ????
>- Profit

reality check time:

-most girls are trash who fuck douchey lowlife guys and rationalize being sluts by saying douchebags are 'alpha'

-almost all ugly girls are sjw who treat men like rapists, oppressors. these girls are all around bitches

-only girls worth dating are university educated, almost all low income girls want to be single moms and are looking to fuck a guy with money so they can get child support

-most all women are covered with tattoos and piercings, both low class and high class, their excuse for looking like a crack whore is that their tattoos have 'meaning'

-most white guys in the tech industry are either gay or being cucked by their 'girlfriend'

that function is the most disgusting thing i have ever fucking seen

if you don't understand the problem you can't solve said problem

>most all women are covered with tattoos and piercings, both low class and high class
You should leave the trailer park more often.

>no u
stealherstyle.net/tattoos/

How much technical knowledge do I need to get a job at a funded startup? Are the interviews comparable to Google? I have a lot of practical experience but limited theory.

The function is fine.

>he this this is a fair representation of all women

React is fucking awesome

If you're only required to know HTML, JS, CSS in order to design pages and make them look good, then you're golden if you know what you're doing. Shit gets fucky if they expect you to know Angular, React, etc. and how to integrate them with possible server side code.

lets hear from the peanut gallery, am I wrong? really quiet in here, I think the h-bomb of truth has been dropped

Nobody gives a flying fuck, stop shitposting

I hate actual web design desu, I'm aiming to get a general "developer" job where I'm either responsible for integrating things throughout the stack, work mostly on the backend, make utility apps for the business, or something similar.

Something where I'm not responsible for making CSS/JS effects look beautiful.

mixing encoding and escaping, you're a fucking idiot

Meteor has few real uses, but a shitty game server might be one of them.

UX is important and technical developer work. Leaving the frontend to monkeys and designers is why the web is full of shitty janky gimmicky bullshit these days.

In regards to your original question, it entirely depends on your area, and the company. Just slam and jam some shit on github and fill your resume with enough buzzwords and jargon to get past the non-technical recruiters, and see what you get.

That's the long version of what I meant with the fedora comment.

let do_something = some_param => { return new Promise((resolve, reject) => {
// Do something
resolve(123);
});};

Is this a reasonable and readable formatting, assuming that the reader is familiar with both ES6 arrow notation and Promises? It avoids another layer of indentation.

Tell us more about how it should be done, sensei.

How do you fellas take a server side variable and use it in js?

For example I am creating some charts using highcharts and am using data from my db to do so. Currently I am just injecting it as a global javascript variable in my html before I include my js files.

var data = {{ data }}


I feel like there must be a better way of doing this

If the chart isn't interactive, you should render the entire thing on the server side before sending it to the client.

Have your javascript request the data from the server via an AJAX call. The response is a JSON string. Use JSON.parse(data) and you'll have a javascript object or array containing any number of variables that you want.

Find a tutorial about RESTful web services, create a front-end for an existing API, many of which can be found here: programmableweb.com/

Generally you don't want global javascript variables. And you also don't want to be injecting things into the middle of script tags on your page.

Fuck, in my job they are going to switch framework importance and now angular is up there, how fucked I am?

>working somewhere that has 'framework importance'

I'd say you're pretty fucked.

What the fuck is 'framework importance'? How about 'not putting a ton of bullshit in my browser importance'?

What do you guys think would be good ideas to add in my portfolio? (to make it visually pleasing)

I literally take ages deciding this whenever I want to get a new job.
My last one almost got me rejected from a 50k a year job because it wasn't user friendly but got hired because of all the features it had regardless.

For god sakes the site emulated a linux terminal, and I thought people pursuing this field would know a few basic things, but I believe I'm partially in fault too for making my customers adapt to my views(which was what I was told two years ago which I think is somewhat correct).

Just put as much stupid gimmicky crap on there as possible and you'll probably get hired by some fucking dumbasses who don't give a shit that their sites require the user to download 10mb worth of bullshit before hitting first render.

Because the webdev is full of feminizt whales that call themselves ux/ix designers that think they have a saying because they tell you how to organize shit while youre the one who actually knows how to code and not only knowing how to use simple shit in photoshop and whatever organizing software they fucking use to plan projects.

/rant