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

/wdg/ - Web Development General

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

Thread replies: 321
Thread images: 31

File: 1487701743799.png (731KB, 824x553px) Image search: [Google]
1487701743799.png
731KB, 824x553px
Previous thread
>>59501345

>Discord
https://discord.gg/wdg

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

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

>Useful Youtube channels
derekbanas
thenewboston
learncodeacademy
funfunfunction
computerphile
codingrainbow

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

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

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

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

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

>cheap vps hosting in most western locations
https://lowendbox.com
https://www.digitalocean.com/
https://www.linode.com/
https://www.heroku.com/
https://www.leaseweb.com
>>
>hm, better way would be to duplicate the code like it is normally done...
These are the fucking people I have to work with.

REEEEEEEEEEEEEEEEEEEEEEEE
>>
>>59554759
It's true though. That's exactly what you should be doing.
>>
>>59554469
Anon checking in from 2 days ago about having a web dev interview with no experience

For some reason there was no technical question, and I was able to get it by throwing out buzzwoods like docker, angular, node, etc. Time to learn!
>>
>>59554877
It's not terribly uncommon to give jobs to people with no experience in a language.

You still have to pass your evaluation though.
>>
>>59554877
tell us about the job. How did you get the interview? Where are you located? Degree or not? Salary? What langs you code in?
>>
>>59555298
He said he has no experience and has to learn everything.

Basically a mcdonalds employee that knows the name of a few languages and pretended to know then.
He will be fired his first week
>>
Is it normal for working in PHP for more than a few hours at a time to make you want to suck-start a shotgun?
>>
what are your thoughts on bootstrap?
>>
>>59554877
Angular and node are not buzzwords mang
>>
>>59555645
Completely normal. I also experience it when I have to work with Java.
>>
>>59555747
Use it all the time, why not? No point in coding something from scratch if others have already done it for you.
>>
>>59555645
Joomla? Magento? A large Wordpress website? I'm so sorry, my man.
>>
Can JS save files on the hardrive and have access to the harddrive?
>>
>>59556085
WordPress plugin

//$p->field_number is 1.6
$i = intval($p->field_number); // 1
$d = ($p->field_number - $i) * 10; // 5 ?
$d = intval(strval($p->field_number - $i * 10)); // = 6
php_sublib14_end_life_routine_without_arguments('true');
>>
>>59556165
Many languages have issues when dealing with floating point aritmethic.
>>
>>59556190
Aye, the kicker for me was discovering that 1.6 was treated as a floating point number, because PHP has no fixed-precision data type.
>>
>>59556154
Only cookies.
>>
>>59556154
>>59556368
and localstorage,cache and indexeddb
but no direct write access to harddrive, only browser provided apis
>>
>>59556431
> localstorage
What is this?
>>
File: local storage.png (23KB, 957x447px) Image search: [Google]
local storage.png
23KB, 957x447px
>>59556433
browser provided api to save data
you can usually check these things content in your browser's dev tools
just google the apis, i think some of the most recent ones like indexed db are not fully supported in trash browsers
>>
>>59556490
Can I save a couple of images in localstorage?
How can I copy those images from localstorage?
>>
>>59556568
haven't use this stuff in a while but you shouldn't have problems finding help for this on the internet
first search result :
http://stackoverflow.com/questions/19183180/how-to-save-an-image-to-localstorage-and-display-it-on-the-next-page
>>
>>59555645
i wanted to do what when i didnt know it good
when i get lost in ' "
>>
I don't get docker. I'm testing it out with a Django site served on the localhost. I can run 'python3 manage.py runserver' fine from the command line and access localhost:8000 but if I try it through docker, it build perfectly well and there's no errors running a container with the output matching that of the command line way, yet I go to the address and I only get a 'connection reset' error. I looked into it a bit and it seems that the docker daemon/your container has it's own IP separate from the system you're running it on but I tried docker inspect [container] and the IP there gave the same issue.

Here's my Dockerfile:
FROM python:3.5
ENV PYTHONUNBUFFERED 1
ADD . /src
RUN pip install -r /src/requirements.txt
WORKDIR /src
CMD ["python", "manage.py", "runserver"]
>>
>>59556568
Base64 with image/jpeg header, my dude
>>
How would you guys write documentation for an API for a small project? I'm only working with 2 or 3 other programmers. The site receives POST and returns JSON.
>>
working on making a radio station with websockets in C. Host sets up a playlist, client receives an audio buffer and plays it. Host's audio buffer just sends out a buffer every second.

I'm probably in over my head since I've never done anything with video or audio streaming
>>
>>59557621
Use a documentation preprocessor

http://www.fusioncharts.com/blog/2013/12/jsdoc-vs-yuidoc-vs-doxx-vs-docco-choosing-a-javascript-documentation-generator/
>>
>>59557621
>>59557656
I should have mentioned I'm writing the backend in Django.
>>
>>59557011
you have to map the ports from the image to the host.
https://github.com/wsargent/docker-cheat-sheet#exposing-ports
>>
>>59557673
Do you use tokens?
>>
>>59557673
Use a Python documentation pre-processor:

https://wiki.python.org/moin/DocumentationToolshttps://wiki.python.org/moin/DocumentationTools
>>
>>59557743
Yes. That's how users are able to login and manage things.

>>59557745
thank you
>>
>>59557624
>never done anything with video or audio streaming
>C
Are you a masochist?
>>
>>59557776
I assume it's as simple as sending a buffer of audio data via websockets to the client, right? I need to use an mp3/wav/whatever library to get the data into a buffer and they every second just fire off 1 second worth of data. Writing a loop for playlists ought to be easy
>>
>>59556069
If you can optimize it
>>
>>59557703
I did that. I'll try again with a fresh perspective some other time as I probably missed something. It's not central to my project but it'll go a long way in making it scalable, plus it looks like handling nginx through docker is quite easy.
>>
i got that code to improve my work on our shitty cms:
javascript: (function() {if (fsON == null ){var fsON = -1; }if (fsON==-1){$("button[data-action='fullscreen#start']").click();}else{$("button[data-action='fullscreen#finish']").click();}fsON = -1*fsON;$("button[title='FullscreenToggle']").click();})();

the script actually clicks the button "fullscreen#start", but variable fsOn remains -1 seems like somethings wrong with "-1*fsON" so it won't execute the else argument.
any ideas what's wrong? i'm an absolute noob in js.
>>
>>59558198
fsON is always null because you set it inside your if scope and it's gone the next time the method runs.
remove "var" in front of it or declare it before you declare the function.
>>
>>59558249
nice, that actually coincides with a js-validator output, just didn't know exactly what to do. thanks, i'll try it out.
>>
Let's say I want to create/maintain websites for small businesses. What is the reality of tasks and responsibilities this position entails?
>>
Angular 1.x question here

I'm using ng-repeat in a web app to render a page with data from a json array. The problem is its a lot of data so it took a long time to load. So I used Infinite Scroll to deal with that. The problem now though is that the search filter won't work with data that has not been rendered onto the DOM. So items that aren't on screen won't show up on search.

Any ideas on a happy compromise? I need to keep the Search and I'm thinking of using pagination instead of infinite scroll, but that won't solve the search issue.
>>
>>59558485
>>59558485
* find client
* define scope of project
* make commercial proposition
* don't fuck up time estimations in proposition
* charge according to time estimation
* get client to accept proposition
* do the suff you signed up for in timely fashion
* change stuff so client is happy, but get him to not ask you to redo everything
* get client to pay you
* if maintenance define maintenance contract and send invoices while you keep track of bugs

you also probably want to set your own copany up so you can pay taxes and your clients get to declare their it costs

so you need project management skills, marketing skills, coding skills, basic sysadmin skills, accountant skills and basic law knowlege
>>
>>59558249
deleting "var" of "var fsOn = -1 did break the whole thing.
i put the var before the function and deleted the first if statement. like this, fullscreen#start worked, but still fullscreen#finish didn't:
javascript: (var fsON = -1; function() {if (fsON==-1){$("button[data-action='fullscreen#start']").click();}else{$("button[data-action='fullscreen#finish']").click();}fsON = -1*fsON;$("button[title='fullscreentoggle']").click();})();

