/wdg/ - Web Development General

/wdg/ - Web Development General

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

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

Other urls found in this thread:

forbes.com/sites/paulmonckton/2016/11/24/black-friday-2016-best-camera-deals-kohls-target-sams-club-and-walmart/#2198c3c34cde
gitter.im/srs-study/Lobby?source=orgpage
publicdb.host
beta.publicdb.host
greysec.net/showthread.php?tid=1272
owasp.org/index.php/PHP_Security_Cheat_Sheet
owasp.org/index.php/Cross-Site_Request_Forgery_(CSRF)_Prevention_Cheat_Sheet
cssreference.io/
docs.peer5.com/guides/setting-up-hls-live-streaming-server-using-nginx/
stackoverflow.com/questions/18998245/how-should-i-link-a-css-file-for-the-subdomain-from-the-main-domain
pastebin.com/DjvzQ7Ar
pastebin.com/A8VhgHaQ
pastebin.com/r2jxxAWk
namecheap.com
hackernoon.com/how-it-feels-to-learn-javascript-in-2016-d3a717dd577f#.k9rs9fmf0
php.net/manual/en/mysqli.quickstart.prepared-statements.php
es6-features.org/
smashingmagazine.com/2011/11/extensive-guide-web-form-usability/
twitter.com/AnonBabble

php a shit

1st for riot.js

Okay, somebody help me here. What exactly that code does? It's a javascript. And how do I check it by myself?

Whatr do you guys think of this site in terms of design?

forbes.com/sites/paulmonckton/2016/11/24/black-friday-2016-best-camera-deals-kohls-target-sams-club-and-walmart/#2198c3c34cde

Study Lounge back up and will remain so for a while.

gitter.im/srs-study/Lobby?source=orgpage

ur a shit
generic 2016 technology news site

It's very p.c.

Just look at that diversity.. - wait, where's the woman? WTF!? Those sexist pigs.

Spent 5 hours uploading my db collection like about a week ago and now its the biggest public database directory in the world. Meanwhile all the sites that I spent weeks making barely gets a few hundred uniques per day, and I'm depressed now.

also should I switch to the new JS memesite or stick to the motherfuckingwebsite design?
publicdb.host
beta.publicdb.host

In PHP can the user hack their way into post? If I have user validation in get should I just copy paste that validation in post or is it assumed that the user can only be valid if heir got to post?

That's the wrong question..


"Post" is just a method a client throws at a server. Nobody can keep it from using it.

The interesting part what you do as server. Again, nobody keeps you from throwing back "451 Unavailable For Legal Reasons" for every single request. It would be a shit site, but it is totally possible.

Not sure what you mean with hack, but I essentially yes. In my opinion it doesn't matter if you use POST/GET as long as you create a temporary verification code every time a user logs in in order to make sure they actually want to do what they're about to do.

see
greysec.net/showthread.php?tid=1272

owasp.org/index.php/PHP_Security_Cheat_Sheet
owasp.org/index.php/Cross-Site_Request_Forgery_(CSRF)_Prevention_Cheat_Sheet

You have just manifested a complete lack of understanding how HTTP works.

I have to make 5 webpages on any given subject for college. Is there any really easy to use tricks that will make the webpages look really fancy? All I've learned for the module in this semester is only basic CSS, HTML and even more basic JavaScript.

Sup guys maybe you can help.

I have a wordpress website running the 2014 theme, and despite all my efforts I'm unable to enlarge the widgets sidebar beyond 172px without it overlapping to the right. I tried this code I found online:

@media screen and (min-width: 1080px) {
.site:before {
width: 200px;
}
#secondary {
width: 200px;
}
}


Anyone can help?

Bootstrap (the css framework)

Have fun with your F-

If you have a post route or a route set up to handle post data, a request to that could come from anywhere and contain anything.

A page/form you set up yourself is not the only path to that route. Just a template/blueprint you set up for your expected user journey.

see: curl, or any functions like PHPs http_build_query/stream_context_create/file_get_contents.

Is this a good book?

It's ok, nothing there you can't learn elsewhere

Just discovered cssreference.io/
Sticky material?

seems pretty useful

Trying to display my rtmp stream on a website.

Just a empty site with a big player that i can share with my friends.

Does anyone know of any easy way to do this?

I've got some experience with writing simple scripts, but never done any serious web development.

I'm using videojs for a rtmp/hls stream.

been following this guide

docs.peer5.com/guides/setting-up-hls-live-streaming-server-using-nginx/

