/wdg/ - Web Development General

Last thread Stop adding videos to the op edition because deleting [embed] is annoying.

> Discord
discord.gg/0qLTzz5potDFXfdT

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

>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 lecture series.

>Frontend development
github.com/dypsilon/frontend-dev-bookmarks

>Backend development
en.m.wikipedia.org/wiki/Comparison_of_web_application_frameworks
backendDevelopmentBookmarks.md

>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
>NEW!
openshift.com/

Other urls found in this thread:

stackoverflow.com/questions/16501/what-is-a-lambda-function
necolas.github.io/normalize.css/
github.com/4tran/VIB
4tran.bid/test/
github.com/sahilm/reddit.js/blob/master/reddit.js
github.com/login'
github.com'
youtube.com/watch?v=OBwS66EBUcY&list=RD7oKPYe53h78&index=24
youtube.com/watch?v=Kr3w3ZQoqGM
adventurega.me/bootstrap/
twitter.com/SFWRedditGifs

First for PHP is getting me interviews.

I'm trying to build a layout in pic related, basically 3 rows of equal height, with each row holding x number of elements on it.

So I'm trying to do this with one vertical flexbox that holds 3 other horizontal flexboxes inside it, and those contain the actual elements to display.

Am I going about this the right way?

kind bump,

no other web monkeys around currently?

>just got verbally abused at work
>"wtf you mean you can't fix our Pajeet-tier code, they wrote a bunch of documents"
>I don't get paid enough for this shit
>Get paid below 60k in San Francisco
>Accepted the contract because needed money
>Have 2 years of Embedded Systems experience
>about 6 months of Python full stack

Thinking of quitting and just letting the company burn, but afraid of burning through savings while in-between jobs.

How easy would it be?

Search for a new job before you quit.

Do your job in the meantime.

Will Express confuse these routes?

