/wdg/ - Web Development General

Russia #1 Ally Edition

> 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/
[YouTube] Crockford on JavaScript - Volume 1: The Early Years 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/ (embed)
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/ (embed)
>How to get started
[YouTube] WATCH THIS IF YOU WANT TO BECOME A WEB DEVELOPER! - Web Development Career advice - "WATCH THIS IF YOU WANT TO BECOME A WEB DEVELOPER! - Web Development Career advice"
[YouTube] Javascript is Easy - "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
openshift.com/
scaleway.com/

Other urls found in this thread:

pastebin.com/stkj0yzx
pastebin.com/C2kj1r4Q
codecademy.com/
w3schools.com/
developer.mozilla.org/
twitter.com/NSFWRedditGif

1st for w-we're all gonna make it...

Is Flask any good?

I'm about to take the Node.JS class on Codeschool.

Is this a waste of time?

Opinions on Node for the backend?

>have several angular2 projects under my belt but using asp.net backend. (full stack)

Is developing the front end from scratch and some of the backend logic + setting up and running a WordPress site good enough skills to get hired as junior on minimum field-range wage ?

Yes assuming they are actively seeking this position and you can demonstrate your work is decent.

They wont drop everything to hire you however.

wow I'm an idiot.

Just started and found out its not meant to be a web framework.

>inb4 not your blog

Should jump the gun and just learn Typescript?

Gonna start leaning HTML and then move on to ASP.net, wish me luck bros.

What IDE do you guys recommend for a newcomer to web development? I'm currently looking at NetBeans.

brackets

HTML is simple, but you should never use it by itself. Before moving on to ASP.NET, you should learn CSS too so that your pages don't look like shit.

Yo, /wdg/,
is there a simple way to redefine the default html colors?
Like blue being #0000FF and changing it to #268BD2

I second this. Plus css is pretty easy.

>learn CSS too so that your pages don't look like shit

Technically, loads of people learn CSS and their pages still look like shit. If he's focusing on backend then leave him be because that's not a priority, let the front end oriented people worry about how the pages look.

Just torrent the content

Hi gais,

how to get the argument from $.ajax call ?
I want to send a variable 'id', to update.php, which is to run a mysql query where id = id.
function openWin(id)
{
var newWindow = window.open("\img/"+id+".jpg" ,"", "width=300,heigth=400");

console.log("Attempting to open: " + id + ".jpg");

$.ajax({
type: "POST",
url: "update.php",
data: {id : this.id}, //here i tried many
success: function(){console.log(id +"++ sent!")}
});
}

update.php:
//$_POST['id'];

if(isset($_POST['id']))
{
$id = $_POST['id'];
echo "id is " + $id;
}


but I get a
Notice: Undefined variable: id
when I try using it later.

I'm trying to make a site where you enter a salary and a table is generated that contains a list of jobs whose average salary is around the entered number. How do I even start, after the basic HTML/CSS/JS?

And just thought about the logic - would it be a good practice to use the callback function to change the value of the updated field in the html ? on just refresh and rely strictly on the db info.

you will need a backend with some db, i think.
So php+mysql ? download xampp/wamp and play around with connecting and displaying a db, and this will fall into place

$.ajax({
url: "myurl.com",
type: "POST",
data: { id: 2 },
success: function(data) { console.log(data); }
});

Phonegap actually sucks fucking donkey dick and balls senpai.

thx, but still:

Notice: Undefined variable: id on line 29

which is in the query, trying to use the $id = $_POST['id'];

Yeah it's good for stuff that aren't very database dependant.

You could get some 90° short cables and really neaten up that setup. Also a small dongle would help

are you sure this.id is defined before you post it?

good, point.
defined it as global in the beginning, and the errors are gone, just a 'connected' for the db. But the query still doesn't work, or the echoing the incoming id. should I post my whole update.php code ?

thx, just saved the pic

i'm not a php guy, i'm a c# .net guy

sorry

That means the isset() returned false...

yes, i know. I'm not getting any data into it.

Has anyone seen a decent source for learning how to do Isomorphic React?

yupe, no matter what I do, I constantly get an undefined index $_POST["id"].
Vardump returns:
array(1) {
["id"]=>
string(1) "2"
}
so supposedly there has to be something inside.

Just show us your code. Pastebin or something.

The Ajax is definitely the problem. Try setting it like this or something, this is how I usually do Ajax.

$.ajax({
url: "process.php",
data: data,
processData: false,
contentType: false,
type: "POST",
success: function(result){
//whatever
}
});

Is web development an "in demand" career? I don't have an interest but people seem to think is be good at it.

>Hey Jonny, this kids got some computa skills!

thx for the input, guys
main part: pastebin.com/stkj0yzx

the called php: pastebin.com/C2kj1r4Q

contentType and processData make the vardump return empty array.

so the main part lists a table of names / id / count from mysql, then has to open a picture onclick from /img/id+.jpg and do a count++ in the mysql in the second php file. there might be a lot of junk code because of all the things i tried.

.blue {
color: #26....
}
this text is blue