also the following didn't work:
javascript: (var fsON; function() {if (fsON==-1){$("button[data-action='fullscreen#start']").click();}else{$("button[data-action='fullscreen#finish']").click();}fsON = -1*fsON;$("button[title='fullscreentoggle']").click();})();

you mind correcting my code? maybe then i'll learn something.
>>
>>59559064
Noted. Thanks for answering anon
>>
How to join multiple rooms in socket.io?
Or maybe should I use something different?
>>
>>59559134
damned, 2nd example should be:
avascript: (var fsON; function() {if (fsON == null ){var fsON = -1; }if (fsON==-1){$("button[data-action='fullscreen#start']").click();}else{$("button[data-action='fullscreen#finish']").click();}fsON = -1*fsON;$("button[title='fullscreentoggle']").click();})();
>>
>>59558485
To maintain you want to offer new features and bug fixing so set up some pricing standard and a ticketing system.
>>
>>59559156
what's with your javascript: anyway?
are you putting this to a onclick attribute? if so, stop. don't do this. add the event after you dom has loaded instead of abusing attributes like that.

put this at the end of your page.
(function() {
var fsON = true;

var myEvent = function() {
var dataThing = fsON ? 'start' : 'stop';
$('button[data-action="fullscreen#' + dataThing + '"]').click();

$('button[title="fullscreentoggle"]').click();

fsON = !fsON;
}

myElement.addEventListener('click', myEvent);
})();

replace myElement and click with whatever element and event you want to do that.

you could modernize this by a lot, but I don't know what browser reuirements you have.
>>
>create hexagon in javascript canvas
>use array input to a function to create the hex
>works fine
>do it again by putting the array in a variable
>completely breaks
why? nothing has changed except that the array is now a variable.
>>
>>59560123
post the code.
magic glass ball not working.
>>
>>59559461
i put the code in FF bookmarks which i can access with key shortcuts. so with alt-1 i can edit a textfield, form, table or whatever in our CMS, with alt-2 i can save it, with alt-4 i can make text a H4 etc. so the bookmark is not http: but javascript:
so my script should check the value of fsON and then either click the button[data-action="fullscreen#start"] or button[data-action="fullscreen#stop"].
no onclick attribute.
as you might expect, i know only little about js, but your code doesn't seem to fit my needs.
>>
>>59560206
make a userscript for stuff like that instead of using bookmarks.
>>
b-b-b-but i just want to make that script work!

>>59560229
still, userscript looks like an interesting thing, never heard of it.
thanks, also to >>59559461
>>
>>59560462
fine.
javascript:(function() {window.fsON = !(window.fsON ?? true);$("button[data-action='fullscreen#" + (fsON ? 'finish' : 'start') + "']").click();$("button[title='FullscreenToggle']").click();})();
>>
>>59560686
>>59560462
third fsON should be window.fsON too, change it yourself.
>>
>>59560139
meh i found the problem and commented out the single line of code that broke it...but i'm confused on why it was even breaking in the first place...it doesnt affect the array variable at all...even worse is that it will change the array even if it's a const which is mind boggling

it happens in both chrome and firefox too
>>
>>59560686
>>59560711
>>59560462

oh also, ?? should be ||.
wrong language.

here's the full fixed thing
javascript:(function() {window.fsON = !(window.fsON || true);$("button[data-action='fullscreen#" + (window.fsON ? 'finish' : 'start') + "']").click();$("button[title='FullscreenToggle']").click();})();
>>
File: elderly.jpg (31KB, 450x371px) Image search: [Google]
elderly.jpg
31KB, 450x371px
What does /g/ think of senior friendly web design?
>>
>>59560732
>>59560711
>>59560686
>>59560462
well fuck me, I forgot false would negate the initializer all the time anyway.
javascript:(function() {window.fsON = !(window.fsON == null ? true : window.fsON);$("button[data-action='fullscreen#" + (window.fsON ? 'finish' : 'start') + "']").click();$("button[title='FullscreenToggle']").click();})();
>>
Learning HTML and CSS

When should I move on from this? What projects should I do? I don't want to sign up on a website to view anything, by the way.
>>
File: 1488957450402.jpg (11KB, 420x420px) Image search: [Google]
1488957450402.jpg
11KB, 420x420px
>>59560736
It's a fucking nightmare to do something for the elderly/people who aren't used to computers.

I've followed a few usability tests on prototypes I've done and the logic computer illiterates use is so different to everyone else that designing a good UX for them means you're fucking the UX for the majority of your users.

>make awesome prototype
>everyone thinks it's awesome and super easy to use
>organize usability tests to see if there's something to improve before locking the specs and starting implementation
>everyone goes through the path without a single problem
>they praise the prototype
>then comes in the elderly test user
>can't get through any of the steps without help
>literally won't find the single button on the page to proceed
>tells that the prototype is shit
>mfw
>>
>>59560732
>>59560711
>>59560686
awesome! it works!
still don't get exactly what the part with the windows property does, gonna have a closer look at it tomorrow.
thanks a lot!
>>
Need help posted my question on stackoverflow,

https://stackoverflow.com/questions/43009883/making-a-post-to-mongo-database-using-redux-saga-redux-saga-mongodb

also anyone have any more docs or examples of using redux-saga with mongodb, in react?
>>
why have i been sleeping on mongodb so long? tried it for the first time last night and just want to migrate all existing mysql stuff to mongo
>>
>>59563048
Client: I need a report of [insert complex query with many relationships]. It should work fast.
>>
>>59563079
mongo makes sense when you're pulling JSON data from an API, just throw it in mongodb and then retrieve whichever data you need.

the mongo drivers for the languages i've tried are god tier as well.
>>
>>59563109
Many modern DB engines have support for JSON fields. Disk usage might be important too, based on the project.
>>
>>59560873

Go do the freeCodeCamp projects.

>muh sign up

Shut up.
>>
How can I practice using git if I only work by myself? I use it but I don't do any branching.
>>
So how do I into backend guys? Everything seems to be frontend focused. Do I need to learn some frontend before diving into the backend?

Got any good resources? Videos, books, anything?
>>
>>59560873
You should try following a tutorial that takes you to use cloud9 where those buttfuckers won't let you sign up for a FREE service without providing your credit card information (for identity purposes).

You don't even get to complain about email verifications anymore.
>>
>>59564233
Start using it more? Whenever you start working on a new feature, branch, work, commit and merge when you're done. If you use a service that has built-in issue tracking then use that to keep track of stuff you know you want to add.

I learned using the git-scm tutorials and still refer to them a lot.

https://git-scm.com/book/en/v2/Getting-Started-About-Version-Control
>>
Sup

I installed an SSL certificate for my site but it doesn't really work, it says "a part of this website is insecure". How can I fix it?

The site is placabit.net
>>
>>59565994
There's probably a script or stylesheet which is not https. Check all your src's and href's.
Also check your site with ssl labs. If you fix the issues and make sure you're setting HSTS headers you should be able to score A+.
>>
>>59565994
Its your counter plugin @
http://www.cerotec.net/contador.php?t=5&s=2&i=82706
>>
>>59566129
>>59566182
I tried removing the counter and now the error is different, it says "certificate emitter unknown" or something like that. What should I do? D:
>>
>>59565994
>a part of this website is insecure
That part of the website you.
>>
what is unit testing and why do i need to know it....hows it any diff than just testing your app locally...
>>
File: Ci9dn7vWYAAGbuV.jpg (52KB, 600x373px) Image search: [Google]
Ci9dn7vWYAAGbuV.jpg
52KB, 600x373px
>>59566444
>>
>>59566338
looks like only firefox is being autistic because the certificate is self-signed. It works fine in Chropera and that's good enough for me.
>>
>>59566482

wat
>>
>>59560873
learn javascript too while you're at it
>>
>>59566444
test all the small things in an automated way. make sure your functions do what you think they will.
>>
>>59566541
those units are still passing...
>>
>>59567334

didnt really answer my question straight forward but ok?
>>
>>59555747

its fine. i mean the most important part of bootstrap is it's grid system.
>>
Super dumb question, but Google results aren't paying off.

