/wdg/ - Web Development General

last: >This season's Advent of Code:
adventofcode.com/2016/

>Discord
discord.gg/wdg
OR
discord.gg/0qLTzz5potDFXfdT
(they're the same)

>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/

>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] 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
pastebin.com/pDT82mQS
pastebin.com/AL6j7GEE

>cheap vps hosting in most western locations
lowendbox.com
digitalocean.com/
linode.com/
heroku.com/
leaseweb.com

Other urls found in this thread:

collinoswalt.com/pics/
zagrebfoodstories.com/najgora-kava-u-gradu-worst-coffee-town/#gs.6tiH1cQ
php.net/manual/en/book.pdo.php
sqlite.org/)
sqlite.org/whentouse.html
charlesleifer.com/blog/five-reasons-you-should-use-sqlite-in-2016/
twitter.com/SFWRedditImages

Things I'm working on:

1.) Videogame
2.) Youtube App
3.) Morse code App
4.) Trying not to kill myself

Which one of these seems most interesting?

>#4

same

Hello ADD brethren.

Pick one and see it through. Keep building and reordering that idea list but finish what you're working on.

Doc is giving me Ritalin in a month. The world won't be ready for it.

What types of websites today can get you some cash and from what?

I haven't even been thinking about making something by myself because I have no idea what could people even use that doesn't exist already.

I basically abandoned all hope for those kind of things after a first year of uni.

I will never be an enterpreneur. Just when I think about all those potential killer apps I could have made, and all those fairy tales my uni told me that are achieveable... Heh.

The only thing I can currently make is some kind of a blog or portal but that shit doesn't get any revenue and takes a shitton of time.

I've got an idea but it will cost you $50

see:

I need a private repository for my current project..

BitBucket or GitLab?

I hope no one minds me reposting my question at the very end of previous threads:

So what is the magic number for the number of projects needed to put in your portfolio? I was going to shoot for four but now I don't even know.

3 - sites (one multipage using foundation and one using bootstrap, and one simple single page site)

1 - simple php project

None of these are real sites though just updated student projects... Now you guys got me thinking I'm fucked. I was wanting to leave all the garbage student projects off of there if possible.

So I came in last thread. I am using XMLHttpRequest to call an API to post some information. If I do it too quickly it'll lock me out. I have the API call in a function. What I do is during the loop I delay it each iteration for .5 seconds.

However it seems like it goes through the entire loop THEN sends them all off, which gets me failed results. I am very confused as to why this is. I am not experienced with javascript.

collinoswalt.com/pics/

I added a section to my blog where I repost pictures I like. Any kind of pictures (instagram, imgur, etc) I want

Depends on your size. The is no rule.


Just try to put yourself in your employers position and look though your portfolio as if it was someone else's. Would you hire yourself? Would you give money to that guy and bet your companies success on him?


Another good measure is simply if you really understood what you are doing. Shut down your computer and have small converstion for yourself:
"How would you implement an online version of monopoly or chess?"

Just go through it step by step and talk loudly:
What technologies would you use?
Where to put your logic?
What are the problems and how would you try to solve them?
Why is using a certain technology (i.e. React) a good/bad idea here?
What happens in your program?

If the task is too easy, try something more difficult.
If the task is to hard, start with something simpler.


This sounds ridiculous, but it teaches you a lot about your gaps. Suddenly you realize you don't really know how a certain part works or what the downsides of React are.. Good! Now go and code it. You just got smarter and have one more project to show up. If you can fast forward through such an mental exercise you are ready for an interview.

Very good way to put it. It's very hard to know when you're ready because people constantly tell you about "imposter syndrome" and all that, as well as an employers knowing that a junior isnt going to be very helpful (maybe?)

I'm super critical about myself so I don't know if I'll ever be happy with a site I make. I do like your advice on asking yourself questions, because in an interview setting I may be stuck with a whiteboard.

Do you think someone is ready with a little bit of html, css, and javascript?
I get the feeling that this used to be the case, now it feels like employers are expecting a junior dev to have a lot more knowledge coming into the industry. I can't really tell if this is just the HR retards putting up qualifications that are outside of a realistic expectation or if the standards are actually being raised.

Also thanks for the detailed response user.

If you're doing a loop with a setTimeOut of 0.5 seconds, the loop will complete and the requests will all be sent 0.5 seconds from now.

