/wdg/ - Web Development General

>2017
youtube.com/watch?v=9hDKfBKuXjI

>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
learncodeacademy
funfunfunction
computerphile
codingrainbow

>Frontend development
github.com/dypsilon/frontend-dev-bookmarks

>Backend development
en.wikipedia.org/wiki/Comparison_of_web_application_frameworks
[Gist] backendDevelopmentBookmarks.md (embed)

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

developer.mozilla.org/en-US/docs/Web/HTML/Element/div#Attributes
drawasaurus.org/
github.com/pomf/pomf
ngmap.github.io/
bankofcanada.ca/banknotes/banknote150/
twitter.com/SFWRedditVideos

Will HTML 4 run?

I know this seems pointless, but it took awhile for me to figure out how to center text in HTML5.

div align="center"

Maybe it'll help someone out there

align is obsolete, use CSS and text-align instead.
developer.mozilla.org/en-US/docs/Web/HTML/Element/div#Attributes

SHUT THE FUCK UP

html is barebones nowadays.

just use css for anything design-related.

I've been doing web dev for about five years now, pretty much all LAMP stack (WordPress, Magento, Laravel, CakePHP).

I've got a new client who's after a portfolio site, which I'd normally go straight to WordPress for. I fancy using the opportunity to learn something new though because PHP is for shithouses.

Are there any strong non-PHP CMS' out there? JavaScript-based would be fun.

Reminder that :
Go, C#, Java > Python, Ruby > PHP, Javascript

I don't expect many people to find use for it. I'm just a novice and thought I would share since I asked this thread and several other people before figuring it out.

My friend has a profile on a website for their job, but they can't edit CSS, only HTML. Thus it was relevant for me.

+1 for vim

>Mention on a webdev discord that I use JSF
>Get called a decrepit 45 y.o. washed-up programmer who needs to learn React asap

and you're only 44. Damn, that must have hurt, huh?

Kotlin, Swift, Dart >>> others

kek. they probably had to google jsf first too

Why do websites make public apis?

why not? It makes it so much easier for others to interact with your site in an automated way. Say you have a cool site and others want to scrape it, well, instead of scraping it they can just code a script in 2 minutes to get all the info through the API.

guys come play my web game that i hacked together with jquery because i don't know react
it's unoptimised fun
drawasaurus.org/

Do you have code published somewhere?

anyone knows how to fix this

Why do websites make any features?

chown -R mysql:mysql /var/lib/mysql

Pretty awesome how long did it take to make? Did you make the sound / gfx urself?

>Why do websites make any features?
I think his question is more along the lines of "What are the benefits of making a public API?"

apache or nginx?

My Scala-obsessed colleagues look down on me for liking Go, but I can bust out a whole service while they're still arguing about which abstractions to use.

Jekyll with cloudcannon is fine if you don't need anything too dynamic. But for a portfolio site it might even be easier to roll your own and use something like dropbox for the store - i.e. they upload their pieces and the site rebuilds itself.

cool idea, it's a bit like pictionary eh?

nginx

Complete newb here, I want to deploy a small application on heroku. The app has static files and media files (i.e. files uploaded by users).

Is there something special I have to do to make sure static and media files are deployed, except this:

urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)

you wouldn't deploy your 'media files' / user files. they're not source. use S3 on heroku for user files

How else is API supposed to be used if it's not public?

it's a small app just to show off, I know that heroku would clean temp (i.e. media) files when the app is reset, but I don't care about it, I just want it up, so S3 would be an overkill I think

What am I doing wrong?

My page url is mypage.com/something/xyz

On that page I have a link with href="/about.html"

But if I click on that it takes me to mypage.com/something/about.html

I need to clear the path "something" from the url.

How do?

that's how it works.

do you have a base element somewhere?
if so try adding ../ before.

I'm just getting started with WordPress, and I'm trying to make my own theme. I started with the "twentyseventeen" theme that they give you by default, just to try to learn how everything works.

I noticed that everything seems to load a metric ass-ton of javascript, despite this being a largely static site. If I create my own theme, will I be able to get rid of jquery and this other crap, or is it hopelessly entangled with WordPress?

Very simple and stupid question, but WHAT DOES THIS DO? Never seen the &&s being used when assigning value.
Specifically, what does the && statement mean and what would this result in?

const localFeeds = localStorage.feeds && JSON.parse(localStorage.feeds);

So I've tried a couple of times in the past to get pomf setup on my home server for personal use, but I can never get it working correctly.