How do i stream to the server? the old rtmp adress isnt working anymore with OBS

like the guide says, rtmp://yourserver/applicationname/streamname
if you are streaming with OBS then put the streamname into the key field instead of putting it into the URL.

Got an email (dat linkedin botnet, tho) about a mid-senior front end gig (es6; ideally react and redux, babel and webpack; testing wise jasmine, ava and enzyme) in Central London for 6 months. £450 a day.

Recruitment company is VividResourcing if anyone's interested.

i've got it running now. Nginx has created a stream.m3u8 file and a bunch of stream-X.ts.

But i cant play the m3u8. The online stream players give me crossdomain error and VLC gives me what i believe is a permission error.

did you skip the http setup from your guide? it sets CORS headers.

i believe you're right. I assumed he just put that into his config in the next window. I didnt understand what to do with that code.

server {
listen 8080;

location /hls {
# Disable cache
add_header Cache-Control no-cache;

# CORS setup
add_header 'Access-Control-Allow-Origin' '*' always;
add_header 'Access-Control-Expose-Headers' 'Content-Length,Content-Range';
add_header 'Access-Control-Allow-Headers' 'Range';

# allow CORS preflight requests
if ($request_method = 'OPTIONS') {
add_header 'Access-Control-Allow-Origin' '*';
add_header 'Access-Control-Allow-Headers' 'Range';
add_header 'Access-Control-Max-Age' 1728000;
add_header 'Content-Type' 'text/plain charset=UTF-8';
add_header 'Content-Length' 0;
return 204;
}

types {
application/vnd.apple.mpegurl m3u8;
video/mp2t ts;
}

root /mnt/;
}
}


Where do i save this?

in your nginx config

nvm, my config file was identical to his the entire time.

must be something else that's fucked.

What a hell is portfolio and what should it contain? Is it like a CV but in a form of a website? If it is why does it exist? Also, is CV supposed to be just text documents with nothing but black text? My shitty friends were saying about adding colors and other shit

Just learn what you need online

>London
Not even once

Do any of you guys use a CMS? What are some good ones? Are they worthwhile?
At my previous workplace we just used a table in our database or resource bundles on the server

It's a showcase of your skills, rather than just you claiming skills on a CV you show them in action. GitHub is essentially a portfolio of code

Oh so I just link the projects that I've worked ?

you ever think, If Trumps ends net neutrality, WebDev might now be the best profession to be in

Is using the html base tag really the best way to reference common files like .css across subdomains? Found this linl on stackverflow stackoverflow.com/questions/18998245/how-should-i-link-a-css-file-for-the-subdomain-from-the-main-domain
I created a git server thinking it was a smart move to just host common files but maybe I was wrong.
Anyone?

Am I doing a good thing by using zero .js on my websites?
Serious question

>no video with supported format and MIME type found

Do you know what might be causing this?

JavaScript is a powerful language. You don't need a library.

I'm taking my first steps into PHP.

I am making a simple blog hosted on a wamp server using a MySQL database for holding the information about the blogs and associated blog posts.
I can access the blog at localhost/blog/index.php

I have limited the content field to 50 characters and then have to click a "More" link at the end to view the whole blog post. Clicking the link takes me to localhost/blog/blogpost.php?ID=id_here

Here's the kicker: I want to know how to use this functionality in a single PHP file. How would I move the code in blogpost.php into index.php without breaking it and being able to retain functionality?
I'm new to this kind of stuff and I hope I can get some pointers

Pastebin of the full code:
index.php: pastebin.com/DjvzQ7Ar
blogpost.php: pastebin.com/A8VhgHaQ

Any input is greatly appreciated!

Is Java Hibernate a good choice for ORM?

Why is there so little consens on that topic.

What is your opinion on Angular? I is good to know it?Is it a time waste or pretty quickly learnable?

fixed it myself, cheers

I figured it out, here's the final code:

pastebin.com/r2jxxAWk

jQuery question,

to summarise my problem, I'm asking about adding content to the DOM without having to recall handlers.


muh
meh

## handling ##
$("#moo a").click(function(event)) {
event.preventDefault();
}


Later, adding some item to moo
$("#moo").append(" mzh");

how can I avoid to make a new call to ## handling ## and have that 3rd ahref handling ?

Delegate the event and shit.

$("#moo").on("click", "a", function() {});

Is this how an isomorphic React app would work?

The server serves an index.html file on all routes. The index.html file connects to bundled Javascript containing all the React-related functionality. This front-end application handles routing and view-generation, occassionally contacting the server for data or authentication.