From the Chrome Developer Console, is there a way to "browse to" a function? i.e. if an element has an onclick handler of "myOnClickHandler", is there a way to quickly view "myOnClickHandler"?
>>
I need some advice, I think I am unable to cope with professional web development, it's just the level of clients and the work that is so dumb and boring (quit a project because simpleXML wouldn't parse values in an XML attribute, so annoying) but webdev is the most popular and well paying job around my area, what do?
>>
>>59567985
>function
When you inspect an element, on the right toolbar you should see the Styles, Computed, and Event Listeners tab...event listerners is what you want for events.
>>
>>59568029

Hm... I see the Event Listeners, but it's kind of confusing in this case. Sorry, but I'm way over my head. I'm not a web dev, and I'm trying to scrape the Toyota Information Services website to download entire manual PDFs. :-)

In this particular case, there's a function called "expandTreeSection" which appears to take a URL as a parameter, but looking at the 'Sources' tab and doing a Ctrl-Alt-F search for expandTreeSection doesn't return any results.

I'm making very slow progress, though. Thanks for the help.
>>
File: rubyist.jpg (18KB, 260x325px) Image search: [Google]
rubyist.jpg
18KB, 260x325px
How valuable is knowing Ruby in 2017 ?
is it dying basically ?
>>
File: notepad.png (18KB, 707x293px) Image search: [Google]
notepad.png
18KB, 707x293px
Why the hell do people still use notepad++? All the other editors in this list are better than it.
>>
>>59563079
Okay, no problem. Fortunately I have very few relations since I actually know how to use MongoDB, and for the cases where I do need to combine multiple documents and see poor read performance, I can denormalize my data to solve that problem.

How will you be paying?
>>
>>59568739

Notepad++ is the lightest-weight option with syntax highlighting (I think), huge file support, and quick startup time (not VS-anything). Oh, and no skill (vim).
>>
>>59568739
>vim for web dev
JUST
>>
>>59564233

Develop in feature increments. Each feature is its own branch. Have a release branch you merge your features into. Your feature merges should always be one commit. You only merge when all your tests are passing on your feature branch.

These rules will get you to use almost all you need in git - branching, merging, rebasing.

This tutorial will teach you everything you need to know to work with git - http://learngitbranching.js.org
>>
>>59568739
>visual studio/vim for webdev
I almost thought you were being serious. You got me.
>>
>>59569957
ASP .NET is still pretty big
>>
>>59569976
Yes, if you're retarded.
>>
>>59570019
Being retarded makes me quite a lot of money then.
>>
>>59570024
Congratulations, I'm happy for you.
>>
>>59570019
C# is comfy as fuck though.
You can set up an API with minimal effort.
>>
>>59569388
Why not? If you're not skilled enough to effectively use vim that's fine, but others are.
>>
I have been learning Ruby via Codecademy and some other beginner resources. The time has come to try and build my first basic programs and I'm just lost. Trying to create a Caeser Cipher. I know more or less what I need to do, but I just don't know how to implement what I've learnt already. I'm getting really bored working through coding/syntax tutorials but I feel like I haven't internalised enough concepts yet to actually biuld ANYTHING.

Do I have to just keep going over and over the basics until it sinks in? Or should I push myself and continue to flounder at solving problems like the cipher? I feel like I'm wasting so much time going nowhere.

Also, I'm working through Odin Project. Its very structured and you learn stuff in sections. I'm going to be stuck on the Ruby section for months at this rate. Is it advisable to work on different subjects at the same time? Like, I could split my days 50/50 on back end/HTML and CSS?

Self-learning is a bitch
>>
>>59570060
I won't deny C#'s comfyness levels. It's pretty damn comfy. But VS/Vim just seems like an autistic thing to use for this field.
>>
Can anyone spot what tool(s) these guys use to display their gallery?


https://www.pexels.com/search/goat/
>>
Anyone else not use redis for caching because it sounds too much like reddit?
>>
>>59569791
What if all I need to do is add a couple lines of css?
>>
>>59570185
Install Wappalyzer chrome extension to see what sites are built with or use builtwith.com

Also the picture layout is easy to do this with Masonry
http://masonry.desandro.com/
>>
>>59570630
>Wappanalyzer
Wow! I have been dreaming of something like this.
Excellent!
>>
File: kip.gif (88KB, 480x270px) Image search: [Google]
kip.gif
88KB, 480x270px
What's a good way to edit bootstrap style? It that when I edit in <style> </style> after loading the bootstrap.css, it often doesn't register.


What is going on here?
>>
>>59570844
Make a style.css and link it after you link bootstrap, also make sure you select elements properly
>>
>>59570844
kill yourself for using bootstrap
>>
>>59567999
I spent 4 days figuring out how a number was generated to answer a client question.

I'm writing documentation so no one has to go through that again.
>>
Launchcode anon here

I was approved for LaunchCode candidacy in early December. I have been called in for several meetings, have attended the meetups, did everything they asked. The most I have gotten out of them are empty promises for interviews that never materialize.

But, about six weeks ago I started applying to jobs on my own, and now I'm starting as a junior PHP developer for an online retailer on Monday. The pay isn't glamorous but I'm getting a real job on my resume and hopefully the next job will come with a fat pay bump.
>>
What's the best PHP framework and why?
>>
>>59566129
>>59566182
forgot to say thanks familios
>>
>>59568701
Would also like to know this.
>>
Why is everything so private?

If a user authorizes me to see their donations then I should be able to see all of their donations until they deauthorize me. Correct? NOPE

It's not fair that websites whitelist previously popular websites from having to reauth while new websites can never go anywhere because you have to auth every 60 minutes.

This is impossible, by the way. I use OBS browser so people can't just reauth in the middle of their stream.
How am I supposed to make the new things that these websites won't make if I'm dead at the start?

Shits retarded.
>>
File: ragdoll.jpg (89KB, 630x350px) Image search: [Google]
ragdoll.jpg
89KB, 630x350px
>>59570073
Eww I was actually just about to start on Odin project today. So it basically gives you the bare structure of what you should be doing and then you just kind of figure it out yourself?
>>
>>59571449
Nice!
I'm the other launchcode guy that was saying not to rely on them about a month ago.

What website ended up landing you the job?
>>
>>59572469
Glassdoor. They seem to have the most listings in my area. Indeed got me a couple interviews as well
>>
>>59554469

I want to make a simple blog. I've never made a website before but I'm a good programmer

How do I get set up? I want to be able to click "run" on something and then be able to click through my website
>>
>>59572723
pick the web framework of your favorite language.
>>
>>59572681
Well expect recruiters to call you daily once you add your new job to your resume.

When do you start?
>>
>>59568754
Well done. That took a while but it's ok. Now I want a report in [denormalize even more] this format please.
>>
>>59572798
That's what I'm hoping for. I'll jump ship on this job quick if it means market pay.

I start Monda, last day of my old job was yesterday :D
>>
File: Challenge_vs_skill.svg.png (47KB, 300x292px) Image search: [Google]
Challenge_vs_skill.svg.png
47KB, 300x292px
>>59572880
Learn this picture. You are going to feel very far behind and that's normal. The skill part for this situation is basically whatever standards they have, how they use their stack, their method of version control, and all the stupid shitty classes they have to do tasks that you don't know about

I felt so stupid my first 2 weeks.
>>
>>59572880
And all devs jump ship for better pay. It's why they have fooseball tables, group events, parties, snacks everywhere, and regular raises to try to keep you. Our company can't keep devs for longer than half a year. The senior-dev has been there for 8 months.

I'm staying until I've been profitable for 2 months. I feel like I owe it to them as thanks for getting my career started when no one else would.
>>
File: frontend.jpg (46KB, 394x564px) Image search: [Google]
frontend.jpg
46KB, 394x564px
After working 2 years programming enterprise ERP using 10 year old programming languages, im ready to make the jump to web dev.
Im using this book, is this a good way to start in webdev or i should self learn with another book.
>>
File: Selection_030.png (72KB, 204x194px) Image search: [Google]
Selection_030.png
72KB, 204x194px
How do I learn about Content Management Systems (CMS)?


I can write sharp code, know several frameworks, but for some reason I never worked with CMS.

Silly question, but -- where do I start?
>>
>>59573352
install one
toy around with it
>>
How do you put a website on local host so you can connect to it in your browser?
>>
>>59573522
you have to run a web server.
Most server side frameworks provide their own.
>>
>>59573603