app.get('/:paramOne?', function (req, res) {
// code
}

app.get('/new/:paramTwo(*)?', function (req, res) {
// code
}


The first get is for the root index with an optional parameter of paramOne.
The second is for the route /new/ with an optional parameter of paramTwo (the asterisk is there to allow the user to pass a parameter containing multiple forward slashes e.g. a url address).

Will Express/Node confuse new as being paramOne, rather than its own route?

Yes

You could use bootstrap instead senpai

Go on

Succumb

Or 960gs, if you fancy getting all Photoshoppy

Has anyone actually paid attention to the code in this image?

>jQuery
>elements not cached
>functions within functions

/wdg/ is officially /pajeet/ now.

Why does the idea of video interviews scare me? Is it cause I know some Stacy HR will make fun of me?

Yes, I know. It's absolute pajeet tier. Look at that fucking nesting.

>Will Express/Node confuse new as being paramOne, rather than its own route?

I think it'll be confused. Even if it isn't it's not a good api design.

Use a query string for paramOne like:
>www.whatever.com/thing?paramone=urgaypwnd

>functions within functions

You're the Pajeet. Passing lambda functions as parameters is great.

How did everyone get started in their programming careers?

I'm interested in learning hadoop more in depth. However, I was told by someone that I need to become really good with Python and Java. I have SOME basic experience, but not even close enough to call myself competent.

Then, after speaking to a few different people some suggest I should learn things like C, because "If I can learn C, I can learn anything".

Are these people full of shit? Is it beneficial to learn C?

Depends what you want to make I guess.
But since you are asking in /wdg/, python/ruby should be good.

I guess what I'm trying to ask, is it true that learning C is impressive? Everyone makes it seem like the REAL programmers are the old school ones that grew up in the 70s/80s and learned how to program using C and bash or whatever, and that "new" programmers will never be "true" programmers because Python is the equivalent of learning how to drive an automatic, and C is driving a stick?

Impressive? No.
Useful? Yes.

Why is it more useful in learning C than dedicating time to learning other languages like python or Java?

I just finished my masters. Trying to figure out where I want to go, and what languages I want to become better at.

I grew up learning C for about 15 years, for game dev, light graphics programming, and emulator programming.

No, it's not impressive, it doesn't make you think deeper than Python programmers. It's a completely different skillset. While the things you learn are a little more technical in C, Python is a much more expressive language, so the challenges of using your tools impressively actually increases.

In regards to whether it'd be useful to learn C now, I'd say grasping the basics of how it works, and attempting to at least interface with 1 of your OS' built-in apis, would be all you need to know to apply it to languages more worth your time (python)

Can't say I'm fond of Java

Because most other languages are based on C.
But starting with Python or Java is fine either.

Thanks for that useful response. I stated earlier that I wanted to learn hadoop more which requires Java. Why are you not fond of Java?

Good to know.

>Why are you not fond of Java?
Well, with Spring, Java can be a very expressive language, but being so statically typed and largely forced into 1 paradigm makes it suffer a lot. I reckon if I had to use Java, I would lean more to something that abstracts needless constructs, something like Groovy.

But that's my opinion. If you like Java, then it's all the more useful since it's still big in the job market. Why are you interested in hadoop?

...

One thing is to pass a function and the other is to declare a function inside a function. That's what leads to endless jquery callback youtube tutorial tier code soup. Write better code fucking retard.

Well, I'm interested in hadoop because I took a class in it and I just thought it was a neat program. Then, I went online to see the job descriptions and requirements, and they all list Java as part of that requirement.

Overall, I think it's an interesting program. I enjoyed using it and I thought it was straightforward. However, I realize that a classroom environment is much different than a business environment.

I'm not going to lie. The salary doesn't hurt either. I live in a very expensive part of California and I need a high salary to survive out here.

Of course, I still need to do more research. What if Hadoop becomes outdated in a few years? I don't think so, but I need to see long term and not just short term.

Any advice coming from a veteran in the industry is welcomed!

Scored myself an interview next tuesday for full stack dev creating some kind of instagram clone website. They claim the work is mainly in HTML5 and the related stuff. I've only done the bare minimum of web development before, like wordpress, focusing on writing backends for enterprise projects in java. What should I expect in the live programming test during the interview if they claim it's HTML5/PHP/mysql?

thats called a closure pajeet, just stick with your PHP

Declaring functions in place is fine, its called a lambda function, which is an extremely useful tool to have.

stackoverflow.com/questions/16501/what-is-a-lambda-function

The example in the OP only appears to be bad because they're callback functions, because Javascript is asynchronous, and once you perform an asynchronous operation, you need to be inside of the callback function in order to have access to the results of that asynchronous operation.

Now we have all kinds of tools to make this easy, such as ES6 promises.

So instead of:

asyncFunction1(function (asyncResult1) {
// do something with asyncResult1
asyncFunction2(function (asyncResult2) {
// do something with asyncResult2
asyncFunction3(function (asyncResult3) {
// okay this is getting a bit gay now
asyncFunction4(function (asyncResult4) {
// please make it stop
console.log(asyncResult4, "is gay");
});
});
});
});


you can use a promise chain:
asyncFunction1(function (asyncResult1) {
// do something with asyncResult1
return asyncFunction2();
})
.then(function (asyncResult2) {
// do something with asyncResult2
return asyncFunction3();
})
.then(function (asyncResult3) {
// actually this is quite easy to work with
return asyncFunction4();
})
.then(function (asyncResult4) {
// I can do this for as long as I want
})
.catch(function (error) {
console.error(error);
});


You can do all kinds of shit with promises, and its easy to turn a callback-based function into one that will return promises so that its easy to work with.

You can't do Javascript and escape asynchronous programming patterns, and if you have something against lambda functions then you're bad and you should feel bad.

I am staring at my screen for 10 minutes and can't find a link to the repo of my openshift application. I created it without naming the branch and now I don't know if it even created it or not. Where can I find that goddamn link???

a div in my page is in a completely different position in Firefox than Chrome how to fix this shit

>trying to get shit working in firefox in 2016
rip in piece user's patience

git gud

Or stop trying to be fancy and just use an existing minimalistic grid system like pure or skeleton

I have an Express app that needs to do the following:

Take a parameter at the root '/'

but

Also present a route at '/new/'

How should I go about doing this?

I already told you

woah, im not even that dude

weird

Try necolas.github.io/normalize.css/

What do you mean full stack? Like are you routing with python

Trying to install ruby and make it work on windows

>the madness

Can somebody buy me a Macbook please?

How do you guys detect mobile in JS without pajeet libraries?

this.width: window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth
this.device: navigator.userAgent.match(/Mobi/) || this.width < 768 ? 'mobile' : 'desktop'

document.documentElement.className = this.device

if (this.device === 'desktop')

//etc...

User agent spoofing seems like the most reliable way. and yes, innerWidth is kind of retarded but it works.

Help me Sup Forums, idk what to do anymore. I'm a really good web designer and can also code. I fucking hate MVC patterns, I just don't get it. I tried to fuck arround with Rails and I don't understand anything. Holy fucking shit there's so much fucking folders everywhere... Why are simple things so complicated now? Should I just go with Python or Node.JS??? Like wtf. I just want to be able to code cool shit with a db. Why do I have to use the console so much??? Can please anyone point me in the right direction I'm going insane.

what do you want to build user? the fact you're saying you're a good web designer makes me think you're not a good designer.

I've been working on an imageboard software. Just rewrote the thumbnailing bit.
I want to do a full rewrite now that I sort of know what I'm doing, (this was my project to learn php) but I'd like to do it with the aid of another person.
If anyone's interested, let me know.

Github page here: github.com/4tran/VIB
Live site here: 4tran.bid/test/

i could help you by telling you to ditch php

>mysqli
at the very least use PDO for DB interactions.

I meant graphic designer lol. Just a simple scraping site, I could do it in PHP but I want to step my game up. I tried Python too but installing the frameworks on Windows is a nightmare.

If you can give me a suggestion for a better alternative that isn't ruby on rails, be my guest.
But honestly, language doesn't even matter for making an imageboard. Basically any of them will work. I chose php because it's by far the most used, so I have plenty of things to use as reference, and it's similar enough to other languages I've used that the learning curve wasn't hard.

Why? Maybe I will in the rewrite. Not gonna do that in this version though.

cool, me too. try rails then. the problem isn't windows though. installing frameworks in mac osx is just as clumsy. i've even quit using gulp for small projects because i hated the node_modules bloat in every folder.

rails isn't bad—but yeah, pajeet memes aside PHP is not going anywhere.

Install Linux, you gay cunt.

var MOBILE = /Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent)

I need my Adobe pack and other shit, sorry. (Btw I'm actually currently installing this on Ubuntu, but it's not my main driver).

Does anybody have exp with Wordpress on Openshift? I set this shit up but I can't figure out how to upload my theme now, I mean, I have my app folder on my PC now, but shit is empty. This is so fucking confusing it's pretty amazing, and there are not much good sources on google.

SQL injections.

use Sinatra, very light weight, gives you total control

What happens when a javascript dev thinks too highly of themselves:
github.com/sahilm/reddit.js/blob/master/reddit.js
> fancy function chaining api to make a single fucking get request
> lambda soup to accomplish said fancy function chaining
> no comments
> no docs

I dug through it just long enough to figure out why it worked and my little hack didn't. (The problem with my implementation was that reddit's redirects break CORS - I excluded the "www." and it broke their shitty api. And naturally none of this is in their docs)

