/wdg/ - Web Development General

/wdg/ - Web Development General
Previous Thread: > Discord
discord.gg/wdg
OR
discord.gg/0qLTzz5potDFXfdT
(they're the same)

>IRC Channel
#Cred 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/
youtu.be/JxAXlJEmNMg?list=PL7664379246A246CB - "Crockford on JavaScript" lecture series.

>Useful Youtube channels
derekbanas
thenewboston
learncodeacademy
funfunfunction
computerphile
codingrainbow

>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
youtu.be/sBzRwzY7G-k - "2016/2017 MUST-KNOW WEB DEVELOPMENT TECH - Watch this if you want to be a web developer "
youtu.be/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:

vuejs.org/guide/
jsfiddle.net/kjx2nst8/
jsbin.com/dinusigeqa/edit?html,css,js,output
stackoverflow.com/questions/1144894/safari-doesnt-set-cookie-but-ie-ff-does
classroom.udacity.com/courses/cs253
stackoverflow.com/a/28347456
en.wikipedia.org/w/index.php?title=Title_in_URL&action=history
jsfiddle.net/geyck9jL/
news.ycombinator.com/item?id=12604742
stilson.net/documentation/javascript.pdf
twitter.com/SFWRedditImages

Starting to rewrite an application from Node to Go...still getting used to its syntax... JS made me so lazy

what's a good web scraper library for C#?

What do you use for a web server? Apache? Node.js?

EventTarget.prototype.addEventListener = null;
Object.freeze(EventTarget.prototype)

How to learn design, I can spew out code like no tomorrow and I have a solid grasp on css with sass, but even knowing all this the stuff I make looks like garbage. Do I really even need design as a full stack dev, fuck me mane.

Only if you're freelancing. In the workplace you'll have UX autists to tell you what to do usually.

>first job out of college
>doing full-stack development
>ran into bug on Safari
>Upon closing out of Safari it will log you out of our website
>mfw I have no clue how to fix this on our end

I know this is a caching issue but I don't know the solution. Every other browser is fine but Safari does this constantly.

I have turned off private mode, enabled cookies from all websites etc but this browser won't store shit.

the product I am working on uses Angularjs and Nodejs.


any ideas on a viable solution for this?

media query that replaces the site with USE A REAL BROWSER YOU FUCKING HIPSTER FAGGOT

>implying I use safari

I fucking hate it. but a majority of our customers for some fucking stupid reason use Safari.

Chrome, IE, Edge, Mozilla are all infinitely better than Safari at this point.

Pic = Martin Shkreli?

No, I know. I want to shoot myself when I look at the browser metrics for my own site

>Chrome, IE, Edge, Mozilla are all infinitely better than Safari at this point.

Last time I had to optimize shit for Safari, it was somewhere between IE8 and IE9 in standards support. Used -webkit- prefix for half the CSS too.

yeah I am 6 weeks into this job and Safari has been the standout for horse shit that I have had to fix. IE usually isn't bad, Chrome I have only seen 1 bug and that was from code built around an older version. Mozilla has nothing so far.

what's worse is I have now ay of seeing how our caches are formed according to the senior dev. So all I am seeing are the caches sent in to the web server when it hits our routing function for authentication.

Making a cross platform password storage app.
Android version with Android Studio.
Desktop version with C#. Not necessarily anything unique really, just want to make something to show my skills right across the board.

I haven't figured out a way to link them into one yet, a web based database storage and management system.

Am I the only person that loves back-end dev, but absolutely hates front-end?

>I haven't figured out a way to link them into one yet
REST API. You could write it in ASP.NET (if you're looking for resume/portfolio building, that's your best bet since everybody is looking for .NET developers these days - it's the new Java).
Then your desktop application, your web application, and your mobile applications will all just utilize the REST API.

Since it's a password storage application, it's also a great place to showcase security knowledge, which you can build directly into your API.

no it isn't
y'all mad

Except its even better if you do in fact know everything

>Am I the only person that loves back-end dev, but absolutely hates front-end?

I prefer backend to front end work. but I am to weak in angular to do a ton of backend at my job.

sucks as I have only made 1 router and a few controllers now.

I've been avoiding ASP.NET for some reason. I know a little bit of just about everything else though, but ASP doesn't appeal to me. I'll still look into it though, maybe it'll grow on me as I learn.

Good thing I posted here because I never really thought about building an API. I was just going to make something to manage a hosted database.

Thanks for the suggestions.

ASP.NET Core behaves like a boilerplate node setup, is pretty okay, not great but a huge improvement from ^4.5.*

------ VUE.JS 2.0 OUT ------
vuejs.org/guide/
vuejs.org/guide/
vuejs.org/guide/
vuejs.org/guide/

Angular, React, Ember and otherframeworkfags you want to take a look at this.

Baby steps:
jsfiddle.net/kjx2nst8/

Not sure why, but it's not working on jsfiddle.

Here's a working mirror: jsbin.com/dinusigeqa/edit?html,css,js,output

The fuck is this horse shit

Hey guys, complete beginnner. I want to get into webdev but I have absolutely no idea where to start, its a bit overwhelming.

What should I start doing, learning a language?

Start by reading the OP...

Admittedly I've only skimmed through it, but I'm autistic and need a basic "how to into"

hey, I told someone in /dpt/ to learn Go yesterday. are you here, by chance?

First step is learning how to find information because you'll need it.

stackoverflow.com/questions/1144894/safari-doesnt-set-cookie-but-ie-ff-does
this one?
have you tried looking at what other browsers do?

I'd suggest to start here: classroom.udacity.com/courses/cs253
you need to know python, though...
also, read a bit about networking and stuff, and learn how to use wireshark

>have you tried looking at what other browsers do?

other browsers work fine. The cache is fine and maintains the login status after closing the browser.

The cache I checked in Safari is odd since it still contains some authenticated content. For instance the cache directs to the authenticated part of the web page so shit like LOGIN buttons don't appear because the cache says it's authenticated.

But our navbar overlay which loads last has the non-authenticated layout.

The cache on Safari looks empty. but it contains some of what it needs but not all.

What makes it worse is that it's incredibly hard to reproduce without a fucking MAC. I have an Iphone 4 and am using Browserstack but browsterstack doesn't work for this bug and my Iphone 4 is so damn old I can't apply any of the newer settings or try shit that would be on a MAC computer.


I'm seriously hoping this bug just gets fixed when safari goes to v10.

>implying the feckless tards who still use safari will actually bother to update it

sorry, I had misread
is this it? stackoverflow.com/a/28347456

Sup /wdg/ I'm returning to web development after a while, boss wants me to do a new admin site for our mysql db, is a framework worth learning? Or should I stick to vanilla php and pdo statements? Site is just a login form and a bunch of queries for internal use.

I want to make a photo gallery of gif images that's very minimal. The design I want is just a tiled/grid-like gallery of images, with a hover over to reveal the gif and an on-click to copy the image link. It's for a personal/private project. I have a few questions.

What would be the best way to host the images? Is there a website where I can upload 3gb worth of images and display them how I want? Would it be better to store them in a database so that I can attach tags, or can I do that with regular html tags? If database, how do I get started on that (since I don't really know much about database/server connection stuff)?

I think I can code the design, it's the backend stuff I'm not too sure about. tldr how do I upload/display/organize 3gb of images?

that may be it but there's one thing I don't understand about this shit. No where in the code is there a point where cookies are set.

It's an SPA so maybe that has something to do with it but I can't pinpoint any good spots to set a cookie to be persistent since no where in the code is there a location.

and the senior dev doesn't know where the cookies are set either.

since it's an SPA could I just set the cookie in the main index.html page? would that fuck with anything on an MVC framework or SPA?

There's a video in OP dumbass.

What do you all think is the best free code learning program? I've been jumping around from site to site for awhile now, but recently I've been sticking with freecodecamp.

>No where in the code is there a point where cookies are set.
I don't get it... how are your users logging into your app? how can you not know where the cookies are set?

honestly idk. I'm 6 weeks in to this job and I am still learning Angular, Node, Sequelize, MDL, etc.

The cookies are being set but it's not explicitly stated in the code. I'm thinking an auxiliary library was added that set the cookies

It could also be I don't know dick about cookies.

how did you get the job? did you lie in the CV or something?
I know what cookies are and how to set them... I think you need to watch some videos or something, because that's really basic stuff that every webdev should know...

oh, and btw, I'm unemployed...

>how did you get the job? did you lie in the CV or something?

fresh out of college. Only ever made 1 website. This is a Startup so there's no documentation on the website and only 1 other developer who has been programming for 15+ years. I honestly question my importance at this company.


>I know what cookies are and how to set them

I should clarify, I do know what a cookie is and how to set one but I have never had such a problem with cookies so I figure I know very little about them.

can you not run "grep -ran document.cookie" in the dir where your code is, and, from there, find the code that actually sets the cookies? do you not have the API docs of the JS frameworks you are using?

Is it worth my time to learn about Android Studio and all this Google Firebase App Indexing shit?

Alright so I got a degree in Geology and a minor in computer science from a pretty good school, and I've decided I want to work in tech because I love it.

My option are that I get a 2nd bachelors in CS, get an online Master's in CS or to just try to get a job with my minor and self teaching. I'm not doing some bootcamp gayness.

HONESTLY, it doesn't even matter to me what I do, but I want to do something that's going to give me lots of freedom in the future. What should I do? What does Cred Forums advise?

get out whiel you still can

>rewrite an application from Node to Go
why is that?

elaborate

You dont really need any certifications to make websites or program anything. That being said to learn the best practices and no bad habits it would be worth doing the cs degree. If you just want a job you can just jump right into self learning and making a portfolio of sites/ applications on github or whatever. I recently got a webdev job doing the latter.

Anybody know where i can get some premium html5+bootstrap templates for free? :^)

Anybody want some help with any project, since its hacktoberfest i willing to help

I think mostly it has to do with your learning style and preferences. I Can't stand freecodecamp, their whole "yay correct, here's 10 points for you, Champ" approach turns me off.

In the end it doesn't matter, you can only learn baby-level stuff with those online things, their goal I'd say is to get you hooked and excited and confident enough to go elsewhere and look for harder stuff. If freecode does that for you, mission accomplished.

pic unrelated, I just love this girl

>left a Django/Python/Knockout/Javascript/AWS role
>got into a Django/Python/Wordpress/PHP/Angular/Javascript/Ionic/LESS/Ansible role
Shit lads, how do I retain my sanity? I must say though, Wordpress and PHP are pretty comfy, I wouldn't use PHP outside of an already big open source project like Wordpress/Moodle though, or maybe I just don't "get" it yet.

Nginx, go, passenger/raptor

>Apache
>4th quarter of 2016

Apache can be faster than nginx, for instance if you are serving mostly php and less static files. If you're dealing mostly with static files then nginx wins though.

small projects is where php shines, I haven't really used wordpress but I've dabbled in laravel and I'd much rather use something like django/rails than fight php to be something that it's not.

Wordpress is the first PHP I've worked on, and it's pretty decent. It's focused on 1 kind of website, but makes itself easily extendable to anything slightly similar. The structure of how a page is served is easy to understand even from someone who just picked up PHP.

That being said, the language itself and even the initial struggles of going through the WP source code does make it evident how difficult it is to do your own monolithic thing. I would definitely use Django or MEAN (haven't gone too much in Rails) over PHP, and Laravel just ups the confusion as well

Know JS & PHP.

What should be my next step in learning for front-end?
> jquery
> angularjs
wat do?

jQuert AND angularJS, preferably angular 2 since you're starting out so it will be future-proofing

I prefer React to Angular, haven't used Angular 2, though.

vue

>it's ok if you don't know everything
Web developers in a nutshell kek

t. codemonkey

Is there a reason to stay away from Node if it's the only work available in my area?

Nope. Memes aside, it's not a terrible technology, and the ecosystem gets pretty comfy. It's a strong 2nd to python imo

Most of your coworkers will probably be unbearable and the ecosystem is kind of shit but it can be fun to work with.

>left-pad
I don't really even hate JS, seems like node would be a 'gimme' generally if it wasn't for the obscure 'build it on that other thing' dependency time bombs.

hey guys, I'm following pic related and playing around with the scrapers on there. Ran into this one, kinda cool and very simple, yet something's wrong. The "getLinks" function is supposed to be randomized (on the 2nd to last line), but that just doesn't happen. Multiple runs give me the exact same link path. Any ideas on why? Is the random function not being seeded properly?

from urllib.request import urlopen
from bs4 import BeautifulSoup
import datetime
import random
import re

random.seed(datetime.datetime.now())
def getLinks(articleUrl):
html = urlopen("en.wikipedia.org" articleUrl)
bsObj = BeautifulSoup(html)
return bsObj.find("div", {"id":"bodyContent"}).findAll("a",href=re.compile("^(/wiki/)((?!:).)*$"))

def getHistoryIPs(pageUrl):
#Format of revision history pages is:
#en.wikipedia.org/w/index.php?title=Title_in_URL&action=history
pageUrl = pageUrl.replace("/wiki/", "")
historyUrl = "en.wikipedia.org/w/index.php?title=" +pageUrl+"&action=history"
print("history url is: "+historyUrl)
html = urlopen(historyUrl)
bsObj = BeautifulSoup(html)
#finds only the links with class "mw-anonuserlink" which has IP addresses
#instead of usernames
ipAddresses = bsObj.findAll("a", {"class":"mw-anonuserlink"})
addressList = set()
for ipAddress in ipAddresses:
addressList.add(ipAddress.get_text())
return addressList

links = getLinks("/wiki/Python_(programming_language)")

while(len(links) > 0):
for link in links:
print("-------------------")
historyIPs = getHistoryIPs(link.attrs["href"])
for historyIP in historyIPs:
print(historyIP)
newLink = links[random.randint(0, len(links)-1)].attrs["href"]
links = getLinks(newLink)

in php when you call a controller's method in a route file does it also call the controller's constructor? i'd imagine so

calm down kid

Are you getting more than 1 link?

I'm testing randint and it's random everytime I restart the python interpreter

yeah, thanks, I figured it out. The script starts at the first link ("python...") and proceeds to list EVERY link in there, along with any IP's found in those links. Once it's done that, it randomly jumps to any one link and does it all over again. So of course the first X amount of links + IP's are gonna be the same.

Yes but if you want to run something every time then typically there is alternative like init. Also what framework.

What's (in your opinion) the best language for backend development? Using PHP is unbearable

>Web Scraping With Python
>picture of an armadillo

Anything but Python, Javascript or C# they're the worst.

>"don't use php, python, javascript or c#"
i.e. don't use any language with real backend libraries and proven use cases

I'd say Python is the one that embodies the web development process the closest.

It's structured enough that it's not a mess compared to reading JS, but not so structured that development is slow compared to C#/Java

It is security-conscious, and with Django, you can pretty much forget security issues. So while JS may be faster to use at the same time, you have the structure and security that clients can trust. Even Java is more prone to security holes.

It is also expressive, and flexible, with so many tools to tailor it to your stack, be it full back-end or just a REST API for a more involved front-end

Ember, React, Angular, Django, Elixir, Jangular, Sinatreact, Spiceynuts, Voodoojs, Coffeebeans, Elixirbeans, Sprinklejs, Mageular, React.js, Elixirnode, Potionpot, Firefly.c, Angles, Jutes.js

Python + Django-Rest-Framework
or Haskell + Servant

How to make a button when pressed 1 time do an action and when pressed again it do an different action? With Jquery.

add a counter to the button, when the counter is even it does action x, when it's odd it does action y

>JavaScript: The Good Parts
>Final Release Date: May 2008
is this book still valid? also, if I'm not a noob (regarding JS and programming in general), but don't know JS very well, should I not read it?

golang is neat

I tried, but it doesn't work. I mean, I want to do a slider, but I just can press "next" button one time. What to do?

shit, ignore the link to , I wasn't replying to that comment

There are a billion ways to make a slider, post code.

jsfiddle.net/geyck9jL/

You're moving the images to the same position over and over.

Why the fuck would a developer need to know design???

Vue has a horrible API and confusing lifecycle.

So I program a web app in React, what now? How do I put it on the internet? Any tutorials out there? I don't even now what to search for and only find wordpress tutorials and that kind of stuff

Can you help me to fix it?

Just for fun. Wanted to learn Go and figured i would re-write an API

jQuery is literally animating elements on a page. How can anyone even consider this 'programming'?

ServerSide is better.

>is this book still valid?
anyone?

>jQuery is literally animating elements on a page
?? AFAIU, jQuery is a way to write the same JS code for multiple browsers and versions so that it'll work even with incompatible/old browsers

(You)
Read this: JavaScript: The Definitive Guide
Then read up on ES6 updates.

$(this).slideDown();

Pretty comfy if you ask me

I will. Thank you.

you're a complete fucking idiot

Eww, you're not one of those people who doesn't hate on popular languages are you?

thanks m8

Really? I've been using Larvel and PHP and have had no problem I find I can rapidly prototype web applications extremely quickly. I don't get how rails is any different

6th edition, right?

How much do you charge for making a page like "free template" mostly CSS. but they say they want like an interface to order food and they want to store that information in a database.

How much do you charge?

Where are you from? (Country)

Why do frameworks have such stupid "zany" names?

how do you people remember lots of stuff like this: news.ycombinator.com/item?id=12604742 ? pure practice?

here's it, if anyone is interested: stilson.net/documentation/javascript.pdf

cause most programmers are stupid people trying to be lel "crazy random and zany"

It's easier to remember when it isn't occult sybmols and is actually serving a purpose. A good number of webshitters never get good enough to use dom builtin stuff, they go for the jquery instead.

>they go for the jquery instead.
What exactly is wrong with jquery? Once you already have javascript bloat who really cares, the user won't. And it's probably already cached in nearly every browser.

I'm offended by the problems it solves and have to fight it on pages i browse.
>Here's a million extra dns lookups for the all the 3rd party scripts I used
>They're only 50mb of PACKED javascript
I would rather lose features than gain bloat personally. Also fuck IE compatibility, fuck safari compatibility. Let them rot.

I don't disagree, on my personal sites its completely functional/mobile friendly without javascript. But I can see why people don't cater to that since the person with js disabled isn't going to click their ads or whatever anyway.

How do drive traffic to my site? No SEO since it's just videos. Is there a more effective way than just spamming it everywhere?
I already have several twitter bots pulling content from reddit and adding my url to every post.

I could learn selenium and make a tumblr bot or something... is there a better way?

I generally keep JS enabled after I've sufficiently hacked their crap off the page. It also doesn't help that the means to make REACTIVE WEB are the same that make it possible to log keys and clicks and send them to any arbitrary 3rd party. CORS protects nothing.

Can you use node.js to build anything these days because i see a lot of quora commentators saying it should only be used for real time systems.

Because web developers are living memes

Quora is like yahoo answers with less knowledge.

Wow, this is totally what most end users care about. Totally.

>end users don't care about speed
web "devs", everyone

Yeah but fuck end users, they're retards. They'll install whatever malware you serve them and they'll never know the difference. Best to do the thinking for them and the clients alike.

>Also fuck IE compatibility, fuck safari compatibility. Let them rot.
This. It's the user's own fault that things don't work properly when he uses such a shitty browser.

>Yeah but fuck end users, they're retards. They'll install whatever malware you serve them and they'll never know the difference. Best to do the thinking for them and the clients alike.

Someone please help me, I really need.

>want to include some technology logos on my personal homepage to show my skills
>mfw the legal buttfuck that is Oracle logo usage

Why is it so hard?

The short answer is that Oracle is a bunch of cocksmokers, user.

Generally if someone sees a corporate logo they'll assume it means you work for them or that your site is running on their software, though.

can't you just follow some random tutorial or copy the slider from some random website?

I'm not going to debug this, but the main problem is you've hard coded the positions, that's why only the first click works.
Those height, width, etc. need to shift with the images, assign them to variables and keep track of which element should have which values.
say:
numClicks = x
positions = [position1, position2, position3]

img1Pos = positions[numClicks%3]
img2Pos = positions[(numClicks+1)%3]
img3Pos = positions[(numClicks+2)%3]


Something like that, my math may be way off. You could also just rotate the positions within the array.

And you only need one listener for the button click.

I tried, but none of the sliders has this preview, and image rotation.
Thank you, I'll try it.

What's a good way to learn Zend atm?
Started reading "Easy PHP Websites with the Zend Framework" by W. Jason Gilmore but ran into a "fuck off, newer version is out" problem.

Zend is dead. Learn Laravel or Symfony. Or Phalcon.

Laravel was my plan all along but then I got an interview scheduled for a company that lists "a first experience/interest in Magento and/or Zend" as a big plus so figured I'd check it out.

Guess I'll focus on Magento till the interview and then continue with Laravel given how the state of Zend learning material is a mess at this point.

That said, what makes Zend dead?

>Or Phalcon
lmao

So I'm decent at coding with Python, C#, Javascript and the frontend shit that is html and css. I want to do backend, so what is my best bet to get a job in? Which of these areas in pic related are easy to get into and have plenty of jobs? Is it API's?

Can someone explain why you use a try catch block with throw rather than using a switch statement?

I've read somewhere on Reddit that the creator of Imgur regretted using an SQL database. I could be wrong, but it was something along those lines. Is there a reason for this? Is there a more efficient way to run an image hosting website?

Best just learn all of them because you'll use a lot of them on real projects.

He probably wished he'd used MongoDB or similar so he could keep the footprint smaller.

I imagine it is because that way you can catch data that isn't specifically stated in a switch.

Dealing with exceptions?

>Thank you, I'll try it.
It's psuedo code obviously, but that's at least the general idea. Feel free to post another jsfiddle, I'd take a look.