What you need to do is do a setTimeOut of 500 * i, that way each call will be sent 0.5 seconds after each other.

>I will never be an enterpreneur.
Sounds about right.

I have 2 rules and they are very good. Since rule 2 is my business model, here's rule 1.

If your website does not fit this rule, then don't make it.
>1. You don't want to write any content, at all, ever.

im tryin to ue webkit-background-clip:text and it looks like ass on firefox. wtf. is there a way to fix this without the modernizer solution? like pure css

1 easily sounds the most interesting but also the most difficult to finish.

Do number 4, you should be able to do it in two or three days tops.

None of those seem interesting.

First year Software Development student here. Things I'm working on:
1) Internally screaming my way through college
2) A shitty MUD passion project I picked up 2 months ago
3) A community website for resources and discussion for aforementioned MUD
4) Teaching myself Python because my course isn't and the MUD's codebase uses it.

Basically I like to play in the MUD. Also I'm shit at art so text-based creations are convenient.

Python is comfy af and all my first yeartards agree. I've no idea why they're teaching us the logical essentials for programming with the messy clusterfucks of Java and C# instead of Python.

I started an ERD for my site's SQL last night and I'm suck wondering if I should add all the account settings attributes to the User_Account table or if I should just attach an Account_Settings table. Other than that, any general tips for someone who wants to design good forums? I'm only planning on using SQL, PHP and HTML at the moment.

Is it dumb if I make a custom PHP method to accept arguments of a table and array of columns and values to parse into a stringbuilder for SQL queries? It'd also validate and escape known column names to avoid SQL injection, and return errors for any unrecognized columns.

Hey team.

My Gulp keeps crashing, even if my code is good.
Is it because of my gulpfile.js set up?

Thanks!

your mom doesn't seem interesting

furst fur acbn

oops

what .exes are u guys making

Uncalled for.

:^)

does anyone have any good background images to use in css?

subtle patterns?

pretty much just looking to form a good folder of images to consider when designing. whether its basic pattern repeats or full background, its fine.

even these opacity .png's are fun to use sometimes

2 Questions for you /wdg/ if you can answer them.

Please help.

i need to vent
Its for a collage project
the project is multiple years old worked on by complete idiots for multiple years.
The professors never checked the code.

Its a website for a school system, teachers can grade students and students can grade their courses. The first group decided that a framework wasn't necessary, and that courses need to be nested 5 levels deep
so you have a course that multiple courses that again has multiple courses, etc..

The second group decided to trow in their own homemade framework. No documentation

The third group made sure to put everything in separate files.

The fourth group decided to do random shit.

All previous groups worked on the project for one year.

There is no documentation. Each group consisted out of 4 people. As a result the entire code is garbage. My group added the most functionality to the project, we are already 3/4 of a year busy on it.

But now i need to reuse something from the second group that still uses the framework. We need to duplicate the 5 level course page. problem the database only saves the fucking id and names of the courses. We have no idea where they store the levels and the parents.
The databases used, 2 flat files and 1 MySQL.
Lines off code over 1.000.000 because fuck reusing stuff, lets just copy that shit

What's the garbage you put up with?

forgot to mention, its all written in php

sounds like you need to nuke it and start over honestly.

>lolwebdevs

we asked, but the professors said that you will experience shit like that in real life all the time.
So you need to just build on it...

any reputable company is going to have better source code than the amateur shit you're working with, and if you encounter shit code in real life then rewriting the whole thing is often the sensible solution

At least it's not written in P..

..oh shit!


This.

The complete thing doesn't sound overly complicated, you could rewrite it in 2 months.

My advice:
Take two weeks, make a small doc/spec and tell the professors to rewrite it next year.

use grunt, gulp is shit

I bet you saw that comment on dark backgrounds for images in the last thread. :^) Not bad. I feel even a bit darker shade of gray would be better and more elegant, and the red links in nav don't have a good enough contrast with the background though, just give them a white color and they'll be fine.

Question for CSS artisans.

How would you achieve this letter "A" in the background of a text, at the beginning of an article?

zagrebfoodstories.com/najgora-kava-u-gradu-worst-coffee-town/#gs.6tiH1cQ

...

Interesting. Thanks.

Have you tried reading the error message it gives you? It literally tells you the exact problem right there. You're trying to @import a page that doesn't exist.

