/wdg/ - Web Development General

Previous
>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.com
codecademy.com
hackr.io

>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-1D4

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.png (822x552, 814K)

Other urls found in this thread:

stackoverflow.com/jobs/salary
stackoverflow.com/questions/2178733/getelementbyidarrayx
jquery-az.com/javascript-foreach-vs-for-loop-to-iterate-through-arrays/
pastebin.com/tV61FpuV
pastebin.com/58auHSs4
tutorialspoint.com/php/php_interview_questions.htm
developer.mozilla.org/en-US/docs/Web/API/Document/querySelectorAll
apple.com/iphone-xs/a12-bionic/
getexpressive.org
github.com/zendframework/zend-expressive-swoole
pastebin.com/gfBPg24A
phptherightway.com/
phpbestpractices.org/
airpair.com/php/posts/best-practices-for-modern-php-development
phpcheatsheets.com/
phpweekly.com/
code.fb.com/web/relicensing-react-jest-flow-and-immutable-js/
youtube.com/watch?v=aBcbZcGqn7M
join.slack.com/t/garbagefire/shared_invite/enQtNDMxMjEzMDQ2NzY4LTMzNTY0MzBlOTgyNjQxOWRiOTQxYWRkODFlMDA4Yjc5NGZjZDM3YjJjZDI5ZTFjMWViMDNjMjVjYzMyM2FkOGQ
en.wikipedia.org/wiki/List_of_minimum_annual_leave_by_country
twitter.com/NSFWRedditImage

Here to answer PHP related questions.

Calculate your salaries /wdg/lets!
stackoverflow.com/jobs/salary

Attached: triangle.png (767x414, 16K)

stackoverflow.com/questions/2178733/getelementbyidarrayx
jquery-az.com/javascript-foreach-vs-for-loop-to-iterate-through-arrays/

I've got a technical interview tomorrow and they're doing it in PHP. Any good practice resources you know of?

has been some time since I used it, but I think you should choose "generate font" at the bottom right rather than "generate svg" if you haven't done so.
Then you just add the CSS and font folder from the zip to your project.

imo it's also a good idea to simply use "fa-" as the css prefix in the icomoon settings and then you include the fontawesome boiler styles for some extra functionality you normally get from the fontawesome pack.
I have these 2 files in my project for example, though the boiler might not be that up to date anymore.

Icomoon custom stuff:
pastebin.com/tV61FpuV
FA boiler:
pastebin.com/58auHSs4

just as an example

>"generate font" at the bottom right
thanks, I'm UI-blind for some reason

not bad
tutorialspoint.com/php/php_interview_questions.htm

Attached: Screenshot_2018-09-12 Stack Overflow Salary Calculator.png (765x418, 15K)

Thanks. It's been over a year since I wrote PHP and forgot a ton of it

>C predicates “ x == x ” and “ x != x ”, which are respectively 1 and 0 for every infinite or finite number x but reverse if x is Not a Number ( NaN ); these provide the only simple unexceptional distinction between NaNs and numbers in languages that lack a word for NaN and a predicate IsNaN(x).

This is the main argument I guess. It's saying that you need a way of detecting NaN even if there's no built-in isNaN function or NaN keyword to compare against. So the way of detecting NaN is to make NaN different from all proper numbers in some respect. Having == (or === in JS) behave opposite of normal makes that distinction, because with that fact, we can make our own isNaN function:
function newIsNaN(x) { // named this because JavaScript already does have an isNaN method
if (x === x) {
return false; // because this is a normal number that obeys the normal === rule
}
else {
return true; // because NaN is the only thing that doesn't === itself
}
}

can't wait for the new npm package
npm install newisnan

Germany?

// Hide this
// Hide this


function hideID() {
var hideMain = document.getElementById('main1');
var hideSub = document.querySelectorAll('#sub1, #sub2');

if (hideMain.contains(hideSub)) {
hideSub.style.display = "none";
}
}


