/wdg/ - Web Development General

Someone let the old thread die and didn't make a new one edition

Previous Thread: >IRC Channel
#Sup Forumswdg @ irc.rizon.net
Web client: rizon.net/chat

> Discord
discord.gg/0qLTzz5potDFXfdT

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

>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/pB0WvcxTbCA - "WATCH THIS IF YOU WANT TO BECOME A WEB DEVELOPER! - Web Development Career advice"
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:

kongware.net/currying-partial-application-javascript
golang.org/
gist.github.com/ungerik/3731476
github.com/avelino/awesome-go#web-frameworks
rest-layer.io/
tc39.github.io/ecma262/#sec-list-and-record-specification-type
wiki.ecmascript.org/doku.php?id=strawman:tuples
jsfiddle.net/41cch5Lv/
stackoverflow
twitter.com/SFWRedditVideos

PHP is fine.

is it though

Any of you built a SaaS and made decent money out of it?

JS frameworks are the popular memes these days, right? How is React going to fare against Angular 2? I want to learn one of these to get a nice cushy overpaid job.

writing javascript like a functional language

kongware.net/currying-partial-application-javascript

const everywhere currying, composition, etc.
ecmascript 2017 got gud records and tuples as well

On top of that, what's the popular back-end frameworks? I've heard ember is popular

When there are widespread horrors such as PHP and when you know how bad committee designs can get, I'm amazed at how javascript has evolved. Sure it could have been scheme instead, but it could have been far, far worse.

ember is frontend like angular/react.

for backend pick a language you like.
I personally have been using asp.net for multiple years now and node.js every now and then.

How do I learn CSS properly?

Everything I design is absolutely horrendous looking, but I'm not sure where I can learn how to design websites well.

Everyone uses express, and many people backbone.

I feel doing my master thesis is such a waste of time.
I just want to work on my websites and make them a success.

bleh

look at template sites and rebuild some.

Fuck I meant Express

>ecmascript 2017 got gud records and tuples as well
What is this about?

Knowing CCS well makes you able to implement almost any design idea. Now, if the said ideas are bad, CSS won't help, you can't just put html { design: "good-looking" } in your stylesheets.

The next tech trillionaire.

Daily Go shilling post. If you aren't using Go for your next big backend project you don't know shit about webdev(or are happy with the alternatives).

>What is Go?
golang.org/
>Why should I use Go?
gist.github.com/ungerik/3731476
github.com/avelino/awesome-go#web-frameworks
>But I just want a simple way to feed data to my frontend?
Go is also bretty gud for turnkey applications: rest-layer.io/

does it run on windows server and can talk to sql server?

Yes. What can't do those?

If I want to start using ES2015 but don't want to use Typescript, Coffeescript or any of those memescripts should I just use babel?

most modern browsers handle it very well already.
only use babel if you need a wider range of compatibility.

record and tuple types (google)
let aTupe = ("a tup", 23)