>id or name
As long as names are guaranteed unique it doesn't really matter. If multiple objects could potentially have the same name (i.e. if they're user-generated) you need to use id.

>which url
semantic urls (the ones with words in them) are considered to be better for seo if you care about that. Also you might replace the object that word represents with something else that has the same name. If you go by id and you delete that object at some point, you can't reuse that uri and you have to 404. In some situations a number might work better though, so just use whatever makes the most sense. Read up on REST.

professional HTML programmer and HTML software engineer here, ask me anything

how do i get muh CSS to werk with muh HTML's?

Has there ever been a case where a website was using their visitors as computational nodes? The server could push jobs to visitors and the browser would run them in the background and return results. Like very slow distributed cryptocoin mining, or something like that.

Thanks lad.

The purpose of the name query will be used with a search bar. So I think I'll be better covered there.

So in the instance of ID, lets say I had a API with all of my authenticated users, no method of search, they were just listed on a single page. Would it then be wise of me to list every single item on there with ID instead? That way the ID stays correlated to the URI? I don't plan on deleting any entries in my API which is the nice thing about using name as the Primary Key.

Making a web scraper in node. The idea is that I have an array of objects, and each object has a link to a webpage. I want to loop through the array and make a request to each object's webpage, then update that object with info I get at that webpage. The issue seems to be that my for loop keeps going while the asynchronous request is still doing it's thing, so my data gets messed up. How should I approach this? I read one post that said to separate the request into it's own function and call that from the for loop, something about the new function having it's own scope, would this work?

i finally managed to connect to mysql but i have no idea what i should write as username or password. i dont recall ever setting a username or password while installing mysql, apache, or php

you have depression?

A NEET trying to make it does make you depressed.

I know I was when I was in that phase. Now I have a job where I sit on ass browsing Sup Forums/reddit for half of my day and I'm only slightly depressed.

are devs jobs really this boring? isnt there work to do

There is, but the workload isn't hard if you know how to google. I learned that when you finish something, you generally wait around a bit before letting people know you're done. If you do it fast and let them know, the managers or bosses would think the work is too easy and won't appreciate the work you do.

"Oh, you designed the database tables, backend code, and front-end code all within my specifications in an hour? Why are we paying you so much for if it's that easy?" - paraphrase of one of my bosses some time ago.

I would prefer if I have something to do rather than not. The day really slows down when you're trying to find shit to look at on the Internet.

I'm not sure. I can't think of uses for that, but I'm sure there are some.

Sure, but when people find out you're using their system to do that, the savvy people can look at your code to corrupt the data.

>mysqli
It's ${CURRENT_YEAR}, use PDO you mongrel
php.net/manual/en/book.pdo.php

And you won't have a mysql user until you create one, so do that. By convention you would usually name it the same as your application, or something similar.

This.
PDO is the best.

Don't talk shit on the newbies though. PHP is so full of deprecated features that tutorials and book still use mysqli and some even mysql.

>PHP is so full of deprecated features
...that no one should be learning it in the first place.

A Fractal of Bad Design, you might say.

That's true, I didn't think of that. I guess with high enough bandwidth you can do what Google does (I assume) with reCAPTCHA: they send the same thing to multiple people and then pick the most often returned result.
But that would be slowing things down even more.

Nothing practical, obviously, but lots of fun things.
Like a virtual CPU that executes a program and sends the assembly code of the program to visitors. I wonder how long it would take to boot a tiny Linux distro in such a way.
Seems like it could be a fun "community project", sort of like Twitch Plays Pokemon and stuff like that.

but its NOT that easy. You're just really good and work fast. It's no min wage job we are talking about. I see your point though. I like to work at a medium pace.

use sqlite and pdo

I believe by default the password is root. sign in with "root" and your root password as the password. If you're going to deploy this in php, you should put the password in a separate "credentials" file with appropriate permissions and add the file to your .gitignore file if you use git on this project.

ok i took care of these but i still get an error. i think it is because i dont have a database, but i dont know how to create one

forgot file

yeah so install sqlite, and manage your data through the command line

log in to mysql via the command line like:

mysql -u USERNAME -p

where username is whatever account has access to mysql

type in your password when it prompts you

Then, type "create database [name]"

and you've created a database.

You should pick up a book on MySQL

Is it just me or does php never fucking works?

def just you m8

git gud

