/wdg/ - Web Development General

jQuery Mobile is fun 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/
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] 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:

lmgtfy.com/?q=build a chrome extension
phptherightway.com
maps.googleapis.com/maps/api/directions/json?origin=Disneyland&destination=Universal Studios Hollywood4
twitter.com/NSFWRedditVideo

For a floating menu button...

Just top:10px; left: 10px; and a high z-index with position: fixed?

Anyone have any good mobile nav bars? Was thinking about hamburger menu with a JQM panel.

Why don't you just use float: left;?

I've been using CSS for 17 years and I still don't understand float.

I've been using CSS for 17 years and I still don't understand CSS

It just takes some element and pushes it as far left or right as it can go.

If there was a good definition of float and it worked consistently every time then I might know about it.

Different things work differently for everything. Like left: 20px won't work for everything, so you have to margin which also doesn't work every time. Ever try to vertically align an image? Welp, better do some image size hack because it doesn't align from the top of the image.

CSS is balls.

captcha related, cecile

Can someone help me decide on a language to write something with only textual user input and doesn't need sessions? Preferably usable with an SQL database but I suppose plain text files are OK too.

>python
Boring, I've made tens of web programs in Python.
>php
I'm worried about the security and the way to do routing is stupid
>perl
I don't like the arrays, and database interfacing sucks worse than PHP
>perl 6
the frameworks hide a lot of magic and the CGI/FastCGI isn't nowhere as nice as Perl 5
>common lisp
No libraries and stuff for web is very poorly documented
>scheme/racket
I couldn't get some code to work when I tried my implementation there so I gave up after a few days
>C
Too much hassle when worrying about sizes and inputs and implementing new features takes too long
>Elixir/Erlang and Haskell
I'm not in a position to learn new things right now, I want to get my program made
>golang
the packaging system is stupid and homemade solutions are fragmented
I tried once, but using a database in addition to gorilla routing meant I had to inline every function (route)
>ruby
RoR has too much magic and Sinatra has undecipherable errors
>node.js
npm, do I really have to say more?
>arc lisp
no regular expression library
>java
too much boilerplate and bullshit for something simple
>D
made by the people who created a proprietary compiler
>smalltalk
web development libraries are sparse and poorly documented
>io, ioke
No libraries
>shen
made by the people who whined that open sourcing their interpreter gave no benefit, so now are working on a proprietary compiler for another language
>lua
this is vaguely plausible actually, but I don't like tables
>ML or variants
poorly documented or non-existent web libraries
>nim
vaguely plausible, but frameworks available tend to hide away magic

Does nobody else feel this kind of dissatisfaction?

>node.js
>npm, do I really have to say more?

Yes, say more. Seems like you're clutching at straws.

Building a seedbox manager using lumen and I can't be arsed to do html. Any good administration panel templates out there?

>new af
>having fun figuring out how to set up a localhost
>its set up and finish
>tfw don't know what to do next
i don't know what to do anymore. I wanted to set up a sql table that referenced video files, and which i could call through a search bar with php, but i'm lost as fuck. I can't stand learning to do all this through tutorials like codecademy. Ugh....

Will I ever make money through my own website and become a NEET?

yes