I'm running apache2 with pretty much default configuration, but when I start uploading images, I start getting server error messages, but what's odd is that often one image will go through and then the next won't? Any ideas?

Pomf github:

github.com/pomf/pomf

I made a little proof of concept once that used tumblr because I was working with a guy who already used tumblr a lot. I ultimately decided against it because I didn't want to worry about tumblr changing there terms, shutting down etc but it was pretty cool from a normie perspective and saved the time of designing a cms interface, searching/tagging was already implemented etc

Localfeeds is set to true if both localStorage.feeds && JSON.parse(blah blah) return true. If one or both of those returns false/fails then localfeeds would be set to false.

&& is a short-circuiting operator.

If the first (left) parameter is false, it returns that parameter, because the result of a logical and operation will be false, and it has deemed that parameter evaluates to false.

If the first (left) parameter is true, it returns the value of the second (right) parameter, because if that second parameter evaluates to true, then the expression is true, and if it's false, the expression is false.

The unintuitive part is that what is returned is not necessarily a boolean true or false value. There are several values that evaluate to false (0, false, "", null, maybe others I'm not thinking of?), and most other things evaluate to true. So the thing that gets returned is one of the two parameters of the && operation.

In this case, localStorage.feeds might be an empty string. If it is, the first parameter evaluates to false, so the operation short-circuits, and that empty string will be returned to be set as localFeeds. If it's not, then the non-empty string will be parsed as JSON, and the resulting object will be returned and set as localFeeds.

Basically, that code just makes sure we don't try to parse an empty string as JSON.

To promote their website/services.

No, JavaScript && does not necessarily return a boolean.

>tfw got job as javascript/ajax/php/sql programmer

Learn absolute vs relative difference. Also you probably want to use base href.

how should I handle user authentication in a node.js/react app? I'm seeing a lot about using tokens with passport and bcrypt, does this sound about right?

what did you have in your portfolio, or what do you think made them hire you?

i made a game in Lua lol thats it

how complex was the game? I don't have a game but have a few decent front end apps, a couple full stack apps that I'm proud of. gonna start applying next week

it was a lame 2d shooter, but i also did have a CRUD app in PHP. Front end stuff doesn't mean much in 2017

alright I got a crud app and another that just stores user settings to db. my front end stuff is just functional with some neat css, banged those out pretty quick

Not him but just start applying.

My job didnt even look at my portfolio.

JWT

Do any non C#/Java backend devs expect much in the line of code completion/hinting in their setups? I'm working on a pretty big Perl code base in Sublime Text and while it isn't unmanageable yet I think its nearing the point where'd I'd appreciate a little help from my text editor

Mostly dependencies so you need them.

Hard to say without error.

I tell you error is "Server Error" sir.

sup, I got sent here when I posted this thread:
Still interested in answers, so I'd be glad if you responded ITT

Switch to VS Code. It's way better for handling anything larger than a single file.

could you post apache error logs please?
It's probably under /var/log/apache2/

Does it even support Perl?

>Do you use yarn/npm/other?
yarn
>Do you completely fix the version numbers, to major/minor/patch version or shrinkwrap?
fixed, I update them manually one by one from time to time because I try to limit number of dependencies I use
>Are you developing a library or an application?
two applications. a front-end for my web application and a game on electron

of course it does

Are you sure SublimeCodeIntel does not support perl?

It doesn't run properly on my end. I tried Codecomplice too. I'm using the latest dev build of Sublime Text 3 though, which may be an issue. But the last build of 2 is so old that I doubt its a good idea to use in a desktop environment that's 4 years newer

yarn automatically locks dependencies recursively, doesn't it? At my work, we almost ran into trouble because a sub-dependency updated and caused a critical vulnerability. I managed to convince some teams to use shrinkwrap but since it's still kind of lossy I'm considering bringing in yarn

but did you have a degree? It's a completely different ball game if you do. Also, what kind of company hired you? Small start-up, big corpo, ...?

MySQL or postgres?

What is the easiest language to make scripts for webscrapping and small edits on Sup Forums for example? JS or python?

python for sure

probably python but there are many scrapy-implementation on node.js basis aswell

Python or TypeScript

Postgres. Also Mariadb > Mysql.

Quick question

what is your preference ide or whatever?

I'm not sure about atom seems slow and clunky

sublime text has that psuedo text editor in a newish feel that makes it a bit uncomfortable

I just with notepad++ was on linux would have used that.

guess sublime text gets the job done maybe I can fix it up to not look soooo how much it looks

We use phpstorm at work. It does some strange things from time to time but it's a pretty good tool overall

thoughts on coffeescript?
i love it btw, it's so minimal. very refreshing after systems programming

Be honest with me /wdg/

I just started trying to learn web dev basics two days ago. HTML and CSS, truly beginner. I am trying to learn and practice as much as I can and plan on doing it everyday because I am currently a NEET on disability and have time. How long is it going to take before I can actually get a job?

Does anyone do it on their own without having a position as a company? How much experience do you have if so? What are the incomes like of people who freelance web dev vs those with jobs? Sorry for noob questions I just don't know if I should spend more time investing in this or 3d printing. The downside to 3d printing is of course the initial investments and material costs.

depends what im doing but more often than not, vscode, if you liked atom but hated how slow it was vscode will probably suit you best

Does it ever boggle your mind the number of shit your server is doing at once? Thousands of simultaneous connections, atomic read/writes to your database, throwing and catching exceptions, doing redirects, hundreds of writes to log files? Doesn't it ever seem like a giant wobbling tower of strings and marbles, ready to collapse at any moment?

Lay off that kush senpai.

>How long is it going to take before I can actually get a job?
Couple months.

>Does anyone do it on their own without having a position as a company?
That's freelance. I hate doing freelance, personally. Administration, client relations, legal, what a nightmare. Watch the talk Fuck You, Pay Me.

>How much experience do you have if so?
You need basically no real experience to get freelance gigs. You could even do rentacoder type shit.

>What are the incomes like of people who freelance web dev vs those with jobs?
Huge spectrum of possibilities for both. Can't really be directly compared. You make this choice based on what kind of environment you want to work in, NOT based on the money.

>investing in 3d printing
u wot m8? Web dev is one of the most in-demand gigs there is, and has been incredibly stable through multiple recessions, and has highly competitive salaries. It's also cushy as fuck. 3D printing is some toy bullshit with no significant revenue potential.

ded, even github dropped it for typescript

the only real skill you need is the mega autism required to bang your head against a problem until you figure it out

been off for years now brother

you can use my haskell Sup Forums scraper if you want

In that case, just use:

Neither solution's ideal, but at least with this one, you'll be using CSS called through HTML instead of an ancient HTML4 property.

I need some help how i do menu like in the picture , i know html javascript php but CSS is hard

I'd say VSCode is good, but a bit bloated. I'm using PyCharm right now, and I'd say anything from JetBrains is trustworthy.

I'm making an async request to a web service using javascript. On page load the object that I manipulate has not yet been filled with data. How can I stall page load (any other way?) until I have gathered all the data I need? If i try and reload the page afterwords it works ok, but not at first.

VSCode for TS, JS and Python
IntelliJ IDEA for Java and Kotlin
Vim for C and text editing

1. Let the page load in peace
2. Call the web service
3. Fill the object with data
4. Inject it into DOM

Anyone know what is the best way to store a location in MongoDB and then display a small embedded Google Map window with the location, with Angular 1?

store latitude and longitude in the database and then use this ngmap.github.io/

Not only your server. The universe just works.

.ul-element { margin: 0; padding: 0; list-style-type: none; border-top: 1px solid skyblue; }
.ul-element li { border-left: 1px solid skyblue;
border-right: 1px solid skyblue;
border-bottom: 1px solid skyblue; }
.ul-element li.active { why-are-you-not-reading-the-css-docs-right-now }

so how does usernames come into play for employment?

git has to be something sensible?

apples to oranges

Iam reading right now :(

not really. they used coffeescript for atom and now they switched to typescript for the new desktop client

I got a background program that needs to connect to a postgres database. To do that the program has to be run by the postgres user. Is it generally safe to have the postgres user running programs?

Have you guys ever made one of those modern pages with multiple fixed backgrounds? I assume everyone it's a template for some CMS since they look so similar. Looking to make a professional homepage to compliment my linkedin

bankofcanada.ca/banknotes/banknote150/ is a great example showcasing some commemorative canadian money

Why isn't thenewboston on the list of youtube channels?

my server works I'm just amazed that it does there's so much going on

It's often called parallax scrolling. It's not really that hard to do; it's a built-in CSS property: background-attachment: fixed

>I assume everyone it's a template for some CMS since they look so similar.
Yes actually, it's used in the current default theme for WordPress, and probably a bunch of themes and other CMSs.

I keep having issues of shrinking my website. Any good guides out there for this issue? Basically, a proper way to structure the divs, width measurements, ect