/wdg/ - Web Development General

What's everybody up to today?

Previous thread: >COMPLETE BEGINNERS GUIDE
github.com/kamranahmedse/developer-roadmap

>Free beginner resources to get started
Get a good understanding of HTML, CSS and JavaScript.
developer.mozilla.org/en-US/docs/Learn - a good introduction (independent of your browser choice)
freecodecamp.org
codecademy.com
hackr.io
theodinproject.com/

>Further resources
developer.mozilla.org/en-US/docs/Web - excellent documentation for HTML, CSS & JS
github.com/kamranahmedse/developer-roadmap - Frontend+Backend learner-path suggestions
youtube.com/watch?v=Zftx68K-1D4x

jsfiddle.net - Use this and post a link, if you need help with your HTML/CSS/JS
3v4l.org/ - Use this and post a link, if you need help with PHP/HackLang

>PHP resources
pastebin.com/gfBPg24A

Attached: wdg_laptop_projector.jpg (481x641, 59K)

Other urls found in this thread:

jsfiddle.net/gsaqty5n/
pastebin.com/kvmzzt4a
pastebin.com/H31ujjAB
boards.4channel.org/g/thread/68784890'
jonahmann.x10host.com/genie.mp3
twitter.com/SFWRedditGifs

Finished a program that uses ajax to print book information.

Client wants map data for land registry app and now i have to learn damn arcgis api... This app was already laravel react redux and now this on top of it. Complexity yay!

Newfag to web dev here. I'm making an Encyclopedia application for homicide and missing persons cases solved years later, built with laravel. It's a project for my girlfriend. Also building a web forum in laravel as the final for my web applications class. Any other suggestions for when I'm done with these?

The other day I got caught up trying to scrape a site for streaming content videos. I'd open Firefox, right click inspect element, open the network tab and filter by "ts" files and then I'd copy the file names by hand. I just want to know how to do this automatically. How can I get these ts file names into a text file? I don't even know where to look, but it's got to possible.

After that it's just wget and concatting with ffmpeg, and I have a working automated content scraper.

Does anyone here have a script that will tell me when my post has been replied to? Basically something that just scans a page for a new instance of my given posting number, and emails me or something when it happens?

idk a chat and hosting app?

*file hosting

Dig into the JS code to figure out how the filenames are generated.

>ts files
That sounds like MPEG-1; are they using JSMpeg? It might be a standardized API, which would make it easy to scrape.

>self joins with outer joins in the mix
Woah I don't understand shit, what is this fuckery? Postgres was going smooth until this.

I love the direction of these OP images

