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

maps.google.com/maps/api/geocode/json?address=1600 Amphitheatre Parkway, Mountain View, CA
maps.google.com/maps/api/geocode/json?address=1600 Amphitheatre Parkway, Mountain View, CA):
cloud.google.com/appengine/docs/php/getting-started/hosting-a-static-website
dfcb.github.io/BigVideo.js/
[your
neocities.org/
neocities.org/api
twitter.com/NSFWRedditVideo

Anyone know the CS:GO crate thing where it ticks through the skins then settles on one?

How would you do that with JS?

I can think like, you have all the images with set dimensions, then when it scroll % width = 0 play the tick sound, but how do you know what image is under the ticker?

Use data-id attributes on the img tag to store the unique ID of the item.

Yeah, but how do I actually know that the ticker is over an image to grab that data-att?

data-selected="true"? Store the current ID in a variable somewhere? There's a hundred ways to do it.

nvm, figured it out.

Generate the winning item before, put it in a random position after a minimum amount. Populate positions around it with other random items. Scroll to it to make it look like it's real.

fuck python

Fuck you.

I've made a shitty website.

On the main index i have a .gif. If i leave the main index for another page and then hit the browsers "previous page" button, the gif is no longer playing.

How do i fix this?

How can i get
"lat" : 37.4223664,
"lng" : -122.084406

from this json with php?
maps.google.com/maps/api/geocode/json?address=1600 Amphitheatre Parkway, Mountain View, CA

Idk m8. I'm not a web dev. I just come here to shitpost.

does the gif loop infinitely when you first view it? (gifs can be made to play once)

sounds like a browser bug

new as fuck to webdev

im going through some of the material in OP, but have some questions

I have a web host that offers PHP and MySQL. what does that mean? Can I just upload my entire db onto their servers? Can I access the db remotely through MySQL Workbench or MySQL Command Line Client? (I don't want to manage my db through cpanel and phpmyadmin) Or do I need a local machine that holds the db and act as a server?

If you have answers or know resources you can direct me to, would be much appreciated

I've been away for a while, what's the current memeJS framework?

I set that JSON to variable "n".

var latLng = n.results[0].geometry.location;

i tried to do this to output all:
$url="maps.google.com/maps/api/geocode/json?address=1600 Amphitheatre Parkway, Mountain View, CA";
$json = file_get_contents($url);
$obj = json_decode($json);
echo $obj;


but in error_log i get
[Mon Nov 28 00:08:46.615543 2016] [:error] [pid 1191] [client ::1:40358] PHP Warning: file_get_contents(maps.google.com/maps/api/geocode/json?address=1600 Amphitheatre Parkway, Mountain View, CA): failed to open stream: php_network_getaddresses: getaddrinfo failed: Name or service not known in /srv/http/index.php on line 4

>I have a web host that offers PHP and MySQL. what does that mean?
Means the server has php and mysql installed and available for you to use if you want.

>Can I just upload my entire db onto their servers?
Yes.

>Can I access the db remotely through MySQL Workbench or MySQL Command Line Client? (I don't want to manage my db through cpanel and phpmyadmin)
For shared hosting, the easiest thing is probably to just develop on your local machine however you like and then do a sqldump and send it to your server (ftp or cpanel's annoying file upload thing) and import it with phpmyadmin.

Generally you only want localhost to be able to directly access to the db for security reasons. If your hosting provider allows you ssh access (They usually don't for shared hosting) you can just ssh into the machine and do whatever you want with it.

>Or do I need a local machine that holds the db and act as a server?
No, that's the whole point of using hosting. You're essentially renting a (virtual) machine in a datacenter somewhere that stays running all the time for your users to access. You could run a website from a local machine, but that's generally a pain in the ass to do for various reasons.

You're right.

It happens in firefox, but not in chromium.

Are you opposed to using jQuery?

You should check out Google App Engine, it has a free trail. It has very strict control of db access. If your IP address is static, you simply open it up to that IP and you can access the db with whatever program you want.

At first GAE seemed a little daunting, but once you go through the short tutorial, you'll be up and running in no time and find that it's much simpler than traditional hosts.

cloud.google.com/appengine/docs/php/getting-started/hosting-a-static-website

Does anyone have any experience with flowplayer?

thanks for the reply.
>develop [MySQL] on your local machine however you like and then do a sqldump and send it to your server
My db is >10GB, may change often, from interacting with clients as well as from my input, frequently exchanging the whole db sounds unrealistic. Surely there must be a better way?
this seems great, if maybe a bit overboard. why do you suggest GAE instead of any of these other cloud data packages?

I have very little experience in web development but a shitton in desktop and mobile (iOS) shit. I am also skilled in visual design. I want to pivot from my current job as a technical-heavy mobile developer to a more design-heavy developer. My current job is killing me and it seems like pursuing front-end is my best option for that. I'm on no deadline so investing time in learning the necessary skills is an accepted necessity. Will I be committing suicide by doing this? Literally any comment/feedback/criticism/ridicule/insults are welcome.

Also you may ridicule me if I have erroneously assumed that front end will sate my desire for a design job.

Go for it. It's a tired cliché, but hard work is the only way if you want real change

dfcb.github.io/BigVideo.js/

App Engine is pay for what you need/use model. So if you have a very low traffic website, it will cost you almost nothing. If you have a lot of traffic, it scales up indefinitely.

You don't actually use all those services from your pic, they are just available in case you want to use them. I just use App Engine, Cloud SQL and Cloud Storage, but you may only need the first two. I don't know how much your current host is charging, but GAE almost never, and I mean never, goes down and is always incredibly fast. If you only use it for small websites, you might end up paying $5-10/month at most. Very secure and easy to secure as well.

Why are so many laptop configurators so fucking shit? I'm buying a Dell XPS 15 but the options are incredibly stupid and you have to start from a handful of shitty presets with seemingly little relation between the specs.

Looks like I'm just going to try to get everything else I want and then just buy 3rd party RAM to get 16 GB. Ridiculous.

How should i do that in jquery?
I dont rly use it that much

Does it make sense to buy a 1080p laptop in 2016? The XPS is my pick, too, but it's been pissing me off because what I really want is QHD with the larger screen size but the 15 only lets you pick 1080p or 4K. 4K lowers the battery life drastically whereas the QHD on the 13 is still great.

So yeah, bad configurations.

High DPI is a meme. None of the Desktop Environments scale properly. You just end up using a smaller screen resolution to fit the screen size.

Which should I learn first: JavaScript, Python or PHP?

What does /wdg/ think of wordpress? Thinking of doing freelance wordpress sites.

Really? I fiddled around with a XPS 15 4k in Best Buy yesterday and it seemed pretty impressive. I use Windows 10 for my work (.NET). My desktop is only 1080p, so I don't have any real experience with higher resolutions on a personal, long-term basis.

PHP, then JavaScript. Python in notoriously easy so you'll pick it up with no problem.

all 3

wordpress is pretty much mandatory for freelance web dev

Maybe it's better in Windows 10, I don't know, but in Windows 8 my high DPI laptop had tons of problems with various programs. Lots of scaling issues.

When it comes to Linux, GNOME3 can only scale by integers. I think KDE's scaling is probably better, but I haven't tested it.

How can i call one function from another in same php file?
function 1
public function fun1(){
echo "fun1";
}
public function fun2(){
fun1();
}

is it something like this?

have you tried to [CODE]json_decode($json, true)[/CODE] ?

>My db is >10GB, may change often, from interacting with clients as well as from my input, frequently exchanging the whole db sounds unrealistic. Surely there must be a better way?

I'm a bit confused on the use case here. You already have a 10GB database, but nowhere to put it? Are you trying to port some kind of local MS Access thing to a web app or something?

>Are you trying to port some kind of local MS Access thing to a web app or something?
basically. I had been using the db on a local machine but now I need to physically move around where the only thing I can count on is internet access. So all I really need for now is a remote-access-enabled SQL db (which, as it turns out, isn't as simple as it sounds, at least in MSSQL).

But I was planning on getting into web dev anyways, so I thought a nice first step would be to set up a back-end on which my database can sit. Eventually, I'm going to build web apps that uses the db, so it's all gravy.

My background is in db management/data mining though, so maybe my whole thought process of sitting a db on a web host is wonky.

Personally, I learned Python first for things unrelated to web development, but any of them would be a good choice. You can use JS on the frontend and backend. Python is particularly easy to read and write. PHP used to be incredibly popular (and still is, although it's declining) so depending on your location, jobs are particularly plentiful.

>basically. I had been using the db on a local machine but now I need to physically move around where the only thing I can count on is internet access. So all I really need for now is a remote-access-enabled SQL db (which, as it turns out, isn't as simple as it sounds, at least in MSSQL).

Okay, that makes a lot more sense.

>But I was planning on getting into web dev anyways, so I thought a nice first step would be to set up a back-end on which my database can sit. Eventually, I'm going to build web apps that uses the db, so it's all gravy.

Weeeelll...What you're trying to do is actually somewhat involved and complicated. You should probably start off by learning some PHP (Or pretty much any other programming language if you prefer). If you just put a naked database on the internet somewhere, you're just asking people to fuck with it, so you really need a web app with some form of authentication sitting in front of it. You should also know how to implement basic security precautions to prevent things like SQL injections.

>My background is in db management/data mining though, so maybe my whole thought process of sitting a db on a web host is wonky.

The database lives on the server where it can only be accessed by the web application software. A user sends an *http request* to the app, and the app *responds* to that request according to programmed logic by reading or writing data to the db and sending the result to the user.

Because everything's inside the outermost anchor element?

Can someone recommend a Windows web host?
I've used Linode for all of my hosting, but they're Linux only.

>Windows web host
lad

I need Windows because I'm deploying applications written in .NET and running on MS SQL Server.
I looked at Azure, but it would be $60/month.

im sure you guys will be pleased to know that I am making progress on my paint clone made w/ paper.js

got color and width options working. now just gotta add some different shapes/tools.

any other ideas for stuff I could add?

that's what you get when you work with Windows.

Fuck, I'm so retarded. I thought you wanted to read the results from the browser so I spent the last few hours figuring out how to pull in the data in using jQuery and making it POST the lat and lng so you could pick them up in PHP. I'm way better at PHP, but now I'm to tired to start over. Good luck. The fuckery with the data is that it's first stored in an array at position zero and the rest can be accessed in the typical multidimensional array fashion. So in PHP, something like [geometry][location][lat] and so on.





$.getJSON( "maps.google.com/maps/api/geocode/json?address=1600 Amphitheatre Parkway, Mountain View, CA", function( data ) {
$.post( "[your website]/", { lat: data.results[0].geometry.location.lat, lng: data.results[0].geometry.location.lng } );
});

Don't come here very much, forgot how to post code


$.getJSON( "maps.google.com/maps/api/geocode/json?address=1600 Amphitheatre Parkway, Mountain View, CA", function( data ) {
$.post( "[your website]/", { lat: data.results[0].geometry.location.lat, lng: data.results[0].geometry.location.lng } );
});

Really wish this site had a edit or delete feature. Messed up the last post, forgot the jquery script.

$.getJSON( "maps.google.com/maps/api/geocode/json?address=1600 Amphitheatre Parkway, Mountain View, CA", function( data ) {
$.post( "[your website]/", {
lat: data.results[0].geometry.location.lat,
lng: data.results[0].geometry.location.lng
} );
});

Which is better specifically for HTML5 and CSS: freecodecamp or w3schools? Specifically, I want more projects to develop so I can not only learn the basics but apply them as well.

w3schools is outdated garbage. Go with FCC.

I'm afraid to go to sleep /wdg/, because I know that when I wake up I'm going to find an email from the one job prospect I have left telling me they've decided to go with someone else.

I don't know what i'm going to do

Which text editor is best: atom.io, brackets.io, or sublime text?

I've heard it's far better in Windows 10, but I don't feel a need to go higher than 1080p on a laptop. I wouldn't say it's meme tier, but I think that it's not that useful unless you're either a content creator of some sort (mostly photography at this point) or you have a lot of >1080p content (unlikely, and most services won't have it for years to come). The battery life is more valuable, for sure.

That said, the other "amusing" thing with the XPS 15 is that you have to pay out the ass to get a 1080p version with their bigger battery (I think it's like $1,600 base). It's laughable how much better the XPS 13 configuration options are.

then just get some side jobs. don't pressure yourself doing 9 to 5.

I've used brackets and its better than sublime IMO. its just a matter of preference. you should try to use those three to see what you want.

I mostly use atom, but when I need to format huge files i have to do it in sublime.

sublime really performs well, but atom can be customized to the however you want it.

I can't get any job

atom is really good and sexy as hell but it's fucking slow. it needs at least 8 gigs of ram to run but i've managed to fuck it up on 16 with a bad regular expression search

sublime is faster and can be themed to look good, but it's not as customizable

Atom. If you don't have a decent amount of RAM, Sublime. If you only do front-end and like it, Brackets is pretty good, but it just doesn't measure up as well.

8GB?

I have a HP Z800 with dual 6-core Xeons and 128GB RAM, and Atom is still ridiculously fucking slow.

atom runs just fine on my 16-gig MBP

Don't give up lad. You're not a quitter. Don't be a fucking quitter.

Half uni/NEET fag here, took a year out of CS degree to learn webdev cause I'm a lot happier doing it to the point where i'd rather start working now and sack the degree

Using ruby/rails, and know plenty of all the basics (JS, HTML etc.), anyone know any projects on github I can contribute to so my portfolio can look better besides the basic tutorial apps ive made, this would be the first contributes ive done

ctrl c XDDDDDDDD

>really wish this site had an edit or delete feature
There is delete you fucking newfag

>jquery 1.11
dude if youre gonna jCurry at least use version 3.0

Free Code Camp has this thing with non profits that need help

> ay lads, quality or quantity?

i've got plenty of projects on github that are unfinished useless pieces of shit and few that are at least mediocre.

Is it better to have many github projects that includes those unfinished and unworthy creations or should I focus on having only few projects that are clean code and expentantly functional?

finish those shits. at least they know you can DELIVER. then you can refactor and clean up later. because efficiency takes time. you'll be experienced enough to do clean code even before you clean up your code.

create large projects, then you're forced to keep the code good enough because you won't be able to remember everything that's going on at some point and when you need to read the bits you forgot you can immediately understand it.

for larger projects you need to know various design and architectural patterns which are usually used by most larger development companies. but if your aim is just some wordpress faggotry then you wont need it

why the hatin' on wordpress? You can do clean code especially in plugin, widget and theme development.

I am a bit of a beginner here and only really comfortable with HTML and CSS.

I want to have a gallery page on the site I am making that takes pictures from Instagram, is there a good way of doing this that is also good for seo (so I can add an alt tag to pics)

Also things like auto pagination would be nice.

>seo
pajeet out!

What? I am doing this for my business.

Any of you guys starting to use more Python in Web Dev? I feel like within 5 years PHP would be replaced by Python

>muh google search engine optimization
ask yourself why you really think this is important
Is it so you can make money from ad clicks? If so get out. If not, why do you need seo

>business
>taking pics from ig
that doesn't sound legal my pajeet friend

>can't do basic shit
>still want to make pennies online
>by stealing other people's content
>so asks to be spoonfed
this has curry indian written all over it

PHP is still the main player in web dev, 80% of the world website is created by PHP and I wouldn't be worry about much about python. It's just a fade and would probably end in a few months

Its from OUR instagram. We keep the instagram updated, and it automatically updates the websites gallery with whats current.

why not just uh you know actually use instagram for this?

>guys how do I make a website to show me my recent youtube videas

Because we work in the vintage car/motorbike industry and a lot of our customers are not on instagram, at best they find us on google or go on our website by referral.

I was thinking that this way we only need to update one account, but both get updated.

if the Instagram pictures are from your account, yeah you can do that. IDK just google instagram developers API, I guess.

Good for you. At least it can signal search engines that you always have content. why not leverage also Facebook and Twitter for your website's content. Both the website and the social media accounts will be always active. Win-win.

This is what I am hoping to do, my main issue is that we don't have the budget to get someone to make a site so I am just learning and doing it myself, its not too hard to do the basic stuff, and I suppose if I make it I can maintain it rather than relying on someone else.

How hard is it to find web dev jobs? Most companies outsource these jobs right? Will my dream of being web dev for Brazzers come true?

I might not have to live out of my car after all.
I might actually make it guys ;_;

Why isn't neocities in the OP?

neocities.org/

It's comfy af for hosting simple HTML/CSS/JS content (for free) and you can use the API to regularly generate content

neocities.org/api

Although I think that might be against the rules.

Tried writing a new feature at work today, but somehow chrome started complaining that "the page has stopped responding" shit every now and then. I have no idea why it even complains about that. The page does appear responsive and all and there's no errors in console. Any idea what I should be looking out for?

what is it about?
Is 56 users really enough to make money?

60 users. Lets say average 5 minutes on site. 720 users an hour. Lets say 5 ad impression per user. 2592000 ad impressions per month. CPM of $1 is $31k a year before tax.

This ain't no way to live. Why don't you use your skills and do freelance?

I'm an autistic neet who is scared of social interaction.

What if they use adblock?

Yet here you are interacting with people.

Is that like a spinoff from geocities? First I've heard of it.

I'm gonna be rich. (sorry for blog posting)