[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 Dev General - Sponsored by jQuery (the /wdg/ frontend

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: 314
Thread images: 36

File: 1491915724737.png (731KB, 824x553px) Image search: [Google]
1491915724737.png
731KB, 824x553px
trying out updated OP from three threads ago
improvements welcome (do we even need Discord/IRC?)

>old thread
>>60755444

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

>Getting started
Get a good understanding of HTML, CSS and JavaScript.
Everything you learn will have these as their base.
The Mozilla Developer Network offers a good intro (no matter your browser choice)
https://developer.mozilla.org/en-US/docs/Learn/Getting_started_with_the_web

>Online courses
https://www.codecademy.com/
https://www.freecodecamp.com/
https://www.bento.io/

>Further reading/viewing
https://www.youtube.com/watch?v=sBzRwzY7G-k
https://github.com/kamranahmedse/developer-roadmap
https://github.com/dypsilon/frontend-dev-bookmarks
https://github.com/vhf/free-programming-books/blob/master/free-programming-books.md

>Code challenges
https://www.codewars.com/
https://www.hackerrank.com/
https://codefights.com/

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

>Useful Youtube channels
derekbanas
learncodeacademy
funfunfunction
computerphile
coding train

>cheap vps hosting in most western locations
https://www.digitalocean.com/
https://www.vultr.com/
https://www.linode.com/
https://www.scaleway.com/
https://www.heroku.com/
https://lowendbox.com

feminine penises are probably still more gay than not, but what do I know
>>
File: 1485889119752.gif (8KB, 645x773px) Image search: [Google]
1485889119752.gif
8KB, 645x773px
>he's not an asynchronous programmer
>>
File: 0e9[1].jpg (27KB, 600x600px) Image search: [Google]
0e9[1].jpg
27KB, 600x600px
>when you realize the real cucks are front end developers
>when you realize back end is where the money is

Who /back end/ here?
>>
ideas to work without JS? any dead ends you can't ignore?
>>
>>60792887
Thanks
>>
>>60792924
Just send one request, that contains info about all the files you need from the server
>>
File: husky_dog_skeptical.jpg (53KB, 341x358px) Image search: [Google]
husky_dog_skeptical.jpg
53KB, 341x358px
>>60792883
>Sponsored by jQuery (the /wdg/ frontend framework of choice)
>>
How many people have server side rendering projects? I just finished mine, almost, I think. C#, react, sockets and vroom btw, ditching react.net was the best idea ever. Responds under 10ms (react.net was 30ms) almost every time and 2ms most times.

If you want you must promise to donate neetbux.

>>60792939
Lol I had an epiphany that all of web is just javascript and your favourite language.

>>60793106
There is literally nothing wrong with jQuery, but it is a purely client side library. Don't be shocked if weird things happen when you're trying to use it server side.

>>60792897
>backend stuff and over complicated ajax
Asynchronous backends are fun, they can take like tens of thousands of requests a second.
>>
>>60792924
Why? Just send as many as your server can handle and let the cpu go up and down. Otherwise unless you're threading horribly or running really dumb code, 300ms is fine. Actually it's kind of annoying and feels like php.
>>
>>60793197
>There is literally nothing wrong with jQuery, but it is a purely client side library. Don't be shocked if weird things happen when you're trying to use it server side.

My reaction was just to using jQuery in general. There are a lot of things wrong with it.
>>
>>60793352
not the guy you quoted, but for some stuff jquery is great, if you want cross browser support for some events, for example.

Sure, it's bloated and you probably (
won't use it all. You can implement in vanilla javascrip stuff like adding and removing classes, or even choose to use on of the many lite distributions of jquery.
>>
>>60793499
nowadays what kind of operations are still not 1:1 browser compatible, unless it's some experimental feature.
Do you have an example of JS code, that works in one browser but not another? (excluding ES6 obviously)

Genuinely curious.
>>
Novice web developer with no academic background here - is it worth going back to university to study in some sort of programming course or is school not very effective at keeping up with the latest happenings and transitions in web coding?
>>
>>60794246
Doing anything is better than nothing. If you learn better from university, do that. If you learn better on your own, do that.
>>
>>60794246
School gives you a frame to build upon and the chance to meet people that you can work with in the future.
>>
>>60794276
It does cost an absolute fuckload of money though, so be smart about it. School is not an absolute necessity since the material on the web is fine, but nothing beats a university for networking possibilities.
>>
So i'm trying to make a webpage where the user enters their last name and it searchs through a csv file and displays the number that matches there name. I have no idea how to go about this. I have been googling madly for the last 30 minutes.
>>
>>60794474
do you want the client to search the file or abstract it through a server side operation?
>>
>>60794517
Which one do you think is easier. All I need is the client to beable to enter there name and have the code/number attached to their name appear in front of them.
>>
>>60794474
This can be anything as easy as string.indexOf, looping over the contents and equality checks, or something slightly more complex like a database.

Either way it sounds like you're missing some very basic programming skills. Go back to the classroom anon and do you a learning.
>>
>>60794474

Google "make ajax request to php file"

bind an event to the input field that makes an Ajax request to the PHP file that is reading the CSV
>>
>>60794591
>>60794593
Thanks and I am missing very basic programming skills, I can only do basic shit in python. I'm doing this for free for a fundraiser
>>
>>60794474

you can do this easily with PHP
>>
give me a good beginning node js project, /wdg/
>>
File: 1496399081989.png (123KB, 3000x3000px) Image search: [Google]
1496399081989.png
123KB, 3000x3000px
>>60794903
TODO app
>>
>>60794629

if you know python consider using heroku, they have a tutorial and a complete working web app using python when you do the tutorial.

it includes the connection to the database, and how you process them. definitely check them out
>>
>>60794903

Build a simple website with express as the template engine.
>>
File: vuehue.png (4KB, 400x400px) Image search: [Google]
vuehue.png
4KB, 400x400px
please install Vue.js
>>
>>60794474
Str_tocsv or something like that.
Foreach through the rows.
Column 1 is row [0]
Column 2 is row [1]
Etc

You should know the rest. If =
>>
>>60794029
It`s mostly older browser stuff such as IE6. I remember have some problems with one of the windows events before and just changing it to jquery equivalent.

You can take a look at this stackoverflow thread for a rather lengthy discussion of examples. Most of them are edge cases or very specific issues.

Also, fuck IE6

https://stackoverflow dot com slash questions/565641/what-cross-browser-issues-have-you-faced
>>
>>60792883
Just bought a new domain. Let's hope my 4th website becomes more popular than my previous ones.
>0 users
>0 users
>2k unique/day
>?????
>>
>>60796175
Yeah, a lot of that stuff seems pretty annoying. I'm glad IE6 is down to basically no usage.

Currently it's pissing me off that Apple doesn't see fit to actually provide an update of Safari; you actually have to manually go to the mac app store and download the new version. It's not hard to do it if you know you want to, but I'm sure it hurts adoption of new versions, which apparently they just don't give a shit about when it comes to browsers.
>>
Give me some idea of fun projects to do with Javascript
>>
>>60796592
Put it on a server

Sorry, I shouldn't even joke about that. Too soon.
>>
>>60796604
I can sense the retardation in this fellow.
>>
File: rockpaperscissors.png (76KB, 921x578px) Image search: [Google]
rockpaperscissors.png
76KB, 921x578px
This won't work will it /wdg/? Oh man I'm in too deep here, Mafia boss wants his Javascript done by midnight
>>
>>60797016
The pic leaves out two closing brackets at the end, rest assured I didn't forget those
>>
>>60796701
At least not retarded enough to think JS on the serv is a good idea
>>
>>60797016
You forgot the semicolon at the end of each return statement
>>
>>60797016
Math.random() doesn't take arguments.
Also you probably want to floor your result

Math.floor(Math.random() * 3)


instead of a switch you can also select from an array. Would probably look nicer.
>>
>>60797092
Damn, that's basic shit.

>>60797182
Thanks m8. Learning erryday.
>>
>>60797092
>>60797303
Semicolons are optional in JavaScript; as long as you have a newline you're good.

It's still generally best practices to include it though.
>>
>half of the dev team at our company team just got fired for behavior reasons

Didn't even see if happen, was just surrounded by empty desks and got called into a meeting about it. Must have been pretty bad what they all did given the company is already short staffed.
>>
>>60797342

I'd go so far as to say they aren't even really optional. Most minifiers will break if you don't use semi-colons.
>>
I've been using HTML and CSS for a few years, last year I picked up Java and XML for app development, and did both front and back-end development for a pretty complex app. Now I'm wanting to actually get back into webdev but on a professional level. I'm pretty proficient at HTML and CSS, though that's generally the easy stuff as far as I can tell. If I really apply myself and learn the ins and outs of JS, jQuery, PHP, Python, etc, about how long should it take until I could reasonably expect to be hireable?
>>
>>60797386
what?
Don't want to go "works on my machine", but I always write without semicolons and neither uglifyJS nor Babilify ever gave me any problems.
>>
>>60797386
>Most minifiers will break if you don't use semi-colons.

If you're just stripping whitespace indiscriminately, then maybe, but I have to imagine that any proper minifier would detect that shit.
>>
>>60797413
Do what I'm doing right now and focus on learning to be able to build a portfolio since a portfolio of work is what gets you hired.

Learn what you have listed and work through as many projects as you can so that you can show experience and knowledge in the respective frameworks
>>
>>60797421

Put it through a gulp/grunt process and chances are something isn't going to cope.
>>
>>60797413
if you are proficient as you say you are in html/css, as in could do exact 1:1 .psd -> html + responsive design, then all you need is js (vanilla + framework of choice - react, vue, angular) and a backend stack and you could be hireable in a few months (3-4 mo @ 6-8 hrs a day).

skip jquery and php, hot shit right now is node/express or elixir/Phoenix. for db mongo, postgres, mysql.
>>
>>60797480
Will do, thanks anon! I've already got an extensive portfolio of illustration and photography since my background was in graphic design during school. Now I'm on to different stuff than what I learned there.

What's a good way to showcase a portfolio of webdev/mobiledev work? I'm building a website for the app at the moment and fixing up some issues after doing some QA, but how do others generally format a portfolio for this stuff?
>>
>>60797522
>exact 1:1 .psd -> html + responsive design

Very first things we were taught in my web design class during my graphic design studies, though we didn't go too deep into JS so I forgot most of that.

I could reasonably be working 8-12 hours on this per day since I'm between jobs, my last gig was as a videographer. I'm also a quick learner so maybe that'll help too. Thanks for the advice, anon!
>>
>>60797413

Pick up front end first, go JQuery and JS and also get to know compiled CSS formats like SASS.

Lots of dev studios struggle to get front end developers because half of them hate working with Javascript and the other half find CSS slow and annoying and only do it when they have to.

Can't really say how long it takes to learn JS and JQuery, I learnt it was I needed. It's very quick to pick up if you've a good working knowledge of coding in general though.

You can always try and pick up PHP on the job.
>>
>>60797591
Well good to know front end is an easier field to find jobs in. I don't enjoy back end anywhere near as much as front end.
>>
>>60797514
hm, maybe.
Using them as webpack plugins atm.

>>60797591
>JQuery
>>60782377
>>
File: Screenshot_2017-06-03-02-47-41.png (871KB, 1440x2560px) Image search: [Google]
Screenshot_2017-06-03-02-47-41.png
871KB, 1440x2560px
Hey guys, the web game I've posted on here a few times (https://www.drawasaurus.org) is now an Android app!
https://play.google.com/store/apps/details?id=com.drawasaurus.game
Hope you guys check it out and let me know how slow and buggy it is.
>>
>>60797696
I first wanted
Do people actually click on those ads (on purpose)?
How much money are you making with this project?
You can tell us anon.
>>
File: 654645697896.jpg (18KB, 336x448px) Image search: [Google]
654645697896.jpg
18KB, 336x448px
Does anybody in this thread (or newcomers) do any freelance work for $$$? How does one get started doing so? What kind of gigs do you get?
>>
>>60797696
>contains ads
no thanks
>>
>>60797624

Wouldn't say it's easier, just that I frequently experience companies struggling for them. I'm a backend developer primarily so I can't say what the job market is.

Anyhow, this is what I'd call a good exercise in JS that'll reflect real world usage:

Make a form
Give it a bunch of text fields and validate them as the user types (ie phone number, email address, two passwords matching). Have it display an X next to the field if they fail.

Have Category drop down. Have that category filter the contents of a second drop down.

On form submission, load in an xml/json file through Ajax, go through that XML and search for an item that matches what's in the second drop down.

Display the rest of the contents of that item in a inline popup/lightbox using a third party library (even if it's just bootstrap).
>>
>>60797774
The game's free and I'm broke, use an ad blocker ya fuck

>>60797766
Not much but a little so far. I actually made a couple hundred dollars from ads on a 4chan searcher site I owned.
>>
>>60797832
Thanks, will do! I'll screenshot your post for future reference. I tend to get a ton of ideas on things to make and do, so as I work on programming I'll probably naturally do a ton of exercises on my own.
>>
>>60797696

really cool anon :D

i wish it scales up a little more in 1920x1080, too many wasted space imo
>>
>>60797767

From my research, the best freelance gigs are gonna be when you are contacting prospects. Try to find companies in rural areas that have a lot of money but a shitty website.

Proposition then for a new website and explain to them how it will help them get more business. You will eventually find an outfit that has been meaning to update their web presence but are not the kind of folk to go looking for pajeet on the freelancer sites.
>>
>>60797696

what language do u use for the website? java?
>>
>>60797767

I've done contracting via an agency. Work varies massively. Can be a great way of getting experience and the money is very good.

I was getting £175 a day just doing html emails
>>
>>60797988
lots of gotchas and compatibility issues when working with emails?
How does it compare to developing for the browser?
>>
>>60797850
hey dude, the app is pretty good, much like the web version. Just a thing though, you should look for a way to maximize drawing screen size when you are the dude drawing. It's too small to be able to make significant detail. But keep it up, it's looking good. If you know of any way we can help you shill it, let us know, I'd be happy to help.
>>
Can you guys help me out and tell me what is wrong with this code?
function getUserChoice () {
var userInput = prompt('What is your selection?');
userInput = userInput.toLowerCase();
if (userInput = 'rock', 'paper', 'scissors') {
return userInput;
}
else {
console.log('Error, error, ERRAR!');
}
}

function getComputerChoice () {
switch(Math.floor(Math.random() * 3)) {
case 0:
return 'rock';
break;
case 1:
return 'paper';
break;
case 2:
return 'scissors';
break;
default:
console.log('Something has happened.');
}
}

var userChoice = getUserChoice();
var computerChoice = getComputerChoice();

function playGame() {
function determineWinner(userChoice, computerChoice) {
}
}

function determineWinner() {
if (userChoice === computerChoice) {
return 'The game ends in a tie!';
}
if (userChoice === 'rock') {
if (computerChoice === 'scissors') {
return 'The computer has won!';
}
else {
return 'You have won!';
}
}
if (userChoice === 'paper') {
if (computerChoice === 'scissors') {
return 'The computer has won!';
} else {
return 'You have won!';
}
}
if (userChoice === 'scissors') {
if (computerChoice === 'rock') {
return 'The computer has won!';
} else {
return 'You have won!';
}
}
}

console.log(userChoice, computerChoice);

playGame();

It is self-explanatory in what it intends to achieve but has grown very large and full of brackets. If somebody can help me make it work (since it doesn't), that would be swell. For now, the Codecademy console returns 'rock' for my choice no matter what I enter into the prompt. Cheers /wdg/.
>>
>>60798069
>if (userInput = 'rock', 'paper', 'scissors') {
compare variables with "==" or "===", but not "="

read and apply
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/includes
for a better way
>>
>>60798012

Basically, anything that's CSS and not a HTML attribute has really inconsistent support meaning you can't use them.

It's like web design in late 90's, complete with table based layouts (which are essential). There's such a limited amount of 'safe' things to use that it's fairly easy when you get used to it.
>>
>>60798069
sit there until you find the solution yourself you babbling retard. rock paper scissors is about the easiest thing you can make besides hello world.

there's enough shitty devs in the industry.
>>
>>60796524
Yeah it doesnt work like thay sadly.
>>
Just got hired for what I suppose is a full stack dev position. They had me doing QA on my first day to help me get familiar with the platform I would be working on. Today they had me spend the day tackling one of the simple bugs I reported. I have no idea what I'm doing. They're using ajax, JSON, Js, C#, SQL and some large database thing. I have no experience with any of these (only html, CSS, php, Java and Python) and felt really out of my depth.

What would you guys recommended I do on the side to help learn this stuff?
>>
File: 1496807999233.jpg (192KB, 1280x738px) Image search: [Google]
1496807999233.jpg
192KB, 1280x738px
>>60798069
Here comes the spoon.
Open wide

function playGame(userChoice, computerChoice) {
if (userChoice === computerChoice) {
return 'The game ends in a tie!'
}
if (
userChoice === 'rock' && computerChoice === 'scissors'
||
userChoice === 'paper' && computerChoice === 'rock'
||
userChoice === 'scissors' && computerChoice === 'paper'
) {
return 'You have won!'
} else {
return 'The computer has won!'
}
}

var userChoice = prompt('What is your selection?').toLowerCase()
var computerChoice = ['rock', 'paper', 'scissors'][Math.floor(Math.random() * 3)]
console.log(userChoice, computerChoice)

if (['rock', 'paper', 'scissors'].includes(userChoice)) {
console.log(playGame(userChoice, computerChoice))
} else {
console.log("ERROR: BAD USER CHOICE")
}


this is still shit btw. :^)
>>
>>60798384
I've been at this web development game for less than a week m8, cut me some slack.

>>60798178
>>60798493
Thanks guys. That code looks so clean and tidy, oh lord jesus
>>
Why didn't you switch to the most reliable and powerful webdev language yet?
>>
>>60798301
What would you use to setup a email delivery system from scratch senpai? I was tasked to do it later in July, don't know where to start. Do people use thirdparty providers or?
>>
>>60798514
>cut me some slack.
no, you learn the hard way like the rest of us.

when a company wants to hire you think they'll cut you some slack? you need to become a problem solver and the problems you're having this early in your learning are extremely trivial shit like syntax errors and minor logical mistakes that are gotten within one glance at your code by any competent person in this thread.
>>
>>60798514
lol don't listen to that pissed off guy, there's plenty of us here who are quite a bit friendlier than him.

Most of us will gladly help you out, as this dude has done right here >>60798493 but also, do take some time before posting to google your answer a bit.

Always feel free to ask though, your questions help us all! I've learned tons of stuff from other people here. When I get my first webdev paycheck, I'll spend it all on a night of hookers and blow, and I'll think of you, /wdg/, as I blow my load.
>>
>>60798486
Start with JavaScript, from there you'll pick up on Ajax and JSON easily. If you know Java then you won't have much problem switching to C#, start with ASP.NET or whatever the fuck they're using.

How the fuck did they even hire you unless they expect you to suck for the first couple of months? I got hired for iOS development, also started from scratch but with Swift and the whole Xcode/Cocoa ecosystem. Took me two months or so to get accustomed to the API's that I was working and be productive. Good luck.
>>
>>60798854
Thanks anon

>How the fuck did they even hire you
No idea, I'm an intern just for the next 3 months. I was 100% transparent on my resume with what I could do, they never even interviewed me, just asked for a background check then told me to come in the following week.
>>
>>60798969
Well shit if it's that easy I might as well just start sending applications left and right and hope something sticks until I've got more experience for an actually good job.
>>
>>60799090
>I might as well just start
I have no idea why aren't you doing this already.
>>
>>60799117
I'm >>60797413
>>
>>60799141
You "can" get hired with precisely zero web dev related skill as long as you have some prior tech experience that shows you can learn this shit.

I was hired as a C# dev because I've edited a couple of C# scripts back in my University days. A month later, I've built a standalone UWP application for universally monitoring Azure tables.
I've got hired as a RoR dev because "well, I was debugging an ASP.NET webapp back then" - a month later I was in a team building electronic commerce website.

There are quite a few employers who are willing to hire a barely entry-level worker and teach them (wait till they'll learn on their own) the shit required. And chances are, you'll be learning on a much faster pace when you're actually working.
>>
>>60797533

build pretty, simple websites that focus more on looks and pizzaz than functionality
>>
https://pastebin.com/raw/jgXf7RJc

<?php $q = new Search(); $q->whoIs(); ?>
is to determine if im searching for student or professor
My question is how do i add id from input field into url
This way when i click on search button i get mypage.php?student_id=
I know it must be something stupid im missing, been coding like 10 hours today


>i get connecting error when i try to paste code, thats why im putting it on pastebin
>>
File: both.png (88KB, 260x260px) Image search: [Google]
both.png
88KB, 260x260px
>>60799327
>focus more on looks and pizzaz than functionality
>>
>>60797696
Hey it's dick, hows the site going?
>>
File: hqdefault.jpg (19KB, 480x360px) Image search: [Google]
hqdefault.jpg
19KB, 480x360px
no mozilla, stop it
is it so hard to make something, that doesn't make me embarrassed to use firefox?

https://www.youtube.com/watch?v=kDRmqabrmag
https://www.youtube.com/watch?v=C2_BQ0PhEM8
>>
http://collinoswalt.com/games/buggy/

3d syntax highlighting
>>
>>60799617
Put url into variable, concat textbox value and then redirect to that variable.
>>
>>60799991
>Firefox: It's better now!
What an appallingly pathetic tagline
>>
Possible to use websockets with a LAMP stack?
>>
>run into problem that takes more than 10 minutes to figure out
>think "omg this sucks, why am I even doing this, do I even like wdg?"
>solve problem
>think "man I was just being a little bitch"

errytime.
>>
>>60800730
what are you trying to do?
>>
>colleague was on vacation leave
>boss told me to re-arrange some of his layouts
> <div class="btn btn-group btn-group-xs pull-left text-right btn-modal"><a class="text-blue disabled-xs centered"></a></div>

oh boy am I pissed fixing somebody else's bloatstrap
>>
>>60800856
you job sounds menial AFtbhfam
>>
>>60792937
when you are so slow you have to realize it
>>
>create git repository on bitbucket
>clone local
>clone phaser into same directory
>commit master
>it didn't go to bitbucket
>did I just fuck phaser or something?
>>
>>60793106
jQuery is not a framework
>>
File: Screenshot_2017-06-07_22-44-58.png (355KB, 1062x319px) Image search: [Google]
Screenshot_2017-06-07_22-44-58.png
355KB, 1062x319px
How do I monetize a website?

Pic related
>>
>>60802098
Depends on the website.

Donations are useless. No one ever donates. I have a website with over 600k uniques and it's made 5 dollars in the last 3 years.

I have 32k unique visits on my new website over the last 2 months and already made more through patreon, and it's recurring.
>>
>>60798054
Thanks for the kind words man, any chance I could get a screenshot of how it looks on your device? I've been trying to maximize the canvas for all possible screen sizes but there's still work to be done.
>>
>>60798528
>Do people use thirdparty providers or?

I'm not him but I think people are pretty big on MailChimp. I've also heard of Constant Contact.
>>
>>60803822
here you go. First two are me drawing, second me guessing.

Just some ideas: When you're drawing, get rid of my score and other people's score, give me more room to draw. And you have 4 lines of chat (3 to read and 1 to write), maybe make it 3. Also, for mobile I would say the size choice is too large, just make it three sizes, S M L, because there's really not much room for detail.
>>
File: obngna.png (800KB, 2968x1276px) Image search: [Google]
obngna.png
800KB, 2968x1276px
>>60804836
Fuck me, I never learn...

Also, my phone is a Moto Z, 5.5", and the screen still feels small when using your app.
>>
>>60804836
>>60804853
Well the thing is that the maximum amount of space is already being used there. The size of the canvas is restricted by the aspect ratio of the canvas otherwise people's drawings would be cut off around the edges. When you're in portrait orientation the maximum size of the canvas is the width of the screen with the height then calculated from that and the aspect ratio.
Aside from that, the user list is supposed to collapse in to a scrollable list next to the chatbox, giving the chat more height, but it was buggy so I disabled it for now.
Could I get your device width, height and pixel-ratio from https://mydevice.io? The more I have the better.
>>
Is it worth it putting timeout logic in my code just because a function refuses to error out even though it's been half a day? Pisses me off because it errors out 3 times perfectly fine just as I expected with intermittent connection issues, but the fourth time it just keeps going forever, never finishing.
>>
>>60805144
width: 360
height: 640
pxel ratio: 2
>>
>>60801509
you need to push to remote? e.g.
>git push origin master
>>
Is web development the future? Should I learn it? I have knowledge in Python and lisp. Would HTML,PHP and css be enough?
>>
Say I have a game with a ranking system. The user can see her ranking on her profile. Do I really need to hit the DB every time she clicks/refreshes the page?
>>
>>60805727
very nice secondary I would say, but you can main it too. If you are into python, don't bother with PHP, use django or whatever python frameworks are out there.
>>
>>60798493
i did someone elses rps homework in another /dpt/.. deleted the code though, it was pretty dank, probably still in the archives
>>
>>60805931
>>60690484
>>
>>60805754
Do you think DB calls are particularly expensive or something? Optimization is the devil.
>>
>>60806146
Disk I/O is usually the bottleneck for performance of many web applications (including this one), so yes, it would be very slow to read from disk instead of memory.
>>
>>60806626
Because databases are extremely dumb things that always make disk reads every single time they need to pull data.

Even if that was true then your OS would cache that info for the DB.

Stop fucking optimizing you dolt. Do stuff, then optimize where performance is insufficient.
>>
>>60797696
Ads are an instant deal-breaker. It makes apps completely unusable when you get teleported to Febreeze's corporate website every second tap. Would never install this.
>>
what do you think about bem?
>>
So i have one table, it lists data from mysql
I have edit and delete options
When i click on one of them it goes to page Action.php?edit_id=1 or ?delete_id=1 and job is done there.
Can i make something like:
When i click for example on edit javascript in background calls Action.php and do what it needs to do without refreshing page?
>>
Is there a nice template generator that would output nice layouts in pure html/css?
>>
Best way to keep track of how many requests my client sends? I guess just a regular network traffic program?
>>
>>60807080

I would say to do that on the server side or perhaps using a reverse proxy.
>>
>>60807080
You log it.
>>
>>60806919
nice idea on the surface I think, but it's used nowhere.
So combining your own BEM style CSS with 3rd party looks odd and can be harder to read imo.

>>60805754
Well, aren't you already requesting all the other profile data from the DB as well?
But yes, how else would you get that data, unless the server keeps ranks in memory and only syncs with the DB every so often maybe?

>>60806935
AJAX
>>
>>60807119
How?
>>
>>60806911
Thanks for letting me know but I can't afford to run it out of pocket so there ya go. Just play it in your browser with an ad blocker.
>>
>>60807118
I'm sending requests to someone else's website, not my own. I'm worried to break his shit if I by mistake leave some never ending loop in the code that just keeps sending requests.
>>
I went all in on security/auth.
Can this be considered good practice or is it really overkill?

- Server has its own CA certificate
- Each client needs to get a certificate signed using server CA cert
- Client certificate must be imported to browser/wherever to use API
- Each client gets a copy of server certificate to verify if it prefers

The last step is only because I'm to poor to randomly order certs from Comodo.
>>
So if i have 10 elements in table and i want to get their href with javascript
How would i do that
For one i can use
document.getElementById('action').href

but what is for many?
>>
>>60807694
should be something with 'filter' instead of 'get'
Try

document.filterElementById('action').href
>>
>>60807694
querySelectorAll()
getElementsByClassName()
getElementsByTagName()

hit up the MDN anon
https://developer.mozilla.org/en-US/docs/Web/API/Document
>>
>>60807641

Do browser support presenting client certs for server auth?
>>
Any of you get those recruiter calls from georgia, dallas, etc that are clearly redirects from India?

Those piss me off. Just blocked one that called 3 times in a row. She called yesterday and it took 2 listens to the voicemail to realize she said "php developer"

"Pawp delper" is what it sounded like.
Fuckin india.
>>
>>60806683
I think you do not understand what premature optimization actually means.
>>
>>60807978
Chrome and FF do, provided that it hasn't seen the serial numbers before.
>>
File: ss_018.png (16KB, 1306x451px) Image search: [Google]
ss_018.png
16KB, 1306x451px
>>60807794
>>60807797
this is what im stuck with
>pic
Edit and delete actions are with user id, edit_user_id=1 example
I want when i click on edit/delete to call php script in background which will delete/edit that user.
What would be the best way to do that?
I am new to js

also document.filterElementById('action').href
gives error
>>
>>60808225

You want to do that without using a html form?

Using only js, you could set a onclick event with a function that would get all the information on the element inside and then you would've to do a request using XMLHttpRequest with desired fields to your php url.
>>
>>60808225
told you before anon, look at AJAX
>>
>>60808344
>>60808225

Forgot to say, the event would be set on each of your deleting tags.
>>
>>60808344
>>60808358
like this
   <input type='button' class="edit_button" id="edit_button<?php echo $row['id'];?>" value="edit" onclick="edit_row('<?php echo $row['id'];?>');">

>>
>>60808381

No anon, that is your php code on the server side, you need to write client js on the onclick attribute, like this: onclick = function(event) {...}.

You will need a new request from your client.
>>
If I know html, css and very basic php (require, array, if, else, sanitizing, but no database stuff yet) and made a Wordpress theme before.

How long would it take to learn proper php? With that I mean having the skill to be able to make a webshop (without payment integration) for example.
>>
>>60808381

Do you have a script tag loading js on your page?

Write a function in that to grab your input buttons
with getElementByClassName, and set the onclick event on each to get your data.

Read this >>60807797.
>>
>>60808616
19 weeks
>>
>>60808692
19 weeks 2 days, 4 hours, 12 minutes and 32 seconds.
>>
hey guys, working on some Python exercises, and I solved one but I don't understand quite how it works. here is the assignment:

>Write a function called cumsum that takes a list of numbers and returns the cumulative sum; that is, a new list where the ith element is the sum of the first i+1 elements from the original list. For example:
>>> t = [1, 2, 3]
>>> cumsum(t)
>[1, 3, 6]

and my solution:
t = [1, 2, 3, 4]
def cumsum(x):
b = []
for i in x:
a = x[0:i]
b.append(sum(a))
return b

print(cumsum(t))


I don't really understand the "a = x[0:i]" part. I thought slicing x[y:z] started the slice at y and went up to, but NOT INCLUDING, z. So in my code, when it's running through the second element, i=1, it should slice to [0:1] meaning just the first element... Where am I getting this wrong?
>>
>>60808712
>19 weeks 2 days, 4 hours, 12 minutes and 32 seconds.

How much time should I add to factor in the fact that I have about 6.5 TB's of loliporn and no will to keep myself from compulsively jerking off to it? Serious answers only pls
>>
File: 7ef.jpg (29KB, 600x600px) Image search: [Google]
7ef.jpg
29KB, 600x600px
>>60808737
wrong thread anon
>>60804534
>>
>>60808712
only if you take into account the prolonged victory fap session one deserves after mastering php

>>60808737
i think "for i in x" doesn't do what you think it does
>>
>>60808776
lol what if I'm only studying python to do webdev? Am I not allowed in here even then?
>>
>>60797016
what is the name of this theme? i need to know.
also what site is this?
>>
File: eaZrosc.png (363KB, 5000x5000px) Image search: [Google]
eaZrosc.png
363KB, 5000x5000px
>>60808803
no i get it, but imagine every person posting their coding exercises for C#, Python, Java in here, because in the future they will or might do backend programming.

I know there are also a lot of JS questions here, but at least JS is deeply ingrained in webdev, that learning JS is basically equivalent with learning to write interactive website features.

I know leddit is shunned, but for things like this it might be your best bet, if you absolutely can't solve it yourself after trying and googling your problem for a while.
or try /sqt/

but yeah, "i" isn't your index but the value in that case, so it just happens to work, for this specific array.
Change the input array and your code will break.
(at least that's what it looks like, without knowing too much Python)
>>
>>60808381

id recommend not using your back end to append stuff to your html.
>>
>>60808737

I think >>60808790 is correct

You should be doing
for i in range(len(x)):
instead of
 for i in t:


The code you have gets each value inside of t, while the range(len()) code gives you the index of each value.

So e.g. the slice for the second element, i actually equals 2, since that's the second element. In the modified code, that value is the second index, which is 1. Essentially the test case made it look like an off-by-one error.

Also, you could be doing this somewhat more efficiently, and not use array slices at all, but I suspect that the point of this exercise is to practice those.

Anyway, good luck!
>>
>>60808737
I would use something like this:
def cumsum(i):
c = 0
while i:
c += i.pop(0)
yield c
>>
>>60809147

So you oppose using php to generate html entirely?
>>
>>60809361

there are better more modern ways to do it. Use your back end to spit out json and use your front end to bind that data so its viewable

your html shouldnt have any php in it if done correctly.
>>
>>60797954
Interesting. Not sure if this anon is here still, but have anybody else gone with this method to get freelance or side work?

>>60797988
Not sure if this anon is here again either, but how does one go about doing contracting through an agency? That sounds /easymode/, and I wouldn't mind doing small things to build up a portfolio.
>>
File: 1490782816643.jpg (35KB, 381x330px) Image search: [Google]
1490782816643.jpg
35KB, 381x330px
>>60808737
#[1,2,3] => [1, 3, 6]
saynomorefam = [1,6,9];
def justfuckitallupbackwardsfam(arr, b):
eljusto = 0;
for y in range(b, -1, -1):
eljusto+=arr[y];
return eljusto;
def justfuckmyshitup(arr):
newarr = [];
for x in range(0, len(arr)):
if x == 0:
newarr.append(arr[x]);
else:
JUUUST = justfuckitallupbackwardsfam(arr, x);
newarr.append(JUUUST);
print(newarr);
justfuckmyshitup(saynomorefam)
>>
>>60809435
2manymemes4me
>>
>>60809398
>there are better more modern ways to do it. Use your back end to spit out json and use your front end to bind that data so its viewable
this completely depends on the use-case. in a lot of them doing a "fat client" is not really worth it
>>
>>60809611

>fat client

what do you mean by this?
>>
>>60809678
mostly that the responsibility for getting data and rendering it into a template is moved from the server to the client
>>
What's the point of cors preflighting?

>Unlike “simple requests” (discussed above), "preflighted" requests first send an HTTP request by the OPTIONS method to the resource on the other domain, in order to determine whether the actual request is safe to send. Cross-site requests are preflighted like this since they may have implications to user data.

What safety implication are they talking about, and why doesn't it apply to POSTs?
>>
>>60809708

i dont see your point. Its still better to use the json binding method, thats also how you prevent the browser from refreshing so much
>>
File: 582017114458.jpg (61KB, 640x640px) Image search: [Google]
582017114458.jpg
61KB, 640x640px
Fucking dammit, Kumar. Get your shit together!
>>
>>60809894
He's telling you that your CV is so shit it can't be current. You better ask him to fight you.
>>
>>60809875
this adds a lot of complexity that isn't always needed. the performance gains from caching (server-side) are often bigger than the losses from reloading the page
>>
>>60810000

i agree that you have to counter un wanted caching, but its not hard thing to do

and i would agree that its less complex. Your html pages are much more readable and your files are easier to manage since your front end and back end arent intertwined together. I dont see at all how its more complex
>>
>>60810037

i mean i disagree that its more complex
>>
ive only ever used IIS, what is the benefits to using node? so i set up the server and then what? just use javascript instead of another back end language?
>>
>>60809996
I think you're right actually. Everyone asks for an updated resume hoping I will somehow add a decade experience to it.
>>
>>60808937
If you think about the biggest demographic on 4chan, most of them won't get jobs at places too big and otherwise will be at small businesses where both or predominantly backend is common.

>>60808616
Don't learn PHP unless you have already been offered a job to code PHP. Learn JavaScript and then either choose node for backends or be 1337 and go C#.

This is how "good" websites are written today. Also, learn react, it and server side rendering is probably going to be standard for some time.
>>
help a retard out, whats the difference between a web server and a proxy?
>>
>>60810037
>>60810049
user wants to read a blog post with id 9

fat server:
1. receive GET posts/9
2. front controller routes this to PostController.getById(9)
3. ask db for the data
4. inject the data into a template
5. send the html page
6. user's browser renders it

fat client:
1. receive GET posts/9 on web server
2. send html with javascript
*** the above only happens on the first request ***
3. client renders it and runs the javascript
4. client-side app parses "posts/9" and calls the shit it needs to call
5. api access layer sends GET posts/9 to api server
6. api server receives GET posts/9
7. front controller routes this to ApiPostController.getById(9)
8. ask db for the data
9. send data as json
10. client receives the data and injects it into a template
11. client modifies the dom

this is what I mean by more complex
>>
>(N) salary as a CTO of a small startup (12 non IT employees)
>2(N) salary as an intermediate dev in a large enterprise

What would /wdg/ pick?
>>
>>60810539
CTO.

Definitely CTO.
>>
>>60810539
How long has the startup been around? How risky do you think it is?
>>
>tfw your JS password validator came out working PERFECTLY
I am loving webdev lads
>>
this place is comfier than dpt
>>
File: 534.jpg (96KB, 390x390px) Image search: [Google]
534.jpg
96KB, 390x390px
>>60810946
>>
File: 1362369111455.jpg (21KB, 372x260px) Image search: [Google]
1362369111455.jpg
21KB, 372x260px
>Webpack v1: March 2012
>Webpack v2: January 2017
>Webpack v3: Mid/Late 2017
>>
>>60811274
Dumb frogposter. Post the yoba version.
>>
>>60810809
been around since november
backed by some decent shareholders from different western countries
>>
>>60811382
if you think the startup is not gonna go under in one year, take the CTO position, hang around for one year, then start looking for something else with better money. Having that CTO on your CV is good for you.
>>
I'm working with money on my database, which I have set as Decimal in Django. But I need to do operations on it and those operations involve floats. I can't have floats together with decimals, because of Type Errors, so how do I convert those floats into decimals? I can't seem to find a way...
>>
File: tele.jpg (45KB, 500x500px) Image search: [Google]
tele.jpg
45KB, 500x500px
want to start a band website that will also offer downloads of our mixtape. haven't made a website since 2011, then used LAMP/drupal

>what technologies should I use
>if the tape is ~.5gb how much bandwidth should I start with hoping for 2k downloads per month to start
>>
>>60812136
I would just do a landing page with an action shot of the lead guitar playing or singer as the background. Have a center button "Have a listen" with "500MB" right below it in subscript. Then use fontawesome and have your social links below the button.

Top center have the band logo.

Consider 3rd party for the file download.
>>
>>60812136
post link to tape, wanna have a listen
>>
How do I test JS programs?
In Java I would mark everything @Autowired and provide mocks/stubs for test run.
In Purescript I would use Reader monad and provide a stub config value.
What shall I do in JS?
>>
File: wdg.png (20KB, 560x544px) Image search: [Google]
wdg.png
20KB, 560x544px
>>60812136
>if the tape is ~.5gb how much bandwidth should I start with hoping for 2k downloads per month to start
0.5gb * 2000 + something extra ?? really now anon

anyway, compress that shit, if you want many people to listen to it and not be discouraged by the size.
A 3rd party service would be your best bet imo. Bandcamp, Soundcloud, etc., right? Not in the "music scene" and no idea how people usually do it, but that would be my guess.
much success to you anyway, if your music is good.

Depending on how complex you want your site to be, you can get away with a very basic set up.
Just a single page with info about your band and links to your stuff, just stick to normal HTML/CSS without anything extra.
With more pages you could start looking at static site generators.
You will be able to host it for free with Github/Gitlab Pages or something like Netlify.
>>
>start project
>invest couple of days into it
>realise nobody will ever use it anyway
>drop project
>rinse & repeat
how do I break this vicious cycle?
>>
>>60812248

jasmine js
>>
>>60812400
Instead of dropping the project, try not dropping it instead
>>
>>60812442
Testing library does not matter, I'm asking about code structure.
How shall I organize my code to easily switch between real and fake objects?
>>
>>60812400
Make a project that you will use.

Problems that you have are usually problems that other people have.
>>
>>60812642
but what if I don't need anything senpai ;_;
>>
>>60809766
pls
>>
>>60797016
Your if statement is all fucked up, one = is assigning something to a variable, also wtf is with the commas that should be || aka or;
>>
>>60797533

go to dribble and look at their ux design, mobile design, all design, and web design. that kind of stuff is what you want for portfolio
>>
File: neet.png (71KB, 300x468px) Image search: [Google]
neet.png
71KB, 300x468px
>>60812768
>needing people to use your projects
Just write stuff that nobody will use and delay applying for a job until you die. That's what I do : ^)
>>
>>60809766
The safety implication is that when you send a request to another origin, you essentially look like that user to that server. So they might send sensitive data that you, as another website, shouldn't be able to read.

Imagine if any site you went to could make a request to Facebook (or any site you're logged into in that browser) and see a bunch of data about you.

Some sites allow cross origin requests of certain stuff, so there's an HTTP request that checks whether the site that you're going to request from supports it.

I'm not entirely sure why it doesn't apply to POSTs.
>>
>>60812400
why are you doing these projects? For yourself? To convince your potential employers that you'd make a great hire? I'm doing projects for the latter, so I don't care if anybody ever visits my sites. Hell, I won't even visit them once they're done. But who cares, as long as I end up getting a job.
>>
>>60812768
I don't know, reimplement something that you already use?
>>
How to improve your github profile:

I may be doing this wrong, but it seems like whether I make 1 commit of just 1 file, or 1 commit of 50, it all counts as 1 on my contribution chart (the green square thingies). So should I space them out and make all smaller commits, just to make it seem like I'm more productive? Or do employers see through that bullshit straight away?
>>
>>60812127

Not familiar with Django but it doesn't make sense to convert floats to decimals you'd loose values, better change your django code to work with the correct type.
>>
>>60813015
>Imagine if any site you went to could make a request to Facebook (or any site you're logged into in that browser) and see a bunch of data about you.
But the preflight is just asking the server if it supports CORS and a particular verb, isn't it?
Wouldn't a malicious request get the same response as a genuine one, and wouldn't a malicious server give whatever response was to its advantage?
>>
>>60812768

Then you need to engage in already existing projects.
>>
>>60813185
yep, exactly what I am planning to get into next month. any tips?

Is it just "clone -> fix bug -> pr" for open source things?
>>
What's the best way to parse Markdown in Perl? If I end up writing my own parser what do I need to know first (common pitfalls, etc)?
>>
>>60813226

Not sure how it works for web apps, but I guess it just pushing changes for bugs or improvements.
>>
>>60813128
>But the preflight is just asking the server if it supports CORS and a particular verb, isn't it?
Yes

>Wouldn't a malicious request get the same response as a genuine one,
The server only knows "it's fine for anyone to access this" or "it's not ok for anyone to access this". The data that's being requested is either safe, or it isn't.

>and wouldn't a malicious server give whatever response was to its advantage?
Hmmm. I guess so? I still don't entirely understand CORS.
>>
>>60813082
Anyone that actually gives a shit enough to look at your github profile isn't going to stop at the green square thing so if you're making a bunch of superfluous bullshit commits to pad your numbers it'd be pretty obvious. You obviously don't want to be completely devoid of activity, but overall I'd say quality > quantity. Focus on writing good code and actually improving and maintaining projects over time instead of shitting out a bunch of half-finished stuff.
>>
>>60813416
Oh, I forgot to mention, you can also specify CORS access for only specific sites, if you want something like an API that your other, related site can access, but random sites on the internet cannot.
>>
How would i go about creating a fourm/chan type of website?
What languages should i learn?
I only know html and css, learning php atm
Any advice?
>>
File: back-end.gif (971KB, 270x252px) Image search: [Google]
back-end.gif
971KB, 270x252px
>>60792937
I had my hopes for front-end till I got myself internship last year.
Never again.
>>
>>60813444
>Focus on writing good code and actually improving and maintaining projects over time instead of shitting out a bunch of half-finished stuff.

It's not like that at all. Every day I work on my projects and modify tons of files etc. The question is, if I upload them all in one commit, it's just 1 contribution. But if i commit them one at a time, I get a ton of contributions.
>>
>>60813486
details?
also, what are you doing now?
>>
>>60812219
not done yet, drums being worked on. maybe i'll pop back in a couple weeks when I got the site up
>>
>>60813691
one of my coworkers did this. Mind this was a full time job. Finished his work on Monday then split it into 5 commits for reporting to suits. They had no idea.
>>
>>60813828
what did he do the rest of the week? Was he in the office with everybody?
>>
>>60813691
Right, what I'm saying is that you should focus on making actual meaningful progress, not making a ton of commits. Generally speaking, no one looking at your github profile is going to care about that level of granularity. If anything, they'll want to see if you have contributions on a regular (daily, weekly) basis over a long period, and beyond that, they'll just want to go though your actual code to see what you're doing. Really though, you should strive for one commit per meaningful change.
>>
>>60813764
Typical front-end task like working with jquery, sass, gulp, compass and bootstrap. Testing of newsletter layouts in Litmus and working with some of the shitiest CMS's in the industry (forgot the names).

Doing PHP now, planing to switch to something else.
>>
Pls help. Dumb intern here

I've been conscripted to write an API for our frontend devs to query the backend shit so frotend niggers need not worry about that. But I have no clue what this means and my boss is being intentionally vague.

Frontend: Javascript Angular
Backend: Node

So does this mean I write, in Angular, some queries to the backend? Or does it mean I write, in Node, some shit that queries our databases? I think it's the former. So does this mean the code "lives" in the client's computer and thus I need to encapsulate HTTP requests within my API methods?
>>
>web dev
>programming
lul
>>
Why won't this code run in jsfiddle?
function getNameOfJon() {
var name = prompt('What is your name?') {
if (name == 'Jon') {
alert('Hello there, Jonathan.');
} else if (name == 'John') {
alert('You have no real name!');
}
else {
alert('What kind of name is that?');
}
}
}

getNameOfJon();
>>
>>60814728
Create REST API. Frankly you should have understood it yourself.
>>
>>60814872
Looks like you have one } extra. Should have shown up as syntax error. You did try to run it somewhere where you can see errors right?
>>
>>60814872 here, tested code in Firefox console. It's just JSFiddle being a bitch, the code works perfectly.
>>
>>60814728
lol you should get your boss to give you clear instructions, but it seems like even if he did you wouldn't understand.

You're supposed to write a REST API in node that takes queries so the frontend guys can query the backend database as they need.
>>
>>60815181
But the API is in Node which exists on our server, not the client, right? So how could the Angular (which exists on the client's computer I think, not our servers) get at it? Yes I am stupid
>>
>>60814728
>>60815288
how did you even get the job
>>
>>60815298
>job
Internship
>>
>>60815288
>>60814728
what country are you in and what's the type/size of your company?
>>
>>60815346
At least it's a morale boost for /wdg/ neets.
>>
>>60815288
They're gonna request a URL that looks something like"/get-data?thing=thing-i-want&id=12345" (assuming it's a GET request), and you'll have to use the data from that URL to find the data in the database, and respond to the request with the info they wanted. Probably in JSON or XML or something.
>>
>>60815288
just tell your boss it's somewhere in the cloud, front-end just has to find it.
>>
>>60815415
USA. Medium size, ~150 employees. Software is their product.
>>
Is it legal to completely scoop a website's idea? There's a website just for my university that some student years ago wrote that checks if a course opened up, but it's $1 per course. I want to make a free one. Is that illegal?
>>
>>60815660
yes, like 99% of what exists on the internet is copied from some existing idea
but don't copy code or design of course
>>
>>60792937
What kind of skills and things do I need to be able to do before I can get my first job as a junior back end dev?? Everything seems to be front end advice.
>>
>>60815419
You must not come here often. I know 3 of us that got jobs since coming to these threads.
>>
>>60814728
If you're using Node, use express, make some GET and POST services based on what you need to send. Based on what the service is (and any data they send in POST), spit out some JSON as a response, probably based on some database query. Pretty much the same way you handle web services in any language. You don't really need to know what the frontend is going to look like to make a web service.
>>
What is the lightest way to have a css color change with clock time (it can be system or server time)
>>
what front end projects to tackle? css, html, and js
>>
>>60817380
This isn't that light, but you can do it like this.

const comment = document.getElementById('m60817380')

function changeCommentColor() {
const hue = ((Date.now() / 10.0) % 360)
comment.style.color = 'hsla(' + hue + ', 100%, 50%, 1)'
requestAnimationFrame(changeCommentColor)
}
requestAnimationFrame(changeCommentColor)
>>
>>60817380
Really really really long animations
>>
>>60814767
the programming is the simplest part
>>
>>60817380
https://jsfiddle.net/f9b9sbr4/1/
>>
Are websites slowly becoming operating systems?
>>
>>60817874
no
>>
Poo.init()
>>
>>60817874
No, web browsers are. Except they don't have their own drivers so a better term would be userspace. For a full realization of your idea, see: chromeOS.
>>
File: installing.png (22KB, 262x405px) Image search: [Google]
installing.png
22KB, 262x405px
>>60817961
This

And basically pic related
>>
>>60794246
Don't fall for the jewdegree. Just get some experience first before you go signing your life away in loans.

Least look at the current and future job trends, I ain't paying for your loan.
>>
Has anyone put a sortable inside a carousel?

The idea is an arrangable 3x3 box grid inside one slide, and the carousel would have a of these slides.
Bonus would be to keep the currently dragged tile as the carousel moves to the next slide and you can drop it there. Like how you can re-aeeange apps on your phone.

So far my dragged tile gets destroyed when trying to advance. Its something like
<carousel>
__<sortable> <!--9 divs--> </>
__<sotable2> <!--9 more divs--> </>
</carousel>
>>
Best framework:
http://vanilla-js.com/
>>
>>60818660
>http://vanilla-js.com/

https://hackernoon.com/how-i-converted-my-react-app-to-vanillajs-and-whether-or-not-it-was-a-terrible-idea-4b14b1b2faff
>VanillaJS is a framework written many years ago by a dude called Brendan that is rarely used anymore.
>>
>>60818660
haha so ironic I'm loving it while sipping my starbucks latte
>>
File: Expierment.webm (988KB, 1574x980px) Image search: [Google]
Expierment.webm
988KB, 1574x980px
Here's my current idea.

Eventually it will just be a contact card. (clouds are stolen but serve as a general idea). Thoughts? Also 100% css
>>
>>60794246
completely depends on the details of your situation, for most people probably not
>>
>>60820093
urban dictionary for teletubbies?
>>
>>60820138
Literally just a contact card. I bought the domain but cbf doing anything with it now
>>
>>60820093

/pol/tards, everyone..
>>
using redis as primary datastore in an expressjs app, i have my routes in /routes/ and a /models/ directory. my question is, how do I manage redis connection among the different models?
>>
if you guys need a CMS for an eCommerce, don't use Prestashop.
>It has no stock features and unless you're an experienced developer and you can develop those things by yourself, you're fucked.
>It's needlessly complicated
>Wordpress sucks
>The community sucks and even if you buy something they will abandon you.

Even as a market for you to sell modules and themes, don't use Prestashop.
>>
>work and get a portfolio pretty much at if not very close to hiring 3 months ago with laravel stuff
>get an interview with launchcode planned
>apply to a bunch of jobs
>totally stop coding and worry about not having active github stuff so cancel everything
>spend next three months doing nothing but watching anime (took a month and a half to finish all of naruto)and being a neet

finally got some motivation to start working on stuff again see how long it takes me to remember stuff

Wish me luck!

Will probably focus on learning wordpress or something becuase of lots of jobs like that
>>
File: 1430273974307.png (9KB, 401x367px) Image search: [Google]
1430273974307.png
9KB, 401x367px
>trying to learn node.js
>so many fucking callback functions
>so many .shit().like().this()
this is so intimidating. do you eventually get used to it or does it still feel awful even after getting experienced?
>>
>>60820744
What's wrong with it? Not the most elegant solution but it's perfectly sensible. The function you're calling doesn't know when it will return, so it takes a callback argument. When the function is done doing its business, it calls the callback to return control over to the callers code again. You're only passing it a function like you would pass any other variable.
What exactly feels awful about it? Just the nesting? Approach that like you would anything else, extract code into its own functions when you get too deep.
>>
>>60820744
meh, callbacks you'll get used to and learn how to write them in a clean way, but I avoid chaining and libraries that depend on it.
>>
>>60820744
>so many fucking callback functions
Use promises/async-await where possible.

>so many .shit().like().this()
Method chaining is actually super useful when you get used to it. someArray.map(someMapFunc).filter(someFilter).reduce(etc)

In other words, yes you get used to it. Keep practicing.
>>
>>60820744
let me guess, you are
>>60709280
>>60709224

there are issues with JS, but this is not one of them.
put those functions in multiple lines then, if you want.
Regarding callbacks, that's gotten a lot better now with promises and async
>>
>>60820777
actually i'd go so far as to say that I prefer async callbacks compared to other methods of handling concurrency like coroutines, promises, etc.
>>
File: 1495678280022.png (301KB, 800x1065px) Image search: [Google]
1495678280022.png
301KB, 800x1065px
>>60815756
Also a friend doing webdev said this is what you need to know:
>web sockets (brief knowledge>
>security
>deploying
>emphasis on auth, lots of OAuth
>ORM's
>API's
>tests

And that's basically it, for a junior/entry position. Just try to focus on one thing per week, 1 thing every 15 days, once you have the general language knowledge of course.
>>
>>60820819
Thats good advice anon but i'd suggest skipping orms for now and focus on basic database connectors and raw sql. orms are kind of weird and don't map well to every problem and also add a lot of overhead. they're pretty dope sometimes though
>>
File: startup.jpg (124KB, 2500x1500px) Image search: [Google]
startup.jpg
124KB, 2500x1500px
Hi guys. This is corny but I have this idea for a website to work over this summer. I was wondering if you could let me know what you think.

Basically a website where skateboarders and video editors match up to tackle projects. The design of the focus of the website will be like a timeline where the couple deliver content including updates and the final edit of the video. Users interested in the work may show support by donating and subscribing for a fee and following
>>
File: Iamthatfeel.jpg (379KB, 800x600px) Image search: [Google]
Iamthatfeel.jpg
379KB, 800x600px
>>60820774
>>60820777
it just feels so different from other languages and when i code by myself i dont know when should i be using it.
>>60820805
not me lol. i always use a pic to attract attention
>>60820802
i would feel less lost in chaining if there was an IDE on the level of visual studio for C#. many IDEs with javascript just autocomplete senselessly. i think i heard visual studio has support for javascript now
>>
>>60820945
>i would feel less lost in chaining if there was an IDE on the level of visual studio for C#. many IDEs with javascript just autocomplete senselessly. i think i heard visual studio has support for javascript now
Start a typescript project RIGHT NOW

It will save your soul.
>>
>>60820945
You should be using callbacks for anything that "blocks", so file operations, networks operations, etc.
>>
Jesus, google adsense is slowing down my webpages and then the ads aren't even showing up.
>>
>>60820858
Yeah, kinda agree. That's what my friend said, I would put basic SQL stuff before the ORM for sure.
>>
>>60820093
Looks nice but stay off /pol/, it's mind-rotting garbage
>>
To anyone using Django, should I use OAuth or is it ok to stick with the default django authorization library, Django-Registration-Redux? Pros/cons etc?
>>
>>60820819

When people say to learn "security" in the context of web dev, what do they specifically mean? Are there any good books or guides that provide a good overview of what a web dev should be responsible for in terms of security?
>>
>>60821210
authentication and authorization (access-control)
you need to be able to provide a way for people to prove they are who they are and make sure that each user group (role) can only access and do what it should be able to access and do, and not more
>>
>>60821263
to prove they are who they say they are*
>>
>>60821210
you should understand sql injection, code injection with stuff like eval, xss, csrf, cors, file permissions and basic linux security, you should understand the difference between md5 and bcrypt/scrypt and why one is better than the other for secure password hashing. I can't really think of anything else right now. http://owasp.org is about the best resource you will find.
>>
>>60810261
Thanks for the tip. I can do Javascript first. It seemed pretty straight forward.
>>
can someone please explain mvc to me? its been 2 years and i still dont get it
>>
File: model-view-controller-03.png (6KB, 727x378px) Image search: [Google]
model-view-controller-03.png
6KB, 727x378px
>>60821883
>http://www.tomdalling.com/blog/software-design/model-view-controller-explained/
Read that.

Model-View-Controller is basically separation of concerns, you have to separate the 3 objects/functions. Model is your database and the classes you have stored there. View is the templates that you show to the user. Controller is the programming logic you use to get the data from the database (not all of it, just whatever is necessary) into the template.

It's not a very rigid thing, meaning every language will implement this but varying it to a certain degree.

Stupid example here that might be a bit off:
-in your database (MODEL) you have info on all kinds of stocks and their daily price: "stock name", "date", "value".
-in your scripted program logic (CONTROLLER) you have database queries that take 1 stock, find its average value for the last year, average value for the last month, and 7 daily values for the past 7 days. Just querying stocks on particular dates and doing some averages, simple math. This data is then passed on to the view...
-The templating part, what the client sees, is the VIEW. Here you take the data passed on by the controller and display it somehow. "The yearly average price of {{your stock}} was {{x}}, its monthly average price was {{y}} and here is a graph for its last week's price: [[cool javascript graph here]].

The idea is that you could potentially change either one of those elements without disrupting the others. Also, if you tell us what language you use, people might be able to give more detailed explanations. Also, if you can't understand this, backend might not be your thing. Go frontend all the way.

Feel free to correct me if I'm wrong, anybody.
>>
>>60797767
I do freelance work. I worked for 10 years on salary though, so built up a lot of connections and a large portfolio. I get work through word of mouth.
>>
>>60798069
>>60798493
It can be quite nice to use objects for this kind of comparison:
const beats = { rock: 'scissors', scissors: 'paper', paper: 'rock' }

function playGame (userChoice, computerChoice) {
if (!beats[userChoice]) { throw new Error('Bad user choice') }
if (beats[userChoice] === computerChoice) { return 'You have won!' }
if (beats[computerChoice] === userChoice) { return 'The computer has won!' }
return 'The game ends in a tie'
}

console.log(
playGame(
prompt('What is your selection?').toLowerCase(),
['rock', 'paper', 'scissors'][Math.floor(Math.random() * 3)]
)
)
>>
Reminder that rails is still alive and relevant unlike PHP
>>
>>60822338
that is really neat
>>
>>60820819

If you want to really have a solid foundation (and you don't really need one to get an entry level position), than make a simple web framework from the scratch.

First of all:
Look at test driven development. TDD gets a lot of flak, but for beginners it's a great way to work, because it will teach you good habits. Also you need to test your code a lot more when you are a beginner.

Start with making a simple web socket for http and https. Maybe a small server, that accepts a connection, returns the curretn date and closes the connection again.
It's not difficult, but depending on how low level you get, it can be confusing. For example when you go real low level (like C) you have to think about big-endian vs. little-endian URLs. Higher languages like Python already keep a lot of stuff away from you.

Then get into the basics of TCP/IP and client-server architecture. Look at HTTP requests and HTTP status codes. If you aer a hotshot, read some RFC

Then make your own ORM that translates into SQL. Doesn't have to be elaborated, I'd rather only support MySQL and add others ony if you like to. And if you keep it low level it's fairly simple..

Table.select('*').where('This = "that" ').first
SELECT * FROM Table WHERE This = "that" LIMIT 1


Then add some simple security features. Learn to protect against traversal attacks, sanitize your SQL strings against SQL injections, take measures against XSS and XSRF. Doesn't have to be super great, rather understand what it's all about.

AND READ SOME RFC'S !!

>https://tools.ietf.org/html/rfc1925
>https://tools.ietf.org/html/rfc1178
>http://www.rfc-base.org/txt/rfc-2616.txt


>>60822368

Both are still alive and relevant.
>>
>>60822338
nice. I'm gonna memorize this one, and next time at an interview when they ask me "So, can you do a quick fizzbuzz for us?" I'll be like "Not yet, still figuring that one out, but check out this badass Rock Paper Scissors!" I'll just blow them away with this shit.
>>
File: Untitled Diagram (1).png (81KB, 1021x616px) Image search: [Google]
Untitled Diagram (1).png
81KB, 1021x616px
>>60821883
>>
>>60821883

Like the other anon already said, MVC will always vary.

The basic thought is about "seperations of concerns", but the details are often differernt.

Bascially the Controller does control the programm flow (unlike in MVVM), the Model does have the abstraction of data and data manipulations and View is the user interface.

But there's a lot of tiny questions with differernt implementations. For example:
-where does data validation happen? (only controller? already at the view? also at the model?)
-is there any sort of control logic in the view?
-thin controllers or thick controllers?
-who does communicate with whom?

Every MVC architecture will answer those slightly different..
>>
>>60822368
Rails is dying
Just use Node
>>
>>60822795

But it's really not.
It has been grownig again the last two years and there are a lot of Rails jobs out there.

Wether you like Django, Rails, Laravel, Node, Angular2.. you can't really go wrong with one of the big frameworks and I wish people could just stop flaming and use what they like.


Also "use Node instead of Rails" is like saying "use a big engine instead of a lexus."

Rails is a full-fledged MVC framework. You can also use it in API mode and feed something like Vue.js, but usually it's a one-man army.

Node is only one part of the picture. It's called MEAN-stack, and not NODE-stack, because you need a couple of things to have the full Rails functionality.

And both have advantages and disadvantages..
>>
Going from javascript/jquery on lamp/lemp
to
node socketio and phaser

A WHOLE NEW WOOOOOOORLD
>>
>>60821883

model = store.items;

view = "your backpack has {{ items.length }} items

controller = store.push({item1: "itemname1});

view automatically updates(reacts) when model(store) changes.

Try using vue.js and you already have MV-VM.
Just pick your controller of choice. Either a mediator.publish(additem) or manual store.push(...
>>
>devving
>test on 5 browsers, 5 devices, across Win/Linux/osx/Android/iOS systems
>all good
>doesn't work on client's machine
just like can't wakeup
>>
>>60797016
hint :
>var computerChoice = Math.random();
>if (computerChoice < 0.34) {
> computerChoice = "rock";
>}

>>60808883
codecademy
javascript editor and runtime inside a webpage
>>
>>60822338

why not pass in
beats[Math.floor(Math.random() * 3)]
as the computers choice?
>>
>>60823803

That would not work, since your expression would return "undefined". You can't query a Hash like an Array..

But this would work:

Object.keys(beats)[Math.floor(Math.random() * 3)];
>>
What's the best introduction to jquery?
A lot of job listings mention it, I've used particular features before, but I've always felt some irrational resistance to it. Is it good?
>>
>>60824840
I-I-I need to add that I'm not taking 'Sponsored by jQuery (the /wdg/ frontend framework of choice) Edition' as a serious recommendation.
>>
new thread
>>60824899
>>60824899
>>
"Your application has been viewed by X Company"

"Your application has been viewed 4x by X Company"

"Your application has been viewed by X Company"

PANIC
Thread posts: 314
Thread images: 36


[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.