daily reminder that web """""dev""""" is not real dev

enjoy your "coding", kiddies

one eye looking forward, another eye looking left

and no, i'm not talking about the shirt either lmao

hey bro your keyboard is intermittently broken.

What's the correct http code to return if there's a missing field in a form? 400? What about not being logged? 401?

t-thanks, you too...

PHP doesn't have global keyword, you don't actually assign $id variable and mysql is deprecated, for good reason.

There is bad request and access forbidden codes.

400 and 401 look good.

there's no $id, because I can't access the $_POST['id'] for some reason, thanks your input tho, mysql is the latter part.

Hi

I have a problem with permalinks in wordpress. I recently moved a wp site from basic hosting to a virtual server (ubuntu), and it's been a nightmare but I'm pretty much dome. One of my last problems is permalinks. When I set anything other than "basic" I get 404 errors.

I tried changing permissions to .htaccess but it won't help.

Pic is not me, just an example.

Any ideas?

Wtf? Fuck Russia.

var sleepCheck = function (numHours);

if (numHours >= 8) {
return "You're getting plenty of sleep! Maybe even too much!";
}
else {
return "Get some more shut eye!";
}

what's wrong with my syntax?

>codecademy.com/
>w3schools.com/
>developer.mozilla.org/
Terrible pasta is terrible.

your function doesn't have a body

MDN is one of the best resources in OP, fuck off cunt.

Good luck with that Web Dev jobhunt
Better get it quick though, it'll be fully automated by next week.

I might be moving to a new job (another startup) but i think i'll need to supply my own machine, are there any reccomended laptops besides chinkpads for dev machines? It'd probably need to run a dev VM

var sleepCheck = function(numHours){
if (numHours >= 8) {
return "You're getting plenty of sleep! Maybe even too much!";
}
else {
return "Get some more shut eye!";
}
}

generally macbooks for startups

nice man, should i grow out a beard and get a manbun. i'm buying a flannel shirt and some wayfarers with the lenses taken out too

kek.

What are some other must haves for a startup?

Machine: Macbook
Editor: Atom
Backend: Ruby on Rails / Nodejs
Frontend: Angular
Car: Prius / Bicycle
Phone: iPhone
...

Angular is for Pajeets, not hipsters.

Frontend: React + Meteor or something

$1k Herman Miller chairs
Overpriced itallian espresso machine

> React + Meteor
gr9 b9 m9

Dildo: Big and Black

In my career they are only teaching me

>HTML, CSS, JS, Bootstrap
>Angular 2 + Typescript
>Serverside with Spring Boot

For Web Development, so what else should I learn by my own?

sounds pretty solid already, though I'd add SQL to it.
I can't think of a web application without a database.

you can switch out bootstrap, angular, typescript and spring with something else if you want.

Any other hipster front ends?

Well yeah, in class we'll see databases too, mostly MySQL and H2, but I already learn about SQL on my databases subject last year.

Also this May I discovered that Boostrap on Angular 2 was barely working because I think javascript didn't work or something.
Was that fixed?

What I mean is that you shouldn't use both Meteor and React on the same project, unless you have a very good reason.

I know Angular1 but I got into React a couple of days ago instead of learning Angular 2. So... React or Angular 2 for the future?

Looks like React, but hard to tell at the moment. Angular2 was a clusterfuck in a lot of ways during development, this turned a lot of people off. Still a long time before release.

React router let's you have a route always active at '/'. Other routes go under words like 'foo' or 'foo/bar'.

So if I go to mysite.com/foo, the component at '/' and 'foo' will both be active.

This isn't the case in express's routing system. '/' and '/foo' are both distinct routes that serve their own separate resources.

Is this "always active index" feature unique to React's router, or is Express the unusual one? Or am I just not understanding something?

I thought it was kind of weird that React's routing system doesn't require the index ('/') to be present on it's routes (i.e. '/foo' vs 'foo' - where 'foo' is still interpreted as '/foo' in React).

Nevermind, I've just realised why this is the case: nesting routes within routes in React router.

Not him but
>Still a long time before release.
Wasn't release planned for this summer? Using Angular 2 this past year was a damn nightmare.

Could be, but I wouldn't bet on it.

Check the todo list on github, it seems like they are still figuring out some key things.

database: mongoDB

You could look into Sass/Scss which allows you to set variables and the like.

$blue: #246462;
p { color: $blue; }

I'm not sure anymore if I should learn Node or go with Python + flask/django for backend.

I have some more exp with JS, but Python is my favorite language. I have no idea what jobs in my area ask for, though. As far as I've seen, PHP is actually the most common (but I've had enough of that shit in college).

Then again, I don't think I'll want to do webdev professionally so I might choose whatever, but idk what is better. Preferably something that is more fun to work with, but not completely abstract like Rails.

I need help, Sup Forums

I need to somehow let a user scribble on a canvas, but I need the line width to dynamically change (based on a number of things, such as the location of the cursor on the canvas)

I am aware that line thickness can only be defined once per stroke, so I've been trying to think of ways to hack my way around that.


