/wdg/ - Web Development General

> 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/
>Crockford on Javascript
youtube.com/playlist?list=PL7664379246A246CB

>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] 2016/2017 MUST-KNOW WEB DEVELOPMENT TECH - Watch this if you want to be a web developer
youtube.com/watch?v=sBzRwzY7G-k
> [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.
youtube.com/watch?v=zf_cb_Nw5zY

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

Other urls found in this thread:

nuget.org/packages/FAP.React/
github.com/bakape/meguca/tree/stable
developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/apply
supremenewyork.com/shop/all
supremenewyork.com/shop/301874/add
addons.mozilla.org/en-US/firefox/addon/imacros-for-firefox/
horizon.io/blog/horizon-2/
lita.engineering/experiments/lux/
getbootstrap.com/components/
getbootstrap.com/css/
getbootstrap.com/javascript/
codex.wordpress.org/Template_Tags
twitter.com/SFWRedditGifs

First for FAP
nuget.org/packages/FAP.React/

Again, it's been a while.

static WebClient client;
static void Main(string[] args)
{
client = new WebClient();
var server = new Server(null, "127.0.0.1", 3637);
var reactivePage = new ReactivePage("frontpage", "FrontPage", JsonConvert.DeserializeObject(client.DownloadString("mywebsite.com/api/frontpage")));
reactivePage.get = (a, b) => client.DownloadString("mywebsite.com/api/frontpage");
reactivePage.IsSPA = false;
reactivePage.IncludeScript("main.jsx");
server.AddPage(reactivePage);
Thread.Sleep(-1);
}


Currently using it to parse this gem of JSX:
var FrontPage = React.createClass({
render() {
return (
{this.props[0].Posts[Object.keys(this.props[0].Posts)[0]].Contents}

);
}
});

Which gets me the unparsed first post of my front page when I go to 127.0.0.1:3637/frontpage

Why? Because SEO.

What's a good analogy for a custom website vs Wix to pitch to a client?

scalability

How about an analogy, like a frozen microwave dinner vs a gourmet steak

No because if the client just wants a basic website there's no real edge on doing it from scratch over something like wix. So the frozen meal is still cheaper and serves its purpose.

Don't bother.

Just remind them that if they need absolutely anything to do with a backend, that includes sales/ecommerce/databasing/SEO/whatever, they're going to need you and specifically you. These are things that actually make money for real businesses which no amount of pretty from your client's teenage daughter could compensate for.

A 12 year old could press save to HTML from a word document, I doubt that same 12 year old could build a backend that responds in under 20ms.

Honestly, then it's not in your client's best interest to hire a web developer. Here's an analogy, a real estate agent is trying to sell land that's been overcome by rising sea levels, better remember to include a boat in the deal or you're technically giving them nothing at all.

Best non relational database?

Started making daily commits to Git on the off chance that I run into an employer that puts much emphasis on that shit. At least when they look at my account they'll see a wall of green lel

~im so desperate pls kill me now

pay $7 a month
make private repo
commit all you want
tfw its all green

Are MVC and OOB mutually exclusive?

>pay $7 a month

Are you havin' a swizzle m8?

What's a good way to learn actual webdev?

I'm pretty familiar with HTML, CSS, JS, PHP. I'm writing a copter clone using canvas - what's a good beginner project after that? Should I learn SQL and make a forum?

Hey so when you're freelancing, what do you do with the database when you're done? Do I have to do anything special now that I've set up this MySql database and everything works, or can I just safely send it all over to the guy?

What's the difference between normal firefox and the (web) developer edition? from what I've read all the tools they offered are available in the normal edition.

I just dump the whole thing plus the project codes into two cheap 16-32 GB usb drive, then let the client decide if I can keep it or not.

If the client doesn't let me keep the code I just hand over one of the drive and use the remaining one for reference in the future.

I hate to say it, but Chrome is far better for testing, debugging and profiling.

I use chromium, but I was just wondering if there was some feature that I'm not aware of in the dev edition of firefox.

This guy here again.

var FrontPage = React.createClass({
render() {
stringtext = "however you want to build your site";
return (




);
}
});


This seems like the best way to go from Ajax append statements to a ReactJS server side rendering JSX file. At this point, it's literally just copying and pasting from my old main.js file to the main.jsx file.

It's nice when things eventually work

If you already know how to program, start with researching things (rest, HTML/CSS view based stuff, backends) and then implement a simple CRUD with whatever language you feel like. From there you can learn whatever meme framework you feel like.

You can use SQL for this or any other databasing or just serialise or whatever.

If you don't know how to program, back out and ask /dpt/ for a beginner project for C.

You should ask for root access dude.

Interesting side note, if I comment out this line:
reactivePage.get = (a, b) => client.DownloadString("mywebsite.com/api/frontpage");

The response time is 1 or 2ms instead of 150ms. Basically because it's relying on only the JSON sourced at start up rather than checking each time, hopefully when it's deployed it'll only be fetching across the loopback address so it'll be quick.

I'm slowly getting into Django as a low priority project. I got the whole urls, views, templates stuff, I don't quite have an intuition for models except that they do the magical things.

Advice or abuse welcome.

what's a good and stable imageboard script I can use?

Tinyboard

thanks

make your own
tinyboard sucks ass

What do you guys think of XML? I'm selftaught and kinda missed getting in contact with it. Tried to get into it a while back, but it seemed to be an archaic solution to let non programmers supply content to static webpages. Is there any reason to use it in private projects? I can just use sql or txt files to change and store content. Seems far simpler, but maybe I'm missing something...

amateur here,

but it seems to me using sql would require more work and txt would require reading making a unique reader and solving all associated problems, so xml probably has a niche for simple data reading in a standardised way.

Do I have to use the this keyword to access object variables in javascript methods?

firefox should not be used for anything

just let it die

why?

SJWs have been on a steady course of ruining the browser by adding useless shit and removing actually useful features. Incidentally, they are also making it more and more like Chrome, so might as well just use Chrome anyway.

XML is old data format that may still have use in some situations but is mostly superseded by JSON. I don't understand why you would need anything besides pages itself to store data for static websites.

Shilling my own: github.com/bakape/meguca/tree/stable

And yet Chrome still can't replace Firefox with its customisability and extensions.

Botnet-fag pls go

Arguably, but they keep removing customisability every other release.
Yes, but you should be using the class keyword here.
class Rect {
constructor(x, y, width, height) {
this.x = x
this.y = y
this.width = width
this.height = height
}

fill(colour) {
// ...
}
}

use chrome and not firefox because firefox is becoming chrome.

so if youre alive and becoming dead, maybe you should just kill yourself.

If you're barely alive with stage 4 cancer, yes. You might live for a few more years with suffering and regular chemotherapy, but best just off yourself.

What an incredibly morbid view of life.

What's the best OS for a prestashop / wordpress server?

I want to use Ubuntu but I fear breaking shit when upgrading versions. So I assume Debian stable is the logical choice.

Use Ubuntu LTS.

>Ubuntu LTS
Oh, I see it's five years support these days. That looks good.

Ubuntu upgrades usually don't break anything, worst thing I've experienced was when it removed PHP5 and didn't even install 7 when I upgraded to xenial.

If you don't want to take any risks just use LTS like said.

Thanks user. Any reason to use the class keyword besides good practice?

Not really. class is mostly just syntactic sugar, aside from the super keyword. You could write the same as:
function Rect(x, y, width, height) {
this.x = x
this.y = y
this.width = width
this.height = height
}

Rect.prototype.fill = function (colour) {
// ...
}


Only if you stick really close to the default package set. 3/4 of upgrades have broken shit for me. It is best to wait 1 month after an upgrade is out for bugs to get fixed.

Sup Forumsxperts, what browsers are you supporting on your websites?

Ideally:
>How far back are going
>How often do you drop support for older browsers
>How much effort do you put into compatibility? Would you rewrite a feature from scratch for IE8 (for example)?

For a commercial projects - as far back as IE11. For hobby projects - latest Chrome, FF, Edge, Safari and FF ESR.

ie11 is the number one enterprise browser at the moment. Do you literally not care about compat?

hey g, what's the best web templating engine for python.

99.1488% of code I write is in python and I'm looking to move to web stuff now.

Plan of attack:
Python backend
jquery for dynamic shit

Thoughts?

It's a personal project. If I can do something nice with a new technology, fuck IE11.

Django come with its own templating engine?

I once used jade for a flask project, I thought it was pretty decent.

I don't support any IE version older than 11. There are so many javascript features missing from versions older than that, I don't think it's worth it.

jinja2 (included with flask)

What ad networks aren't scams and have no minimal payout limit?
I tried googling but all I get is referal links to scammy networks with low reputation.

Running a nodejs server, need to use the spread operator (...) to pass values in an array as arguments to a function.

The amazon server it's running on apparently has an older version of node and doesn't support the spread operator.

Anyone know of an ES5 compatible way to do this?

Why don't you use babel to generate valid ES5?

Maybe this?
developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/apply

function myFunction(x, y, z) { }
var args = [0, 1, 2];
myFunction.apply(null, args);

I had tried this before but it didn't work because I was passing the arguments to a constructor.

I managed to fix it, though. Just don't use the "new" keyword.

Install a newer node version locally. You can use nvm, if you can't yourself.

Hey /wdg/.
I carelessly bought a few very shitty domain names that represent no value at all.
It's been a few months since I bought them, so I can't refund.
How do I minimize my losses now? I doubt anyone would want to buy them at all.
Or do you think if I dropped the price to something like $3, they would sell?

Please help.

It works fine on my local, just not the amazon server. I'd rather not have to go in and update node every time a new instance is created.

How shitty the names are?
And how much did you pay, I'm curious.

They weren't registered, so I paid about $20 for two. The names are very shitty - no one would want them.

Are you going to tell us the domain names or should we use our imagination?

I guess you should use your imagination. I've given enough description - they're very shitty. Do you understand, or are you dense?

No need to get defensive. Just trying to get an idea of what exactly the domain is. Your definition of shitty might be not be the same as ours.

Besides, if anyone here is dense, its you. You dropped money on two 'shitty' domains, now you're on Sup Forums asking if you can sell them for $3. Fuck off.

Go JSON, much-much more simpler than xml.

Is checkmydubs.com still available?

nah

How do I set SQL to automatically create a record in a table?
I have a table (users) that stores the user's information. But I want to automatically insert a row into another table (settings) while will have default setting values once the user completes registration. Linking the tables with foreign keys doesn't automatically generate the record in the second. I could manually insert the record after the user signs up but that's extra lines of code and it might not be the best way to do it.

look up triggers.
or use a stored procedure to create your user where you insert into both tables.

I'm trying to create a bot which could on this website
supremenewyork.com/shop/all
>select a picture (Click)
>select a size (ComboBox)
>add to cart (Click)
>checkout (Click)
>fill out the payment informations (Textbox + ComboBox + CheckBox)
>validate order (Click)

I have few knowledges in VB, but is that possible with this language ?

it's possible but not optimal.
if you only have a bit of experience with VB forget it and pay someone to do it.

Just wondering, what is the point of your bot?

Alright thanks, bots for this website are really expensive tho

Order clothes which sell out quickly, maybe reselling some to make money

you could try phantomjs, should be pretty easy with that.

>code freeze today
>notice yesterday there's bunch of small changes that aren't in the scope
>some of them partially untested
>panic.html
>revert one of the partly untested changes
>can you finish this by tomorrow user
>yes
>OK we'll roll with this, get it done
>whyDidIAgreeToThis.java
>revert the previous revert
>fix the problems in it
>deploy to various environments and test it
>it fucking works
With minutes to spare to the deadline.

Okay.
But instead of doing all those steps (click, combobox, etc), can't you just directly make the calls?

For example:
>POST supremenewyork.com/shop/301874/add
>authenticity_token=--&size=29000&commit=add
>etc

Sounds easier to me, but maybe it's not, I don't really know what the order requires.

When I say "click, combobox" it's to indicate the things I got to do if I want to order "manually", the order requires.

I will try your example tho thanks

I'll try too, thanks you

Okay, I thought it was something like iMacros
>addons.mozilla.org/en-US/firefox/addon/imacros-for-firefox/

Oh cool, thanks.

How long would it take me to learn how to make something of this scope on a WordPress or SquareSpace site (HTML and CSS I assume)?

I made the layout concept but now the guy wants me to implement it, and if it's doable from scratch in two months, I could use the money. I'm supposed to make a template which he'll use to make profiles for other athletes, and the home page needs to have blog-like news with each article having its separate link, the rest I feel I'll be able to do with the same knowledge.

Google Adwords or whatever.

Man, I'm a frontend intern and everything I have to do is so easy. I practically only have to implement premade CSS framework code snippets, do some design and sprinkle some simple Angular that talks to the server on top of it. I do everything in an hour tops and then I do nothing for the rest of the day.

I could be proud that I'm good at this but I know this shit is probably just piss easy.

Don't know if I want this kind of job. On the other hand, I have some backend knowledge with PHP and Node, but far from enough, although that shit is also boring, just more stressful.

The only thing I learned here is that frontend is the most unimportant, easiest thing to do. I feel like a monkey.

Use selenium.

Why aren't you using horizon, /wdg/?
>horizon.io/blog/horizon-2/

Fucking Windows 10 anniversary update fucked my vagrant up fucking shit.

You now have bash on Ubuntu on Windows, tho.

Hey guys after this semester I will have enough credits and the right courses completed to get my associates at my local cc. I was thinking about getting that and then pursuing web dev on my own without a bachelors. I'm 25 and still living with my parents so I'm sick of that and want to get out in the workforce asap. What do you guys think about this?

You're an intern. You are given easy stuff to do at first. Once you prove to them that you know your shit and can handle your way around you'll get progressively harder tasks. Once you get something done don't shitpost in Sup Forums for the rest of the day but go tell someone you're finished and need more stuff to do. That way they'll know you're finishing your shit in no time and will hopefully give you some more demanding tasks.

If you claim front-end is easy you haven't had to deal with browser support and especially the quirks in mobile browsers and touch screens. Front and back-ends have different challenges but both of them provide enough challenge.

I started with piss easy tasks as an intern. Now I've been here for 2 years and the front-end stuff I do now would've made me doubt my ability to do this job back when I started.

>he fell for the windows 10 meme
you deserve everything bad that happens to you

I was bored.
I decided to get you started.
lita.engineering/experiments/lux/

Yeah, no browser support stuff or any optimization here. I'm practically the only one doing frontend, though, and they don't seem to have much experience in that field, even on HTML + CSS level. The boss leaves the place early and others have no idea what I should do, while the boss doesn't want to give me more tasks until I finish the first one, so basically I don't have much options.

On the other hand, the projects are for pretty important clients, but the apps itself are pretty generic and nothing special.

Unironically, after about 2 months, the hardest thing for me to do was coding CSS and making all hacked bootstrap code responsive, while on the JS side, it was probably making simple promises.

The thing is that I feel there is not much to do in my position and it seems they were doing just fine before I got here, simply copy pasting generic bootstrap templates over and over again.

I don't think this internship taught me anything.

My little example is very much incomplete, and does not conform to your designs. But again, it should at least get you started.

Note that 'main.pdata' in the main controller should not be set staticly, the way I have in the example.

In production, you'd launch an ajax request to the backend, for a specific player, and you'd just load the response data.

Thanks a ton m8, dissecting it will give me an enormous headstart, especially when it comes to aligning, I was looking into how to do it last night and getting everything where it needs to be, and realigning it for mobile devices, seemed like hell. Thanks again, I really appreciate it.

Then I suggest you find something new after your internship is over. Sites that rely on user interaction will make front and back end work much more interesting.

And front end isn't for everyone. Just like back end isn't for everyone. Find shit that you like to do. I'm lucky because I like doing front end stuff and I'm good enough in it that I get a lot of influence over the shit I do. I don't mind doing the odd Java task here or there but it's not really my favourite thing to do. That has tons to do with enterprise Java though and not doing back end itself.

The only thing that I even remotely like doing in web is design and frontend (haven't tried backend though, but I need something to be creative with). Yeah, I don't know if I'll stay here.

Can you give some examples what tasks you had to do at the beginning and what are you doing now? I actually can't really imagine what could have been so complicated that made you ask yourself if you'd be able to do it.

>js strings are immutable
why is this allowed? why are you allowed to change numeric values but not strings?

The big things to study (if you're not already familiar with them) are:

- Bootstrap
- This shit will save you a LOAD of time/code in the long run
getbootstrap.com/components/
getbootstrap.com/css/
getbootstrap.com/javascript/

- LESS

Allows you to do things like nesting css, and using "&:" to refer to the current selector
(saves a load of redundant typing)
.main {
color: purple;
.sub1 {
color: blue;
.sub2 {
&:hover { color: gold; }
color: white;
}
}
}

instead of:
.main { color: purple; }
.main .sub1 { color: blue; }
.main .sub1 .sub2 { color: white; }
.main .sub1 .sub2:hover { color: gold; }

- Angular

Allows you to construct templates with data-binds. So that when you make a change to the value of a variable within the controller, it will automatically propagate into the DOM. Meaning you could click a player's button, and have it automatically ajax the player's data, and set it to main.pdata, and the DOM will update automatically.

And stuff like that.

If you want to turn this into a wordpress template, you need to... actually, I don't really remember how to do wordpress stuff. You'll have to figure it out on your own: codex.wordpress.org/Template_Tags

I know you need to do something to make wordpress aware of the template, but I can't recall an exact code snippet. I've only done it once.