Use Go or Node.

what do you need openshift for?

To host my wordpress news portal for free for some time, my current hosting just shat itself.

any decent hosting service has PHP and database management for the price of a beer. no need to go through the trouble to save a penny

Don't have a credit card. I actually never hosted anything before, so I'm not even sure if I can pay the hosting without it. Eh whatever, it's for a college project, there is no reason for me to pay anything. Btw I think I figured it out, found a good tutorial. It's actually pretty easy.

That's not so bad though user. It's a simple script people can drop in their documents to easily retreive reddit content. It's for retards, sure, but it does what it's supposed to do.

The only dev camps in my area cost thousands of dollars and to even be considered for a "scholarship" or financial aid, you have to be from an "underrepresented group in tech". You can't get help if you're white. This isn't even a single instance, it's all of them. Why the fuck do I even bother

I'm guessing id have a hell of a time trying to get hired anywhere too.

Tell me this is not real. I thought it's a meme more or less.

isn't Sup Forums technically a dev camp?

Say you are gay or a tranny (female to male).

Have any of you faggots used Polymer in your projects? It seems pretty cool and I want to try it out but it seems so heavy.

It is absolutely real.
Sure but I feel like I'd be better suited to learning in person.

stab a pajeet. win-win

I've considered it, but that was my conclusion as well. I tried some of the demo apps and it took a whole 2 seconds to render a fucking todo app on my cheap android. Yeah, no.