Is that right?

ok so the web host i intend to use supports ASP.NET

this means i can use freaking C# right??? i won't even have to touch php?????? please tell me this is real

also is there any way you could help me get an estimate of the amount of computing power you can use in a shared environment? especially since C# should be much faster than most scripting languages, then could i do processing of small (dozens of kilobytes) user-uploaded files, or are you supposed to only do the lightest tasks of handling user sessions and sending emails and whatnot?

having trouble modifying somebody else's template, huh Pradeep?

whats the new meme front end framewokr now? Did NG2 fail? React all the way now?

88 cent .com domains from name cheap until the end of the hour

namecheap.com

vue.js is the latest meme

if you can get to it. every year the same shit happens where namecheaps shit fucking script cant handle the hundreds of thousands of people trying to load their site. You'd think that a site of this magnitude could be up for more than 5 seconds at a time

React is elegant, but not easy to get into.
Because it's just the view layer you'll have to implement everything else to your liking.
Which can be good if you know your shit but if you are just starting out you are bound to make tons of bad design choices.
>tfw just started a React/Redux job and I barely have an idea what I'm doing

Used to be an Angular guy but the change to v2 is just too retarded.

Did a project in vue.js but it's pretty much babbys first frontend framework, wouldn't bother learning it desu

what dont you like about NG2?

I'm trying to get a re-write green lit at work from a cluster fuck jquery mess to NG2.

Oh I phrased that wrong.

I can't actually say much about ng2. It's probably very elegant and whatnot
For me it just didn't make sense to switch. I invested heavily into ng1, and switching would require too many unproductive hours of learning the new API and possibly TypeScript.
Also I couldn't reuse any of my old directives without rewriting large parts, which is a bummer. Modularity was always the main selling point of ng to me.

>jquery mess
Dear god maintaining a jquery project which goes beyond a few simple hides, shows or whatnot is a real pain in the ass.
Was actually my first ng project, rewriting a jquery PoS into an actual maintainable SPA

Totally reasonable reaction to NG2 coming out. They say its possible to use just JS for NG2 but EVERYTHING is in TypeScript.

The Jquery mess is basically an entire enterprise web client (thick) split into 4 40-50k line js files.

Most html is string+dom manipulation. Only the dead know peace from this agony.

Also jquery.extend(). Fucking. Everywhere.

Any good black Friday web hosting sales out there? Is cloudatcost pay one time and have it forever just a meme?

hackernoon.com/how-it-feels-to-learn-javascript-in-2016-d3a717dd577f#.k9rs9fmf0

How do you guys write your javascript code?
In my workplace I am used to typing a few lines then console.log(result)

So its like:
Some Constructor() {
}
console.log(result)

AnotherConstructor() {
}
console.log(result)

But then my supervisor keeps on watching behind my back while I code as if
expecting me to write everything fast. I saw his face doing a facepalm reflected on my monitor. When I'm writing html I could do it fast I already know the result even without refreshing the page. But when I write js I'm a console.log person. I try to make my js code easy to read, easy to maintain, does what its supposed to do and yet my supervisor keeps on facepalming on my "console.log per function" style of writing code. I thing he wants me to just:

"tikatikatikatikatikatikatika [enter],
tikatikatikatikatikatikatika [enter]
tikatikatikatikatikatikatika [enter]
tikatikatikatikatikatikatika [enter]
tikatikatikatikatikatikatika [enter]
tikatikatikatikatikatikatika [enter]

p.s. I follow design patterns as well so my code isn't shit-looking at all. Or am I really supposed to do

"tikatikatikatikatikatikatika [enter],
tikatikatikatikatikatikatika [enter]
tikatikatikatikatikatikatika [enter]
tikatikatikatikatikatikatika [enter]
tikatikatikatikatikatikatika [enter]
tikatikatikatikatikatikatika [enter] method of coding?

Check the LET thread

Would actually want to know as well.
Will soon be putting up my portfolio website and would like to host it outside of heroku.
Also, should I even bother with .com for 15€/year if I can get .us for pennies?

Jesus fuck, PHP is a dumpster fire. Fractally insecure. Someone please remind me again why it's so great? It's impossible to write clean, simple code when you have to constantly dodge the gaping security holes. Not to mention it's hideous to read compared to most other languages.

slack is written with PHP ¯\_(ツ)_/¯

I'm glad you remember articles from the 2000's

>It's impossible to write clean, simple code
That's more down to your level of incompetence.