I've been stuck in this for a few hours now. Could anyone show me the correct way to write this? I keep getting this error:
>Failed to execute 'contains' on 'Node': parameter 1 is not of type 'Node'.

Just to add to this, but it would be complicated for me to use a for loop and go another route because the IDs I'm working with aren't named quite the same/in order. It's kinda difficult to parse them.

it all in the docs: developer.mozilla.org/en-US/docs/Web/API/Document/querySelectorAll

querySelectorAll returns a NodeList.
Right now you are checking, whether hideMain contains a NodeList, which makes no sense for the function.

try
for(let node of hideSub){
if (hideMain.contains(node)) node.style.display = "none"
}

I think, but not sure.
Haven't written JS in a while.

just to add to that or rather to ask.
why not query the sub divs right away like
document.querySelectorAll('#main1 > #sub1, #sub2');

?

Hi, I do not know which technologies to specialize myself in.

I'm looking for something like Spring Framework and in php that allows ease for making of scalable projects or RESTful API's. I know nothing about php yet.

My top criteria is probably demand.

Thank you.

Why does apple always have the best websites designs?

apple.com/iphone-xs/a12-bionic/

Attached: index.jpg (225x225, 4K)

No, thank YOU.

Hi guys! I have basic API in node.js+express+swagger and i need to make it fetch data from another API. How should i start?

open the text editor

>RESTful APIs
zend expressive is made for that. is you are using *unix system you can use php swoole with zend expressive boosting the performance x20 times atleast. ( you can use ReactPHP or AMP on windows, but they don't have the same performance as swoole as its written in C and zend expressive doesn't have an official support for either one of them, but you can implement it yourself, its not that hard )

zend expressive : getexpressive.org
getting started with zend expressive and swoole : github.com/zendframework/zend-expressive-swoole
php resources : pastebin.com/gfBPg24A

since you don't know anything about php, i recommend you take a look at the following links :
- phptherightway.com/
- phpbestpractices.org/
- airpair.com/php/posts/best-practices-for-modern-php-development
- phpcheatsheets.com/

also you may wanna subscribe for the weekly php mailing list : phpweekly.com/

Appreciate the help. I'll have to read into it more and try out a few things.
Apparently I'm not running ES6 either so I can't use the for-of or something.

Do you really have to support IE, or what are you running this on?
for...of should run anywhere else as far as I know.
But really it doesn't matter. You can just use a normal for loop with indexes of course.

Hey thank's a lot! Very helpful post, will keep most of those links for later.

What is the point of Angular.js? What problem was it created to solve?

I inherited a website built on Angular and I know nothing about it. It seems like forcing users to have javascript enabled, forcing them to download large javascript libraries, and forcing them to run potentially bloated javascript code, seems like a weird and unintuitive way to make websites. I'm looking at the source files and nothing looks like the traditional html I'm used to. What frame of mind should I be in to make sense of it all?

Attached: pic_angular.jpg (225x225, 7K)

>What frame of mind should I be in to make sense of it all?
Google Developers.

nice troll

Angular is absolute shit for the reasons you described and more. React is better in literally every way.

what does one do when front-end javascript files start getting out of hand? At first it started out as attaching an event handler or two, now for one page in my application I've got almost 300 lines of scripting, with at least a dozen different functions, most of which make ajax calls to get and set state in the server, with several deep promise chains, all to handle these odd edge cases and different types of flows.
Example - when user clicks this button, fetch this data from the server, then do this, then check this, then do this or that depending on data received. Another button - if user previously clicked on the other button, then do this. otherwise do this, then this, then this.
I'm not a front-end kind of guy. I 'm looking for some help

>What is the point of Angular.js? What problem was it created to solve?
It's kind of about using server-side MVC methodologies on the client. That's my take on it.

Like, someone really, really liked Zend2 and said "I wish I could use Zend2 in js for an SPA, all on the client".

