[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

/wdg/ - Web Development General

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 321
Thread images: 48

File: 4.png (868KB, 822x552px) Image search: [Google]
4.png
868KB, 822x552px
Previous thread >>59878632
>Discord
https://discord.gg/wdg

>IRC Channel
#/g/wdg @ irc.rizon.net
Web client: https://www.rizon.net/chat

>Learning material
https://www.codecademy.com/
https://www.bento.io/
https://programming-motherfucker.com/
https://github.com/vhf/free-programming-books/blob/master/free-programming-books.md
https://www.theodinproject.com/
https://www.freecodecamp.com/
http://www.w3schools.com/
https://developer.mozilla.org/
http://www.codewars.com/

>Useful Youtube channels
derekbanas
thenewboston
learncodeacademy
funfunfunction
computerphile
codingrainbow

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

>Backend development
https://en.wikipedia.org/wiki/Comparison_of_web_application_frameworks
[Gist] backendDevelopmentBookmarks.md

>Useful tools
https://pastebin.com/q5nB1Npt/
https://libraries.io/ - Discover new open source libraries, modules and frameworks and keep track of ones you depend upon.
https://developer.mozilla.org/en-US/docs/Web - Guides for HTML, CSS, JS, Web APIs & more.
http://www.programmableweb.com/ - List of public APIs

>NEET guide to web dev employment
https://pastebin.com/4YeJAUbT/

>How to get started
http://pastebin.com/pDT82mQS
http://pastebin.com/AL6j7GEE

>cheap vps hosting in most western locations
https://lowendbox.com
https://www.digitalocean.com/
https://www.linode.com/
https://www.heroku.com/
https://www.leaseweb.com
>>
1st for it's possible to install Android SDK to work with Cordova for some reason and no tutorial helps at all.
>>
>>59913154
impossible.
>>
Where should I put the recaptcha? Modal?

I need a designer. I have a ton of projects I'm doing and they all look like shit.
>>
Anyone know how to get cordova working?

It's saying it "Error: Could not find gradle wrapper within Android SDK. Might need to update your Android SDK"

I have the most recent android sdk.
>>
>>59913878
Uninstall Cordova when you reinstall make sure it's the most recent version
>>
>>59914020
I just did npm cordova -g update and I'm having the same issue.
>>
>>59913878
Did you tried everything listed in the stackoverflow threads?
https://forum.ionicframework.com/t/error-could-not-find-gradle-wrapper-within-android-sdk-might-need-to-update-yo-ur-android-sdk/22056/5
>>
>>59914443
It worked! That tools download fixed everything, it built the app.

Thank you so fucking much. No idea how I didn't come across that thread when searching for fixes.
>>
So how come limit doesn't work when doing this?

$result = mysqli_query($con['main'], "SELECT * FROM ".$database['1']." WHERE ".$wherethis." ".$wildcard." '".$search['term'].$endwildcard."' LIMIT".$limit."");
>>
File: IMG_1671.jpg (108KB, 900x522px) Image search: [Google]
IMG_1671.jpg
108KB, 900x522px
>not using cgi and writing your backend in c
>>
>>59915103
what's in $limit?
seems like you're missing a space after LIMIT as well.

besides, use parameterized queries anon, don't plop them together like this.
>>
What are some general trends right now? More and more mobile instead of desktops/laptops in the coming years? More video-based content than text-based?

I'm a total newbie
>>
>>59916542
Yeah lol that was it. I let users set their own limit inbetween 100 and 100,000, so a number.
>>
>>59916784
parameters, anon.
https://en.wikipedia.org/wiki/SQL_injection#Incorrectly_filtered_escape_characters
>>
>>59916790
Yeah I already filter everything separately. Hence no _GET or _POST in the query itself
>>
File: angry_pepe.jpg (65KB, 900x900px) Image search: [Google]
angry_pepe.jpg
65KB, 900x900px
When your DBA at work doesn't comply by Normalization rules, doesn't enforce table relationships and thinks it's a good idea to let foreign key columns have nulls...!!!!
>>
Hey I have a weird thing happening on Heroku:
>push dummy commit
>request index page
>all good
>request dummy page which just lists all entries in a table
>get SQL connection exception
>refresh
>exception gone

Anyone get this before? It's Heroku Postgres if you're interested.
>>
>>59919035
I had that kind of client once. 4 months later we ported an intranet for a new customer, who then required a normalized database, and somehow it was my fault.
>>
>>59919035
>>59919281
Jokes aside don't do foreign keys and constraints lol. Huge performance impact where you could just enforce the rules in the software and retarded clients will want exceptions to those restrictions.

/s Microsoft did this in all of their Dynamics-family products
>>
File: file.png (42KB, 1920x1080px) Image search: [Google]
file.png
42KB, 1920x1080px
in typescript, how can i have duplicate identifiers across separate files?

it seems to think all scripts in the project are going to be ran at the same time

i'd be happy with being able to turn off "auto-include every file" and using
/// <reference path=""/>
to reference files in a sane way but i don't know how to do that

having
"include": []
in tsconfig disables checking altogether which isn't what i want

>just use modules/namespaces
i'm using typescript in javascript mode and surely there's a solution that doesn't require added code and complexity and compilation steps
>>
>>59919191
No, but I had SQL exceptions with Heroku before. It was usually caused by the connection limit being reached.
>>
>>59919530
That's weird I would assume there's only one connection from my app. Do you know whether they are reusing the servers for multiple instances of the Postgres addon?
>>
>>59919368
what are you trying to do?
each page has its own Section object?
Why not make a class which contains the object and create a new instance of it for every page
>>
>>59919368
Stop using typescript. It's a cuck lang.
>>
>>59919598
i was hoping the contrived example would make sense

i just have two things named Section that serve different purposes and can't even exist in the same page/context

it's b*llshit how i can't use the same name for them even though they can't clash

>>59919633
well meme'd friend
>>
>>59919368
Stop blinding yourself.
Stop using typescript.
Find better things to enjoy in life.
>>
>>59919368
>>59919850
that's unrelated to typescript, but how vscode treats files in the same directory as one project. you can set it to file scope, so it treats each file on its own.
https://code.visualstudio.com/docs/languages/typescript
now how you actually set it to that I don't know, I don't have vscode.
>>
Trying to grab the content of the data-expanded-url attribute. What am I doing wrong? Pls help

http://jsfiddle.net/GwgDN/64/
>>
>>59919985
>Uncaught ReferenceError: myFunction is not defined

who taught you to use onclick attributes?
especiall yon jsfiddle the entire script you enter is scoped, so you can't access those from outside, use addEventListener.
>>
>>59919985
>>59920008
to continue on that, did you even look at your console output?
>uncaught TypeError: document.getElementByTagName is not a function
there's only getElementsByTagName.

learn your development tools.
>>
What podcasts do you listen to when you're programming?
>>
>>59920071
I always listen to judge judy in the background.
americans sueing each other for trivial shit is hilarious.
>>
>>59920071
I don't listen to podcasts while programming because it's information overload and one of the two winds up being half-assed.
I only podcast while doing actually monotonous tasks, such as cleaning, exercise, or gaming.
>>
I have to build a file based php mysql gallery upload system and the images are stored on
my file system/server but the user uploads them with a description.

I've got no idea how to link the images they upload that are stored on
my file system to the description which the user then uploads to my MySQL server.
Is there a way to bind or link the data so when I display the image I relevant description.
>>
>>59920102
generate a guid for the image and save it as such, save the guid and other image information in the database.
>>
>>59919035
He is right though. High level of normalization is retarded. You need to design a DB by identifying what queries you'll be running and optimizing the DB layout to run these queries more efficiently. You don't need to compact your data like it's 1975 and your HDD takes a whole room and it needs 3kW of power.
>>
>>59920139
>tfw you ask your client
>tfw "We don't know."
>tfw "We've been in production for 30 years and have no way to check."
>tfw "Nope you may not get readall/sysadmin rights on the database."
>tfw "That's why we hired you! To magically figure everything out and fix our problems forever."

And as a bonus:
>tfw @ Uber and switching databases every 6 months because we're retarded
>>
>>59920124
Wouldn't this mean changing the filename for the image.
What if I wanted it to remain the same how would I link the GUID to the image then
>>
>>59920102
DB:
img_id: 1, desc: lorme ipsum

filename: 1.jpg

tada
>>
>>59920192
why would you want to keep the filename?
it doesn't matter how you save it on your disk.
you are saving the original filename in the database anyway and can return it the original filename from your backend.
>>
>>59920102
You have 2 major options:
1. Save the image in the DB as a BLOB and save it's data in the same row; file type, file name, description. This will allow you to have multiple files with the same name.
2. Generate a UUID like >>59920124 wrote. Then rename the file with this UUID and save it in the file system.Then save the file name and description in the DB.
>>
>>59920192
>>59920192

your mysql table should have these columns, which you should fill when an upload is successful

-path_uploaded_to
-guid
-filename
-size
-mime-type
>>
>>59920234
>>59920223
>>59920207
>>59920195
>>59920192
>>59920124

Thanks lads, in the right frame of mind now to sort this out
>>
PHP > others
that is a fact, not a bait desu
It is so natural way of programming
>>
>>59920382
how do I php
>>
>>59920425
You kill yourself. Just use some sane framework if you really like drowning in shit.
>>
>>59920382
>It is so natural way of programming
let me guess, it's your first language?
>>
Are there any guitars that have 12 strings, but have like a switch so you can mute 6 of them and change between 12 and 6?
>>
>>59920508
/g/ - guitars
>>
>>59920508
try >>59918807 >>>/wsr/ or >>>/mu/
>>
>>59920508
No
>>
>>59920508
>>>/mu/
>>
>>59920508
That would sound like shit because you would keep hitting the additional 6 strings every time you strum.
>>
>>59920463
3rd desu

I started with c->c++>java and then ->php

Which one is the best according to you?
>if you are thinking js pls dont reply to this post.
>>
>>59920535
>>59920528
>>59920538
Shit, I forgot I wasn't in /gg/
>>
>>59920549
>>if you are thinking js pls dont reply to this post.
who are you quoting?
>>
>>59920571
>who are you quoting?
me

so js it is, you must be some hipster faggot
>>
File: anime.jpg (32KB, 640x360px) Image search: [Google]
anime.jpg
32KB, 640x360px
>>59920602
it's a nice language once you actually learn it

not that an unenlightened PHPeasant like you would know
>>
File: php vs js.png (87KB, 987x383px) Image search: [Google]
php vs js.png
87KB, 987x383px
>>59920709
no it is not nice
>>
File: logo-php-adbac78231.png (343KB, 2000x1371px) Image search: [Google]
logo-php-adbac78231.png
343KB, 2000x1371px
PHP is the best backend language ever written. Prove me wrong.

>inb4 b-b-b-but what about muh frontend language that some retard decided to use for backend
>>
File: ss_002.png (66KB, 994x605px) Image search: [Google]
ss_002.png
66KB, 994x605px
>>59920757
my negro <3
>>
Guys how hard would it be to build something that

1.scrapes information off ebay like buyer email address + quantity

2a.Creates login details from the browser Webmin of a server by entering 3 different strings and selecting 1 option from a drop down menu
2b. Downloads a string and a zip file.

3. Create an email from a template, enter in scraped Ebay email address + downloaded string + attach zip file.

4. Once email sent, send email, leave feedback and mark as dispatched in ebay.

I know basic bitch programming but not done it in years so don't really know where to start. How hard and length a project would this though and if I were to do it what languages and programs would I need to be up to speed with?

The only program I am any good with is excel...
>>
>>59920924
It'd be extremely easy. Try it in Webassembly.
>>
>TFW we have no foreign keys in our database because "They make development slower".
Developers who don't understand technical debt should be shot. Out of a cannon.
>>
>>59921025
no relationships, some people take them hard :'(
>>
Why are there so many JS frameworks?
Why can't we just make one framework that solves everyone's problems?
>>
>>59921082
because js is for hipsterfaggots
hipsterfaggots like to be different so they will always try to bring something new, even if that new is shit
>>
>>59920847
>curly brackets for single lines

REEEEEEEEEEEEE
>>
>>59921125
class
{
function
{


if{
else{
for{
while{
switch{
etc{

only when is class and function
>>
>>59921082
Because that isn't how anything works in the real world? In which scenario has "one solution" effectively worked for everybody? Truly curious.
>>
>>59920847
you could just run ffprobe instead of ffmpeg, it can return all the info as json.
>>
>>59920847
>>59921204
oh never mind, it does thumbnails, whops.
>>
>>59920738
you shouldn't let the internet influence your opinions on things so easily

you're criticizing a language you don't know

>>59920847
what's that thing called where you settle with something bad because you've never tried anything better

or the one where you refuse to try anything new

i think combined with pigheadedness and immaturity they'd describe you well

i don't know how to talk sense to someone who won't listen
>>
>>59921082
everyone has different problems, you don't want one giant framework with everyones edge cases in it.
>>
File: me.jpg (122KB, 1280x720px) Image search: [Google]
me.jpg
122KB, 1280x720px
>>59920847
>class for a single method that doesn't even use any class features
php users
>>
>>59921238
>what's that thing called where you settle with something bad because you've never tried anything better
>or the one where you refuse to try anything new
>i think combined with pigheadedness and immaturity they'd describe you well
>i don't know how to talk sense to someone who won't listen

I tried rails, django and node, i try everything by myself
>>
>>59921259
I like it that way because i dont include any class in file, i use autoloader.
When i type class name autoloader will load it
pls dont be bully
>>
>>59921267
i might be confusing you with >>59920549 if that post isn't yours

i've used php before & i followed some site making tutorial involving node, express and jade once and i can't understand how anyone could prefer manually concatenating and echoing strings and manually managing loops when frameworks (is that the right word) exist
>>
You are not memeing /wdg/? Should I unironically learn PHP?
>>
>>59921566
ofc you should
>>
>>59921566
Of course, but not because of memers.
>>
File: wpengine-freelancer-rates.png (46KB, 735x442px) Image search: [Google]
wpengine-freelancer-rates.png
46KB, 735x442px
How much should I charge for installing a free WordPressâ„¢ theme+plugins
+make them some logo if their's is shit on an existing domain for some small pizzeria or cafe?

I thought of just searching for these in some small towns on yelp/4square/google and if they have a shitty website, send them an email proposing this.

Would they even pay through Paypal?
>>
>>59921566
Its pretty much used for everything and does a lot of the heavy lifting if you have databases.
>B-but facebook uses react
Big websites specialise have javascript specialists and only use it for certain small tasks.
Only use javascript for fancy animations or dom manipulation. Things like form handling is much better in PHP
>>
>>59919338
You are joking, right?
>>
>>59919368
Creating global variables is almost always stupid. Wrap that shit in an IIFE.
>>
>>59913147

I am trying to make it so a raspberry pi with no javascript can connect to Micky D's Wifi.

This wifi is free, and all you have to do is hit a button and then it whitelists your mac address.

The HTML of the page that has the button has a form.

The form looks like this by default:

https://pastebin.com/9jH4Fnne

I have tried reading the form, copying its data to a new form with no onSubmit field, and then submitting it but that didn't work.

Feels like that was a shitty hack. My question is: what is the right way to do this?
>>
>>59921082
https://xkcd.com/927/
>>
>>59921741
can't use them in other files that way

i ended up renaming the other Section
>>
What are typescript postscript and coffeescript actually used for?

Are they just meme langauges for people who dont wanna use javascript.
How would one use them when their are so many javascript frameworks would they accept the language
>>
File: asdasd.png (69KB, 617x309px) Image search: [Google]
asdasd.png
69KB, 617x309px
Who /ELIXIR/ here?
>>
>>59921758
I'm assuming the validationHash is generated when the page loads once, so you'd have to get the correct value from the actual page beforehand every time.
without JS or any other language, forget it.
>>
>>59921771
Is it comfy?
>>
File: Neet_pepe.jpg (45KB, 409x409px) Image search: [Google]
Neet_pepe.jpg
45KB, 409x409px
Comfy general desu
>>
>>59921770
they transpile to javascript, it's just a little different on how you write your things, the outcome is plain js.
>>
>>59921771
>>59921800
I refuse to use Elixir for any complicated application until it gets a good IDE or debugger.
>>
>>59921784

So you are saying I need to recalculate the validation hash?

Would the hash be generated from the JSON of the form data?

I'm trying to do it in python. I can cope with any language though.
>>
>>59921770
>typescript
it enforces types

>their are so many javascript frameworks would they accept the language
https://github.com/DefinitelyTyped/DefinitelyTyped

most popular-ish javascript things have type definition files for them, and you *are able to* use plain javascript files with typescript but there isn't much type information in them so it can't do much type checking around them
>>
>>59921841
no, you just grab the hash.
open the page, read out the hash and session cookies if any.
then post it with the other information to the target page.
>>
any way to get free credit on digitalocean (already used a ten bucks code) or namecheap? im a cheap bastard
>>
>>59921913
if you have no income at all that you could put aside you're either underage or homeless
>>
>>59921859

> no, you just grab the hash.

My current script that doesn't work grabs the hash from the form.

> open the page, read out the hash and session cookies if any.

I don't understand. What would I do with session cookies? How do I debug/view them?
>>
>>59920738
Do you know where that image came from?
>>
>>59921913
get hostsailor vps, it is only 1.99$
>>59921960
yes, from article which describes why php succ :D
>>
>>59921950
the hash is (probably) bound to the session.
how you get it in python? I don't know, check the docs of with whatever you read out the page to get the headers sent by the server.
>>
>>59921913
ramnode has pretty cheap vps options
>>
File: elix.webm (253KB, 1558x426px) Image search: [Google]
elix.webm
253KB, 1558x426px
>>59921800
it's so comfy it makes my dick hard, i'm not even joking.

>>59921811
tests/doctests are built into the language
and you can debug with iex shell. you can call each function manually within the shell, you can even call functions in a server app while it's running. see pic
plus https://github.com/vishnevskiy/ElixirSublime this sublime package has code completion and error highlighting.
>>
>>59921808
I just pushed a commit which got rid of the comfy, should be live soon tbqhwyf
>>
>>59921658
FB still uses php quite a lot. Tommy went on a podcast recently and was talking about it and how people get so fucking retarded when it comes to frameworks.
>>
>>59922393
What would you recommend for learning Elixir?
>>
>>59922445
I'm currently doing https://www.udemy.com/the-complete-elixir-and-phoenix-bootcamp-and-tutorial/ it's not free but worth it . definitely got me started. and I've never done functional programming before.
>>
>>59922429
exactly they still use php for the majority
it's just react for smaller tasks and bits here and there
people act as if facebook is a real react app smilar to their shitty project on github using redux for the first time
>>
>>59922393
Dude, I know Elixir inside and out:
- tests won't catch actual bugs regardless of language
- iex for debugging is insane especially when trying to figure out race conditions between processes
- a plugin that gives you snippets/autocompletion is useless when you know your way around the stdlibs and hex packages already

The Erlang/BEAM built-in debugger and observer modules also have trouble when working inspecting in-between processes.
>>
>>59921811
>>59922393
The thing I like the most about Erlang/Elixir is how it crashes the whole process when no patterns are matches and does not let you know what the value was so you can add the missing pattern clause easily. What you have to do is add a:
>x -> x |> IO.inspect
clause and recompile the whole application and wait for it to happen again.
>>
>>59921655
$20+/hr
>>
>>59922393
>>59923009
Also,...

...the incompleteness of the Erlang2Elixir stdlibs. E.g. when you're starting out you have no idea the :module modules exist and can randomly guess and Google issues. Random :math methods being mapped to the Kernel module is ridiculous but, for example, you want to start out with Elixir and make a telnet server? No problem:
>:gen_tcp.listen(5000, [:binary, packet: :line, active: false, reuseaddr: true, exit_on_close: true])

...or pattern matching maps is also ridiculous: on one hand tuples and lists retain order but maps don't so when half the functions don't have a return type specifiec and/or you're using one of the many Hex packages that randomly interchange between tuples and maps you're fucked:
>{:ok, x} = {:ok, 3} #=> ok
>{:ok, x} = {3, :ok} #=> fuck you
>[1, x] = [1, 3] #=> ok
>[1, x] = [3, 1] #=> fuck you
>%{1 => x} = %{1 => 2, 3 => 4} #=> ok
>%{2 => x} = %{1 => 2, 3 => 4} #=> fuck you
>%{3 => x} = %{1 => 2, 3 => 4} #=> ok because fuck you
And of course:
>{:ok, x} = %{ok: 3} #=> fuck you: ** (MatchError) no match of right hand side value: %{ok: 3}
>>
does /wdg/ hate angular?
>>
File: asuka.jpg (198KB, 1100x944px) Image search: [Google]
asuka.jpg
198KB, 1100x944px
what are some good examples of sites I can examine the code of and learn that way?
>>
>>59923991
https://www.w3schools.com/html/html_examples.asp

https://www.w3schools.com/css/css_examples.asp

https://www.w3schools.com/bootstrap/bootstrap_examples.asp

https://www.w3schools.com/js/js_examples.asp
>>
>>59924043
nice job reading their post
>>
>>59924329
>what are some good examples of sites I can examine the code of and learn that way?
>nice job reading their post

>I post examples

yeah, thanks friendo, np
>>
>>59913147
>https://programming-motherfucker.com/
Why is this in the op? It's shit.
>>
>>59924405
>>59924043

No I meant like an actual website that I would be creating as a web developer, like I don't know a pizza website
what are some really well made ones, that will make me think
>>
File: file.jpg (157KB, 800x868px) Image search: [Google]
file.jpg
157KB, 800x868px
>>59924405
>"sites I can examine the code of"
>posts a site with unrelated code examples

epic /pol/ gif dude
>>
>>59913147
Everybody seems to hate on PHP, but the more I use it, the more I learn to love it.

The other day I found out about PHP's DOMNode class, and was able to use that and DOMXpath to create a parser and api front for another website that only renders out non-wellformed html.

Today (and yesterday) I've been working on using systemd-udevd with php to create a system-of-scripts that'll automatically detect whenever I plug my phone in my computer, and when I do, it'll automagically find the mtp mount, grab my samsung health data, backup the data, parse and reformat the data, and create a new representation of the data. Then it will copy the new representation to my website.

So basically using udev and php, Im effectively creating a system that will create a new 'Workout Results' page on my website, and the only thing I have to do is plug in my phone. That's it. I plug in my phone, and udev, gvfsd, and my scripts take care of everything. Even the publishing to my website (because I have a sshfs mount setup in /etc/fstab).

Tell me that isn't cool.
>>
tripfagging rots your brain
>>
>>59922706
It's just weird how people think these frameworks are supposed to be one stop shops. They were never such. That's how they become bloated shits. Instead, these frameworks are established to solve an internal problem the company has and if they desire, they release it into the wild. Facebook isn't suddenly going to use that one solution for a specific problem literally everywhere possible, they aren't reinventing wheels that work for them unless necessary.

It's why all the "what language..."/"what framework..." nonsense is such garbage. Use what works for your problem, don't create problems by choosing a framework before hand.
>>
>>59924492
>system-of-scripts that'll automatically detect whenever I plug my phone in my computer, and when I do, it'll automagically find the mtp mount, grab my samsung health data, backup the data, parse and reformat the data, and create a new representation of the data

that's the cool part senpai, not using php for the logic
>>
>>59924898
It's cool that PHP is versatile enough to be handled in this way. People think of php as that old hypertext preprocessor and always think of really shitty php code.

A lot of the haters fail to realize that php is actually a pretty nice, dynamic language that can be used in a multitude of scenarios. It's not just a web development language.

It's cool that I can add a shebang to my php file, and have the php script called directly from my udev rule, and it automatically picks up all the udev environment variables. No wrapper script necessary.

It means, for all intents and purposes, php can be used anywhere a shell script could be used.

And unlike shell, php is object-oriented. Which can make things much easier, in certain scenarios.

I just think its really cool i'm able to do all processing in php, even though this would traditionally be done in shell.
>>
How the fuck do I do a bunch of api calls in sequence with JS? I have an array of items and I need to call an api to get info for each one. If I just go through them with a for loop, the http requests are executed synchronously and I hit the api's rate limit before I get through them all. How can I call a function and then wait a certain amount of time before calling it again on the next item?
>>
>>59924479
https://github.com/bradfrost/Mobile-First-RWD
Your imagination when looking for the best example is the limit
>>59926392
This is when you learn about Promises, async and await.
>>
>>59926392
https://jsfiddle.net/kaw3y1mq/
>>
>>59926477
>>59926645
This is exactly what I needed, thanks. I've used Promises before but not async/await. 90% of the time I just fuck it up and get syntax errors, and almost all the tutorials I can find online are for one of the billion 3rd party libs that all seem to implement them slightly differently, and not the official spec.
>>
where can I find advance react projects or dev projects, Ive done projects with database get and manipulate data im looking for a project tht would really impressive compannies, if not I might go learn to make a phone application
>>
>>59927807
i'm making one i'll show you when i'm done ;^)
>>
hi wdg, I'm working my way through learning web dev right now and I'm wondering if I should switch to an ide? I hear mixed things and I don't really know. I'm using notepad++ at the moment
>>
>>59928139
Depends if you like to take it easy.
In visual studio i like.. do this:

select>option*5

And it auto generates a select with 5 options, or i do:
<bs-[snippet]


And it auto generates for example a carousel on bootstrap.
>>
>>59916192
Are C backends retarded?
>>
File: 1371288520977.jpg (10KB, 250x237px) Image search: [Google]
1371288520977.jpg
10KB, 250x237px
Do full-stack devs really exist anymore or have they become magical magical unicorns?
>>
>>59929526
how do you even be a fullstack dev anymore? The stack is like 5 miles high
>>
>>59929545
Exactly :c
>>
File: memelang.png (157KB, 515x656px) Image search: [Google]
memelang.png
157KB, 515x656px
>>59929526
if you consider someone who can use rails or node.js along with any of the popular frontend frameworks then there are tons of them.

the guys who actually the popular libraries have almost always been specialists though. barely any front end js guys even have a clue how node streams work or how to handle file uploading on the server.
>>
>>59929526
They exist. Extremely popular in SV and startups.

>>59929545
The stack isn't any higher.
>>
A tutorial to get me started using the nodejs meme anyone? idk any language yet
>>
>>59929974

all these fucking people who think they want to be web devs

but they can't fucking use google or stack overflow?

you're not gonna make it faggot
>>
How the hell do i set up a "singleton" in javascript?
I'm coming from C++ and im trying to get some simple paradigms set up

I cant understand what "this" refers to at any given moment like when adding a "function-object" member or variable
>>
So I know it's bad to edit a live website, so I was wondering how to go about editing my website offline and then pushing those edits to the live site.
>>
>>59926392
var users = [
"john",
"tim",
"jack",
"susan"
];

var userData = {};

for (let i=0; i<users.length; i++){
(function handleUserIndex(ind){
var usr = users[ind];
var delay = (ind * 800);
setTimeout(function doApiCall(){
TheApi.getInfo(usr).then(function(usrInfo){
userData[usr] = usrInfo;
if (Object.keys(userData).length == users.length){
console.log("Data for all users has been retrieved.");
console.log("We should now execute a callback or something");
}
});
}, delay);
})(i);
}


Simple example that spaces the api calls out 800ms apart. It can also detect when we've got the data for all the array items.

If you want to do things *properly* then you should use promises. To ensure each API call executes only after the preceding api call has finished. And that could get a bit complicated.

The simple example will be good enough for most use cases. But if you're obsessive, and want to only do things in the best way, then again, use the promise api to ensure that each call can not execute until the preceding one completes.
>>
>>59930633
Have a local web server where you test things before pushing it into production.
>>
>>59930633
FUCK IT WERE DOING IT LIVE, FUCKING THING SUCKS
seriously just dev in prod dont be a bitch
>>
>>59930180
I'm going to make this really simple for you.

ONLY use 'this' in combination with constructors.

function doStuff(){
this.color = "red";
}
doStuff();

// you just fucked up. You used 'this' in a regular function call. You effectively did:
// window.color = "red";
// this refers to window


function Car(){
this.color = "red";
}

var myCar = new Car();

// You did alright. You used 'this' in a constructor function, which was then used to construct an object.
// this refers to the object that was being constructed. You effectively did:
// myCar.color = "red";


In short:
If you're calling a function, 'this' refers to the window object. You're setting global variables.
if you're instantiating an object using a constructor function, 'this' refers to the object being constructed.

You can also use 'this' when adding functions to an object's prototype, but I wouldn't worry about that right now. Start with constructors, worry about prototypes later.
>>
>>59930755
>declaring a functoider in a lizzie
r u ok?
>>
>>59930873
and what if you wanted to add a method to Car?

is the top-level "this" the "window"?
>>
>>59930883
Immediately-Invoked Function Expressions are the bomb. Especially ones with names.

Why did I use an IIFE?
function createCoolShit(){
// stuff
}
var people = [ 'tom', 'jones', 'harry' ];

var storageChest = {};

people.forEach(function(itm, i, coll){
storageChest[itm] = createCoolShit();
});


The above may seem all great. But after you're done giving each person cool shit, your function remains. You declared the function. It is now exposed to the rest of your script. Do you really want that?

var people [ 'tom', 'jones', 'harry' ];

var storageChest = {};

people.forEach(function(itm, i, coll){
storageChest[itm] = (function createCoolShit(){
// stuff
})();
});


The above code actually is great. You give each person some cool shit. Once you're done, your function is effectively gone. Nowhere else in the script can you call 'createCoolShit'. When you use an Immediately-Invoked Function Expression, you're basically declaring and executing a function that will only exist while it is being executed. Once execution completes, the function is gone.

Unless you do something during execution which exposes the function. (Which you CAN do)

Also, if you give the IIFE a name, then that info is still available. It doesn't have to be anonymous.

Consider:
(function makeCoolShit(param){
var _A = arguments;
if (param == undefined){
return new _A.callee('cherry');
}
else {
this['filling'] = param;
}
})();

The above will return a new object of type 'makeCoolShit' with a property 'filling' equal to 'cherry'.

It may seem like an anonymous function, but when you're within the execution context of the function, it is effectively a normal function. Which can be referenced and even called like a constructor function.

So you can effectively use the function to construct an object, just like a named function, but when its done executing the function goes away.
>>
File: code.png (24KB, 601x344px) Image search: [Google]
code.png
24KB, 601x344px
Having some trouble with an XMLHttpRequest. For some reason when I (purposefully) kill my server and then try to use this function from the page that is still in the browser, the ontimeout event is never triggered. I can't see anything wrong but I might be codeblind having looked at it for too long. Any pointers?

Can't post the code because it looks like spam apparently.
>>
job interview tomorrow

wish me luck boyyyyyssss
>>
>>59929703
>>59929545
>>59929526
interesting, i would have asked if non-fullstack devs still exist. I write on a React + Nodejs stack and also work on our AWS platform. Does this not count as full-stack? Isn't this the expected function of nearly every new developer?
>>
>>59930940
"this" is an idea. A keyword. A thing which changes depending on where it is used.

'this' is the window object in all cases that are not constructors or prototype declarations.

You can capture the value of 'this' and save it for later use.

function Car(){
var _I = this;

this.color = "red";
this.odometer = 0;
this.passengers = [];

this.startDriving = function travelDistance(){
_I.driveInterval = setInterval(function addDistance(){
_I.odometer += 1;
}, 60000);
};

this.stopDriving = function stopTravels(){
clearInterval(_I.driveInterval);
};

this.addPassenger = function addPerson(name){
var Person = function Person(){
this.name = name;
};
_I.passengers.push(new Person());
};

}

var myCar = new Car();
myCar.addPassenger('Tom');
myCar.startDriving();


Unless you override the variable somewhere down the function chain, then _I will always be equal to the car object. The value of 'this' will be equal to the car object everywhere, except in the addPassenger method. Because in the addPassenger method, you're declaring a new constructor-function, then using it to instantiate an object. Within the Person function, the value of 'this' is equal to the person object. Everywhere else, the value of 'this' is the car object.

However, even in the person function, the value of _I is the car object.

Sorry to make it complicated. But just try to remember:
- Only use 'this' in constructors
- The value of 'this' is equal to the object being constructed. The value of 'this' will always be that of the inner-most constructor. So if you've got a constructor being called within a constructor, the value of 'this' refers to the nearest constructor.

I hope I haven't made it more confusing. I remember when I was first trying to understand the concept of 'this' and it took me quite a while to get it.
>>
>>59931009
The only thing I notice is that you're calling JSON.parse on an object.

callback( JSON.parse(resp) );


within the ontimeout function should be:
callback( resp );


Unless you want to convert resp from an object to a string, then JSON.parse would work.

This probably isn't an answer to your problem, but I dunno, an error in the ontimeout function could be causing it to halt execution prematurely, making it look like it was never fired.

Do you have the console open? Are you seeing any errors?
>>
>>59931154
Thanks I'm starting to get a hang of the paradigm. Basically the "new" operator creates a scope in which every "this" under its callstack will be modifying some newly allocated dynamic memory.

so going
var myCar = new Car() will bind "this" to some new memory and all modifications to "this" under "Car()" will be editing this new memory which eventually gets assigned to "myCar". The most-top-level "this" is the window object.

so if I wanted to make a singleton like some dominant "context" object would I do something to the effect of

var Session = new (function(){this.blah="blah"})();

?
>>
>>59931234
>the "new" operator creates a scope in which every "this" under its callstack will be modifying some newly allocated dynamic memory.
Yes. I think you're getting it exactly.

>var Session = new (function(){this.blah="blah"})();

That definitely works.
You can also get even crazier. Like, you're constructing Session with an anonymous function. So the Session object will always just show up as 'Object' in the console.

However, if you give a name to that IIFE, then your Session object will show up in the console as an object of type $name.

Try this in your console:
var Session = new (function(){this.blah="blah"})();
console.log(Session);


Then try this:
(function runApp(){

var sampleConfig = {"pie": "cherry"};

var Session = new (function Session(t){
this.blah = "blah";
this.appConf = sampleConfig;
this.time = t;
})(Date.now());

var pub = {
"YourSession": Session,
"appFunction": arguments.callee
};
return pub;
})();


Remember to play with this stuff. If you're using chrome, you can do it right here in this thread.
Just press F12. If the console isn't on the bottom, you may need to go to the settings menu and hit 'show console drawer'.

Then just inject code into the console, and click around on the output to play with it.
>>
File: timing.png (5KB, 422x130px) Image search: [Google]
timing.png
5KB, 422x130px
>>59931222
You're right that should be stringify, I didn't get past the first iteration when I noticed nothing was going to console.

The POST is being created and sent ok, but all I get in the debugger is the following. The first two are successful before I kill the server.

POST XHR http://XXX/sub/delete/1 [HTTP/1.1 201 Created 317ms]
POST XHR http://XXX/sub/create/1 [HTTP/1.1 201 Created 281ms]
POST XHR http://XXX/sub/delete/1 [1374ms]
>>
>>59931383
>>59931222
I just lowered the timeout to 1000ms and it went in there fine...
>>
>>59931403
OK, i'm a fucking idiot.
If it can't find the site the problem is a timeout, but an error. I had some code attached to the error event but not onerror.

    req.onerror = function() {
console.log('error');
}
>>
>>59931234
>>59931374
And just to really fuck with your brain, there's another way to change the value of 'this'.

Function.apply method

I'm a terrible person.
>>
>>59931560
so do most people generally do something like

...
function Honk()
{
var Instance = this;
...

and use the "private" variable "Instance" rather than "this" so that methods can work

like if I have a

var PrivateVariable;
and a

this.SetPrivateVariable = function(NewValue){Instance.PrivateVariable = NewValue;}


is this how it's usually setup?

I figure once the constructor is over then "this" is just whatever "this" happens to be when
myHonk.SetPrivateVariable(5); is called rather than the actual myHonk instance
>>
So I asked in a Web Dev general yesterday related to a Javascript script I was running on my portfolio that I am currently making.

I am currently using bootstrap to make full-screen divs and classified those by their own specific id. I wanted to make multiple "next" buttons to scroll automatically to each specified div id.

<script>
$("button").click(function(){
$('html,body').animate({
scrollTop:$("#divid").offset().top},
'slow')
});
</script>

However, whenever I reuse the script to simply change the div id, but that causes the first button running the script to scroll to every specified div id. Is there a way to use this script to ONLY scroll to each specified div id or should I scrap it and try to figure out a different way?

Thanks.
>>
File: 7968114-3x2-700x467.jpg (45KB, 700x467px) Image search: [Google]
7968114-3x2-700x467.jpg
45KB, 700x467px
>>59913147
>material-ui@next is a million times better than the stable material-ui
>can't use beta branch in production
>codebase is totally different
>let's just build a fuckup now and we'll rewrite it next month
>JUST
>>
>>59931620
>I figure once the constructor is over then "this" is just whatever "this" happens to be when
myHonk.SetPrivateVariable(5); is called rather than the actual myHonk instance

Not exactly. If i'm understanding what you're saying, then you're thinking about it sort of in the wrong way.

'this' does not change over time. 'this' does not change in accordance with 'runstate' or anything like that.

'this' changes by context.

Also remember that in js variables are passed by reference, not by value. This may be part of the confusion.

function Honk()
{
var instance = this;

this.lastSetOn = Date.now();

var PrivateVariable = {"sampleValue": null};

this.SetPrivateVariable = function(NewValue){
PrivateVariable.sampleValue = NewValue;
instance.lastSetOn = Date.now();
return this;
};

}


Even when the constructor is over, the 'this' will always be the myHonk instance. At least, in all the code above.

You may have a Car object, who's "this" value is the car. And you may start driving the car, and doing all manner of other things while operating on car's "this".

But when you call myHonk.SetPrivateVariable(5), both 'instance' and 'this' will be set to the myHonk instance.

It's really important to understand: 'this' changes by context. (in the code)
It does not change over time. And it does not change in any relation to code execution state.

I'm not sure if i'm explaining it well or not.

As far as convention, usually people will create a variable reference to 'this', usually called either "me" or "_I" or something similar. They create this reference not because 'this' is expected to change, but rather, because it allows them to ensure they always have a permanent reference to 'this', even if they need to reference the instance within a nested constructor.
>>
>>59931620
>>59931859
I also wouldn't exactly say that anything bound to 'this' is ever private. Quite the opposite actually. 'this' is bound to the object instance, making it very public.

When you need to create "private" variables, what you do is declare a variable that never gets returned. (don't attach it to the object)

When you need to operate on, or in any way access the private variable from one of your methods, you just reference it directly. Closures and Lexical Scope and all that will
take care of making sure you're able to work on it.

function Car(){
var _I = this; // very public car instance
var _D = {}; // data object, which is private (unless we expose it later)
_D.honkCount = 0;

this.honk = function honkTheHorn(){
if (_D.honkCount < 10){
console.log("We honked our horn, scaring the other drivers away.");
_D.honkCount++;
}
else {
console.log("We probably should not honk our horn again.");
}
};

return this;
}


In the above example, our "honkCount" is effectively private. It never gets bound to the object-instance directly, so the user cannot access it. Nor can any outside code.

However, all code that is in the same "closure" or "lexical scope" as _D can access the variable, and work with it.
>>
>>59931829
>there a way to use this script to ONLY scroll to each specified div id or should
Not sure I fully understand what you're trying to do but your code is saying is that when ANY button is clicked, run this code.
>>
this is a block level variable
how hard is it to understand.
>>
>>59931620
One last little example to help make sure you understand the nature of "this".

See screenshot.
>>
>>59931954
It can be very hard to understand for someone who's not familiar with it.

I would say that I have a perfect understanding of how to use "this". I never mess up anymore.

But for the first 3 months I was learning javascript, I just could not comprehend what everyone was talking about, and how to know what the value of 'this' actually was at any given time. And I kept reading articles and code samples and shit all the fucking time. I just wasn't getting it at first.

It was only after LOTS of playing with it, and making LOTS of mistakes that I finally wrapped my head around "this".

And yea, now it seems so very simple.

But when its your first time, it can be tricky. It doesn't behave like a traditional variable. It's not really even a normal variable. Its a keyword that gets a variable substituted in its place at runtime.

Shit's crazy.
Even after all these years, I always make sure the first line in any constructor is "var _I = this;" that way I can start using _I instead of the "this" keyword. Because even with so much experience, the "this" still makes me nervous to use directly. Always worried i'm gonna forget where i'm at in the context, and going to mess everything up by making incorrect assumptions about "this".

So even though I completely understand "this", I'll still always make sure to set a reference variable right away. Just so everything can always be 100% clear.

TL;DR: Don't give the new guy a hard time. We've all been there.
>>
>>59932048
I sounded flippant but what I should have said was you can over explain something. You can explain block level variables much quicker.
>>
Can you use Firefox to develop in all of these meme JS frameworks?
I just setup npm, vue and what not, when I run the dev web server and point Firefox to it, I just get a blank page but when I try Chromium instead it works as intended.
>>
>>59932619
shouldn't make a difference, what did the error console say?
>>
>>59932629
Nothing, it's completely empty. Likewise, it doesn't seem like any data is being sent to the browser at all because when I hit ^U to display the source it's just a single blank line.
>>
>>59932637
seems like some sort of other problem then, try a blank profile on firefox, might be an addon interfering.
>>
>>59932649
That helped, as in, it did not load either but it helped me identify the issue. I have no localhost entry in my hosts files (but rather localhost.localdomain and my hostname), so for some reason my Firefox profile served me about:blank instead of an error that it cannot connect to the server, seems like Chromium implicitly injects localhost domain.

Cheers.
>>
Fucking re-naming Angular 2 to just Angular is the worst thing Google could've done. It's like they forgot how searching for shit works.
>>
Redpill me on firebase
>>
>>59934886
It's a realtime database, authentication, storage and hosting platform. It's good if you're in that sort of thing.
>>
>>59934703
In angular's case, a fuck load has changed making it ridiculous just to find documentation, ideas, projects, and solutions. In other scenarios, renaming it to just [framework] is pretty brilliant.
>>
Can someone point me to a js gallery script that
>allows for pinch resize
>swipe allows to change image displayed
>some kind of api for slide changes
>can be embeeded into an existing div and will not shit out
please help
I've started writing my own but it's a pain in the dick
>>
Writing a single use token api. Is there any already done so I can save time? If not, what does a single use token api need?
>>
>>59935208
This could become a /wdg/ OP image.
>>
>>59935367
you're mean, anon
>>
First for ASP.NET is kinda ok my nigga
>>
File: 1492372908540.jpg (99KB, 450x600px) Image search: [Google]
1492372908540.jpg
99KB, 450x600px
>>59935384
Sry
>>
>>59935395
Fist bump, my nigga.
>>
>>59935395
>>59935447
My negroes
Much more comfy than any js meme out there
>>
>>59935447
>>59935395
>>59935465
As much as I hate ASP.NET I can agree with the last statement.
>>
>>59935465
My nigga what about RoR?
>>
>>59935501
Why the hate though?
>>
File: 20160124022011398.jpg (450KB, 1620x2430px) Image search: [Google]
20160124022011398.jpg
450KB, 1620x2430px
>>59935539
I have to work with it for my IRL job.

It works most of the time and is comfy to use, but every now and then something awful happens.

Ever since Microsoft adopted Agile/Scrum to EVERYTHING they rush to release. MSDN has "TODO" comments instead of documentation. Random bugs appear every now and then. And since HTTPModules cannot intercept a whole request/response anymore (only chunks of 32/64kb) that made our attempts at fixing their bugs quite hard. And when your company has a support license with Microsoft only two things happen: they ask if the bug affects 10k+ users (which it never does because small company) or they say KB[random number] already fixed it and then you install it and it's not fixed.
>>
feel bad bothering you guys for help with what's probably an easy question but I've been racking my head at this for at least an hour now it just won't work.

Basically creating a mock order forum that allows you to buy a few things and then it'll calculate the total cost. The whole thing works except for the total cost calculation I'm trying to do at the bottom does absolutely nothing. Not sure what's going wrong
>>
Does anyone have any recommendation for a script that makes fullscreen scrolling easy to implement and responsive and not laggy?

The only thing I have seen so far is http://alvarotrigo.com/fullPage/ but I am wondering if there are better alternatives out there before I get started with this one.
>>
>>59936507
This is also a good candidate for a future /wdg/ thread.

Overriding user/OS/driver scrolling is bad.
>>
>>59936561
*thread image
>>
>>59936561
>>59936575
I'm only asking because I am throwing together a couple of examples of sites for a family member's business. They will be something super simple that I want done quickly to show them later, which no doubt is faster with some simple .js

Can you link me to any resources for doing it with pure CSS?
>>
File: 1472575474303.gif (3MB, 345x260px) Image search: [Google]
1472575474303.gif
3MB, 345x260px
>mfw php
>>
Hey anyone got an example of an infinite scroll website with an open git I could look at?
>>
I am having an impossibly hard time getting my own CSS to overwrite Bootstrap CSS for things like navbar link color, jumbotron opacity, etc.

I have no idea what I'm doing wrong. I have my personal .css after the Bootstrap .css and everything like that.
>>
>>59939074
are you using the exact selector bootstrap defined its styles or one with a smaller specificity?
the latter one will not overwrite the styles unless you use !important.
>>
>>59939074
https://developer.mozilla.org/en-US/docs/Web/CSS/Specificity
>>
>>59939105
>>59939117
Oh okay I see now. So I need to use inspect on my browser to see what selectors that Bootstrap is using so I can copy them to overwrite it? Wouldn't using
!important
be fine as well since I am using my own .css file that's completely separate from the Bootstrap css?
>>
>>59939197
the easiest way is to give your body (or any other container if you want) an id and then just do
#mybody .bootstrap-selector { ... }

the id should make it more important than any other bootstrap selector.

using !important is frowned upon and you might just dig your hole deeper with that.
>>
>>59939277
Oh okay that makes it much easier than having to dig around for the proper selectors to use.

I have another question if you are familiar with Bootstrap. I have a jumbotron, but I can't seem to change the opacity of it. Even when I set it's background image to a 50% opacity png, its like that png is being layed on top of some inherent white background that jumbotron uses as a default that I can't seem to find anywhere in the code.

For example, I am using a fullscreen background image with cover, and when I set the jumbotron opacity to .5 or even when I use that transparent color png as the background image for the jumbotron, I still can't see the main background behind the jumbotron.

Any ideas?
>>
using AJAX, it looks like its possible to have a button do a POST request with just giving it the type of "button". I don't have to do "submit" type. Should I still do "submit"...? does it matter?
>>
>>59939904
what?
>>
>>59940711

you dont know what im talking about obvs so why even respond jeff?
>>
>>59940743
because your post doesn't make sense, seems like you confuse quite a few things.
first, ajax has nothing to do with buttons.
you can have a click event on any element and do something then, like sending a POST request with ajax.
html on its own needs to distinguish when to actually submit something, hence the input type submit.
>>
>>59940779

ok so i guess the answer is no, i dont need to do type="submit" on my buttons.
>>
>>59913147
hey gentlemen. I need to build slideshow in react. should hold up to 150-200 slides with heavy jpegs/video/audio/custom components. how do i optimize so users' low-spec compy won't choke on 200 slides at once? should i use react-router and put each slide into separate component? what do?
>>
File: dead.png (36KB, 625x747px) Image search: [Google]
dead.png
36KB, 625x747px
Why doesn;t this work
>>
>>59940856
your server doesn't support SSI, server side includes.
>>
>>59940868
okay then what is the easiest way to make an universal navigation bar
>>
>>59940881
if you only have html as an option then use a static page generator, otherwise whatever dynamic language your server supports surely has a similar include option.
if it's your server then you could also enable SSI if it's apache or nginx.
>>
>>59940838

also, i just discovered you DO need to say type="button" if youre not going to do type="submit"
>>
>>59940921
if you want a button, then yes, you need to tell it to be a button.
you could also use <button> instead, same thing.
>>
>>59940936

FAKE NEWS

as i mentioned in the original post, this IS for a button tag, and you STILL need to give it a type="button" if youre going to do AJAX requests.

ex:

<button type="button">jeff, pls go</button>


pls go jeff
>>
>>59941027
you definitely don't need to do this, you're fucking up somewhere else here.
>>
File: whatthe.jpg (6KB, 217x213px) Image search: [Google]
whatthe.jpg
6KB, 217x213px
>>59940856

>tabs for indents instead of spaces
>shtml in 2017
>VS Code
>all those line break tags
>>
>>59941027
ajax has NOTHING to do with buttons you ungrateful brat, check how you add the event to your element instead of spreading bullshit.
>>
>>59941066

I found the shtml solution in google
vs code seems good for me

I used the line breaks to test if my navigation bar was fixed and on top, sorry Im new to this and didnt have any content there, this is a learning project
>>
I'm gone for a week and the gen turns to shit.
Gr8 job everyone
>>
>>59941054
>>59941076

jeff, the button tag by default is set to submit, if i dont give it a type it thinks its a standard html submit button, which fucked up muh AJAX and i'll have to pass the event through the onclick function and do something like
event.preventDefault();
which is gay and a waste of time when i can just give it a type of "button".

jeff.

pls go.
>>
>>59941152
you always should prevent the default event if you handle it yourself, you don't know what other shenanigans the browser will do otherwise.
>>
>>59941066
>sarah memes outside of /v/
truly a time to be alive
>>
>>59941229

theyre everywhere. I found out about it because even techcrunch wrote an article on it

best meme by far in 2017. First ME was good, rest were shit
>>
>>59941194

what do i need to prevent? nothing happens when you specify type="button"
>>
>>59941325
make it a habit to, next time you might not use a button but an anchor or any other element with a default action.
you might not need it now but it makes your code more portable and reusable.
>>
>>59941397

i dont see the point honestly. IT doesn't look like theres any default action for button elements with types of "button", therefore preventDefault() is useless.
>>
>>59941422
you'll figure it out eventually.
>>
>>59941430

no, i wont. If you have an onclick function for
<button type="button">click me</button>
its just a clickable button that doesn't do anything other than what you tell it to do. Youre telling me to make it a habit to prevent default methods from running on something that doesnt have any default methods. Why is this so hard to understand
>>
>>59941027
>/fit/ memes on /g/
just dont...
>>
>>59929526
Why pay 2-4 guys when you can pay one?
>>
Hello anons. Who went to school for development and who taught themselves?

How do you best learn?

I am curious. I'm a math person but this all seems more fun.
>>
>>59942134
That shit is old too.

Do they even say that there still?

/fit/ and /g/ goes hand in hand on the site though.
>>
>>59943443
I taught myself.

The guys at my job that have degrees get way more recruiters messaging them though.
>>
Any equivalents to Django Rest Framework for other languages?
>>
>>59943481

jeff is just so easy to make fun of tho
>>
>>59943836
Does he still pretend he's natty?
>>
>>59940881
if you literally want the minimal viable product just make a navbar.html and load it with jquery's .load()
$( "#NavGoHere" ).load( "/example.html" );


Personally I use webpack html-loader /w ejs and precompile it before uploading.
<% include pages/partials/example.ejs %>



Most people here use PHP. They are scum.
>>
Bump because fuck you
>>
>>59943757
Popular node frameworks include restify, express, and meteor. No python there.
>>
>>59936393
Missing semicolons on 4 of the last 5 lines.

Also postage is undefined?
>>
>>59919985
>http://jsfiddle.net/GwgDN/64/
Selectors like querySelectorAll, getElementsByTagName, etc. all return an array-like object (since multiple elements can and will 'fit' that query). So you need to specify WHICH element of those returned you want. In this case, it's the first one: document.getElementsByTagName('a')[0].
>>
>>59924043
>w3schools.com

Ahahahahahaha.
hah.
>>
File: flat,1000x1000,075,f.u1.jpg (139KB, 1000x1000px) Image search: [Google]
flat,1000x1000,075,f.u1.jpg
139KB, 1000x1000px
>>59913147
Should I learn Node or PHP first? I'm more familiar with javascript but it seems like there's an excess of PHP jobs available out there.

If it helps at all I also know some C/C++ and know basic java syntax. Overall I've been more comfortable with C.
>>
>>59945804
Node's pretty much just JS with a few extra doohickies, like access to the file system and no inherent window object. So I'd say learn it in an afternoon or so.
>>
>>59945804
PHP syntax is a lot like C and its OOP functionality is a lot like Java.

If you're just starting out, PHP is way easier than Node in my opinion.
>>
File: 1446145821387.jpg (417KB, 1920x1200px) Image search: [Google]
1446145821387.jpg
417KB, 1920x1200px
>>59945827
>>59945892
Alright, sounds good. I'll probably start to learn node by building something and then just jump onto PHP after. Thanks!
>>
File: 1420099814802.jpg (13KB, 250x239px) Image search: [Google]
1420099814802.jpg
13KB, 250x239px
I think I'm pretty decent with the software side of asp.net applications, but I wanted to learn how to actually apply it to making a real website rather than one running on the local machine.

Looking at the prices, it seems like the only viable option is to go through some cloud hosting, but that doesn't really give me the experience I want of hosting it myself. MS's site says the basic winserver software will cost like $900 which is way too steep for me just for learning.

Another alternative would be pirating windows server, and that way I wouldn't mind buying a little shitbox just to learn how to do it properly. How risky would this be though? As far as i've heard, ms slams down hard on piracy of their business packages. How doable is this part of the process?
>>
>>59947261
Just enable IIS on some shitty old laptop, enable 32bit applications on the apppool in the iis panel, add port 80 in/out firewall rules, give permissions to the apppool user on the folder you're gonna use and then deploy your app using visual studio or just copy over the compiled and packaged folder.

And if you're gonna use SQL server make sure the protocols are active, including the name pipeline.

Don't really need a windows server for deploying some website unless you're looking to add things like a DNS server, Active Directory or DHCP.
>>
>>59947651
thanks i'll take a gander at this tomorrow
>>
>>59947770
The cloud option is using Azure, which is free and quite literally an instant deploy from VS.
>>
>>59921152
The compasss
>>
>>59947820
i saw that, but i figured it would be good to learn how to do it myself since at some point I would think the cloud hosting would pass the cost of hosting it yourself.
>>
File: 3ahY5oz[1].jpg (29KB, 550x528px) Image search: [Google]
3ahY5oz[1].jpg
29KB, 550x528px
multiple different online shell sandboxes:
http://www.tutorialspoint.com/codingground.htm
>>
HEY WDG.

I'm going to set up my old web shop, selling and web-pages as a living.
Looking for primers on hosting - Ion what to do w/ client's domain name and hosting - suppose I shouldn't do this in my own name.

Right now I'm thinking about using my DIGITAL OCEAN account to host each site. Clearly not a good idea.

Please share your wisdom on this topic of hosting servers
>>
It's a cool place and they say it gets colder
You're bundled up now, wait till you get older
But the meteor men beg to differ
Judging by the hole in the satellite picture
The ice we skate is getting pretty thin
The water's getting warm so you might as well swim
My world's on fire, how about yours?
That's the way I like it and I never get bored

Hey now, you're an all-star, get your game on, go play
Hey now, you're a rock star, get the show on, get paid
All that glitters is gold
Only shooting stars break the mold

Hey now, you're an all-star, get your game on, go play
Hey now, you're a rock star, get the show, on get paid
And all that glitters is gold
Only shooting stars
>>
Somebody once asked could I spare some change for gas?
I need to get myself away from this place
I said yep what a concept
I could use a little fuel myself
And we could all use a little change

Well, the years start coming and they don't stop coming
Fed to the rules and I hit the ground running
Didn't make sense not to live for fun
Your brain gets smart but your head gets dumb
So much to do, so much to see
So what's wrong with taking the back streets?
You'll never know if you don't go (go!)
You'll never shine if you don't glow

Hey now, you're an all-star, get your game on, go play
Hey now, you're a rock star, get the show on, get paid
And all that glitters is gold
Only shooting stars break the mold

And all that glitters is gold
Only shooting stars break the mold
>>
are there any updated methodson how to reduce react bundle size? All the things in google are so 2015. My basic hello world is 144kb minified.

Here's my webpack config:
const path = require('path');
const webpack = require('webpack');
const Promise = require('es6-promise').Promise;

const ExtractTextPlugin = require('extract-text-webpack-plugin');
const extractCSS = new ExtractTextPlugin('[name].bundle.css');

// const HtmlWebpackPlugin = require('html-webpack-plugin');
// const HtmlWebpackPluginConfig = new HtmlWebpackPlugin({
// template: './client/index.html',
// filename: 'index.html',
// inject: 'body'
// });

module.exports = {
context: path.resolve(__dirname, './src'),
entry: {
index: './index.js'
// vendor: ['jquery', 'lodash']
},
output: {
path: path.resolve(__dirname, './dist'),
// publicPath: path.resolve(__dirname, './dist'),
filename: '[name].bundle.js'
},
module: {
rules: [
// extractCSS
{
test: /\.scss$/,
loader: extractCSS.extract(['css-loader', 'sass-loader'])
},
// babel-loader
{
test: /\.js$/,
loader: 'babel-loader',
exclude: /node_modules/
},
// babel jsx
{
test: /\.jsx?$/,
loader: 'babel-loader',
exclude: /node_modules/
}
]
},
plugins: [
// HtmlWebpackPluginConfig,
extractCSS,
// size reducer
new webpack.DefinePlugin({
'process.env': {
'NODE_ENV': JSON.stringify('production')
}
}),
// merge chunks
new webpack.optimize.AggressiveMergingPlugin()
],
resolve: {
modules: [
'../node_modules',
]
}
};
>>
>>59913147

Hey boys.

How does Facebook do it such that I open a chat window at the bottom and then click on pages but the chat windows don't reload? They can't possibly send AJAX requests for the entire page besides the chat window, right? So how do they manage it?
>>
>>59950186
Twitch just added something like this not too long ago too. The video keeps playing on the bottom while the page reloads. Pretty cool. I don't know how they do it though.
>>
>>59950186
Probably with React. The chat is part of the main component that loads its children and the Pages components get changed when you click on stuff
>>
>>59947862
yeah maybe if you're google or amazon.
>>
>>59950186
websockets, react
>>
>>59950186
Its a SPA its not really loading a new page. Instead, its designed to appear as if its loading a new page. The URL changes via html5 history API and the content updates in the main window but you didn't really request a new page its just ajax.
>>
>>59951516
they use long polling. facebook chat was written before websockets was widespread.
>>
What kind of resources would you recommend to get started with web development?
I took a look at those in the OP and they seem either to be of questionable quality or aimed towards total beginners. I already know how to progam reasonably well and am interested in making a small project like a simple message board.
>>
>>59951969
I recommend you start creating a message board and read the resources as you go along. For example, if you decide to use Node, then go on the Node website and read the official documentation and google what you don't understand and so on until your message board is ready. Then move on to the next project or apply for a job
>>
>>59952032
Sounds reasonable enough, I'll get started that way and annoy the thread with anything domain specific I don't understand Thanks.
>>
Its been a little while since I've looked, has apache mono closed the gap with iis yet?
>>
>>59954469
mono is not ready for asp.net

iis has iisnode so it wins by default.
>>
File: 1478947493419.png (5KB, 900x143px) Image search: [Google]
1478947493419.png
5KB, 900x143px
>>59913147
What's wrong /g/?

body {
font-family: 'Ubuntu';
text-color: #1A1A1A;
}

footer {
background: #c1ffe7;
margin: auto;
width: 70%;
display: flex;
flex-direction: column;
}

fieldset {
flex-direction: column;
}
>>
is it bad practice to have lots of classes in php?
When im writing my code i dont include files, i use autoload for classes
Sometimes my class can have 10 functions, sometimes can have 1
Is that good/bad/not important on your opinion?
>>
>>59955028
https://jsfiddle.net/
put it here
>>
>>59955113
I'm sorry, I found the problem (missing <br />). Thank you :)
>>
>>59955072
only drawback to autoload is you need a good naming convention and some stuff renames your files like zend guard. if performance is your concern you should be using caching.

regarding guidelines on functions per class it is never set in stone but the general thought is that smaller is always better

If an element consists of more than 30 subelements, it is highly probable that there is a serious problem:
a) Methods should not have more than an average of 30 code lines (not counting line spaces and comments).

b) A class should contain an average of less than 30 methods, resulting in up to 900 lines of code.

c) A package shouldn’t contain more than 30 classes, thus comprising up to 27,000 code lines.

d) Subsystems with more than 30 packages should be avoided. Such a subsystem would count up to 900 classes with up to 810,000 lines of code.

e) A system with 30 subsystems would thus possess 27,000 classes and 24.3 million code lines.
>>
File: out.webm (164KB, 1074x522px) Image search: [Google]
out.webm
164KB, 1074x522px
>>59932619
Finally got some time this evening to do what I wanted to do yesterday.

I still have to fill the German dict, and maybe add more later, as well as display some replay/settings screen when the timer hits 0 but so far so good.
>>
>>59956318
Looks fun
>>
File: Capture.png (16KB, 219x586px) Image search: [Google]
Capture.png
16KB, 219x586px
Never made a website before, making my first one for a family friend.

He really wants the website in blue, so I was like alright. But, the logo for his firm is all red, so I felt it'd be weird if I didn't use red anywhere else so I made it so the button for the page you're currently on is red, but now I've no idea how I should colour the submenus.

Help lads
>>
isn't all web development just pajeet tier?
>>
File: 20160124022116430.jpg (323KB, 1620x2430px) Image search: [Google]
20160124022116430.jpg
323KB, 1620x2430px
>>59957759
Yep. Isn't that great though? Think about it.
>>
>>59957528
/* Palette generated by Material Palette - materialpalette.com/blue/red */

.dark-primary-color { background: #1976D2; }
.default-primary-color { background: #2196F3; }
.light-primary-color { background: #BBDEFB; }
.text-primary-color { color: #FFFFFF; }
.accent-color { background: #FF5252; }
.primary-text-color { color: #212121; }
.secondary-text-color { color: #757575; }
.divider-color { border-color: #BDBDBD; }
>>
>>59957868
hmmmmmmmmm
>>
Anyone have a good way to check if a given string is a valid URI. I'm using laravel 4.2 and the given validations don't have this by default
>>
File: Capture.png (11KB, 254x627px) Image search: [Google]
Capture.png
11KB, 254x627px
>>59957892
This ended up looking a lot better, thank you anon.

Do you think I should separate the buttons in some way or not?
>>
>>59957528
Use a static website generator and a free theme that you can tweak later
>>
>>59958012
>check if a given string is a valid URI. I'm using laravel 4.2

URL and Active URL are listed as laravel 4.2 validation types maybe you should kill whoever taught you to say URI IRL.
>>
>>59958055
i think your buttons look good for a flat design but maybe a thin line between

really what matters is what google thinks. after it crawls your page it will give errors if links are too close to touch one at a time with fat sausage fingers.
>>
>>59958163
that sounds like a fuck ton of work compared to 6 lines of CSS
>>
>>59958278
It's not but you'll find out for yourself one day
>>
>>59958236
https://hello.com/this-is-cool-content -> URL

/this-is-cool-content -> URI
>>
>>59958293
i used static genertors pre webpack I dont see the point now except like you said you cant even do babby first style
>>
File: Capture.png (10KB, 232x616px) Image search: [Google]
Capture.png
10KB, 232x616px
>>59958265
I ended up adding a 2px thin line, helps make it clear that the submenu is a part of the 2nd button as well I think.

>>59958163
I've already finished most of the pages, mostly all I need to settle on are the colours which I think I've managed with anon's help.
>>
Is a bcrypt of an utf8 encoded password + 64 random bytes acceptable for storing password in a database?
>>
>>59959387
salt hash the end
>>
what ide php developers use?
>skip storm pls
>no text editors
>>
hey this should be an easy one

hey how do i get moon runes to display properly on my site
>>
>>59959928
file data in utf-8, html charset set to utf-8, body font with support for moon runes (on chink OS should be easy)
>>
is there a ui framework that's meant to be really reactive like material, but without making the user feel like a preschooler when using it?
>>
File: laughing.jpg (30KB, 400x480px) Image search: [Google]
laughing.jpg
30KB, 400x480px
>>59935208

owl slider used to be good

pinch resize is default behavior on phones though right?

you're probably a freelancing pajeet way in over your head and fucked. kek.
>>
>>59960031
If you could show us your superior design alternative to material design I'm sure the answer would be to roll your own shit with a DOM manipulation library.
>>
>>59960353
if i could make my own design i wouldn't be asking for a framework to make one here.

or maybe framework was the wrong word to use? I don't know, structured guidline maybe?
>>
File: 8sd.png (167KB, 348x342px) Image search: [Google]
8sd.png
167KB, 348x342px
wdg, I'm a decent programmer, have been doing it for the better part of a decade and I'm currently doing courses but really live like a NEET in mother's basement. I want to make some extra cash, I don't need consistency as I'm just looking to make some pure spending money while I study.

I was thinking of building up a website to show off and advertising website design, is this a viable path to get some work and do you have any tips on how to get my name out there? So you know, I'm in new zealand.
>>
>>59913147
React or Vue?

React looks horrendous in every single way.
>>
>>59960612
seconding this neet
>>
I've had enough with js memes and the elephant meme. I'm gonna learn ASP.NET for crossplatform..
>>
Nobody talking about react fiber?
Discuss, you neets
>>
>>59960904
>> an updated framework that is still fully backwards compatible with existing React-based applications.
>> there will be a few small breaking changes

neat. it sounds to me like Relay Modern implementing caching in the form of static queries is the bigger announcement since everyone has such a hardon for faster speeds on mobile these days.
>>
File: Capture.png (191KB, 471x413px) Image search: [Google]
Capture.png
191KB, 471x413px
noob here

how do i remove this bullshit

i want my photo to be full width

i'm using an img tag in a script in a div
already using max-width: 100%;
>>
>>59960612
In my experience people will pay for you to evaluate SEO or build them a site with good SEO ranking, but they pester you a lot. In America. I've met some Kiwis in the USA they all told me theres no IT jobs in New Zealand.
>>
>>59961673
Right click and inspect for some good practice. You should be able to tell whats wrong really easily.

What you are seeing is the edge of the div or some padding or something you did wrong. Isn't css gay?

I recommend a grid if not a ui framework. Did you know that common libraries such as jQuery are already cached in everyone's browser?
>>
>What you are seeing is the edge of the div or some padding or something you did wrong. Isn't css gay?

gay as fuck

looks like i needed

body {
margin: 0;
}


>I recommend a grid if not a ui framework. Did you know that common libraries such as jQuery are already cached in everyone's browser?

everything you said went over my head

i'm making a static personal website by hand for fun/learning, haven't bothered to implement/borrow anyone else's frameworks/libraries/tech
>>
>>59961936
Memes are easier to use than learning CSS.
>>
File: 1392325627597.png (228KB, 601x292px) Image search: [Google]
1392325627597.png
228KB, 601x292px
>>59962038
guess i'll stick to memes

any reason i shouldn't host with the guys i bought my domain from?
>>
>>59961673
whats happening is that the default browser style has a predefined margin and other elemtn i forgot
at the beggining of each document you put these all to 0
Thread posts: 321
Thread images: 48


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.