You sure about that? :(

yes. just work on it.

On SQL, since PRIMARY KEYs can't be null, is there a point to putting NOT NULL with it?

I don't need much to live a comfy NEET life, I already finished the HTML exercise of Codecadamy, it's fun so far.

I have 2 months to find a remote job. I've finished Free Code Camps front end cert, used to mess around with PHP 7-8 years ago and have enough Ruby that I can put up simple, clean sites ala Jekyll.
My question is this, should I keep on with FCC and other MEAN based stuff or should I pivot to Wordpress and spend the next few weeks learning that? Which is the quicker, if not more lucrative, way to a freelance/remote paycheck?

Learning is easy and the most fun part.

>read book on language you want to learn
>work on passion project as you read through book
>Google problems you can't solve

Never copy/paste code. Read how to do it. Read the code posted. Code it yourself. Don't reference the code until you've been lost for over 15 minutes.

Yes. It's not difficult.

what type of data type should i use in SQL to store references to filepaths?

why is React so based?

I can't stop writing ugly code.

What can I do better here?

and yes, I just realized I have data-role as role on the home buttons.

Those are going away.

I use a TINYTEXT.

>comments in HTML code

Single page app. Figured it was important.1

What are you talking about? The only thing you could have done to make it look better is to remove a few of the blank lines and indent a few so they fall within their parent div.

Maybe that's it. Those few lines per page with no indentation.

This is what I get for years with no indentation at all.

Try coding in Python for a few hours, you'll have no choice but to pay attention to indentation. :)

just to make sure I guess

can someone teach me angularjs?

I'm a Python dev. How does this look?

>html
>code

Doesn't fucking matter how Python looks, there's only one way to write it.

Just look at the picture.

You saying it's not? Let's debate this. What is this markup language interpreted as?

Yes, someone can.

go with React

Are the people that teach shit at bootcamps actually good?

Like really REALLY good?

They make 140k where I live and the average FAMILY income is 50k combined here.

Do you have to be god tier or can I show them a website that gets more traffic than theirs and maybe land the gig?

I rightfully have imposter's syndrome.

most of them are software engineers turned web dev geeks, yes they are smart.

Guys. I want to make a chrome-extension.

How do I do this?

I need to be able to access any kind of sound apis, and networking apis.

Are there any kind of "getting started" guides.

why's that?

lmgtfy.com/?q=build a chrome extension

Yes.

Is there an agreed upon great guide for PHP? It seems like it's not really taught in courses much anymore, but I see a lot of job listings for it.

Just set out to achieve something and figure out how to do it? I learnt all about PHP by making a blog with an account system and shit. Use PDO for databases and disregard anything

Cheers, I guess stumbling around with reference pages for a few hours to get something done is the best way to learn in end.

it's the only way to learn stuff sempai

Damn straight.

Don't copy/paste. Read what they did to solve the problem and attempt to solve it yourself. It's easy to copy/paste from stack overflow but you won't learn a damn thing most of the time.

Any book is good, but a lot of them have bad practices. Agreed with user, definitely use PDO.

Once you can make a retarded version of Twitter then you are good to go.

phptherightway.com

window.open("\img/"+id+".jpg",'','resizable=no,width=300,heigth=300');

why the fuck is this not working ? the image is show, but almost every day the window is in a different and random size.

Actually, using things before you fully understand them can be a good way to learn.

pasted a supposedly working link, changed it's link and it works ! then changed my link to be the same as the first one, i mean both are 100% identical, mine still doesn't respect the height and weight...

I'm finally learning back end. I'm reading about REST routes and how they're supposed to be laid out, but what if for example I have a blogpost I want to update without needing to go to another page? Edit them on the fly instead of going to /blogs/:id/edit ?

javascript to turn the blog post into a text form and a save button which sends that new text to the database, then reload the page?

i know I could just do that, but if I do I stop following the REST pattern?

I don't really care about patterns like that

I fucking hate jquery
I fucking hate javascript
I fucking hate MVC
I fucking hate the web
I haven't written a single line of code since yesterday because I need to use the fucking jquery to continue

Fuck everything

What are the counterparts in the MEAN stack for the LAMP stack? MongoDB/MySQL, NodeJS and Express/Apache, JavaScript/PHP?

MongoDB / MySQL,
NodeJS / Apache,
Angular & Express / PHP

LEMP or bust
Linux / NGINX / MYSQL / PHP
the holy quadfecta(though to be fair I've only ever used MYSQL, I'm interested in postgresql)

> Current year
> Using

literally what else would you use for breaking lines

the Hartl book is starting to become really confusing I am at chapter 8 right now.

And it seems like I only know half of the things that he is talking about.

It seems really confusing especially after coming from just JavaScript/css

Is there a rails book that goes slower? for slow people.

if you find rails hard i suggest you give up and go shovel dirt instead

theres literally no hope for u

Overall though I kind of like the book, I sort of get Test driven development. It is nice to actually use git for projects and get used to it.

I also like the layouts and stuff that saves code you have to write.

What I don't understand is Controllers.

Application controllers/test controllers what ever controllers.

jesus.

>u

You don't. You use CSS to space everything

Anyone?

Fastest route to a job, Wordpress or MEAN?

Stop trying to make MEME stack a thing, it's not a thing. With node, you can use any or no frontend framework, any or no backend framework, and pretty much any database. Mongo is an objectively shit database, angular 1 is obsolete, angular 2 is a pile of broken beta shit, and express is...Actually express is pretty good.

Point is, stop locking yourselves into a "stack". Different tools are good for different jobs.

WP will get you a job faster, MEME will get you a job that pays more than McDonalds.

Let's say I'm running react on the front end and node/express on the back.

Which should handle the routing? I've seen a set up suggested that express only serves a bare html page at a wildcard route, while react handles all of the actual routing.

I also want to know, react seems to do a job express also does and I don't know how to combine the two.

React (or any other frontend framework) "routes" let you use a url to represent a certain state within your single page app so the user can bookmark urls and use the browser back button like a more traditional non-SPA site.

Typically you would then use Express's (or whatever backend you're using) routing to serve up API endpoints and hit them indirectly with AJAX calls.

If you're not making a SPA, you could have the user hit the routes directly and build pages dynamically from templates, or serve up static html (although in production, you'd want to use something like nginx for that).

Hope that makes sense.

Anyone using angular here? I've been working with ionic and came across a strange syntax, I'm not sure how to create a service in:

angular.module('app.services', [])

.factory('BlankFactory', [function(){

}])

.service('BlankService', [function(){

}]);


why are there square brackets around functions?

Use
if you want. You can also use to divide it from the rest.

for dependency injection.