Could I do it using apache?
>>
File: 1486675522001.png (105KB, 362x492px) Image search: [Google]
1486675522001.png
105KB, 362x492px
>>59573364
Got any suggestions where to start?
Any help is GR8LY appreciated.
>>
>>59573642
sure.
>>
>>59573649
Wordpress or Drupal for PHP
Django for Python (even though it's technically not a CMS it has an admin module)
>>
>>59568701
I see job postings for Ruby quite a bit, but it seems mostly looking for senior Ruby devs.
>>
>>59575044

adding to this:

The listings that I see are also mainly for senior devs, if they're not for seniors then it seems like it's listed in a "at least one language" requirement just so they have someone that knows the basics of programming. I dunno if it's dying but it's not as strong as it once was.

Keeping up with how fast this industry moves is pretty intimidating for me. I've never seen anything like it, I'm trying to get my feet wet but as a beginner you always want to chose the best language that will help you grow/make money. But in this industry you already hear whispers about ES7 and all the hot languages everyone is learning. Then there's the employers that are all raising the bar on what you need to know for an entry level position, like they're trying to get a full stack dev for $30k / year.
>>
Does anyone have any modern resources for learning Spring development? Every single webdev job around me wants Spring.

PS, fuck ExtJS.
>>
how to go about learning js
im reading eloquent js and i dont like that js is limited to browsers only ;-;
>>
>>59575506
>Then there's the employers that are all raising the bar on what you need to know for an entry level position, like they're trying to get a full stack dev for $30k / year.

That's exactly what they want, you'll soon realize that people don't like to pay us, from a web developer to a software engineer. They just don't. That's why most devs follow the freelance route somewhere down the line, become digital nomads and shit like that.

Word of advice, if you're something like me, don't let this expectation crush you. If you keep thinking about whats gonna be hot or not, you'll never move anywhere.

Choose something you like, don't be lazy. I started with C, for example. Once you get a grip of the basics of programming and OOP, you'll learn any new technology in a week or two, you can always shift and change, don't forget that these are tools, a plumper won't unlearn how to fix leaks just because he changed his tools.
>>
>>59575747
nodejs
>>
how do I practice webdev
I just have no ideas
is there something silimar to codewars?
>>
File: 1488685182177.jpg (264KB, 924x1106px) Image search: [Google]
1488685182177.jpg
264KB, 924x1106px
>>59575885
Damn anon, Thanks a lot for the advice and the motivation. I guess going to go with my gut instinct and jump onto some Ruby tutorials.

I really appreciate you helping out a lost soul. I guarantee you that I'm just like you in that regard, I would end up not learning anything.
>>
google domains or namesilo or namecheap?
also, cloudflare as CDN?
>>
>>59577200
gandi, avoid namecheap and godaddy.

I personally don't like cloudflare.
>>
>>59577231
Thanks. I've heard gandi is good for the price too.
What should I look for to decide? I'm rather lost and tempted to go with Google Domains just because I think google won't fuck me as hard as the others.

Why not cloudflare? Do you know any other worthy alternative?

Sorry for the many questions. Ignore me if they're a pain.
>>
>indicate gender
>custom
>>
File: 347r38yweudhwld.jpg (203KB, 1532x482px) Image search: [Google]
347r38yweudhwld.jpg
203KB, 1532x482px
Anyone knows of a decent BDD (I just need the Given, When, Then structure) kinda like JS's Jasmine, but for C#?

I don't want to use SpecFlow (if it even supports GWT), I don't want nor need Gherkin. I found a single project doing some sort of Jasmine in c#, but it's been dead for five years.

I ended up with one called JustBehave, and it almost looks like it could work but I'm not sure about its limitation of having a single Given and When in a single file. I may have to settle for this, but I was wondering if anyone knows of better options.

>inb4 C#
>>
>>59568739
I use Komodo
>>
>>59566444
If you know what you're doing, it helps you make less shitty code and to make sure you're not breaking shit when making changes.

Or you can keep doing manual testing like a neanderthal I guess.
>>
>>59566444
I can test my API in 2 seconds, doing it manually would take 10 minutes and I'd never re-test it after the first time.
>>
I'm making a very simple personal website. This is my first website but I'm good at programming and figuring shit out.

My main issue right now is creating some kind of template for blog posts. I think you are supposed to make an HTML class?

It also needs some kind of page system which needs to have some basic search/sort functionality so you don't have to scroll through every blog post to get to the first one and the whole website doesn't load on the front page. but I don't want any jewgle mystery javascript judaism on my website in any form. I also don't want to learn how to build a database or php or sql or anything.

So what I plan to do is create a folder in my website called "posts." In the directory "posts" every HTML file will have a unix timestamp filename and use the template for a post that I mentioned. The raw text data isn't going to be more than a couple thousand words so I will write a javascript script to look through them for keywords and display files that are a match. I might also add some keywords metadata for it to read.

So my question is: is this a fucked up way to do what I'm doing or is it acceptable?
>>
>>59579570
Eh, seems like you're re-inventing the wheel. I'm sure a lot of the static site generators offers what you're after if you don't want to deal with any backend language.
>>
How do i map a viewmodel to my model without having to write it all retarded like this?:

model.data1 = vmodel.data1;
model.data2 = vmodel.data2;
model.data3 = vmodel.data3;
model.data4 = vmodel.data4;
model.data5 = vmodel.data5;


Or am i being retarded and there's a way to insert the viewmodel to the db context?
>>
why do most of the job postings have too much skill requirements? I am busting my ass trying to learn all the new memes its just too overwhelming.

I already know vanillajs, jquery,php, vuejs, react, object-oriented js+php, sass, flexbox, css3, es6, webpack, Git, JSON manipulation, photoshop, illustrator, etc...

but then I see job listings near my area that webdev requires: Scrum, Agile, Marketing, etc..

What the shit? Just when I thought that my knowledge was already enough. Its depressing
>>
>learn html and css
>my websites look like shit
>someone told me to learn bootstrap
>its too hard
>all bootstrap does is make it easier to make a super generic website
>even then i cant make a super generic website

what the fuck so i do now.
>>
>>59581043
Literally lie dude. Everyone does.
>>
>>59581082
I've seen people charging $300 to slap a bootstrap template only with different images/logos to a cpanel.
>>
>>59580933
Use an automapper, all languages must have one available.

If that's C#, look for "Automapper" (literally). It's awesome.
>>
>>59581043
>I already know vanillajs, jquery,php, vuejs, react, object-oriented js+php, sass, flexbox, css3, es6, webpack, Git, JSON manipulation, photoshop, illustrator, etc...
m8 that's more than enough. Just apply for any job you're interested in. I don't know why they keep asking for shit, but just do it.

If you know half of the shit you say you do decently enough, you're good to go.
>>
>>59570066
seconded.

a few plugins (emmet, color-syntax, surround, etc) and for front-end/web it's actually a really nice editor.
>>
>>59581112
that doesnt answer my question
>>
>>59576670
the best way to practice is to copy other sites. use a framework of your choice and replicate facebook's home feed, youtube video page, twitter sign-up, etc. ideally in an actual work environment, this will help you take graphic designer's work and convert it to html.

once you are good with layout (i.e. you can confidently take any design and know exactly how you place it in html + css), then make your shit work. take your previous copies and make them dynamic. twitter sign-up? use stormpath/okta/auth0 and make that form work. facebook home feed? make it where you can actually make posts and they appear dynamically on the page.

once you are able to do that confidently, you will start to have 'flow' in your work. where it's like you know what to look for type of shit, you don't have writer's block (coder's block?), and you start building useful shit
>>
Hey guys,

I might be joining a small company soon that for all I know has no operations person. My background is more in development but I'm wondering what the best resources for learning this skillset would be?

Put another way, "how should I start learning devops."
>>
To my dearest /wdg/ I have a computer science degree and about a years experience at a start-up doing web development. I produced something from the ground up.

What's the secret to getting a job at a big company where I can finally learn to work with a team and actually learn what sensible product development and software engineering cycles are like?
>>
>>59581524
>I might be joining a small company
You poor fuck. Hold on to your butt, anon, you're in for a wild ride.