>constantly dodge the gaping security holes
See above. If you know what you're doing, writing secure code in PHP is about as easy as any other language.

>hideous to read compared to most other languages
Do you really care that much about how it looks?

Hibernate is great, if you're using spring then consider Spring Data, it still uses Hibernate but abstracts it some more for you

Glanced over it. Line 99 with the $_GET id is very insecure and open to sql injection. Look into mysqli_escape and use that before you use the variable inside a sql query. Or look into PDO. That's just what I saw. You should also be suspicious of anything in the $_server super global also

That's some terrible looking code, a few tips:
* Move the configuration variables to the top of the script along with the mysqli connection
* Use classes and style them with CSS instead of using bgcolor
* Don't echo "", do it the other way around like this:



And like said, never use user input directly in queries. PDO is preferred but you can do prepared statements with mysqli also, read: php.net/manual/en/mysqli.quickstart.prepared-statements.php

having a pretty decent month so far

Anyone here use and enjoy react.js

no

who would enjoy a bloated crap?

riot.js for the win!

I'm hating it less each day.
It sucks at the beginning due to the JS memestack you have to get into (webpack, babel and all that other shit)

But when that is done it makes for a pretty comfy dev setup. Hot reloading is nice for sure.
However it all will probably be for nothing due to some new hot framework coming out in 2 months tops.

frontend, not even once

if he knows what he's doing? he wouldn't need you in the first place. just ignore him. don't overthink. focus on code, not on people.

>font-size

smaller < small
large > larger

Explain this

Try to find a code formatter (on save) suited for your needs.

don't use -er. learn how to typography. I have to talk to graphic designers just on typography alone.

lol fuck that guy. my attitude toward work has become, unless someone tells you there is a problem, try to ignore any "noise" or vibes or whatever. so just keep doing what you're doing.

but seriously who watches someone code over their shoulder? that's what reviews are for.

yeah the memestack is cancerous

I've been practicing without using ES6... maybe I should be doing it with ES6 instead

async await

Just have a bit more confidence in your coding. If you're in the zone try writing at least 15-20 lines before checking your work. What helps me is just a quick comment on what I expect functions should output.

its like they're trying to turn it into a real programming language

I tried to fight ES6 as long as possible but I'm afraid nowadays it's easier to just go with it.
I mean eventually it's gonna be the standard anyway, right? Might as well get used to async and await while you're at it.

es6-features.org/

Arrow functions are pretty nice.
Also creating a copy of an object is ez

var copy = {...original}

Things like this are my fear because I always code like shit when there are people watching me code. Even if it's someone I know like my sister or another friend

Now that I think of it, I do everything like shit when there's someone watching from my back, even playing games

How do I explain this to a potential hirer? I hope no hirer does this when I graduate

yeah i know. basically every platform thats having trouble with their load times are migrating immediately

Wait isn't async/await an ES7 feature?

yeah it didn't make it into the 2016 release, but soonTM

Require some guidance as to how to go about make the form in the picture.

Here is how i would go about doing it:

For “JobSearch.com”
Create div set height in pixels set width to 100%
For “Create Your Account”
Set margins so Create Your Account is a bit below
For “*Required Information”
Create h2 header with margins so basic information box is a bit below
For “Basic Information Form”
Create Div width 90% centered somehow
P tag basic information

Any criticism is would be great.

I need a basic site with a database and member list.

Skills I require: HTML, CSS, jQuery, PHP or Python or Ruby or whatever language you can do it in

Site will need to query a database, register members, post messages, and download/parse URLs and a basic design. You'll also need to know nginx and linux setup and the site will need to be modern and flip between pages seamlessly with jQuery.

Shouldn't take more than a day to complete. Can pay in bitcoin. $25 maybe is fair, maybe more.

Anyone interested?

Hey guys,
I'm trying to make a script atm with Tampermonkey but I'm having some trouble with it.
My goal is to either redirect me to a certain page when I open a certain page
OR
to close the tab when I open a certain page and then open a new tab with a certain page.

So far I've got it working but the problem is - the script only starts working and doing what I said above when the page already fully loaded, which renders the script completely useless.

Anyone got an idea how to execute the script immediately before the page is fully loaded?

I prefer Mithril.

smashingmagazine.com/2011/11/extensive-guide-web-form-usability/

if it's a registration with multiple parts maybe make a progress bar? Overall the design seems good, just seems like a lot (even though it isn't)

The domain name that I bought for my digital ocean VPS always changes the url to my server's IP address
I'm using google domains and it is written in node js
can someone help me out?