/wdg/ I want to simply update text on a web page as it is updated on the server without polling. Is SSE the option I want or is there anything else I should pick over it? I know I can do it with SSE but I'm not sure if there's a better standard instead.

Didn't work. Any other advice?

I'd just do websockets.

It's hard to git gud when even the code from online tutorials don't work.

lel

read the actual docs instead of muh online tutorials

SSE doesn't work on Internet Explorer, so I would not recommend until enough people get off of that shit.

Websockets works with everything.

Mhm well the library I'm using only has these stupid tutorials so I'm completely fucked

Thanks, this seems better for my needs as well after reading about it. With SSE I was going to have to go from 1 machine to another over TCP anyway and then have the second machine act as the SSE server, with websockets, it seems like I can cut out the middleman as long as I can access machine 1 through a TCP connection which I can.

IE has been dead for years. 10% share currently. It's done. People are already off that shit. M$ is a disgrace.

I don't develop for internet explorer, period. Just like I don't develop programs for compatibility with 16 bit processors. People need to stop using IE, so hopefully not including it in my projects will add further incentive to install Chrome or Firefox or upgrade to Windows 10 with Edge

>Edge

no, just no. Still doesn't support SSE. Pretty much IE with a slightly better UI. Ditch it all.

M$2Edgy4me

Really? I don't have any windows PCs so I didn't know, but I had heard that edge fixed all the shit that made IE terrible. Wow, Microsoft, SAD

They say they're working on it, but once again they're grossly behind the competition.

they completely missed the browser and mobile market. they'll never catch up either.

dont use SSE

>Find something that you can sell for more than you buy it for
>Make a website that sells it
>Try to automate the process as much as you can

I've done this a few times and it works, but you won't make enough money to live on unless you live somewhere with a really low cost of living. It brings in a few hundred extra dollars a month and doesn't require much time once you've got them up and running. I try to ride trends, for example, drones, vape accessories, vr accessories, etc. It works much better if you have some money from a day job and can buy some bulk product to sell, since it's a lot cheaper that way.

PHP is so weird. At work I created a function that reads all url parameters. It was literally just foreach ($_GET) or something like that.
Everytime I ran it, our entire server crashed and all sites were down for 20 minutes.

HUE!! Pajeets are the best tutorial teachers. how can the rest of the world even compete. i watched 10 american videos, one pajeet tought me fast as fuck how to build a complete web page.

SQLite doesn't support connection pooling and isn't suitable for use in web applications.

what are the specs on the server at your work? i would really look into why it was crashing the server like that, might learn a few things well. heck i'd even like to know what was going on. Is there somewhere on your server you can go to see the memory/cpu usage at the time you ran the script?

lol you dont even need a video in the first place to learn how to create a web page. you dumb as hell, son.

>SQLite works great as the database engine for most low to medium traffic websites (which is to say, most websites). The amount of web traffic that SQLite can handle depends on how heavily the website uses its database. Generally speaking, any site that gets fewer than 100K hits/day should work fine with SQLite. The 100K hits/day figure is a conservative estimate, not a hard upper bound. SQLite has been demonstrated to work with 10 times that amount of traffic.
>The SQLite website (sqlite.org/) uses SQLite itself, of course, and as of this writing (2015) it handles about 400K to 500K HTTP requests per day, about 15-20% of which are dynamic pages touching the database. Dynamic content uses about 200 SQL statements per webpage. This setup runs on a single VM that shares a physical server with 23 others and yet still keeps the load average below 0.1 most of the time.

sqlite.org/whentouse.html

ouch... also why does everyone here hates wordpress?

Why bother though?

Why not just use something that can handle lots of traffic?

it doesn't require a sql server instance.

it's definitely suitable for web apps....pretty sure the guy i responded to isn't handling twitter or facebook amount of requests on his app. i've done a few projects for companies with it and works fine

charlesleifer.com/blog/five-reasons-you-should-use-sqlite-in-2016/

post the code pls

>testing on a production server

>pic
but that's wrong. where did you even get the pic from?

I think it was this server from a german hosting company.

I don't work there anymore, so I don't remember the exact code but it was really simple. I tested it a couple of times and the server always crashed. Weirdly enough it worked in a local dev environment, that's why I pushed it to production.

We never found the cause for the problem. So strange that one line of basic PHP crashes a 300Euro/month high end server.

why wouldn't you hate wordpress? it's bloated lazy shit