And there's a difference between operations (which you can only get from the business itself) and devops. Which one are you actually going for? Devops is a bit blurry but it's mostly getting shit to run, continuous integration workflow, maintaining the repository, and a bunch of other shit of that nature where you get any updates of your application to any deployment server (with production being the final destination).
>>
>>59581566
Really devops.

Do I "just" learn LAMP and virtualization, automating VMs, automated deployment, build scripts....everything?
>>
function unless ( test , then ) {
if (! test ) then () ;
}
function repeat ( times , body ) {
for ( var i = 0; i < times ; i ++) body (i);
}
repeat (3 , function ( n ) {
unless ( n % 2, function () {
console . log (n , " is even ") ;
}) ;
}) ;


im so confused
>>
class CLScraper {
getListings(url) {
fetch(url)
.then(res => {
return res.body();
}).then(body => {
console.log(body);
})
}

}

CLScraper.getListings("https://boston.craigslist.org/search/sss");

module.exports = CLScraper;


this is coming up "CLScraper.getListings("https://boston.craigslist.org/search/sss");". what's wrong with it?
>>
>>59582372
sorry, coming up "TypeError: CLScraper.getListings is not a function"
>>
>>59582403
>>59582372
getListings isn't static so you would have to call it on an instance of CLScraper.
Define it as static if you wanna call it on the class itself:
static getListings(url) {...} 
>>
Any suggestions one who I should use to host my website?
>>
>>59582646
I use and like linode
>>
>>59582646
Personally have had a lot of luck using demonvps in the past, good pricing but it's not hourly if you need that.
>>
>>59581525
Get more experience.
>>
>>59582372
Just a few notes:

Unless you're using class instance variables, you should put getListings static so you can call the method outside the class without having to instantiate the class.

You don't need two .then chains when you're just returning a value.

Look in to async/await. They function the same as promises in the background but have much more readable syntax.
>>
>>59561264

Fucking this!

Why the fuck should we even consider a design for a demographic who's first reaction to anything is:

This is new, therefore it's confusing.
This is all techno gobbledegook, I'm confused
I'm not willing to learn, and that's your fault.
Why isn't it just doing everything right away, why do I need to do anything.
There's too many brown people on the streets.
I didn't survive the war, so everyone could just stare at their eye thingies.
I'm not willing to even attempt to solve this.

Seriously, fuck them. The mother in law is already becoming like this. She complained that her thinkpad was getting really slow, so decided to give her a chrome book. 95 percent of the stuff she does is on chrome, and the other 5 percent is playing scrabble. So giving her a system that removes most issues sounded like a great idea...

>how do I get my emails?
>how do I press the button

THE EXACT SAME FUCKING WAY YOU DID BEFORE

Fuck designing for the elderly, it's a thankless and painful task.
>>
>>59554469
>Trying to do UX/UI for a client while doing full-stack job that's severely underbid.

Seriously, I don't understand how pros make their sites look good. I get the how to do things, I know media queries, transitions, and all that shit. I can use JS to gussy it up a bit but every webpage that I do looks like programmer art or like a shitty imitation.

Also, asking again from a previous thread, does anyone have some guidelines for PayPal's Express Checkout? It seems similar to Stripe's solution, but the documentation is kinda meh.
>>
Is this a good book to follow in the beginning stages of web dev learning? I don't do great with just googling stuff because I lack direction
>>
>>59581043
From what I've heard, most of the time they list things that would be nice to have but aren't required
>>
>>59560873
>When should I move on from this? What projects should I do? I don't want to sign up on a website to view anything, by the way.
If you're not even willing to sign up for a website to continue your learning, don't bother continuing at all. Such a retarded limitation
>>
>>59581082
Learn flexbox, use some CSS framework with grids copy, google fonts, copy a nice looking site
>>
>>59584496

I've never gotten on with O'Reilly books. Maybe I've just been reading the wrong ones. Have you considered online courses, like on CourseRA or Khan Academy?

Personally I'd suggest not trying to learn everything at the same time. You'll be juggling 4-5 different concepts. It's more efficient to learn the basics of each before moving on.

Start off with the frontend. Learn HTML and maybe some basic CSS. Move on to JS when comfortable, because that gives you dynamic control over HTML/CSS. Once you're comfortable with those, move to the backend - learn the basics of PHP, then how to integrate with MySQL. Once you're comfortable with those, put everything together. Aim to keep frontend/backend separate.

Good luck!
>>
>>59585517
I appreciate the reply. I'm already pretty comfortable with HTML, CSS, and JS. I picked up a copy of this book to learn about PHP and MySQL, and how to run a web server, and put it all together. So far it's alright, but I'm just now getting past the basics of MySQL and PHP and wanted to know if it was worth continuing.
>>
I have heard this site is outdated

http://webdevchecklist.com/

Something like that is really helpful, is there an updated one, or does anyone have any comments on what can be improved?
>>
Anyone have thoughts on this? (How to devops)

>>59581660
>>
http://eloquentjavascript.net/code/#5.1
i dont get how reduce works ;-;
>>
How do you guys get a matching color scheme for your site? I can't design for shit as I only do backend work. My colors never fit.
>>
I want a Front End junior position ASAP

Should I spend time learning Ruby to a decent standard? Or should I just crack on with Rails and spend the time learning Javascript instead?

I want back end knowledge but I'm not sure how essential it is to landing a junior position?
>>
>>59586840
>I want a Front End junior position ASAP
>Should I spend time learning Ruby to a decent standard?

It would be completely irrelevant to a front-end role.
>>
>>59586781
it's like forEach, only that it skips the first entry and puts it in the first parameter with the second parameter being the current item.
the first parameter will be what you returned before otherwise.
>>
>>59586816
I'm stealing colors from template sites.
>>
>>59586866

I see lots of job posting for Front End positions saying that back-end knowledge is highly desirable. Most seem to want PHP but I've already started with RoR so I'm sticking with it I think
>>
>>59586892
it's all the same shit, if you know one you can pick up anything. Just know how to make a REST API and how to consume it using a front-end framework.
>>
i hate php
>>
>>59586874
why is [] provided as initial value
>>
>>59587030
because the sample calls reduce(..., []), with the second parameter being the initial value, which makes it start iterating from index 0 instead of 1.
>>
How do i add button that will be fixed and always over other divs?
My button is fixed but it goes under webview and you can see it only if you inspect elements
>>
>>59587363
increase its z-index.
>>
>>59587375
i thide z-index with - and + numbers but still nothing is changed
>>
>>59587449
post a codepen example
>>
>>59587464
>codepen
https://codepen.io/anon/pen/wJxEYG
>>
>>59587593
seems to work fine if you don't use a negative z-index.
>>
>>59587679
strange, i tried 10 and -10 and it didnt worked
now it is working

probably problem was with electron and not code
>>
>>59581660

Pretty much, yes. You don't have to learn them all at once though. Try to learn each independently if feasible. There's a lot of shit involved.
>>
I don't get JS. I'm trying to just read a file

No clue what the first arg of new File() is supposed to be. Can't find any good explanation.

Here's the code (couldn't post because 4chan thinks its spam)

http://pastebin.com/YzsKz3fm

The output is just a blank line.
>>
>>59588228
you can only read files from input elements or from drag&drop.
letting you read any file by specifying a path would be a security nightmare.
>>
Not exactly 'dev', but .. I want to use some images on a website I have. Am cutting corners, don't want to have to be concerned about bandwidth. Is there a free image hosting service that stands out? Thanks.
>>
>>59588322

There has to be some way to get a file that is inside the directory of my website as a javascript string
>>
An employer asked for times I helped others out with coding issues, so if someone asks here for me in an hour, asking if I helped you out coding wise could you just say I was a big help?

Cheers.
>>
>>59588491
ajax.
>>
>>59588515
>>59588322

OK, I tried using ajax and it works

Is their a way to treat the resulting file as HTML and call getElementByID on it?
>>
>>59589094
create a dummy element, set innerHTML to whatever you received, then use querySelector on your dummy element to select the element you want.

getElementByID is per document only and doesn't work on elements.
>>
>>59587973
o-ok.

Sorry to keep bugging, but do you know of any good resources online or book that are kind of "everything you need to know" or aggregate links to other content?
>>
>>59583557
Well that's a fucking catch 22 isn't it? How do I get enough experience to get a junior level position so that I can gain some experience.
>>
>>59589709
You didn't ask for a junior spot. You asked how to work in a big corporate environment where your small startup experience won't be enough.