The closest I got to it working (pic related) was using a bunch of maths to draw a line around the line points either side of the normal line (the distance from the point being the width I need at that point), and then using context.fill(). It almost worked, but there are a few issues with this approach that may be deal breakers.


Could anyone suggest/recommend a different approach?


I need this to run as close to 60fps as possible, so drawing lots of trapezoid shapes would not work. (as I've seen on google/stack overflow,)

I could try posting the old approach on a jsfiddle, if anyone wished

If you're strictly looking at web development jobs there are lot more jobs in PHP, Javascript or Ruby than Python. A lot of the PHP jobs are really mundane shit like installing and tweaking Wordpress and other garbage though.

Outside of web development there are more Python jobs than either PHP or Ruby, but a lot of those are system administration jobs which I find boring as fuck.

I don't use any of them now, but I had to make the same decision 5 years ago and I chose Ruby simply because I enjoy it more than the others and the jobs tended to be more interesting to me (small teams with lots of freedom creating new products). If I had to make the choice again I'd learn both Ruby and Javascript for the same reasons. For the average website, Rails is still the most productive framework around and there's nothing in the node ecosystem that comes even remotely close to it but knowing Javascript is essential in any case.

If you're just desperate for a job PHP or Java would be your best bets by a huge margin.

I've kept the width constant in the screenshot, so I can see it working properly first

Nah, the links are somewhere in the wordpress database and need to be re-generated.

Don't mean to be a smartass but googling "regenerate wordpress links" might be the best idea.

>Technically, loads of people learn CSS and their pages still look like shit

tfw.
I mean, I know a lot about it, all the shitty hacks, tricks and quirks and still I can't really give my applications a consistent theme.

Partially I blame my monitor. I don't know what my boss was thinking, but there's no accuracy whatsoever. When I see my pages on a proper screen all the shadows are different and all the colors and shades of grey are different...It's awful.

It's a meme anyway. Yes, the user sees stuff earlier, but that's all worthless since they won't be able to interact with any of it until react actually loads everything.

At least a loading indicator is honest. Clicking something and having it show no reaction is frustrating.

x = "There are %d types of people." % 10
binary = "binary"
do_not = "don't"
y = "Those who know %s and those who %s." % (binary, do_not)

print x
print y

print "I said: %r." % x
print "I also said: %s" %y

hilarious = False
joke_evaluation = "Isn't that joke so funny?! %r"

print joke_evaluation % hilarious

w = "This is the left side of..."
e = "a string with a right side"

print w + e

what the fuck is the point of using strings when i can just type it in manually?

(im reading learn python the hard way)

In those examples there's no reason why you couldn't just type it in but they're just showing you how string formatting and concatenation works. In most real cases the string would be coming from elsewhere at runtime so you couldn't just type it in.

your question is too complicated for a Kazakh welding BBS, try /sci/ or make your own thread on Sup Forums

Does anyone feel awkward at work? I'm a jr full stack web dev, just started last week, and i dont have shit to contribute at the daily stand up. I guess ill just do my best and see where i go

>tfw stop a project for a few weeks and have no idea how to continue.

>learning javascript
>started making small web app using bootstrap for front-end stuff
>mfw modals

Literally who came up with this entire fucking mess

>want to have a function that simply pops up a modal dialog, waits for input, gets the value, and then continues processing

This would be too easy, right? Instead, I have to use jquery shenanigans to create callbacks for a few buttons' class name, and another one for when the modal is hidden.

And because of this shit, I have to store program data in global variables in an extremely hackish way.

Why can't these people take a page from desktop GUI development? QT, WPF, and even Java Swing are more sensible than this.

Maybe I'm just retarded, but I literally cannot see how anyone enjoys frontend programming.

Just change the z-index when you need the modal.

Think simple.

look into promises

Hiding/showing the modal is not the problem

The problem is with having the modal do useful fucking work.

I have an array of javascript objects that I need to update with user input from a modal.

Because I have one button for each object, I want to re-use the same modal for each button.
So, the HTML button used to create the modal has a property called "data-id", which is the object's index in the array.

Just passing this property into the modal, and having the modal update the right element's data, is a huge pain.
I got it to work now, but all this nonsense makes me miss Java's bloated (but still useful) system for interfaces and inheritance.

I would just create a class that inherits a JOptionPane, and set it's ActionListener or MouseListener to change the data I want.
No fuss, no muss, and the way it should be.

>promises

Never heard of that before, will take a look into it.

I don't get why mongoose.model turns the name of my database collection into plural.

that's a common thing for database frameworks.
I do that too, since a table is a collection of objects, so I name it "objects"

Anyone use JQM?

Better for mobile than bootstrap in Cordova?

Does it mess with the regular jQuery I already have? I'm thinking of switching to it.

>tfw just learn is now just

What a time to be alive.

Hey, I can't answer your question because I don't know much about developing mobile apps. I actually asked in the thread before this one for advice.

I'm going to develop an API in PHP (not sure what kind of API yet) and have it serve data to the app. I asked what technologies I should use to build the interface besides Android Studio but didn't get many answers. What do you generally use?