I'm finding it really hard to grasp JS. I learned a bit using FreeCodeCamp but I couldn't do the projects with my basic knowledge so I'm reading Eloquent JavaScript right now. However, it's killing me. I understand it eventually if I search for an explanation online but not enough to apply it myself. Sometimes I just don't understand it at all. I'm on chapter 6.

So what can I do to bring up my level of JS? fuk this mang

How are you on chapter 6 and not grasping it? Are you doing the exercises? Are you playing around with alternative solutions? EQ is pretty damn great at encouraging such, it would be a shame if you're just straight reading through it without taking notes or doing the exercises.

Yeah doing all the exercises, looking stuff up etc. I'm taking a lot of notes and like I said I understand it and why it works, but if you asked me to write it I wouldn't know how. Kind of like being able to understand a human language but not being able to speak it.

ive always disliked that systax, i prefer to use
app.service("exampleDataService", exampleDataService);

function exampleDataService($rootScope)
{
this.title = "sample";

this.alert =
{
id: null,
data: null
};
}

app.controller("alertModal", alertModal);

function alertModal($scope, $uibModalInstance, exampleDataService)
{
$scope.title = exampleDataService.title;

$scope.alert = exampleDataService.alert;

$scope.ok = function()
{
$uibModalInstance.close($scope.alert);
};

$scope.cancel = function()
{
$uibModalInstance.dismiss('cancel');
};
}

which is much more readable, even with dependencies

Learning backend. Is it supposed to be this formulaic and easy? All I've seen is that you need to make routes and save shit in databases. It's very irritating and the many options for a backend language to choose as opposed to just JS in front end made it seem very daunting but it doesn't seem so bad now. Maybe I need to get myself wet with an actual complex project? All I've done so far are generic blogs and mini social networks.

DINGY DING DING DING

> text not inside of an HTML element
> links not wrapped in divs

>divitis

What if you needed to change the background of the link? What if you wanted to add subtext for the link, and move it all to the right or left?

If there's a unique section of a website, it should be in a div, IMO.

All that can be done without wrapping it in another tag

That's normal. I've been using javascript for roughly a year now and I still have to look up stuff all the time. There's no reason to memorize everything when google exists. You'll naturally memorize the stuff you use over time. Just make sure you have a solid understanding of the fundamentals and practice every day.

Why does jquery mobile have such an ugly navbar?


Are there any alternatives I can use?

make it yourself

Are inline styles the best way to style shit in React? This feels very messy to me. React seems to really hate the notion of concern separation. I understand why they chose to go against it, but in the case of styling this does not feel like the ideal solution.

Alright so I'm going to develop a quiz app and wanted to get your input if my idea of the implementation sounds correct.

The quiz part is going to be a webapplication, preferably SPA with VueJS. I'm also making a dashboard where an admin can log in and edit the questions. The questions will be saved in a MongoDB Database and the Dashboard also contains an API that returns the questions from the database. The quiz app queries this API and gets a JSON response with all of the questions. I want to build the Dashboard on a Node server with the sails framework, since I already have some experience with it.

So basically the quiz and the dashboard are two seperate projects that I'm going to host on subdomains. Does this sound somewhat reasonable or did I get the wrong idea? Still fairly new to webdev.

That seems like a lot of stuff for one project.

How else would you do it? I need the quiz app and a custom cms that saves the questions in a database.

Sounds over-architectured to me.

Only bother making an API if there's a need, otherwise just access data directly.

Only use MongoDB if your application actually consists of "big data" i.e. more than a few Terabytes. Otherwise just use a regular RDBMS such as MySQL or PostgreSQL.

Very confused with the term API. Before I got into web dev I usually heard that word in game development like in the Havok engine or OpenGL. But in web development they use that term for basically just paths.

react components have exactly the same styling options as regular html. Only difference is you need to use className="" instead of class="".

An API is just a bunch of standardized protocols used for writing software.

>But in web development they use that term for basically just paths

Are you referring to a Rest API?
e.g. maps.googleapis.com/maps/api/directions/json?origin=Disneyland&destination=Universal Studios Hollywood4

It's a way of calling external services or software via a URL, nothing special about it. You call a URL and get some data back representing the output of a process on the external server.

The reason I want to use a relational database is, because the questions don't have a set amount of answers. It seems to fit better than a traditional database with columns. I'd also like to learn MongoDB for future use.

>don't bother making an API
What's the alternative? Sending the queries from the frontend? That seems insecure.

Try A Smarter Way to Learn JavaScript.

So it'd be alright to link a stylesheet to the html page I anchor all my components on and style them that way?

>because the questions don't have a set amount of answers
So what? With two tables you can solve this
Question
-------------
QuestionId
Text


Answer
-----------
AnswerId
QuestionId (FK)
Text


And your "traditional databases" are relational databases. MongoDB is a NoSQL/non-relational database.

>learn MongoDB for future use
Only for pet projects I hope.