Grind out a few months at a small company. With a degree and a dev job the recruiters will not leave you alone.
>>
>>59590114
Oh a year startup xp.

Put your resume on every job site and wait for Monday.
>>
>>59583674
Guess you're not that good at what you do. You're also a faggot.
>>
>>59583674
What's most enraging about them is that they don't even try. When they're given something new they just raise up their hands and REEEEEEEE.

>>59581525
>big company
>sensible product development and software engineering cycles
Oh boy are you in for a surprise.
>>
>>59589495

None that I know of personally. I had the good fortune to only need to learn these things bit by bit as my small business progressed.
>>
>>59581525

For your own sake, hang on and gain more experience.
>>
I'm using bootstrap for my responsive website, and I have a navigation bar in the header, but on one of my pages where I have an embedded youtube video, the drop downs on my nav bar stop working. They aren't in the same container or anything. For the video Im using class="embed-responsive embed-responsive-4by3"
>>
>>59590608
post an example, no one is going to bother setting up everything.
>>
>>59590689
http://pastebin.com/DXbcxvqy

just stick that in an html file. the nav bar works when you comment out the container with the video
>>
>>59590885
your youtube iframe opening tag doesn't close, so the bootstrap script never gets executed.
>>
>>59591026
ah thanks.
>>
>>59591026
>>59590885

lol this is why you use an IDE, so you don't waste hours trying to find a missing tag or parentheses.
>>
What are my options for website hosting? I'm told there are "free" services but what are the drawbacks? Can I expect to be paying $20 per month?

I just wanted to make a basic online resume in bootstrap + php for my art/design CAREER.
>>
>>59554469
Can you guys test something I just made?
https://uncensured-history.000webhostapp.com/responsiveAuth/front.html

The password is 'secret'.

How does the timing feel?

I was thinking that buttons are kind of old school. Nobody wants to hit login buttons anymore. And even having the user press 'enter' is kind of old school. People like it (most of the time) when their apps are running just a bit ahead.

So I was thinking of creating an auth module that tries to automatically log you in as soon as it thinks you're done entering the password. No buttonClick/enter required! In production, it would automatically redirect you as soon as you had an 'AuthSuccess'.

I've set the timing for 600 ms. I'm thinking of increasing it to 680 or so. The idea is that if you haven't touched a key in 680 ms, you're probably done entering your password. It's OK if the thing checks with the server before you're actually done. I don't mind a couple of false authChecks that were triggered too early because the user types slow. I don't mind a few.

But I don't want to do like some websites and check after every keystroke. If you're checking every keystroke, that could be like 20 ajax requests in just a couple of seconds, per user.

With the module waiting until 600 ms has passed since last input, you're more likely to be submitting ajax requests only when the user is actually done.
Again, except for the slow typers. We'll waste just a couple of ajax's on them. It's ok. It'll only be a couple.
>>
>>59592423
Also, that isn't a real authChecker. It's just a simple dumb stringCheck.

And the delay is only for simulation purposes. The server isn't actually that slow. There's a sleep in the code.
>>
>>59592423
>>59592498

For usability purposes, you might have to do some thinking about presenting auth errors to the user.

I like it but it was not immediately clear to me as a user, that I could get an authentication error and it would keep looking at my password.

So when I saw 1 or 2 authentication errors, I didn't realize it was THEN going to authenticate me.

This probably wouldn't be a problem for people who type quickly or who remember their passwords, but it could definitely pose a problem for people who might be thinking or trying different passwords if they can't remember (which often happens with me)
>>
>>59592423
>>59592498


>>59592542


Ignore that comma splice; I copy pasted some shit and forgot about it :)
>>
File: 1490325453043.png (282KB, 1109x1080px) Image search: [Google]
1490325453043.png
282KB, 1109x1080px
So I've recreated a good portion of a popular website. Very basic, but I couldn't do shit 2 days ago.

After HTML and CSS, what should I look into? Bootstrap? Jquery? Javascript?
>>
File: 1489430874132.jpg (57KB, 500x641px) Image search: [Google]
1489430874132.jpg
57KB, 500x641px
>>59592542
>>59592498
>>59592423
If you're going to submit an HTTP POST on a client-side JavaScript event you should wait 500 milliseconds to a full second before submitting the AJAX request. Spamming requests like that is inefficient and dumb

Not to mention someone can open up the JS code, copy your $.ajax call, put it in a for-loop and spam your server with requests.

There needs to be server-side validation, incremental delay and at least some client-side validation (e.g.: don't send a request on passwords shorter than 4 characters, etc.)
>>
>>59593105
>Not to mention someone can open up the JS code, copy your $.ajax call, put it in a for-loop and spam your server with requests.
why would someone do that?
>>
>>59593277
To bruteforce the password
>>
class Container extends Component {
toggleTodo(id){
const list = this.state.data.forEach(todo=>{
if(todo.id==id){
todo.done=!(todo.done)}
});
}

removeTodo(id){
const remainder = this.state.data.filter((todo)=>{

if(todo.id!==id) return todo;

})
this.setState({data:remainder})
}

Former doesn't work (toggleTodo). How do I change the value todo.done? I am passing them as props.

What's wrong?
>>
>>59592910
All of the above.

Some helpful tips:

- Don't overthink bootstrap. All bootstrap is, is a way to instantly make your elements prettier by adding classes to them, and treating them as components.

You want to put your content in a panel?
<div class="panel panel-primary">
<div class="panel-body">
<!-- Your Content -->
</div>
</div>


That's what bootstrap is. A quick and easy way to make stuff start looking good with minimal markup. Just add a class, and the element will start to take on that component's aesthetic properties.


Javascript.
- scoping matters. If you don't understand scoping, then ALWAYS prefix your variables with 'var'. And wrap all the code in all your scripts in one of these:
(function myMainFunction(){
// put your code in here
var exampleObject = {"cake": "chocolate", "pie": "cherry"};
})();

If you forget to prefix with 'var', your variable will be a global. And if you don't understand scoping, then the globals WILL MESS YOU UP somewhere down the line.
And if you don't wrap all your code in some kind of function, then prefixing with 'var' won't do shit. They'll still be global anyway.

- learn about callbacks. They're kind of ugly, but they're a fundamental. know what they are and how to use them.

- learn the promise interface. It's similar to callbacks, but designed to be cleaner and more readable. (see attached picture) (but don't skip to this, you still need to understand callbacks to understand the promise interface)
>>
>>59594397
>>59592910
jQuery
- Learn jQuery as it will dramatically reduce the amount of typing you do.
- Be aware of the difference between a standard array, and a jQuery collection.

Know how to use .forEach and jquery's .each
// array's forEach method
myArr.forEach(function(item, index, collection){
// do stuff to the array item, this function will be called on each array item
});

// jQuery's .each method
$('div.panel .panel-body').each(function(index, item){
// do stuff to a panel-body, this function will be called on each panel-body
});
>>
>>59594422
>>59592910
ASYNCHRONOUS BEHAVIOR
---------------------------------------------

Recognize that some functions have asynchronus behavior. This means that it may return a value before its actually done executing.
Your script can get executed out of order if you don't understand this stuff. Just because a function is called on a later line, doesn't mean it executes after a function on a prior line.
Some common async functions:

Array's .forEach method
jQuery's .each method
XmlHttpRequest's .send method (also jquery's $.ajax, $.get, $.post)
Promise's .then method

Most people like to use .forEach when doing something to every item in an array. But this is asynchronus, so you have to consider that.
One little trick for this is to use the old for loop.
myArr.forEach(function(itm, i, coll){
doStuff(itm);
});
handleModifiedItems(myArr);
// handleModifiedItems can be called before the forEach is done with its work.
// In this case, you'll end up operating on a half-processed array.
// (or maybe not a single item has been processed, depending on the complexity of doStuff)


for (let i=0; i<myArr.length; i++){
doStuff(myArr[i]);
}
handleModifiedItems(myArr);
// as long as doStuff is not an async function,
// then handleModifiedItems will only ever be called
// after the for loop has processed every item.

