/wdg/ - Web Development General

Death to PHPajeets!

Previous 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:

ixl.com/math/grade-3/relate-addition-and-multiplication
auth0.com/blog/2014/01/07/angularjs-authentication-with-cookies-vs-token/
auth0.com/blog/2015/04/09/adding-authentication-to-your-react-flux-app/
en.wikipedia.org/wiki/Cross-origin_resource_sharing
twitter.com/NSFWRedditImage

HEIL PHP

What's some non-botnet Google Analytics I can use?

if you want to know what's so bad about php then all you have to do is look at wordpress

...

...

Don't use analytics at all.

Or make your own. That way you can make sure it's not a botnet.

piwik

This. Not to mention, that way your users won't block them.

Open Analytics

tfw everyone is sleeping and thread is about to die

Not me. I'm preparing things for work tomorrow.

Gotta test those Redux stores. It's my first week and I need to overtime to look competent.

Long live php

>debugging for 2 days
>nothing fucking works
>turns out my browser was reattaining an old session cookie

When in doubt, Cmd + Shift + R

>cmd

I actually have Ctrl, but I assumed most web developers use Mac

don't do overtime for free, if you start off working more than you have to they will think start expecting it from you and you will inevitably burn out. this is absolutely retarded.

also react+redux is a shitty meme.

I get what you say, but I'll do this only for the first week.

In fact, I only do it because it's also beneficial to me, I'm learning a new stack and all.

I haven't studied anything formally and I make 15$ an hour writing php.

Did I do okay?

As freelance?

I'm working for a company writing intranet sites with controls and reports. Doing both front-end and backend, I'm the only web dev in the whole place.

You're doing fine. But don't stay there for more than 1.5 years, keep studying and move out when the time is right.

Yeah, it's very easy to become complacent and *poof* suddenly you're fired and no one wants to hire you.

that's a fear i have.

how good is wicket?

>build professional looking website featuring fully deployed portfolio that uses almost a dozen separate technologies
>send carefully manicured resume along with thoughtful tailor-made cover letter to junior developer openings
>do this at least 50 times a week
>finish technical exercises with complete and well-documented answers within the same day as receiving them
>go on interviews, dressed business-casual with tasteful ironed blazer, smile and firm handshake, friendly, relaxed, confident
>hit it off with interviewers while solving all their code challenges and brain teasers
>joke with HR as they walk you out of the office and assure you they'll be in touch within the week
>send polite follow-up thank you notes to every person you met there later in the day
>never, ever hear back from a single one of them, not even to say no

So what is it?

Do I have something on my face?

You're being underpaid to do a job someone else could do better. Gj user. However you should fight for a better wage if you're the only web dev guy.

If you have social media purge it. Read your resume and make sure it doesn't say something stupid.

Make sure that you give them the right contact info too.

Wow man, no idea.

>business-casual
>smile and firm handshake, friendly, relaxed, confident
>hit it off with interviewers
>joke with HR as they walk you out

In posts like this, I would definitely say it's something about your personality, but you seem to get the hang of it quite well.

There must be something else about you, I don't know. I got my first junior job on my first interview by doing just what you did.

There's something inside you, it's hard to explain.
They're talking about you, boy, but you're still the same.

>half ass the exams
>sperg out
>a "yeah, maybe" personality
>still get hired

happened 3 times. they were shit companies though.
point is, never give up.

never let down

Just normiebook and there's nothing incriminating on there. I've been over my resume endlessly.

I can usually get along with people when I make the effort and I'm sober. Especially when we're talking about a mutual interest like this.

I wanna give them a nightcall to tell them how I feel

Maybe this is what they expect from developer candidates and my efforts to be sociable put them off. I'll go to the next one with some food stuck in my beard.

Anyway yeah, giving up isn't an option. It's just fucking frustrating when I feel like there's some red flag I'm not aware of

mayhaps you ask for too much $ ?

Maybe you should try to act like you don't care that much. Just like you would when hitting on the ladies.

I look at the salaries listed for the company on Glassdoor and pick something on the low end. They usally seem to respond like I'm lowballing them. One guy even said "nah, we'd pay you more than that".

I'm starting to think that might be the trick. I hate that kind of game playing but I guess that's show business.

That's not only show business, that's how people work. Get used to it.

It's not nice, but it's the best system we have. You have to not want shit to get shit.

>I feel like there's some red flag I'm not aware of
Have you tried asking them? Most of the time they'll tell you what's going on, but only if you ask them.