>what does one do when front-end javascript files start getting out of hand?
Acknowledge that you're building an SPA and do it right from the ground up.
Maybe look into global state solutions too.

Is typescript worth using?

Not if you're just animating a carousel but if you're doing anything serious then it makes JS more like 'real' server-side programming languages. If you think that's a good thing then you'll probably like it.

Sounds like a case for vue or react components

I sometimes forget that React can be embedded piece-meal.

Angular.js is angular

>NPC.jpeg

I can only use CSS for basic page layout and styling. How can I get good at doing useful animations and useable sites? Is there a good 30 day challenge or some shit that starts out easy and build skill?

Nobody likes people like you. Never ever do case animations you freak

before jumping into code, design what you want something to look like or how you want it to move. Doing that will give you a starting point and more specific goals to reach on the way to the final result. Once you break something down to a really specific move, google it

>You can't use react to create a website that will or could compete against facebook

why using it then?

>pretending that that wasn't fixed a year ago
Why would you like on the internet?

Oh was it? my bad then, any source? i want to leave angular so bad.

WebAssembly bois

Attached: LA.png (831x651, 19K)

code.fb.com/web/relicensing-react-jest-flow-and-immutable-js/

Goddamn yes, i lost a fucking year, ty very much!

> i lost a fucking year
And this, dear anons, is why you can listen to memes but you must verify them for yourselves.

So I asked this question a few weeks ago but didn't phrase it very well or get any real responses. For a friend's side-project online shop is there any better solution than Wordpress and Woocommerce?

Now I don't love WP or WC, but I got a quick shop website up and running in less than a day, I used the default storefront theme which isn't too hard to modify with hooks. Added some css and removed sidebars etc for a clean look, added an Instagram plugin, PayPal plugin, and basic content and uploaded it to a cheap host.

That's a shop for less than 1 day set up, $3/mo hosting, and no initial cost.

I looked at squarespace and wix, and a few other online shops-as-a-service and there was nothing even close to that price point. Did I miss something or get the best deal?