// the for loop is a synchronus loop. (thank god for that)
>>
>>59594440
>>59592910
If you need to use an async function on every item in an array, then you're better off using forEach, and setting up some structure to register completed items, and only run your callback after all items in the collection have registered themselves.

Know about setTimeout and setInterval

Many people will hate on using timeouts and intervals because these functions aren't in the spirit of true evented programming,
but if you're just getting started, timeouts and intervals can help you get productive faster, without needing to delve into trying to write 'perfect' evented-code.

The best use case for interval, is for asynchronus behavior like we talked about earlier.

Example:
(function printAllNotes(){

var noteUrls = [
'./note-nice_apartments.txt',
'./note-myClassSchedule.txt',
'./note-groceryList.txt',
'./note-bills.txt'
];

var notes = [];
var noteCount = 0;

noteUrls.forEach(function(itm, i, coll){
$.get(itm).then(function(r, s, x){
notes.push(r);
noteCount++;
});
});

var checkInterval = setInterval(function(){
if (noteCount == noteUrls.length){
clearInterval(checkInterval);
console.log("We have all the notes.");
console.log(notes);
}
else {
console.log("We don't have all the notes yet.");
console.log("We will check again in 600 miliseconds.");
}
}, 600);

})();
>>
>>59594460
>>59592910
I think this should be enough information to help you get started.
And don't forget to check the docs: https://developer.mozilla.org/en-US/docs/Web/JavaScript
That place has loads of great stuff. If you ever can't figure something out, and you haven't yet read the docpage for the functions you're using, make sure to go read them.
Just jumping right in is great. But when things get hairy, its good to check yourself and make sure you REALLY UNDERSTAND how your code works. Most beginner mistakes can be
figured out by just reading the docpages for the functions you're using. (the ones you didn't write yourself)

Mozilla is for native-api stuff.
If you're using an api like jquery, then you need to go to their documentation.
>>
>>59593105
I never said this was production-ready.
I thought it was pretty obvious this was just a proof of concept. Really just meant to test the look-and-feel of this time-based authChecker.

Of course in production there would be more things going on. Password character length checks. Password format validation. Server-Side authentication monitoring and throttling.

I'm not retarded. I know how people are.

This was literally just a BASIC proof of concept, to test the look and feel.

Also, I do have it waiting 500 ms. (600 actually, and was thinking about 680)