> couldn't understand the spaghetti code either

Fuck yes. scored a phone interview for a rails position. my first dev interview, what should i expect

That's what i'm saying. Do you think half the people who use jQuery know how most of its methods work?

How do you guys stay motivated? I have a project due in a week and a half (I'm getting paid for it, albeit not much) but I can't seem to stick to coding for hours like I used to.
I feel like the depression from the other aspects of my life is starting to creep into my work.

this isn't logging in for some reason
want to take a gander?
thought I did everything textbook

import requests
from bs4 import BeautifulSoup
import time

def login():
with requests.Session() as c:

headers='Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.102 Safari/537.36'

url='github.com/login'
out = c.get(url, headers={'User-Agent': headers})
html=out.content
soup=BeautifulSoup(html,'html.parser')

commit='Sign in'
utf8=''

authenticity_token=soup.findAll('input')[1].get('value')
print(authenticity_token) #this is indeed the correct token

login=r''
password=''

login_data=dict(commit=commit,utf8=utf8,authenticity_token=authenticity_token,login=login,password=password)

try:
c.post(url, data=login_data, headers={'Referer':url, 'User-Agent':headers})

logged_in_url='github.com'
page=c.get(logged_in_url,headers={'User-Agent':headers})
except Exception as e:
print('[1] Exception', e)

f=open('outfile.html','r+')
f.write(str(page.content))
f.close

what do you even do in that role? like i get that front end is how websites look and back end is how they operate. but what does somebody do who is specifically hired to do work in rails?

I'm about to be a senior in college and have done all of my internships and personal projects in web. I've decided to take my next year to get very good at something non-web (along with keeping up with webdev) and I think I've decided on Rust. I wanted to learn something not so common just because it's fun, and Rust seems like the best bet of the new ones to be somewhat relevant. And who knows, maybe it'll become a decent backend web language. Does anyone have any opinion on it or what other language they'd suggest?

minimal. cheers

Just become a tranny user. Or just tell them you identify as a non-binary androgyne.

Wow, yet another Sup Forums clone. Haven't seen enough of those already.

Ruby works, try Rails, it's a fucking nightmare. I've been using Windows since 3.0 and I didn't manage to get that horseshit to run without it spewing sqlite or other errors.
On Arch I got everything working within 10 minutes with some Jewtube guides, including the github SSH crap, even though I've only been actively using a Linux based OS for a month now. It simply fucking works.

>Ruby works, try Rails, it's a fucking nightmare

Ah, Rails. I spent more time on StackOverflow than actually writing code. Good times.

im kinda new on this, i have no intentions of doing web dev as work just for fun, what do you guys think about framework like bootstrap?

Try django or laravel

what music do guys listen do when you are working?
here is what i am listening to

youtube.com/watch?v=OBwS66EBUcY&list=RD7oKPYe53h78&index=24

Good job

is it possible to scrape w/ static html? if so, how? Unfortunately I need to sent post and get messages on other servers and you don't get server side stuff on github

need a hero to fix that embed

How can people listen to anything but classical music without getting distracted?

Well pajeet, you see most people use toilets and don't have autism.

Heh, that's a good one.

I listen to this

youtube.com/watch?v=Kr3w3ZQoqGM

Don't even need to play it to know it's a meme

>>"wtf you mean you can't fix our Pajeet-tier code, they wrote a bunch of documents"

fucking hell man, I really do want to see the numbers some time for how much outsourced devs are supposed to save companies. Because EVERY time we've had to work with them its taken weeks longer to get shit done and thats not including the extra staff brought on to fix their shit.

or you could just use bootstrap and save yourself time and effort. No need to reinvent the fucking wheel when its already done and works just fine.

adventurega.me/bootstrap/

He praises the template though

And tbf, if you're making a full-featured website, you can't center it on bootstrap anyway, but you would still like to use it so you can focus on non-front-end shit

Is there any advantage of owning a mac over having linux for web development? Regarding maybe de IDEs available, the hardware support?
I have a linux computer but sometimes I wonder if owning a Mac mini would be worth it, considering it also has bash and a lot of tools for web developers.

mostly because it justwerks, and because it can interface with linux, eg your servers, just as easily. There are some useful tools that are mac-only as well. Sequelpro is the best MySQL gui out there