(To clarify my friend's side-project shop is likely to bring in $500 - $2000/year so spending $360/year with squarespace is a no starter)

You got the best deal. At least with WC, it's pretty extensible with both programming or GUI edits. Now PHP's a bitch to deal with, but even as a non-PHP dev who worked on a WC project for 6 months, I think I made the right choice.

Price-wise, yeah, it doesn't get better

Premade webshops as a service gives you limited customization and control and lock you in. So that's a bad idea.

If you're familiar with Wordpress than Woocommerce certainly is the best solution for small websites. Simply due to how many plugins there are and how easy it is to update and customise. But each webshop CMS will you give its own headaches.

*then
*will give you

Hey /wdg/ I'm doing an assignment for a course and I can't figure out why this does not work.
I need to use a textfield in a form and limit the input to two numbers (0-99). using pattern="[0-9]{2}" does not seem to work if I put a 0 or 00 in the textfield. How do I solve this ?

That's more or less what I thought, but I was hoping there was something out there that I'd missed. I used WP + WC because I'm familiar with them, but I was really surprised there wasn't really an alternative free shop CMS, like I'm not after a lot of features

0 won't work because it's not two digits and your regex specifies two digits, I'm not sure why 00 doesn't work, maybe it get's interpreted as 0...?

Use pattern="[0-9]{1,2}" or pattern="\d{1,2}"

You really should've been able to figure this out on your own using mdn and w3 schools, but I'm glad you posted it because I discovered the pattern attribute

There are so many pajeets who just spend their time copying other websites.
And I've never seen a case where it paid off.

>"[0-9]{1,2}"
That one solved it, thanks.

They both work dude, [0-9] will only match the Arabic digits we use in English but \d will match any unicode character that is a digit (from languages that don't use Arabic digits).

[0-9] is the right choice to match 0-99, but in often it is more correct to use \d

Not that impressive tbqh

>As soon as I learn a framework for front-end, a newer better one arrives
Every time

>As soon as I learn a framework for front-end, a newer better one arrives

jQuery August-2006
Angular Oct-2010
Backbone Oct-2010
Ember Dec-2011
React Mar-2013
Vue Feb-2014

You might be a slow learner...

2018 - I'm just took a job doing PHP/jQuery
Some things changes, some things stay the same.

Apps written in 2006 haven't been rewritten five times since then, they're still running in the same language they were first written in. They only get ported if there's a pressing need and DX is basically never a pressing need.

what was on your resumee/portfolio?

A tonne of stuff but it was several users doing PHP in a similar field that got me the job.
I've got a bunch of skills in modern JS, node, React etc but jQuery was the only part of my JS framework list that mattered.

I actually broke our app recently by accidentally using some ES5 without thinking. One of the senior devs had to go through while I was away and change all my 'const' and 'let' to 'var' and stuff like that. It worked fine for 90% of our clients but it broke a couple of clients with old browsers. They pay good money so we're still doing 2006-era JS.

A tonne of stuff but it was several years doing PHP in a similar field that got me the job.
I've got a bunch of skills in modern JS, node, React etc but jQuery was the only part of my JS framework list that mattered.

I actually broke our app recently by accidentally using some ES5 without thinking. One of the senior devs had to go through while I was away and change all my 'const' and 'let' to 'var' and stuff like that. It worked fine for 90% of our clients but it broke a couple of clients with old browsers. They pay good money so we're still doing 2010-era JS.

>reads a couple of online tutorials
>framework ninja guru

how did you got your first job then?

>I use document.querySelector("#nigger") instead of $("#nigger") I'm so hardcore

I had a cow-orker do that and convince management to change the project's base technologies completely halfway through.

Suddenly I'm being told to make a Zend2 PHP project work in Yoeman because 'it should just work' and being asked why our code doesn't work on the internal debug server like every other app. The project ended up being cancelled.

I was 90% done in a Masters in AI and finishing it off part-time and a company wanted an AI/Analytics guy so they hired me part-time while I was finishing my thesis. I finished my thesis, converted to full-time and worked there for several years.

A few jobs later, that old job doing PHP/jQuery for an analytics app got me this job doing something sort of similar but full-remote.

I don't want to use google chrome what do ?
Firefox is shit, google chrome is shit, which web browser do I use on archlinux ?
>inb4 terminal browsers

Is theodinproject any good? It teaches ruby but python seems to be way more popular.

Attached: 1522034454731.png (1057x561, 789K)

ff is less shit than the alternatives desu
it may be a cucked shadow of its former self but it's still the best

thank you for explaining (job stuff)

If you think everyone's first two choices are shit then you're going to have to make your own choices, not have us tell you our choices and then tell us that we're making shit choices.

I develop in Chrome and it's fine, my colleagues all use Chrome or Firefox, they test in Safari and IE but use the first two for development.
Never develop exclusively in things that nobody uses, your UX becomes irrelevant.
I do prefer to use Chromium over Chrome though.

Has someone else ever hated a language before using it, then after using it finds out that it's actually nice?

I always loved c++ and hated everything else (specially java).
Was forced to learn java and still hated it.
Was forced to learn php for work and actually enjoyed it, but at that time I hated javascript.
Was forced to learn javascript also for work, and loved it, it's one of my strongest points nowadays.
I've learned lua, go, c# and python. And ended up liking each of them.

The only thing that I believe will never change is how I really fucking hate java.
Rust also sucks, but less than java.

firebug, do you use it? what for?

Attached: 245px-Firebug_logo[1].png (245x196, 52K)

write your own browser, since everything is shit i guess you'll have no problem creating something better

I was mostly looking for alternatives. I know that it's better to develop while aiming for chrome and firefox users, I just wanted some alternatives for everyday use.
It looks like firefox is my only choice.

Any wordpress developers here? I'm still leaning back and forth between
>build code from ground up for site
and
>just cobble it together with wordpress plugins
For the ground up option, what do you guys think about UserSpice to handle users+groups?
youtube.com/watch?v=aBcbZcGqn7M

Have you tried Qutebrowser?

Nope but I like the idea, thanks user.
I think I might try it for some time

>I just wanted some alternatives for everyday use
No you don't.
Develop on what the most developers use and the reason for that is so that when you have problems, there are a dozen stackoverflow answers about that problem. Not just a weird error message that nobody other than yourself has ever seen.

Don't be a snowflake, be a sheep. Sheep get to learn from the mistakes and problems of the rest of the herd.

how do you want to spend your time?
writing code for your site or writing content for your site

i have a very simple idea and i just want it to work so i can collect my tiny % off each commission posted & fulfilled and sell merch in the store

user buys credits
user uses credits to post bounties or spend them in the store
bounties get updated to a feed on the main page
other users carry out bounties and post their proof as comments to bounties
bounties are confirmed
bounter hunters get the special credits
bounty hunters cash out their credits or spend them in the store

i've found about 90% of the wordpress plugins i need to do this but it still will need a dev to make it all fit together right reeeeeeeeeeeee

...

taking bids on slack
join.slack.com/t/garbagefire/shared_invite/enQtNDMxMjEzMDQ2NzY4LTMzNTY0MzBlOTgyNjQxOWRiOTQxYWRkODFlMDA4Yjc5NGZjZDM3YjJjZDI5ZTFjMWViMDNjMjVjYzMyM2FkOGQ

You are me
I hate Java with a passion, but love FP langs, C++, C (more than C++), Python and Javascript

what is this

i'm soliciting bids from Jow Forums in what will either be a spectacular success or disaster

>i'm soliciting bids
>posts a slack channel
>need to give an email
>so much work for nothing

dude

gb2rdt

I use Wordpress for my website.

I try to avoid as many plugins as I can. But I do use the necessary ones.

I'm using wampserver on a 32 bit windows.
Anyone trying to enter to my website gets a 403 forbidden error.
I just want people in my local network to see it.
pls halp

Hm, not hate, but I have a real strong dislike whenever I see Java.
I don't even know it and have never written a single line, but it just looks so fucking verbose and unnecessarily retarded.
Python I don't hate, but I don't like the whitespace indentation. And then of course the retarded discussion about master/slave terminology.

How many vacation days do you lads have?

20+ here

en.wikipedia.org/wiki/List_of_minimum_annual_leave_by_country

>Iran
>26 Paid and 27 Public holidays
>53 in total
I wonder if they're hiring over there.

I use Chromium for testing with Selenium, it works perfectly.
Use Qutebrowser if you don't like Chromium for personal use. Very keyboard oriented, must learn shortcuts.

There's this halo effect where the quality of surrounding communities affect the perception of the language itself.
When people hate a language, it's mostly because of that than hating the language itself, I think.
With that said, I had the opposite experience by looking at Python and saying "how cool are those one liners" and hating it after finding library writers' obsession with **kwargs based APIs and how that often causes shit to fail silently just because you made a typo when remembering exactly what a parameter name was.
That, and dynamic typing really fucks you up when working with larger codebases (not specific to Python, though).

Firebug was really nice when it came out, but now browsers come with their own developer tools. I don't think you can even install Firebug nowadays.

Attached: 1536018331343.jpg (674x666, 84K)

>vacation days
lmao, I have unlimited PTO

How often do you go into work? Once a week? Every 2 weeks?

I go to work every day. I take take off when I'm sick, when I want to go to a conference, or when I just want an extra day for my weekend.

Unlimited PTO doesn't mean you can take off as many days as you want. It just means you don't have to justify the reason that you are taking time off, and there is no difference between vacation time and sick time from the company's perspective. If I just stopped showing up to work, my boss would fire me.

And what do logs say?