I ended up getting it, I just had to do it by hand as I described. The js code just contained a link to a "blob:https" which was useless. The files were being sent from a server from a different domain (and it didn't show up in the JS in a way I was able to identify).

>ts files
The were labeled like "0.ts", and the "type" (in network, in developer tools) was mp2t. The thing is, I don't care much about this particular site. I will in all likely-hood never scrape from it again, but my script that I used to scrape it was a one-off and that kinda triggered some autism. I'd like it be able to be used for a wider use case without having to manually enter the file names.

Thanks for the input though, any ideas?

I am planning on creating an imageboard using PHP/Laravel (basically Jow Forums but with some improvements)
Any idea on what should I add?

User accounts, voting on comments, gold membership, avatars, signatures and some kind of point system where you can earn points for posting.

a (You) tracker, you don't have to scroll up or down to check your (You)s a small tab appears on the bottom of the page you can click on it and will display all the posts with the (You)s you can still scroll up and down, but this way you don't have to just to check the replies you got and reply to them.

Jow Forums X

interesting, any feature Jow Forums X is lacking?

>The js code just contained a link to a "blob:https"
I think that's what allows a element to play back the video, unless I'm confused and it's rendering to a canvas instead. You might be able to hijack the blob url and export the data that way, but I don't know exactly how that works.

As far as scraping the content as it comes in, different sites stream video in different ways. This one uses the mp2t format, MPEG-2 transport stream. Others might use m3u8 playlists. And there are other possibilities as well. So you can't really rely on always knowing the format for scraping a site's content.

Anyway, to scrape a specific site, a good way of finding where a request is made from in JS is using XHR breakpoints (in Chrome dev tools, not sure if Firefox has something equivalent).

Are we on VUE 2 or VUE 3? I am fucking confused

Attached: 131342535.jpg (1106x1012, 64K)

from what I vaguely remember reading, the blob-url is some kind of fake url that the server uses (kind of like a public key). what was much easier was the network->"ts" file search. I'm fine with adding support for different protocols, since a lot of the code would be recycled.

It's interesting there's not an easier way to just export Firefox's filter that I use to plain text.. And yes, firefox does offer something similar to the XHR breakpoints. It's just annoying I can do it in a GUI, but not via text (yet). It's obviously all there. Anyhow, thanks. I guess I'll look at the javascript more.

What are the most popular backend languages to create new projects today? Is it still Node

Attached: 1541793058250.gif (680x502, 179K)

Does anybody here have experience with Neutrino?
I built a React component with the react components preset, but when I try to build the project it's not ES5. Trying to add it to a HTML file gives ReferenceError: require is not defined. I was under the impression the preset would build valid usable code from the get-go.

Link to the code neutrino spits out:
jsfiddle.net/gsaqty5n/

Attached: Screenshot_20181204_030404.png (1919x935, 1.76M)

test

help me get this script to work. it's purpose is to see if anyone has replied to a Jow Forums post

#!/bin/bash

read -p "Enter URL to be scanned: " url

# this part sucks, should have to prompt to save it as if I can just extract the string wget will save it as anyway
read -p "Save URL as: " html
wget -O $html $url

# prompt for post number
read -p "Enter string: " string

# loop, scan, and "refresh" via wget
# sleep 0 is just for testing purposes
while [ $(cat $html | grep -c $string) -lt 2 ]; do wget -0 $html $url; sleep 0; done

feel free to tell me my approach is shit too, it'd be nice if it worked other sites like stack exchange but obviously that work by searching for post numbers

What the "backend" does besides connecting the input data to the database and connecting the database data to an API? Honest question, please answer.

What's the best domain registrar out there these days? Gandi.net always looked pretty high end back in the day, but I don't know if that's still the case.

i feel like a cron job could more easily do this

Frontend is what people look at and use, backend is what is stored on a server for them to view and retrieve

Think of it as a shop, you have the shop floor where all the items are displayed, and then you have the stock room in the back where all the items are stored

bash newbie here, way outa my leage, but I almost get it, but wget -0? what does that do? I just googled it and found nothing

What's the best gsuite alternative? Am I better off just hosting mail myself if I don't want to pay Google? Is it feasible to do reliable email on my own?

No one?

What should I use for address auto completion? Smartystreets and Google Maps' API seem to be the two standout options. Any other recs?

Honestly just fuck JS, I thought it had evolved past ES5/jQuery fuckery but it's such a pain to create a simple JS file with tools such React or Neutrino you just might as well write ES5 directly instead of praying to the gods build tools will do it for you.

Yes I'm mad, I've wasted a week to try turn a 25 line file from react into standalone ES5 file.

Attached: 1518371611772.gif (480x270, 1.61M)

help a brainlet out,
so arrow functions in javascript don't have their own 'this', but regular functions do, which is why in such cases we use bind, apply, call etc, am I correct?

I'd put this in a cronjob to run every 1 minute/5 minutes and increment the notify_if_greater variable (externally in a log or something) every time it notifies, but here's the basic idea: pastebin.com/kvmzzt4a

X_userid is your userid that's running X

I've been hired and am going to tackle my first real project starting tomorrow

just wanted to share because thanks to you guys I had a pretty fun time learning to code and you're probably the reason I didn't quit

love you /wdg/

Attached: .png (493x402, 3K)

>getopts 'u:n:p:t:'
u: should be b: sorry

what's on your portfolio?

Is The Odin Project a good resource? It's teaching ruby but people kept telling me every company uses nodejs

it was supposed to be -O, and it allows me "save as". I'm also a bash newbie and I'm finding it very hard, but convenient, to "think" in bash.

>now i have to learn damn arcgis api
I hate this.

>client wants system with features A, B, C and maybe in the future D and E
>client says that's all
>talk to employees and check what the current workflow looks like without the system and it seems the client was very reasonable in his request/specs
>implement it using a language/framework/library/operating system that seems to support everything the wants without much trouble.
>show progress to client every week and try to get feedback so we don't waste our time and they don't wast their money
>everything goes well
>hit 5 month mark, program is ready, deploy with success. employees want to suck our dicks
>1 month later client requests features/usecases G, H that he never told us about during the spec/development phase
>our choice of technology makes it a fucking hell to implement said features/usecases
we've been suffering for nearly a year since the project manager decided to say "yes" to that feature. no amount of testing seems to protects us from the problems we find in production every week due to having to reinvent the wheel and use shady code to make things run at all.

>pastebin.com/kvmzzt4a
Thanks user!

I think your script is pretty neat bro, keep it up

been doing landing pages destined to business websites, mostly

started getting into backend a bit ago and creating administrative modules (data entry, storage and consulting for example)

as soon as I added those I got called by an insurance company that needed a consistent way to manage their information

>administrative modules (data entry, storage and consulting for example)
really interesting

>he doesn't use VUE X
pleb

business logic
namecheap

There are PHP companies, C# companies, Python companies, etc. Node for the backend is definitely not a majority. Its just a strong player, like everything I listed and more.

Bump on namecheap

I just realized this would be a better solution: pastebin.com/H31ujjAB
where /home/anonymous/bin-conf/count-replies.conf is:
notify_if_greater=0
board='g'
thread='boards.4channel.org/g/thread/68784890'
post='68786574'

i still just use gandi
free email/whois privacy, which was always an optional extra every time i looked elsewhere

The previous post I could almost understand but this one is waay out of my reach

It just sources the variables from an external file, in this case it's /home/anonymous/bin-conf/count-replies.conf but in reality you can have the file and location to be anything.

As for the DBUS_SESSION_BUS_ADDRESS, you may need to replace the '1000' which is my userid running x with your own. You can echo $UID to find that.

Then sed will effectively increment the notify_if_greater variable in the external file by 1. Hopefully that helps somewhat

meant for and the reason it's in an external file is to make it easier for editing. You could then use arrays to watch multiple posts and threads, hotkeys bound to automatically export the url and post number to the file, and hotkeys to quickly modify the file. At least that's what I'd do

The previous post I could almost understand but this one is waay out of my reach

it doesn't but you are so kind for trying, thank you

werks on my machine nigger. Unless you're running x as a different user, like root, which would make you a double nigger

glad to hear it user. Good luck on your new project. Let us know how it goes.

there isnt a way to prevent user to change values of option elements in select dropdown and send them to php script and create a record in table right? i mean i have
A
B

values are actually foreign keys
so if user selects A but changes 1 to 2 in dev tools, theres no way i can know he fucked me over and he gets to write B into table?

don't trust user input

kys

Here are my online music visualisers.

>p5.js

jonahmann.x10host.com

Can I make the API require login and password to be used by the frontend or I need another type of authentication?

On the backend, before you write to the database, check the data you got from the user to make sure it's valid. The user could hypothetically send you anything. So know what options are possible for the user to have selected, and make sure the thing they actually sent you is within that list of options.

Also sanitize any input you get directly from the user; look up SQL injection and how to prevent it.

All in all, basically this:

both 1 and 2 values are valid and exist in table that is referenced
the only problem is that user can trick it and insert the wrong (but valid) value and thus reference B instead of A

you either have a valid state or a wrong state. you can't have both at the same time.

if both 1 and 2 are valid then you should just accept the input, otherwise you reject it. that's all

so OP is right, there is no way to prevent it

So your issue is that if the user edits the page's source code to change the value associated with option A to a different value, it will send this different value to the backend.

But how is that any different than if the user just selected option B instead?

I'd like to publish my project on Github, but all throughout my project I've used tabs as indentation instead of regular space, should I do something about it? I recall some anons bitching about it so idk

u r right

>Working on project
>Suddenly something stops working
>Used to work before
>Don't know what changed to make it stop working

Oh god why.

redpill me on Php
why is it hated by many people?
why would I use php as a backend language instead of Java, C# or JS?

so is it confirmed that Vue will takeover React in 2019 judging by current trend??

Probably not any time soon.

Attached: Screenshot_2018-12-05-12-49-43-469_com.android.chrome.png (1080x1920, 306K)

people hate it cus they ain't it
they ass mad php dominates like 80% of all websites and their crappy python/ruby/asp.net/node crap can't even keep up with what is effectively a failed abortion of a language so they get all shitter shattered and ass blasted about muh conventions when the nuts and bolts of the entire thing is that php just quite literally werks and their gay shit doesn't
it really does keep them up at night

When to use interfaces and when to use types in TypeScript?

That's why you always write the unit tests before you write the code itself

People only dislike PHP because it's a little chaotic and unordered. Like some functions have the opposite order of parameters which you are used to. Compared to JS as well, PHP just looks uglier on the page since most of the time in JS you're working with methods tacked on to the String object, Array object etc while PHP doesn't do that but just uses basic functions.

>People only dislike PHP because it's a little chaotic and unordered
i've heard php 7 fixed that. is that true?

Why not make it a micro service?
Vue 2 still, but other vue libraries are in version 3
Yeah, thats correct

A little, yeah. But the issue is that it has been disordered for so long. To make it neat and fun to work with like JS they will need to rewrite the whole thing from scratch

Not really, it may take a few years and release 3.0 of vue to maybe take over
Use interfaces when you wan to declare a common set of functions into different classes that will have diferent properties

Use types when you want to declare the properties of a class, maybe a library that is not in Typescript

if you know Python, then you should check out BeautifulSoup

yes if you calculate in that react won't change, react hooks are on the way

mods

Second guy here, what if I'm wanting to define the layout of an object literal for a function's return value, like so:

const fn = (): {foo: 'bar', baz: 'hello'}


But it is much, much longer than only two keys and if I put it all inline in the return value area then it makes the code barely readable. But at the same time I only need to define this object literal's set of keys and value types once. What would you do in that situation?

>Be failure CS student
>Apply to jobs as a joke
>Have interview with startup tomorrow
>They mainly use a tech stack I learned while being a NEET
wish me luck bros!

Currently working on hobby project in PHP with MVC pattern in mind. Thing is, I have this huge static array of strings which contain titles and descriptions for a huge form in the view. The array looks like this but x100:

$radioGroup = [
'someValue' => [
'title' => 'The Choice',
'desc' => 'Huge description paragraph'
]
]


My question is, where do I put all this data? for now the model is handling it, but I think I'm doing something wrong here.

cool

jonahmann.x10host.com/genie.mp3

what song is this

I'd learn PHP but I don't want to do LAMP and that's a lot of the jobs.

Copied and pasted this code but it shows up like pic related, any ideas why?

Male

Female

Other

Attached: file.png (214x125, 4K)

That's awesome to hear user, good for you, mate.

Aparrently it has to do with the css, but I have no idea how to fix it, removing it entirely seems to do the trick

best book for learning javascript?

Lets say I have a regular old Django MVC app, if I just add sterilizers for my app, could I build a React.JS front end without touching the rest of the code (leaving the rest of the site running as is)?

Do you have a database set up? Depending on how your forms are laid out it might be best to have all that data in a database and generate the forms from that.

what's the best way for me to pick up react as a vanilla/jquery guy? i wanna do more full stack but everywhere requires react, and I don't have any pro experience yet.

Congrats bro! How long have you been learning?