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

youtube.com/watch?v=4bZvq3nodf4
publicdb.host/
firstamender.com
npmjs.com/package/es6-promisify.
104.128.226.151/create
deepstream.io/blog/deepstream-2.0-more-than-1000-times-faster-than-socket.io/
gitter.im/srs-study
dev.mysql.com/doc/refman/5.7/en/data-type-defaults.html
github.com/jad340/startpage/blob/gh-pages/styles.css
twitter.com/SFWRedditVideos

Reminder that if you don't care about or design your sites around the limitations of shitty mobile devices, you're mediocre at your job and you're the reason that the web sucks.

youtube.com/watch?v=4bZvq3nodf4

would love to read more opinions on this

Hello anons, im creating Hello World in drupal and im having some problem, when i go to url
/hello/world
i get

Access denied
You are not authorized to access this page.

i did drupal router:rebuild
>code in pic

Why are you trying to learn drupal?

Ill need it for work

Have you considered quitting?

Check the error logs..
If the user in charge of updating the files does not have root permissions, Add (don't change his group) him to the apache/nginx group.
Otherwise, change the Directory Group to apache/nginx.

I have a question about semantic data.

WHAT IS THE LEADING/BEST FORMAT?!

I see schema.org has something like a specification. What else is there? This is a huge blocker to me, and I need this done ASAP.

Why would i do that?
Giving up on first obstacle lol
That problem would be if you were building plane php app. Problem was in .routing.yml, in naming.
It is fixed

I'm a python guy who started doing javascript/jquery and now Node.js

Holy fuck asynchronous programming is annoying. I understand its reason (so the browser painting doesn't hang) but all the callbacks and crap you have to do is like jumping through hoops.

I know there are Promises but that seems like an advanced topic for someone who's new-ish, and I guess the next version has async-await that's supposed to help

tl;dr
asynchronous and callback hell is super annoying.

r8
publicdb.host/

Have any of you guys used a raspberry pi to run your web apps 24/7? While testing them I mean

I thought about getting the $5 zero

I made this site alone.

firstamender.com

promises are pretty easy to learn

needs details next to download links, like what does "twitter" mean in this context

It looks shit but well done

>needs details next to download links, like what does "twitter" mean in this context
Think its pretty obvious. Twitter means twitter.com db dump

>Why would i do that?
Because you have to work with Drupal.

>It looks shit but well done

why does it look like shit?

Why is that a problem?
I like company, it is young and people are ok.
Drupal developer work 4 hour for clients, 1 hour pause and then 3 hours drupal community work, building modules etc.
Windows is forbidden

asyncFunction(function (error, result) {
if (error) {
// do error stuff
return;
}
// do stuff here
anotherAsyncFunction(result2, function(error, result) {
// do stuff here
//etc etc this is pretty gay
});
});


Promises are quite simple
asyncFunctionWhichReturnsAPromise().then(function(result) {
// do stuff here
return anotherAsyncFunctionWhichReturnsAPromise(result);
}).then(function(result) {
// do stuff here
// this is pretty managable and you can chain as much shit as you want
}).catch(function(error) {
// if anything goes wrong at any point in any async operation, it will be handled here
})


You can make any callback-based API into a promise-based API very simply, with stuff like npmjs.com/package/es6-promisify.

Also a good idea to polyfill promises themselves to account for older browsers.

yeah, a db dump of what? obviously not everything, so what does it include?

drop shadow text on top of primary colour gradients, awful typography throughout, odd shadows, headings don't line up with content, spacings all over the place,

In Bootstrap what is the best way of making it so 3 images on a grid row have no gap between each other so that they are all touching? pic related

if i have a page that connects to a db to read from it, then i have a form on that same page that i want to write to another db once it is submitted, how do i open up the 2nd db connection? do i have connected to it on the .php file that the forms action is set to?

Whats a good website framework that is like bootstrap but doesn't request jquery?

you want me to manually look through the at this point 800+ dbs uploaded to the site and add metadata to them? the nearly 300 daily unique visitors that visit the site usually know what they're looking for, and its all pretty much just raw sql dbs with hashed passwords and other info that you would normally find in a user table

there are none. bootstrap is the cancer of the web development community and so is everything else. just spend 10 minutes learning the basics of css and you'll be able to make something much nice with minimal googling

this is basic css why do you need bootstrap to set the width of something to 33.3333%

to achieve what

guys im running a file host website
a pomf clone tbe, its just for me and my friends really. anyway, literally everything i can think of works, except opus audio files dont really come through correctly. they just display as text, which if you save it all is still smaller than the file itself.

tried loading with multiple browsers to the same effect. and the worst part is that it worked before, and at some point it stopped working. i do keep software pretty up to date (wt-nmp staack), including os updates, so im guessing something external to me broke it and i just have to wait for it to fix itself but, just in case, does anyone have any ideas? im just a hobbyist at best

>POMF CLONE
aahhahaahhahahahahahahhahahahahahahhahahahahahahhaha xddddddddddd

>typing out 33.3333%

just do calc(100% / 3) nigga

fuck off nerd

what is meteor

An opinionated node.js framework, good for some kind of projects.

Did they fixed exploits?
I knew year or two ago when i was testing it, it had some exploits

I can't get a fucking job.

Whats the best backend language in 2016?

php7 ofc

Its a "full stack" framework, which nobody makes anything with because Node offers far more flexibility and choice, and Meteor doesn't have enough advantages to make it worth putting up with the limitations.

The entire thing is architected around the idea of maintaining a websocket connection to the client, so that the server can push changes to clients instead of using the request/response model that all webapps use. So in order to accomplish this they have their own built-in version of MongoDB, and in order to see if any changes have happened which a client needs to know about, they do something called oplog tailing, where thye just read a list of all the changes that have happened in the database and then update the clients if appropriate.

If you want the server to be able to update clients, you can use one of the 5 websocket libraries that are availabel to Node, and you're not stuck with MongoDB as your database.

So basically Meteor is a gimmick, its okay as a learning tool if you want to learn full-stack Javascript, but move on to Node as soon as you get some idea about what you're doing.

Wouldn't it be cool if the general had its own website?

We could just post links to all the shit we have in the OP.
j-just because some of the other generals have cool sites

We should just do one of those wikias where people can suggest edits.

ill do the logo

why bother when the links are always posted idgi

we could add more shit there and organize it better than here

Sure, but who's going to build it? If you want to make a repository then fine, go ahead, I'll contribute when I have time. The hardest part, however, will be deciding on a language/framework to use because we all know how much of a divide there is when it comes to that shit.

>some of the other generals have cool sites
Links? I'd love to see them.

But we could also just add more links to OP and it's very organized right now

see this is the major problem with web devs, they want to solve a problem that just doesn't fucking exist, only complicating everything in the process

HTML, CSS, Javascript.

Let's keep it simple.
No frameworks.

I LOVE REINVENTING THE WHEEL

so no backend then?

Start the repo, wireframes, and the general plan then. I'll contribute where I can.

Well you can join the discord server, there is a special channel there for reading suggestions.

I'm impatient as fuck and want responses
>104.128.226.151/create
roast my shit bois

I guess I'm halfway done

I clicked back after making a room then submitted again.

fixed it

When you first started learning programming (with no prior experience) about how many hours did it take before you hit that magical plateau of learning?
Like how long did it take for you to achieve that "Ah, I understand now" stage? I've tried getting into web development about 4 different time and end up getting bored within a few days. Oddly enough i'm obsessed with learning but I don't know shit except for the basic understanding of html.
Any thoughts on this, anons?

Took me about 3 months probably before things really started to click.

I focused a lot on end results, like "I want to make a simple terminal RPG in Node" up to "I want to create a geo-projection in d3"

Who is using Java to develop webapp's here?

Dropwizard is comfy as fucc

anyone have good recommendations for resources on making web APIs, in general or with asp.net? I'm using microsoft's pages on the topic atm but I figured I'd drop in to see if any anons have some good shit

>104.128.226.151/create
its down

What's the best way to do css?

Do I bootstrap and then have a file that overrides all the colours and styles I want.
Do I download the uncompiled bootstrap, change everything in there and then compile it every time I make a change?
Do I just use my own CSS and make everything messy as all fuck?

I'm a backend dev with no UX experience at all creating my first front end, does anyone have any good resources to look at to get an idea of where to start with good design practices and actually building the CSS to standards rather than throwing shit at the wall until it sticks

Hey my hivemind bro, I'm wondering the same thing.

I've been in frontend projects before and it was like several 10,000 line css files that you just chucked shit into with !important and hope it worked.
There has to be a better way

With the projects I've worked with they've either been provided stylesheets or there has been a front end guy working with sass, which seems like total overkill for my project which is why I asked

They tried to explain it once but it went straight over my head. Hopefully someone here can point us in the right direction

nigger bootstrap is the definition of messy

is it bad that my site map is this disorganized?

Would you trust these guys' libraries for future projects?
deepstream.io/blog/deepstream-2.0-more-than-1000-times-faster-than-socket.io/

Study Group back at gitter.im/srs-study

Gonna be active for the rest of the day.

Why not? If you think it's malicious or flawed then test it and go through the source code.

just remove the array lookup part:
var index = Math.floor(Math.random()*array.length)

Just realised it, thanks anyway

I hope the project stays free, maybe I'm being too paranoid.

Where should i buy a domain? The domain just to set up the dns

if i insert data into a table but dont specify all the columns, just some, will the fields i dont mention in the INSERT INTO query just be filled with blanks? I'm using PDO.

2bh coming back to this general is just migraine inducing

>tfw employer forces me to use 2 different versions of bootstrap with 1-2 different themes on the same page in every single project (I'm not kidding).

Just kill me.
98% unused css selectors per page.

NameCheap is the cheapest no bullshit registrar currently

Either you name all of them, or don't name any of them at all iirc.
Idk why you're asking instead of testing it out yourself, this is they type of shit that will take 5 minutes.

Have a site that mostly hosts semi-legal files such as db dumps and hacked github repositories. Gets between 400-1000 uniques on a normal day and close to 30k total requests with these numbers.

Any way to monetize this? Obviously adsense is out of the picture and users are usually pretty privacy conscious.

Every database has rules for setting default (and sequential) values when creating a field.
dev.mysql.com/doc/refman/5.7/en/data-type-defaults.html

Bashing my head against this particular kata for a few hours now.
Tried /sci/ but no response yet so maybe someone here might have an answer.

I need to write 2 functions. One, dist($v=speed, $mu=traction between the tires and the road surface), and speed($d = distance in meters and $mu = the same traction).
dist() is supposed to calculate the total stopping distance in meters given $v and $mu and a reaction time of $t = 1. For that I used
function dist($v, $mu){
$v = $v/18*5 //to convert from km/h to m/s
return $v+$v**2/(2*$mu*9.81); //normally it'd start with $v*$t but $t==1
}


Issue is with my speed function. I cannot figure out how to get speed given that to calculate it, I used $v*$t.
Normally I'd just use the code below but adding $v*$t makes this invalid.
function speed($d, $mu){
$v = $sqrt($d * (2*$mu*9.81));
return $v*18/5; //back to km/h
}

Advice projects for portfolio for front end(Angular) developer.

yea I'm going to work on it a bit more and put it back up later

Does anyone have any idea why my font-awesome icons don't work on mysite.dev but works on www.mysite.dev?

Folder Structure:
+ application
+ resources
-----css
-----fonts
-----images
-----js
+ system
- index.php


I'm using CodeIgniter and the base URL is set at www.mysite.dev

Using flask and flask-login to make a simple employee scheduler for my final project. flask-login doesn't support access levels. What's the best way to implement something?

dont be just a front end guy

why do you have a full domain as base url

I'm grabbing data from a form and inserting it into a table. But I also need to grab data from another table and insert it in the same table. The part i'm stuck on is when I grab the php variables that store the form data and insert them into the table, how would i (based on a common customer number) insert data from the other table at the same time? How many queries should i run?

something like
INSERT INTO first_table (name, number, something)
SELECT @name, @number, st.something,
FROM second_table st
WHERE st.number = @number
?

$t is not defined inside any of those functions. If you have a variable $t available outside the function scope, then reference it like this:
function dist($v, $mu) use ($t){

You need to enable CORS, or redirect all requests to the full domain.

im still confused on where i put the php variables. Cant go in the SELECT part because im not really selecting them from a table...

the example only selects one value from a table, the rest is from your parameters.

It wasn't an issue as the $t was always 1 and I simply used $v+(the rest of the equation) instead of $v*$t+(the rest of the equation). Wanted to mention the $t as it is main part of why the speed equation didn't work. Cheers anyway.

Fuck me, solved. Gotta brush up on the quadratic equations...

bump

>firstamender.com

looks shit . well done for the simplicity and functionality . might want to do this on free time (if I have one!)

yeah it would be great if wasn't right.

does the order of elements within the tag matter?

>Can't go in the SELECT part because im not really selecting them from a table...

Littel do you know about SQL, my friend..

SELECT (3+5)*2;


Why do you never ask SQL people to help you move your furniture?
>They sometimes drop the table.

Why is NULL is the Chuck Norris of the database?
>Nothing can be compared to it.

What do you call someone who turns into Father Christmas whenever there's a full moon?
>A were-clause.

A SQL query walks into a bar and sees two tables. He walks up to them and says "can I join you?"
>Then a waitress walks up and says "Nice view"!

It's the order in which they are "read" and thus loaded, rarely does it matter.

ideally, you want to do meta charset, then the title tag, then the viewport meta THEN the other metas (like OG, twitter, etc..). Lastly is the stylesheets. You might want to put the script tags at the bottom just before the closing body tag. Just my two cents. m8.

yes it is crucial to html rendering speed

>A SQL query walks into a bar and sees two tables. He walks up to them and says "can I join you?"
>>Then a waitress walks up and says "Nice view"!

hahahaha good one !

Just making a simple startpage atm, but I can't seem to get my main content div perfectly centered (see pic). Here's my CSS: github.com/jad340/startpage/blob/gh-pages/styles.css . How can I fix this?

What does a SJW think when she sees an SQL-injection?
>CREATE TRIGGER