As a side story, I once landed a job only because, a month after being rejected, I send them an email with something along the lines of "hey man I know I didn't get the job. I would like to know what happened or what did I do wrong, I would really appreciate the feedback so I don't make the same mistake on my next interview". Casual, unprofessional tone. A week later he called me for another interview, and boom I was employed.

>They usally seem to respond like I'm lowballing them
Ask for more then. It's easy to interpret that as not having any confidence in your abilities.

How much do you ask for and where do U live?

That doesn't make any sense to me at all but I'm going to try it.

I live in NYC metro area and usually ask for $65-70K, which is about $10K lower than average for a junior position and really the bare minimum you'd need to live in this filthy rat trap town.

I figure. You shouldn't be asking anything less than the average if you live in fucking NYC.

add openshift to op, free servers with scaling useful for small projects or development

What are the biggest memes in web dev? I don't mean career related me-me s, rather language and praxis related pitfalls. Learning front end for my project and probably need backend people on board too- what are some noobtraps here? bluepill me on memes

pic unrelated

I'm trying to make a web game with socket.io and was wondering about how I should send data to clients. Should I emit events to clients as they happen or accumulate all events in an array that I emit/empty every X amount of time? I don't know what's better bandwidth/performance-wise.

MEAN stack. Only the N part is actually good.
How realtime is your game? Multiplayer?

This is a terrible example of a php codebase. WordPress is infamously clunky. Look at laravel for a good example of modern php. It's very pleasant to work with and php7 improved performance substantially.

Yes, realtime multiplayer. It's not agar.io/slither.io but I'll use that as an example game for what I'm asking.

Get 3rd party to check out your resume and for mock interview. Friend should be enough.

In React:
className="NameOfClass"
Works, and:
className={NameOfClass}
Works, but how can I give the element resulting from the component two classes, one of which is fixed, and the other of which comes from data passed to the component?

Don't buffer at all. Let the kernel optimise that for you. You also might want to use raw websockets, instead of socket.io, which comes with significant overhead.

>Let the kernel optimise that for you
I'm not sure what that means. So if, for example I was emitting on average 500 messages with 8 bytes of data each a second to clients, there'd be no benefit to buffering them and sending out an array of ~17 messages every 0.03 seconds for a total of 30 messages a second instead? Is this already optimized behind the scenes?

If you are sending it all to different clients, no. You are actually more likely to create lag. There could be some difference with per-client buffering, but that needs to be benchmarked in your specific use case.

>If you are sending it all to different clients
Depending on the game, I'd probably be sending it to either every client or try to optimize it by, for example, only sending movement updates to players who can actually see the object that's moving (especially in any large-scale game).

What language?

Pass a variable that is calculated before, bro

Is error handling important for web dev? Should you remove the error handling before minifiying the code?

>trying to learn React before learning how to program

nodejs backend and the frontend is just javascript manipulating canvas

only started learning webdev a few days ago

That will likely run into CPU bottlenecks and GC pauses soon enough, though maybe it will work out somehow. Node is just generally a silly choice for game servers.

The react library does just that, for example. It removes error handling for production.

I'll make it anyway and see how it goes, I don't want to get caught up learning a bunch of different things.

What would you suggest instead?

C++ is the default choice. Erlang is king in scalability, stability and availability. Go could work, but it's hard to tell right now. The GC needs a few more releases to mature.

Hey, boys, rate my code ;P #GirlsWhoCode

How do you find the product without multiplying them?

How about

for(int i = 0; i < b; i++)
a+=a

or something. Derpmaster

ixl.com/math/grade-3/relate-addition-and-multiplication

First google hit. 3rd Grade btw.

you must be a cs student

>b-but CS requires so much math! It's a really mathy, sciency kinda degree user.

Superior:

function no_mult(a, b){
var i = 0;
while ((i/b) != a){
i++;
}
console.log(i);
}

no_mult(5,2);

>go to job seminar
>This lone chick employer with a hastily hand written name tag is sitting by herself
>inquire
>wants a business partner and "friend" (she mentioned friend about eight times during our talk)
>will heavily use WordPress but that's as detailed as it gets, doesn't even explain business purpose
>walk away wondering if I'd even see any code or just die alone in a basement surrounded by cats
>my sole experience with WordPress

Post you web dev resume for critique. Also if you have a job, it would be nice if you posted your resume for inspiration

How do I go about making a login session if the front-end is Angular2? Can't think of a secure way to ajax to a page securely.