An ajax every 600 ms isn't entirely unreasonable if the server and network is good. I've got a nice, high-performance VPS on an enterprise-grade network. I've setup mod_http2, so we're using the http2 protocol with all the performance gains that it yields. ( believe it or not, when you setup your SSL/TLS stuff properly, http2 can achieve MUCH higher performance than http/1.1. I don't know all the underlying science, but somehow http2 is fundamentally different in how it sends data over the wire. It keeps your session alive, uses multiple connections, encrypts and compresses all the headers/payload, and some other stuff. It's based on google's SPDY protocol) ( I went to a talk on the subject a while back: https://benramsey.com/talks/2016/04/lonestarphp-http2/ )

My server should totally be able to handle an ajax every 600 ms. Really, after the first couple, my server should be able to handle an ajax as often as every 180 ms without any significant delay.

(and no, my server isn't that 000webhost server, that's just a secondary host I use whenever posting links in this thread)
>>
i wrote this, it makes a new user in my mongodb,
it works but sht looks ugly as fuk how do I into
aesthetic code?
>>
>>59594979
The fuck are you indenting so much for?
>>
>>59594979
is req.body.* sanitized n shiet?
>>
>>59594979
You're over-thinking the indentation.

On the 'var newUser' part, that closing curly-brace should line up with the 'v' in 'var'.
The object-keys should be 4 spaces past the closing curly-brace.

Whenever something is nested in something else, throw enter, spacebar 4 times.

Every indented item should always be 4 spaces past its parent item.

The closing curly-brace should line up with the item.

router.post('/', (req, res) => {
if (isValid){
var newUser = new UserDB({
"screenname": req.body.screenname,
"email": req.body.email,
"password": password_digest
})
}
});


Indentation should always be done in multiples of 4 spaces.
0
4
8
12
16


Don't start doing that crazy indentation stuff that you're doing. I know you're trying to make it look better, but ironically you'll only make it worse.
Just stick to the standard.
Indent child items. Use 4 spaces past the parent.
>>
>>59595092
*single tab with the width of 4 spaces
I'm a bit tired today, always use tabs.
>>
>>59595066
wut do u mean
>>
>>59595160
You're free to use the tab key on your keyboard, so long as you're not inserting the tab character into your code.

Set your editor to use spaces instead of tabs. Then you can use your tab key in your editor, and it'll actually insert 4 spaces. But you get to use your tab key.

But don't actually insert the tab character into your code.

Trust me. Just don't. It will bite you in the ass over time. Its not clean. Its not uniform. Different environments/editors will handle that character differently.

Tab is not a uniform unit of space. It varies.

If you echo your shit in the console, see how fucked up it looks.

Use space. For the love of god, use space.

Tab is ugly. Tab should only be used as a delimiter for csv data that is intended to be parsed.

Tab is a delimiter. Use it to delimit data.

But use 4 space characters on anything that you might ever want to look at. (whether it be in an editor, a browser, an application, or directly on a framebuffer console)

You have been warned. If you decide that you know better than this anon, and want to continue using tab anyway, then you asked for what you have coming to you. Because this anon warned you.
>>
>>59595290
This poster is clearly schizophrenic, I wouldn't take his advice and keep using proper tabs for indentation.
>>
File: e91.jpg (30KB, 600x640px) Image search: [Google]
e91.jpg
30KB, 600x640px
>>59595318
>>
How do I make a very simple server side script for my website? It needs to be called from a javascript script and then search a directory and return some URLS

Also how do I make sure that form input isn't being used to drop my dank tablez?
>>
In c# when i use:

@Scripts.Render


And look at the page source, it gets no indentation.

How to fix?
>>
>>59594422
You've sold me. There is no longer any reason to use JQuery.
>>
>>59596150
I know a developer that has worked in the industry for 5 years or so and doesn't even know javascript, ONLY uses jquery.
>>
How much will it cost to host a website if I only expect maybe a couple people every month
>>
>>59598461
Its free on heroku
>>
>>59596328
jQuery is written in javascript.

What are you guys talking about? Acting like the two are separate?
>>
>>59598493

what's in it for them?
>>
Should I ask my Django Rest API questions here or on stackoverflow, or is there a better website?
>>
>>59598517
Getting paid if you end up needing to upgrade.
>>
So let me get this straight: can I use C# code wherever I would be able to use PHP code? I've been learning php for a few weeks now and I hate it but I love coding in C#.

Is the work flow between C#, html, and MySQL the same as PHP, html, and MySQL.

in other words, instead of using <?php //insert code here ?>, I could just do something along the lines of <?c# //insert code here ?> ?
>>
>>59598500
they probably mean that he doesn't know the DOM, which is something only retarded front-ends care about. You can learn everything you need to know about it as you go by googling.

If you can use jquery, you can program javascript, the DOM is just a way of interacting with the page that jquery hides because it does a bunch of redundancy stuff for you to ensure your shit works in every browser possible.
>>
File: file.png (62KB, 652x501px) Image search: [Google]
file.png
62KB, 652x501px
>>59599473
No, it's quite different.

You'd need to use the Visual Studio IDE and ASP.NET Core MVC.

It works on a concept called MVC - where Model is any kind of data (string, array), View is what the user sees and Controller is what binds the data to the view.

Your server side code (model/controller) will be inside their own .cs files and your view would be a .cshtml file.
>>
>>59599486
I love jQuery but even I know the DOM. Which is actually useful in other shit.

Ironically, it was Windows Powershell that really taught me the DOM. When I started learning about XML processing. Evidently a lot of DOM stuff pertains to XML as well. The node architecture, the properties, and some of the methods. I also learned that even the text within an element, is considered a node. the '#text' node. Comments are also nodes.

PHP's DOMNode class also helped me to learn the DOM.

And of course, javascript is fundamentally based on interacting with the DOM.

Just because you like using jQuery selectors, or xpath expressions to quickly grab nodes, doesn't mean you don't understand the DOM.
>>
>>59599839
Hell, I have something open right now from where I was using the DOM node architecture the other day in php to try to process some non well-formed HTML spit out by this system I'm trying to write an interface for.

They have no api. So the only way to interface with it, is to simulate browser requests and process the html output.

Which means working with the DOM.

pic is when i was trying to filter out the garbage so I could analyze the structure of what was there, to figure out the best way to parse and process it
>>
https://msdn.microsoft.com/en-us/library/system.xml.xmlnode(v=vs.110).aspx

http://php.net/manual/en/class.domnode.php

https://developer.mozilla.org/en-US/docs/Web/API/Node

Certainly plenty of documentation on the DOM.
Anyway, that's enough 'going off on a tangent' for me.
I've got work in the morning. I need to get my ass to bed.
>>
File: wyald.jpg (65KB, 465x367px) Image search: [Google]
wyald.jpg
65KB, 465x367px
Anyone got some good inspiration for portfolio pages?

Looking to flesh out my portfolio, but I got nothin' - inspiration needed
>>
>>59601664
Ageru
>>
>>59595598
Php.

And prepared statements with pdo.
>>
i have to do some state of the art research, is there an archive where can i find papers on some particular framework or application?
>>
File: 1476728951107.gif (2MB, 600x600px) Image search: [Google]
1476728951107.gif
2MB, 600x600px
>be right now
>tfw at first developer job first day
>Waiting for hr guy for orientation with some other new hire
>other guy waiting has a CS degree and I dont
>>
>>59601664
PORTFOLIO!

I need to make one.
Bump for suggestions and primers
>>
Working with angular 2. I can't figure out how to use modules to centralize my imports.

I have a folder called Database that has my db stuff: db-acess.ts, column.ts, table.ts, database.ts. If I want to use that stuff I have to make imports. Is there a way to centralize this imports in a Module or Barrel or whatever that allow me to import a single file?
>>
If methods should only do one thing.

Then what is a good rule for classes?
>>
>>59603602
Classe should group all methods relative to a specific subject. All your database methods ("OpenConnection", "CloseConnection", "ExecuteQuery") would go into a single Database class.
>>
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/bind

umm
can somoene explain the first example to me
retrieveX() comes out as undefined to me
>>
File: 20160819_132229.jpg (1MB, 2048x1152px) Image search: [Google]
20160819_132229.jpg
1MB, 2048x1152px
>>59581525
Me again updoot. Just been going down the line of top 50 lists on various publications and applying to whatever's open. I have a phone call today :D
>>
Is it possible to start making "decent" income in webdev freelancing? What should I know? I don't need much, food, rent. Just tired of being an overworking slave in corporate environment (C++/Java).
>>
Can I use python with apache?
>>
>>59604581
But C++ is great!
>>
>>59605080
not saying it isn't, seems like webdev world doesn't really use it tho

I just wanna sit at home and earn some money
>>
File: 1490006570632.jpg (37KB, 500x500px) Image search: [Google]
1490006570632.jpg
37KB, 500x500px
anybody here willing to share their github? Would really appreciate it
>>
>>59599643
Anon that is probably the easiest explanation I've seen on the MVC model. There's five minute fucking videos on YouTube to tell to you that same shit you just said in 5 seconds.
>>
>>59604581

It's more than possible.

Just expect people to keep fucking you over if you're going it alone.

Using an agency is a good way to shield you from this and the money is still very good, often for piss easy work.
>>
>>59603602

A method is a sentence
A class is a paragraph.
>>
I hate it when a great workplace becomes terrible

>first few months enjoying work
>release goes bad (not catastrophically so but caused headaches getting it correct)
>new procedures in place!
>rather than being focused on minimising risk so fuckups can't happen, they instead introduce a blame culture where there are giant arrows pointing to, and putting the blame on the person who made a mistake so everyone's scared
>increasing micromanagement, meetings criticizing the dev team for minor things, lots of nannying treating the dev team like kids
>criticism of the whole team in meetings for issues that could have easily been solved with a quick word

Usually a bustling office, it was like a funeral today after yet another of these meetings. Can see a staff exodus coming. The irony is the dev team have been performing well.
>>
>>59606344
They don't realize how easy it is for us to jump ship. We arent supersaturated yet and they keep pulling shit like that.
>>
>>59606344
what was your role in that? were you part of that dev team?
>>
>>59603767
good luck my nigga
>>
>>59606405

I live in one of the UKs tech hotspots, web coding jobs are piss easy to get here.

>>59606422
Botched release wasn't my fault at all and I helped fix it (a nice late night which we've been reminded sternly several times we're expected to do, rather than apologised for being made to do), didn't realize I'd dropped someone in it because they were looking for the person to blame (which pissed me off).

Everyone in the dev team has been partially guilty of one or more of the subjects of meetings but again, all things which could have been resolved with a quick word in private or even just a passing comment/reminding by a manager when they spot things they're not happy about.
>>
There's no /sqt/ thread around so I'll just ask in here.

Anyways, I've been using azure web apps + filezilla on hosting and deploying my test websites for some time. Now I've been trying to get into AWS and I'm so fucking lost.

Does anyone know a good tutorial (for idiots) on setting up an EC2 instance (or azure web app equivalent) and continuous deployment with ftp using filezilla?
>>
Does mysqli_real_escape_string protect against SQL injections from the URL?
>>
So if I want to generate my content with php do I direct the user to php files instead of HTML?
>>
>>59606773
Use prepared statements, everything else is wrong.
>>
>>59606344
Do they not have QA?
>>
4chan down?
>>
>>59606895

Why spend money on adequate QA when you can just work the devs hard?
>>
>>59606617
>I live in one of the UKs tech hotspots

where is that? Very interested in relocating, as long as it's not London.

>>59599643
for those trying to do MVC on .NET, this book is an awesome intro. Pretty easy to follow along and it really hammers in the basic concepts.
>>
>>59607282

At the risk of too much identification, UK tech hotspots I'm aware of : London, Brighton, Cambridge.
>>
>be me
>looking to hire web dev
>contact web dev
>tell him i want to buy the script which hes already sold to 3 other people
>http://giveawayhopper.com/
>http://marvelousga.com/
>https://simplo.gg
>tells me no he cant because it's unethical

seriously, what the fuck is up with web devs who actually give a shit about ethics, so what if a potential client wants you to clone a website, why do they give a shit so much? this fucking bothers me man...just take my fucking money and do what i want you to do

now have to go search for a poo in the loo web dev to do it

ps. how difficult is it to build a site similar to those i posted?
>>
>>59607281
Why didn't I think of that?
>>
I learned HTML like a retard and still don't understand how positioning works.
Can someone explain it to me real quick?
>>
>>59606805

You can absolutely direct users to .php files.

However it's generally better to send everything to a central index.php and to rewrite the URL to pass variables

IE

www.website.com/

Loads index.php

www.website.com/news/2017-01-01/seo-friendly-page/

Which loads the same index.php but could also pass
$_GET['page']="news"
$_GET['date']='2017-01-01'
$_GET['title']='seo-friendly-page'
>>
>>59607385
Be more specific if you want help.
>>
>>59607328
Michael, is that you, mate?
>>
>>59607385

>Position: Absolute

Puts the object in fixed location inside it's parent element. You can manually position these without having to worry as much about other content moving it around. Element takes up no space

>Position: Relative

Leave a gap where the element would usually be but display the element where you position it

>position: static

Normal behaviour

>Position fixed

Like Position absolute except it stays in position when the page is scrolled. Don't use this on mobile sites as it kills performance when coupled with smooth scrolling (page is re-rendered every frame of movement)

For everything but Static, you can use top, right, bottom, left to move them around.
>>
>>59607550

... Howard?
>>
>>59607448

cool
>>
>>59607334

if any devs here can clone this script for me i'll gladly pay you $150
>>
I learned HTML like a retard and still don't understand how positioning works.
Can someone explain it to me real quick?
>>
new thread when?
>>
>>59607969
>>59607969
>>59607969

NEW THREAD
>>
>>59603229
>other guy waiting has a CS degree and I dont
If he has a degree and you don't then that means you are superior.
>>
My website is less than half the size of 4chan's javascript even when you load a 1024x1024 PNG
Thread posts: 321
Thread images: 31


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