type Jigga = {Nig: string; Jig: string; Figga:string}
let aRecord = {Nig = "ayy"; Jig = "kek"; Figga = "lel"


obviously that isn't javascript, but it would be something like that

*
let aRecord = {Nig = "ayy"; Jig = "kek"; Figga = "lel"}

Why tuples in a language that does not have type safety and already has some non-typed array?

Is it not even in proposal phase yet? Can't seem to find anything about it hitting ES.

>Currying
Method chaining is better. I've never needed to use currying, unless a memoizer function counts as currying? Don't think it does tho.

Is posting a github page and asking for opinions appropriate in this general?

He should use babel anyway if he wants to use modules, which he probably should.

Because Python

tc39.github.io/ecma262/#sec-list-and-record-specification-type apparently
tuples in strawman phase
wiki.ecmascript.org/doku.php?id=strawman:tuples

Hey guys, 30 replies in and not a single noob PHP question.

These threads are getting better.

Can someone suggest a good intro to database design book?

Can I get a job as a Jr just knowing HTML, CSS and JS/jQuery? Or do I need to master meme frameworks and libraries as well?

You'd think the JS-cucks in charge of the language would ask "why implement this" before implementing something.

If you know JS than you know the frameworks, sans routing, layouts, etc. Frameworks aren't their own language.

Most companies don't take frontend devs seriously (= slave pay).

I need to create pdf from form data, with fixed margins, some for POS printers some with gutter margins.

What do you recommend? site is php and js but is on a VPS centos so any language is ok.

also is it posible to force the browser to print this pdf or does the user have to download it first?

php wkhtmltopdf

It's a wrapper for a html to pdf c library. I've found it handles css way better than dompdf. Less resources too. You can stream the pdf to the browser with the correct content header.

What's the best style of making PHP websites without using any heavy frameworks?

>also is it posible to force the browser to print this pdf or does the user have to download it first?

Yes, use some server side script to call a cups print job. for example in php you could use
execute('lpr ');

Yeah, but It's not a bad place to start a career

is it truethat webdevs cant fizzbuzz or is dpt memeing?

How much do you make hourly? Also location and job.

$40, Midwest, Full stack + React

On second thought, I wouldn't think you'd want to generate a pdf just to print; waste of resources. Why not format a html template and call the print dialog from javascript? You can't just command a print to the printer either, they'll have to press the print button.

Can anyone troubleshoot a silly error, I tried to provide as much info as possible in the attached image

OOps, here it is

just spitballing cause im not really a webdev, have you tried making sure its not case insensitive, also are you sure post methods work without a action redirection?

I am happy with Phoenix framework

...

none

htaccess?

that would be great, but fixed margins doesn't work from the browser, each user would have to set the page size on firefox or chrome, as far I know there is no way to disable page number or printing the link this has to be done manually

thanks!

Double form

Of course webdevs can fizzbuzz, asshole.

let fizzBuzz = require('fizz-buzz');

fizzBuzz.doFizzBuzz(100, (err, item) => {
// do fizzbuzz to 100
if (err) {
console.error(err);
} else {
console.log(item);
}
});

any framework for user management? drupal is too big for this mysql table results project

>

oi m8 u takin' a piss?

I have no idea where that came from ha

ur mom

Laravel 5.2 has good user ACL out of the box

I need advice /wdg/. I'm making a website right now for car parts. For a single part there are multiple years for the same model. How do I even put that in the database? Do I have to make a separate table for years?

reported

Yeah, unless you want to serialize the years to json or that awful PHP format, or a comma separated list.

That makes it rather difficult to actually query for the data, though ("give me all the parts from *this* year").
Some databases have native support for json data fields nowadays which actually do allow you to query for this data and some databases basically are json only (NoSQL).
You're fucked when you try to use that with any ORM, though.

> const add = x => y => x + y
undefined
> add(2)
function add/ add(2)(3)
5


What is add/

but npm is great

Just add a year field in your product table?

nosql doesn't have this problem

how about a comma separated list of years in a string

Let's say I have a list on a PHP page, each element of which has a button that changes the color of the items' text in the list.

I want to implement this with AJAX.

Do I first render the list in PHP then manually set the color of each element in the callback function or do I get the list as JSON whene I first get on the page and render it in JS, and have the callback function retreive the list again with the updated colors every time?

Well shit, I guess I'll see if I can do that then. Converting this from excel will be a pain in the ass. I like the comma separated list idea though. Would there be huge drawbacks about using that instead?

I have no idea how to use nosql, Sounds cool but I feel like it'd take even more time to learn it.

>That makes it rather difficult to actually query for the data, though ("give me all the parts from *this* year").

If only there were some kind of "structured query language" which made that possible

Table One -- Cars
ID, Manufacture, Model, Year

Table Two -- Parts
ID, Name

Table Three Pivot table -- car_part
Car_ID, Part_ID

Really simple, don't listen to NoSQL hipsters. Eloquent orm would make this extremely easy to manage.

You could even make another pivot for manufactures.

The second option should allow you to setup polling so that if you are pulling the list from a db or something, then the list would be able to be updated without refreshing the page.

the second function.

const add = x => y => x + y
is equal to
function add(x) {
return function(y) {
return x + y;
}
}

so calling add() returns the second function.

I would take PHP question any time over node shill or total n00bs who want to become professionals in a week.

This. Also next time use pastebin or something.

right but where does the name come from

Thanks, I really appreciate the input. I'll do that and put a year column. It didn't occur to me that a separated list for a column was a possibility.

Knew to HTML/CSS stuff. Is understanding how to center things something everyone goes through. Seems like I can never figure out exactly how do do it. I just made this as a test to then start applying some jQuery stuff to, but I can't get the navbar to be properly centered under the title.

jsfiddle.net/41cch5Lv/

Is it possible to create a servlet like in Java using PHP to react to POST requests by updating the color, getting a list and passing it to the page without reloading it and adding another entry in the browser history?

it's just what the firefox console tells you. arrow functions are anonymous and don't have a name.
chrome for example returns
>add()
function y => x + y

stackoverflow com/questions/18494689/css-menu-has-odd-left-margin

nav ul {
list-style-type: none;
padding: 0;
}

Its called AJAX.

I meant handling everything in PHP, like this:

>GET request to controller
>get list of items
>render the array of items with buttons next to each with PHP
>press button
>POST to same controller
>change color, get list of items again
>render them with PHP again

All that without adding extra pages to the browser history.

Yup, still AJAX

>mfw Django

Is that seriously a trap? Wtf.

It's strawman stage, so not even likely to make it in yet.

why?

Anyone familiar with knockout + require? I'm using require to break the viewmodel in components, each component with its own viewmodel. The problem is that the viewmodel gets recreated every time. I need it to only initialize once.

Anyone went from web dev to programming? I'm just thinking about that, I'd like to know to what field is the transition easiest. E.g. mobile applications, game dev, or some more scientific, like machine learning.

I transitioned from gamedev to general application dev to webdev. I'd say gamedev is the most fun

Yeah, before I even started programming the game dev was a field that interested me the most. I then stopped caring much about it but a week ago I made some simple pong game in canvas and at thar point I realized how much fun it actually is.

how do i sweet talk a reciter I just got a call from one and am going to call back.

yes

How the FUCK do I make non-retarded scatter plots with c3js?? All the examples assume every "column" has the same x values. I need to give it a list of objects, tell it to color points based on a value of the object, and move the points based on the given axis values.

Fuck this gay shit I'm going back to D3

Anyone know how I should write an input box in a form for a POST HTTP request?


and it gives me beneath it

What was moot thinking with this coloring? Can barely see the purple

What tool are you using to parse the {{ }}?

>>
Python (Flask)

Alright, just curious. Anyways, weird, I can't say I know much HTML, but isn't input type="text" supposed to be sufficient for creating an input box?