Dude, read this 2 good articles about it:
auth0.com/blog/2014/01/07/angularjs-authentication-with-cookies-vs-token/
auth0.com/blog/2015/04/09/adding-authentication-to-your-react-flux-app/

Sure, they don't exactly use Angular 2, but they explain the big picture, if you need more than that then google

You would use token-based authentication over https, same as anything else. The fact that it's angular 2 is irrelevant.

tokenmind

Thanks

Plz (a, b) => new Array(a).fill(b).reduce((c,p) => c+p)

I'm about to sign up for my first vps, going with Linode after a little research, people seem to find it more stable than others. What sort of plan should I go with for a nodejs dev portfolio website? There's not going to be much traffic to the site, nor high bandwidth, but the apps might be a little cpu intensive if lots of people are hitting it at once. It's either $10 for 1core/1gb or $20 for 2core/2gb

You have to dynamically draw a tabular form based on three tables, rows, columns and number of tables come from each one. Data is loaded from and saved to an oracle database.

How do you do it?

I'd just pick the $3.5 plan on ramnode. They have the best prices and my personal experience with them has been fine.

Is the entire 3D motif I have going on here horrible? I think it might be.

I'm also unsure about the plus sign. It lets you add another reference image, but I'm not sure if that's clear.

(Note: I still need to style the stuff at the top, I know it's horrible)

you forgot the pic user

Hold up, does AJAX pose a security threat in itself? Not using Angular or any other front end framework, just wondering.

How bad is this design? I don't know if I like the 3D motif I'm going with.

I'm also not sure about that "+" button to add a reference image. I'm not sure if it's clear enough that you need to click the button.

I also just realized this screenshot has me using the wrong icon for the "remove" button on images, which I can fix pretty easily.

(Note: the stuff on top isn't styled yet, which should partially explain why it looks so bad)

Yeah, I'm an idiot.

Over https it's fine. Avoid using http, especially with any sensitive info, and avoid JSONP as much as you can and it should be fine.

Without seeing the rest of the page and general site look, some quick things I would try are:

- The Remove button on the right should get a box shadow like the cards.

- Reference Images button should look like Add Another, and it and the Description textarea should be inside a card.

- All the Description labels should be bigger

- Price and submit buttons at the bottom left should be bigger.

- Is that the full width of the window? If so, I would add a bit of gutter space on either side of the page.

>tfw the only thing I'm proud of and want to put into my portfolio is a barebones website I made for my wannabe neonazi friend as a joke for our group of friends where I combined his name and a bunch of ben garrisson meme nicknames and styled those into a swastika.
>can't put that in my portfolio

more padding between elements, it's really tight

What if you have to jsonp because you ate authenticating from a packaged app like through Cordova?

No other way to authenticate that I know of.

I think one of the main problems is that the rest of the site uses a mostly-flat design. We barely have shadows anywhere.

I think I need to just use borders or something, this 3D shit clashes with everything else. Shit.

I'll hack on it some more and try to fix it.

This.

I'm tired of day trading stock/crypto, working a low wage job, and freelancing.

Actually I'm not, but I would love to get a web dev job.

Still waiting on the launchcode interview.

You would generally AJAX POST the login credentials to the server, which would check them, and send back a token, which the client then sends with every future request. The token expires after some period of time, or if the server invalidates it. There's really no reason to ever need JSONP anymore.

That's one motivated ideaperson.

Bothers me that they don't learn to dev.

Well the server is "cross-domain" technically since Cordova is local to the phone. Does that not matter?

Somewhat new to AJAX.

You would need to implement CORS on the server and "preflight" the request. That's the current standard way to do things.

en.wikipedia.org/wiki/Cross-origin_resource_sharing

Okay, I tried to make it look cleaner/space stuff out more.

Unfortunately, I couldn't get firefox's fucking screenshot --fullpage command to work, so I can't post the full page. Still, I think this already looks a lot better. I'm not sure on the borders to separate different characters, unfortunately—would something else look better? I realized I didn't need anything to separate the reference images, but I think I needed something to separate the reference subjects. Maybe I could use different background colors instead, or something?

On my website homepage I want to have a services section that shows the 8 main services my company offers. Everywhere I look for inspiration looks fucking boring and is just a 4x2 grid with small picture and text.

Has anyone seen any "Services" pages on websites that they think looks nice and isn't so boring?

The border stands out quite a bit. Try making it a lighter gray or something. Also, all your text, buttons, and textareas need to be like...twice as big, those will be impossible to hit on small screens. The shading checkbox should probably go somewhere else if there aren't going to be more options, and the Description textarea at the top should be taller and/or narrower.