[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: 328
Thread images: 35

File: 1466182524466.png (868KB, 822x552px) Image search: [Google]
1466182524466.png
868KB, 822x552px
Last thread
>>55540825

'Save this image if you're gonna create new threads, faggot' edition

> Discord
https://discord.gg/0qLTzz5potDFXfdT

>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/
https://www.youtube.com/watch?v=JxAXlJEmNMg&feature=youtu.be&list=PL7664379246A246CB lecture series.

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

>Backend development
https://en.m.wikipedia.org/wiki/Comparison_of_web_application_frameworks
backendDevelopmentBookmarks.md

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

>NEET guide to web dev employment
https://pastebin.com/4YeJAUbT/
>How to get started
https://www.youtube.com/watch?v=pB0WvcxTbCA - "WATCH THIS IF YOU WANT TO BECOME A WEB DEVELOPER! - Web Development Career advice"
https://www.youtube.com/watch?v=zf_cb_Nw5zY - "JavaScript is Easy" - If you can't into programming, you probably won't find a simpler introduction to JavaScript than this.


>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
https://www.openshift.com/
>NEW!
https://scaleway.com/
>>
Hi. My anus began to bleed after using JavaScript. Is this normal?
>>
>>55568952
Link doesn't work for me :(

>>55569030
Nice. But I don't see the advantage over subreddits.

I recently put up my first project after learning for 6-7 months. It's another take on internet message boards: https://some.cafe/about

It has an anon section but you can only interact with people who share your email address' domain. So @gmail.com users and @shittyemployer.com users would see different posts.
>>
OP, update your discord link.

We now have a short link:

https://discord.gg/wdg
>>
>>55574514
Thanks, I'll change it next time
>>
How do I work with a large legacy codebase without killing myself? 10k lines css, about 10k js, and god knows how many for the server side.
>>
I want to build babby's first website for a family member's small local restaurant. What's a simple reliable platform to get this done on?

Wordpress? Where should I host it?
>>
>>55575002
unless you need a foolproof way for them to edit it themselves, why not make a custom page?
>>
>>55575002
I host a few static html sites on Google App Engine. Traffic is low enough that the free tier is more than enough.
>>
>>55574787
Is it at least properly documented? If not: that's your first milestone.
>>
>>55575028
It doesn't need to be fool-proof. I'd be the one editing it.
>>
>>55575028
Also, the only web dev experience I have is when I tinkered around and made a geocities webpage in middle school nearly twelve years ago.

I really have no idea where to start.
>>
>>55575028
>>55575083
What do you think of Wix? That seems right up my alley and enough for a local restaurant (contact page, social media widget/feeed, static menu).
>>
>>55575250
the installer?
>>
>>55575250
Yeah, Wix and Squarespace are easy to use.
>>
Anyone here using redux-sagas to get JSON API data? I'm trying to find examples doing this while sending headers with the fetch request
>>
>>55575258
Wix dot com
I searched around for simple website builders and this seems to be a popular one. Already has restaurant themes to work backwards from.

Does it look alright to you?
>>
>>55575291
Would you recommend one over the other?

Then should I just go digital ocean or aws when I'm ready to go live?
>>
>>55575107
Nope. No documentation, no tests. 400 line methods, classes with more than 1 responsibility, JS mixed with html instead of a separate file, inline css, etc. I'm thinking of not touching it unless absolutely necessary but I still have to reuse some of it or I'll end up with duplicate functionality, this scares me. Not sure if I should add my own or reuse. Hoping to set up my own test suite, starting with integration tests and use that as my safe zone. But I don't think it will be that easy.
>>
>>55575321
I think it's a matter of preference Wix used to be shittier but they've improved their product. They both provide hosting options and you won't need something like AWS or Digital Ocean if you're using a site builder (Wix/Squarespace).
>>
>>55575445
So I build the site, pay to connect a domain then that's about it?
>>
>>55575352
Best approach is probably rewriting it part by part, perhaps in a different language with IPC.
>>
>work at a web dev studio
>work is slowly being migrated to a team in India
>the Indian team is incompetent
>every project we're doing is going horribly wrong

I know I should jump ship but job hunting is such a ball ache...
>>
>>55575811
You'll be job hunting sooner or later. Just be prepared
>>
>>55575900

Get to say I was the lead (only) developer on a site for a multi-billion dollar company which is a nice thing to have on my CV
>>
What's the best place to advertise to get some easy cash doing HTML+CSS shit?
>>
>>55576300

Here is what's going to happen:

You're going to advertise to make a website

You'll be phoned up by a small business who'll offer $150 for a 'small simple website'.

After about 10 hours of work, you'll have a reasonable website up and running for them with all the basic pages for a static non e-commerce site.

"We didn't provide you with specs or a design but I don't like the colour scheme, can you change it?"

"can't you make the design look near identical to <insert extremely polished site here>?"

"Why doesn't this site have feature xyz (that takes hours to implement) ? I thought that would have been obvious?"

"what do you mean we have to pay for hosting and the domain, I thought you'd do that?"

It will be hell.

There is a reason developers don't freelance.

If you genuinely want work doing pure HTML+ CSS, look around for contract jobs doing HTML email campaigns. Generally pays more than it should and can be lowish stress. You'll also get the fun that is table based layouts again.
>>
Should I be using event.target or 'this'? I've seen videos that use both.
>>
>>55577126
event.target
this considered harmful
>>
>>55574238
rate pls
>>
>>55575811

Why? So they'll be able to hire 10 times as many people under the same wage structure? Do they think there's strength in numbers or that they can just throw shit at the wall and hope it sticks?

I hope you've already started looking for jobs though, you shouldn't wait until you're unemployed.
>>
>>55577244
>this considered harmful
Crockford pls go.
>>
>>55574787
You can always use something like LESS and CSS to split the CSS up into different well named files, and compile it on changes.

Alternatively there's ctrl+f
>>
>>55577900
Or bleach
>>
I am coding an app in Node.js but I feel like asynchronous programming is a bit overkill for what I am doing. Should I just switch to C# or Python? The core of my program needs to run sync not async.
>>
>>55577938
>The core of my program needs to run sync not async

It probably doesn't. You just don't know how to make it async
>>
>>55577952
It has to post things one by one. If it posts too fast I will get banned.
>>
Dear god a job in web dev is horrific, I just wanna die
>>
File: linux.webm (275KB, 48x72px) Image search: [Google]
linux.webm
275KB, 48x72px
>>55577938
>>55578043
Don't listen to >>55577952 If it's sequential, pick a sequential language you already know. Use the right tool for the job. Cucks that brandish their meme of the month as a panacea are simply retards.
>>
How many of you guys actually do enterprise work?

Working on decade old legacy Java back ends that follow no standards because I couldn't get a job that wasn't web dev is killing me
>>
>>55578152
Yes. I've had it with dev work, fuck it I'm going into testing
>>
File: werner-atheist.jpg (77KB, 438x412px) Image search: [Google]
werner-atheist.jpg
77KB, 438x412px
why are most web developers atheists? you would think they would be smart enough to understand how god could program the universe
>>
>>55578144
Thanks mate ^_^
>>
>>55578217
>testing
I'd kill myself within a week.
>>
>>55578242
At least it's easy. And you can relax most of the time and watch porn. Better than making sure all divs align.
>>
>>55578072
At least it pays well. I just need to not kill myself for 7 more years and I can retire.
>>
>>55578152
I do. I know your pain, I'm >>55574787
At least I can add tests now so the new code should be nice.
>>
>>55578223
Thing is most web developers aren't that smart.
>>
File: 1453927116094.png (60KB, 500x371px) Image search: [Google]
1453927116094.png
60KB, 500x371px
>>55578043
>It has to post things one by one. If it posts too fast I will get banned.

So you need setTimeout() basically.

I mean it really doesn't matter, you can write your spambot using whatever language you want.
>>
>>55578223
Considering the shitty spaghetti code I've seen, I can completely believe that God programmed the universe. But if he did he's a Pajeet, and is not worth worshipping.
>>
File: blankface.png (156KB, 547x429px) Image search: [Google]
blankface.png
156KB, 547x429px
Anyone working with Construct 2 here? Where the fuck are all the free plugins, effects, behaviors, etc. being hidden at?

Sucks since it's JS you can't try a plugin out before you buy it.
>>
>>55574787

oh honey, that's no where near a large codebase. God help you
>>
http://collinoswalt.com/gadgasdg

404 page
>>
File: kNk7itR.jpg (102KB, 1280x1707px) Image search: [Google]
kNk7itR.jpg
102KB, 1280x1707px
Hello friends.

I have a Nginx, php, mysql Freebsd jail set up on a microserver.

It's currently hosting a WordPress site I'm using to help me learn and to help market myself as an engineering designer.

Anyway.
I was thinking about hosting my little eng equation solvers I've written in python on a site so I can use them and have my colleagues use them too. They're simple things, but I want to eventually move onto more complex stuff.

I'm assuming I have to use django or flask for this?
Would it be a bad idea to have my WordPress site link to the django based pages and serve them both off the same server?

ie. On the current FEMP server: Create a new database in mysql, install django and configure Nginx to serve the pages correctly..... then have links to this sub-site from my pretty and easy to maintain WordPress blog shit?

As you can tell, I'm a fucking noob.
>>
File: atheism.jpg (139KB, 463x557px) Image search: [Google]
atheism.jpg
139KB, 463x557px
>>55578683
>doesn't believe anything is worth doing
>apathetic toward worth of anything in this world
typical atheist.
>>
File: postgresql.png (34KB, 610x280px) Image search: [Google]
postgresql.png
34KB, 610x280px
Useless for web? Better Mysql?
>>
>>55579921
SQL databases suck
>>
>>55574787
I start commenting the shit out of it as I druge along. Over to time it comes together in my head a little more. When it's been percolating in head, i get better ideas on how to refactor it.
>>
Does Java fall under web dev?
>>
>>55578217
I help with regression testing at the end of a sprint and it's should destroying,. I couldn't handle it

>>55578339
I wouldn't mind so much h if we had the time to thoroughly go through it adding tests and the such but there is a hard to please client
>>
>>55580412
If you're doing a web app I don't see why not, but I don't many here use it
>>
>>55579921
Better than MySQL.
>>
What other features should I add to my news site other than tags, categories, articles and comments, upvoting and downvoting on comments?
>>
>>55581145
Most viewed/commented/liked etc
>>
>>55581029
thats highly subjective on the requirements
>performance
mysql
>*in starbucks* omg, it supports so many things
postgresql
every time i encounter a posgresql db/schema its filled with everything, the trash cans and its dog (and the dog is wrapped in a json object, somehow).
try mariadb, or if the db is contained/accessed by a single process sqlite
>>
Okay so, I'm working on a small project and need to decide on some form of frontend, beacuse my lazy hack method of just ripping apart a php returned JSON is just too lazy to work with.

Last I heard angular is a meme now, is that actually true?
>>
>>55578683

You're a humongous diot
>>
What's a good resources for learning ASP.NET MVC? The Microsoft tutorials?
>>
>>55581306
Thanks
>>
>>55581390
literally every frontend framework is a meme but that's only because the idea of a full frontend framework is relatively new and no framework is going to get it right with version 1 or 2 or even 3

that said, i like react and ember
>>
Do you guys think there is any benefit in saving timestamps as Date (human readable) objects? Besides the obvious of it being human readable

I always use unix timestamps because it feels so much more intuitive but from what I can see there seems to be a push to use Date type objects
>>
I'm loading a php tag with just one echo:
<?php echo $lang['BACK']; >


The problem is, instead of loading the text, it just shows a letter 'e'. The variables in that same file where the lang array is work fine in other files, but not on this one. Whu do you think this could mean?
>>
>>55582851
Sorry, forgot to put the ?> here, but it is in the code.
>>
>go through the whole learnyounode tutorial
>able to write some code in node
>read some books/posts about node

>still don't understand callbacks at all and any time I get them to work it's just me reciting magic words I don't understand
>>
>>55582851
whats the content of $lang[back]?
>>
>>55583051
Just a string that says 'back'.
>>
>>55583093
weird, do
>var_dump($lang);
>>
>>55583122
Where does it come up? I'm working straight on the server.
>>
>>55583122
Done. Says string(2)"en"
>>
>>55579534
More like modern day bachelor degrees. I might as well have written "BSc Computer Science" on a piece of paper and signed it, because apparently it would have the same amount of power.

>Would it be a bad idea to have my WordPress site link to the django based pages and serve them both off the same server?
I'm not too familiar with Nginx, but I assume that won't be an issue.

Go for it.
>>
>>55583214
>>55583257
Fixed. It was a directory issue.
>>
I'm getting into webdesign freelance soon - going to make on demand WordPress themes and plugins.
Is there anything I should know before starting?

I already have a portfolio with several completed websites, as well as a GitHub with my software projects.
>>
I'm the OP from >>>/biz/1357338

What's the odds of my server getting blocked from scraping the whole of 4chan every hour? Pretty high right? How can I get around this? 70 boards * 10 pages * 14 threads per pages is a shit load of requests (1 request per thread).

Considering limiting it to 20 or so boards until I figure it out.
>>
>>55582778
Only if you want the timezone and don't want multiple fields.
>>
>>55585418
Follow the rules and you won't be banned:
https://github.com/4chan/4chan-API#api-rules
>>
>>55585579
Also, don't scrape threads which haven't changed, you can figure that out from the thread list, most boards are dead-ish anyway.
>>
>>55582851
This line of PHP is telling you to turn back and learn something else before learning PHP. PHP will make you retarded. You must learn something good first.
>>
On work we have in house website that all the workers (around 20 of them) are using.
The server is in restricted network so it doesn't show to outside world.
On every page the php tests if the user is authenticated and dies if not.

Currently I have js that calls some php service that uses the database.
Could I stop using the php in the middle and connect to the database straight with js?
I know that in general that would be suicide because giving away database username and password but this is not general case.

I could even do it so that once you get to page that uses ajax calls it would generate in php a new database password for dummy user in the database which has restricted access. And when the js created connection it would change the password right away or if that would cause problems once the session is over.

Is this retarded idea?
>>
>>55585673
>Is this retarded idea?
Yeah
>>
>>55585673
Yes. Why would you even want to do that?

>>55585579
I'm currently scraping because 1 request per second for the number of threads I'm processing is too slow but I'm an idiot for not implementing >>55585587 so just cutting the number of threads down will help anyway. Cheers for giving me some common sense, it's been a long week.
>>
Are there any free TLDs?
>>
File: 485867.jpg (908KB, 3840x2160px) Image search: [Google]
485867.jpg
908KB, 3840x2160px
>>55578223
I'm a Roman Catholic systems programmer.
>>
>>55585860
.tk

famous for viruses back in the day, still works though
>>
>>55585565
I just save UTC Unix timestamps for that.
>>55582778
No reason. You will have to construct a Date object per item each time you need to do a sort or some other comparison. Numbers can be simply compared.
>>55583007
Learn promises and async functions.
>>55578223
Agnostic here.
>>
>>55586620
Timestamps don't come with timezones, if a user enters a time in UTC+5 and you want that information stored then you either need two fields or one date field.
>>
>>55586632
You can have your frontend convert all dates to UTC, when entering, and back, when receiving. But I now see this is not much better in most cases, because of all the conversions you do.
>>
>>55586671
Yes I know, I think timestamps are superior, but there are cases where you NEED the timezone intact, not the UTC time.

So the answer to your first question: It depends on your needs.
>>
>>55578223
most educated countries have a huge atheist population
most educated countries also have a higher amount of people working in computer related fields
therefore, there are going to be more atheist/agnostic webdevs in relation to other industries

i would think someone with half a brain could fundamentally understand this
>>
>>55586956
Statistics hide more than they reveal.
>>
>>55587141
Really makes you think
>>
>>55587141
knowledge is power
>>
How do I get lighttpd to pass any request to a fcgi backend?

The following will work for '/' but nothing else. Google isn't helping. A nudge in the right direction would make me happy.

fastcgi.server = ( 
"/" =>
((
"host" => "127.0.0.1",
"port" => 9000
))
)
>>
>>55587710

I'm very disappointed in all of you. How can you entitle this thread wdg and not wonk your shit. Shame on all of you. Evey one of you should feel bad about himself. >:(

FYI from trial and error, it seems that lighttpd will not pass the request to the fcgi backend unless a the file the requested location refers to exists in the document root. The actual content does not matter, only the fact that it exists.
>>
Hello /wdg/

For a few days I've been thinking about the placement of images within a text

<article>
<h2>...</h2>
<figure>
<img ...>
<figcaption>...</figcaption>
</figure>
<p>Text that belongs to the first figure</p>
<figure>
<img ...>
<figcaption>...</figcaption>
</figure>
<p>Text that belongs to the second figure</p>
<etc>
</article>


I want to achieve the following:
* Wrap text around figures
* Switch the images anchor point every second image: One left, one right, ...
* On bigger article widths the figure should be max-width: 50%
* Don't look retarded, and don't break context

Let's say I float the figures, one to the left, on to the right: The figures containing the images will then be placed, depending on articles width, viewport width, font-size, font-family and amount of written text in the <p>-elements.

This sucks because I have no control over the actual placement of the images.

How do you control the placement in a more proficient way?

Is this the reason why cards became popular?
>>
website vs web application ?
What is what ?
>>
>>55588295
Application vs app
>>
>>55588311
ty, relative
>>
>>55588295
A website displays content and is merely informative.
A web application brings interactivity along with the information. Tries to mimick an every-day application inside a browser.
>>
https://www.techempower.com/benchmarks/
Is this thing accurate? I'm interested in the most performant frameworks and it seems that go+fasthttp is the most well-rounded and consistently in the top combination. Anyone in here to confirm/deny this or to shit on their methodology/misrepresentation of some frameworks?
>>
>>55589878
Before asking "which is the most performant?" you should ask yourself "WHY do I want the most performant?". The thing is, 99.9% of the time you don't need all that raw performance for your whatever-you're-doing.
>>
File: 1456012043872.jpg (105KB, 750x750px) Image search: [Google]
1456012043872.jpg
105KB, 750x750px
OK so I'm in talks right now with a potential future employer and I would like to request some advice from /wdg/ please:

This is a entry level position and they've asked me what I want my starting pay to be, this isn't on an application or anything they've emailed me directly and I know what the pay range is I imagine I place myself in the upper levels of the pay range?

They've asked me what kind of web work I do like and what do I not like doing. This would be my first job, how am I supposed to know this right now and what is a smart answer that doesn't make me seem like the clueless cunt that I am?
>>
>>55589938
>WHY
Because if I'm choosing between learning, say, clojure and go, for writing web apps and this benchmark's results hold in real life apps (http-kit serves a third/fourth of requests per second compared to fasthttp) I don't see a reason why I should chose clojure over go then (idgaf what language to learn really) and spend 3x on hardware to serve the same number of requests if I ever write anything of use (and if I don't then performance of course doesn't matter but neither does anything else).
>>
>>55589878
They are accurate enough. Go is fast and only C/C++ offer consistently better performance. Never used fasthttp, but they seem to be skipping on features to achieve their speed (Websockets, HTTP/2, etc.). I'd personally use net/http with httprouter/httptreemux as a router + some utility packages.
>>
File: webdev-assembly.png (103KB, 506x662px) Image search: [Google]
webdev-assembly.png
103KB, 506x662px
>>55590082
>spend 3x on hardware to serve the same number of requests
And how many requests would those be? Tens of thousands per second? Millions? Consider yourself lucky if anything you do hits a thousand visit per week. Right now you shouldn't be focusing on doing stuff that can scale - Focus on doing stuff, ANYTHING. By the time you hit a bottleneck, and if you can factually say that it's because of your stack choice, you'll be on a much better position to select a replacement (or replace the component from your stack that's causing the bottleneck).

>I don't see a reason why I should chose clojure over go then
There are many factors to choose one language over another: community, resources, information, packages/components, tooling, maturity, examples, your own preference (procedural over functional, using your example with Clojure-Go). And even when you look into each of those items, there also is a chance that your language/stack/framework choice isn't suitable for the project you want to build.

>b-but still, m-muh performance...
pic related
>>
>>5558970>>55589970
>they've asked me what I want my starting pay to be
I'd ask for something relatively reasonable, but mention that you're looking forward to being paid more as your skills develop and you become better at what you do (try not to sound pretentious).

>They've asked me what kind of web work I do like and what do I not like doing
Mention frameworks or languages you've worked with and you like working with. Highlight some of the pros and cons of each (mostly the pros). Try not to make it sound like those are the only things you like working with, mention some other things. Like "I've never worked with AngularJS before, but...."
>>
>>55589970
what is the job m8, where do you live, how old are you
>>
>>55590402
Dude, I was interested in finding out what are the most performant language/framework combinations, not in getting a trite general life advice. (No offense but this is really the most often repeated sentiment whenever it comes to discussing performance of anything ever)
>There are many factors to choose one language over another
The minimal requirements (for me) are met by pretty much all languages in these benchmarks (I wouldn't go for Ur/Nim and some others no matter how fast they are) and now I'm deciding based on frameworks performance.

>>55590292
Missing websockets is pretty bad for me but I found some dude that forked gorilla websocket to implement httpfast support (https://github.com/leavengood/websocket), if it proves too much hassle to get working I'll just go with net/http and other regular stuff like you say. Thanks m8.
>>
>>55590415
OK so don't really mention any sort of cons or at least try to spin the con into a "but I look forward to learning more" type of thing?

Thanks for the advice anon.

>>55590494
Just an entry level Web job, in the US, upper age for this site. I'm trying to get out of tech support been there for years, burnt out, tired of dealing with retards. I honestly thought my age would be a big thing against me but I look young so it's not an issue. Place I interned at didn't know how old I was until my last day there.
>>
>>55582851
do some basic debugging and figure it out

<?php
/* myshit.php */
/* example of how to debug shit */
$lang = [
"back" => (object) [ "directory_listing" => scandir("./") ]
];

$mode = (isset($_REQUEST['mode'])) ? $_REQUEST['mode'] : "json";

$output = (object) [ "back_language" => $lang['back'] ];

$debug = print_r($output, true);

$output->{'debug'} = $debug;

switch ($mode){
case "text": header('Content-Type: text/plain'); echo($debug); break;
case "json": header('Content-Type: application/json'); echo(json_encode($output)); break;
}
?>


/* app.js */
(function(){
var sep = {
small:'-'.repeat(20).concat("\n"),
big:'-'.repeat(25)
};
var style = {
sep:'font-weight: bold; font-size: 16px; color: darkgreen;',
bigSep:'font-weight: bold; font-size: 16px; color: darkred;',
header:'color: darkorange; font-size: 13px;',
debug:'color:#286090;'
};
var log = {
bigSep: function(txt){ console.log("%c%s %s %s", style.bigSep, sep.big, txt, sep.big); },
header: function(headTxt){ console.log("%c%s%c%s:\n", style.sep, sep.small, style.header, headTxt); },
direct: function(r){ console.log("\t%o", r.back_language); },
debug: function(r){ console.log("%c%s", style.debug, ' '.concat(r.debug.split("\n").join("\n "))); }

};
$.getJSON('./myshit?mode=json').then(function(r, s, x){
log.bigSep("BEGIN: Log Entry");
log.header('Direct Output');
log.direct(r);
log.header("Debugging PHP Variable");
log.debug(r);
log.bigSep("END".concat(' '.repeat(13)));
});
})();


>>55585637
There is literally nothing wrong with php.
>>
>>55590738
define upper age ?
>>
has anyone ever made something with electron for the desktop?
>>
from here obviously.
>>
>>55590904
Why do you care?
>>
any js/jq library to make resizable windows like in codepen.
>>
>>55590629
In my opinion the lack of HTTP/2 support is a bigger problem for performance than any benefit httpfast may provide.
>>
>>55591282
to compare to my situation, i'm also trying to get into webdev, sick of hearing "oh noes i've deleted the internet"
>>
>>55583007

Callbacks Explained:
-------------------------------

Sometimes javascript functions will continue executing (doing stuff) even after the appearance that they've finished execution.

Like maybe you call the doStuff(); function. The function returns a value of "apple pie". Your script continues, as it appears that the function finished execution.
But then a few seconds later, something else happens. It turns out doStuff(); was still executing even though it already appeared to have stopped.

Well, if you want to have a function execute only after everything from doStuff(); has occurred, then you need to either use the Promise Interface, or use a callback.

A callback is a function that is passed into another function (as a parameter), and will be called at some later point in time. (presumably as the last operation of the parent function)
>>
How should a PHP form handling page be structured? Is there a standard for this? Here's a quick example:

<?php
if ($_POST) {

$foo = $_POST['foo'];
$bar = $_POST['bar'];

if (!empty($foo) && !empty($bar)) {
// now there is stuff to be done
// like make sure foo is not a number and bar is not a string
}
}
?>
<html>
..
<form>
...


That shit is repetitive as fuck. Is there a lightweight php package that does this?
>>
>>55583007
    var myFinalFunction = function(beginingTime){
var diff = Date.now() - beginingTime;
console.log("%cI'm the callback function. I should execute last. I executed %o ms after main", "color: purple;", diff);
};

var main = function(callback){

var beginTime = Date.now();

console.log("%cI'm the main function. I should execute first.", "color:red;font-weight:bold;");

setTimeout(function(){
var diff = Date.now() - beginTime;
console.log("%cI'm the deferred function. I will be executed sometime after main's execution.\nMain will return a value and finish execution before I even begin execution.\nI executed %o ms after main.", "color:darkorange;", diff);
callback(beginTime);
}, 800);

return {pie:'apple'};
};

/* function types:
*
* named function:
*
* function myNamedFunction(){ console.log("I did stuff"); }
*
* function in variable:
*
* var myFunctionVariable = function(){ console.log("I did stuff"); };
*
* anonymous function:
*
* (function(){ console.log("I did stuff"); })();
*
*
* so for passing a callback, you can do any of:
*
* main(myNamedFunction);
* main(myFunctionVariable);
* main(function(){ console.log("I did stuff"); })
*/
main(myFinalFunction);
>>
>>55591586
Slim.

Also, separate your shit. Do NOT mix logic and presentation. Get a router, or convert your forms to AJAX and return JSON with PHP.
>>
>>55591586
<?php
$foo = (isset($_REQUEST['foo'])) ? $_REQUEST['foo'] : die("need foo");
$bar = (isset($_REQUEST['bar'])) ? $_REQUEST['bar'] : die("need bar");

function continueIfNotEmpty($vars){
forEach($vars as $name => $var){ if (empty($var)) { die("Empty Var: $name"); } }
}

$myVars = [
"foo" => $foo,
"bar" => $bar
];
continueIfNotEmpty($myVars);

/* OK, so it looks like both foo and bar are set, and not empty, or we would've died by this point */
/* Note: by using $_REQUEST rather than $_POST we can catch the "foo" & "bar" parameters as either GET or POST vars. */
/* or you can just:

$input = json_decode(file_get_contents("php://input"));
$foo = $input->foo;
$bar = $input->bar;

which will get your parameters from a JSON POST Payload rather than traditional URI-Encoded GET and POST parameters
*/

?>
>>
>>55591788
Thanks. If I use JSON forms how am I going to implement CSR?
>>
>>55591788
>
function continueIfNotEmpty($vars){
forEach($vars as $name => $var){ if (empty($var)) { die("Empty Var: $name"); } }
}


What is happening here?
>>
>>55591586
>How should a PHP form handling page be structured? Is there a standard for this?
>That shit is repetitive as fuck. Is there a lightweight php package that does this?

You are on the brink of tripping and falling down a rabbit hole to never-never land, which I have only recently clawed my way out of and washed up on the shores of...


I don't know where I was going with that but the point is that there is no point. That is to say, no, there is no standard but yes, there should be and yes there are legions of snakeoil salesmen willing to sell you a silver bullet labeled as the "one true way"

Web development is a hack, PHP and its community is the embodiment of what ignorance can forge through sheer force-of-will and persistence. The moment you consider it legitimate is when you fail. It is a means to an end and nothing more. By legitimizing it you are only doing yourself harm.

I only recently awoke from the feverdream to realize that I have no useful knowledge, no transferrable skills, I am nothing and nowhere at all.

Get that form working and forget about it. Learn data structures and algorithms, linear algebra, calculus, geometry, and all the math you should have learned but didn't. Take a raincheck on OOP. Don't make the same mistakes I did.

t. webdev
>>
>>55591973
Second this sentiment. Having gone into webdev without a cs background I spend my days now reading up on data structures, algorithms, essential math and various programming patterns in order to catch up with "real programmersâ„¢".

Being a front-end dev I pretty much live Javascript. ES6/7 is the only thing that has kept me sane recently. I'd take Javascript over PHP any day though.
>>
>>55592237
Nah, i don't second it. I see it more as a self esteem issue yall nerds have
>>
>>55591969
A loop over the array and die() if any of them are empty. It's foreach and not forEach in PHP, though.
>>
>>55591973
>>55592237
Idiots who haven't bothered to do a bit of learning.

It's not any language's fault for your lack of will to do some studying. You jumped into the "hurr durr I submitted a form now I'm a webdev" meme... well, guess what, reading a few tutorials online and dicking around on codeacademy isn't going to give you a job.

Get a framework. Or don't. Or get a router, or write your own. Get a template manager such as Twig, or don't, but separate your logic and presentation, PLEASE.

If you can't muster up the strength or knowledge to do so, get a framework and it'll make you do things the right way.

Yes, web development is a hack, but so is everything. If Javascript could change tomorrow and give you all the tools and shit you need, it would, if PHP could change without breaking all the shit currently depending on it, it would. There is Win95 code in Windows 10. Think about that.

Now fuck off and get some shit done.
And yes, you are in the right by reading up on good programming practices and data structures, as well as algorithms.
>>
>>55591338
There are many excellent libraries. One of my favorites is ExtJS.
Here's a quick example showing a re-sizable code-editing window (see url below)

I do fucking hate it when 4chan thinks my post is spam. God damnit. Maybe this long paragraph of ranting text will be enough to convince the system that I'm not just spamming urls.

Fucking god damnit, it STILL thinks I'm spamming. I'm not. I sware it. I'm just trying to help a bro out. I'd post the code directly here, except I keep hitting the character limit. So I'd like to post a url. Will you please stop kicking back my shit, Mr. 4chan Post-Analysis Bot?

Thank ya.

http://pastebin.com/raw/5QbWKzd8
>>
>>55592568
>Idiots who haven't bothered to do a bit of learning.
...
>And yes, you are in the right by reading up on good programming practices and data structures, as well as algorithms.
>>
Entry level Web dev (front end), USA. Just got a job offer for only a salary of 30k. Seems a bit low, is this normal or are they low balling me?
>>
Hi guys, im a 21 idiot, and i recently learned HTML as my first language, but I know that HTML it's only a markup language. So i want to learn a prommaging language as c++, c, javascript, etc. what do you recommend me and why?
>>
>>55593562
>30k
Where the fuck is this?
Buttfuck, Idaho?
No. 30k is waaaaay too low.
>>
In JS, why would I use normal for loops if for...of exist?
>>
>>55575250
Dont be a pussy faggot. Just learn HTML is easy as fuck
>>
>>55593719
My personal recommendation would be to start off with C for a short bit. Just so you can learn types, loops and whatnot. Then, since you already know HTML, try going forward with Javascript.
>>
>>55593549
Well, NOW they've come to their senses...
>>
>>55593782
Shit city Tennessee. I'm pretty sure the average here is 45k (cost of living is super low) but glass door is an unreliable shit site.
>>
>>55593798
Ok I know a little bit of JavaScript, but it's not enoght, so im gonna try learning more...
Other thing... I use the notepad for HTML programming, should i use something else? something that allows me to see my results faster?
>>
>>55593809
It's still way too low.

Go for it if:
- You do not have anything on your resume yet
- You don't have any other job offers
- You're not sure of your abilities yet
- You live with your parents or your rent is abysmally low

If you accept the job, create a LinkedIn profile, network a bit and start searching for a new job after a few months.
>>
>>55593833
Use Sublime or whatever that has syntax highlighting.
>>
>>55593833
Sublime text with Emmet plugin
>>
>>55593833
>I use the notepad for HTML programming
Don't.
Some shitlord will recommend you try Vim, but I recommend you go with PHPStorm/Webstorm, or Sublime.

DON'T use Dreamweaver or any WYSIWYG editor. The only way to be sure that what you've written looks good is in the browser. Sorry, but you're gonna have to smash that F5 button.
>>
>>55593866
> dubs plz
Also, a friend recommend me notepad++, should i download it or not?
>>
>>55593884
It's ok. Definitely better than just Notepad.
But do give Sublime a try.
>>
>>55593902
Ok thx, i recently download it, can i program in C in Sublime?
>>
>>55593844
Very good advice this would be my first job in the field. Rent is low but I hate my roommate (rent is around $500 or so if I were to move out on my own). No other offers but I haven't looked it just kind of fell in my lap.

It's on a contract so that would take me out of the running for a minute. I really appreciate the advice anon.
>>
>>55593931
Yup.
>>
>>55593954
Dude thx a lot!!! this is and looks way better than notepad XD, thx dude
>>
>>55593790
If you specifically need the index, looping over multiple arrays simultaneously, need to check odd or even, consume multiple items in each itteration, etc.
>>
>>55593809
Man, at least its not somewhere like NY or SF. $30k a month would only cover your rent, maybe food too.
>>
need to build a web ui in angularjs... someone recommend me a good guide to pick it up
>>
>>55574787
>10k lines css
u wot
>>
>>55594104
Yeah I know you guys start around 100k though right?
>>
Anyone here has experience with magento? What do you think of it?
>>
>>55594189
>you guys

:'(

>tfw I'm not in NYC.
>tfw I'm not even in America.
>tfw I don't even have a job.

Feelsbadbro. I envy your $30k a year, cherish it.
>>
>>55594226
We're all going to make it bro. I believe in you.
>>
>>55593866
>PHPStorm instead of vim
>>
So i just set up my own apache web server. Im new to linux so i just want to check if i understand this correctly.

According to most tutorials, i should create a new "super user" and add it to the "sudo" group, thereafter disabling remote access to root. But will this new account will actually have the same abilities as root? Im asking because i dont have physical access to my server and if shit hits the fan and i need to do something that is only doable from root im fucked.
>>
>>55594333
>Spending months learning how to use an editor
>>
>>55594274
Thanks senpai.
>>
>>55594359
3 days using it is enough to learn the basics.
>>
It says in the MDN that I can list even prototype methods using for...in loops in objects, but I can't see them

var obj = {
name: "John",
last: "Doe",
age: 30
};

for(var i in obj) {
console.log(i + ": " + obj[i]);
}


How do I make it so that I can see even the protp and constructor methods inherited from the Object prototype?
>>
How do I go from web developer to literally anything else that involves programming?
Shit degree in Information systems, hate working with people with no technical background.
>>
>send out 1287318972746th application this year
>finally get a somewhat promising response
>"Send us an example of your work - some code - that you're most proud of"
>mfw my most complex project is basically a hackjob being held together by duct-tape and best wishes

I...I can get by with this, right? I mean, I basically have 0 experience in web-dev yet I've managed to create something that works. It's a full e-commerce platform written from scratch (admin panel included).
>>
It happened. I got my first local contract. Now what?
>>
>>55594626
You can go backend / databases.

>>55594976
Work all night cleaning up the code and send it to them when it's ready. Don't forget to give a summary of what the program is about and be sure to heavily comment it.
>>
>>55595476
I often fantasize about becoming a dba. My relative did it for decades and then data warehouse shit and she doesn't know how to change her windows desktop wallpaper and only had to learn oracle and scripting (her words not mine) for sql in the data warehouse era.

Im not naive though I know everything is a meme.
>>
>>55595476
Thanks for the tip. I have to send in a Github link to the project. I haven't touched it in weeks, wouldn't it look suspect if they view my commit history to realize I made changes less than a few hours ago? Maybe I'm overthinking, I don't want to fuck this up or else it might be another round of applications before someone shows interest.
>>
>>55578152
How much does that pay sounds comfy desu
>>
Can I combine functional, object oriented programming and the MVC pattern?
>>
>>55596006
That's pretty much React.
>>
>>55595476
I already am a backend developer. Just tried of glorified fucking crud apps.
>>
>>55595813
I rarely update my github even though I make changes to my program all the time. I think it's okay if you clean it up for them.
>>
>>55596136
Noted. Thanks.
>>
These kind of reels are really nice.

https://www.youtube.com/watch?v=Q5763pPchvw
>>
>>55593562
It's ridiculously low.

I took at low paying job (40k) like that 3 years ago and make over 6 figures now. So unless you have better options you might have to take it and just bet on yourself.
>>
I'm doing the Eloquent JS exercises, I'm at a part where I need to create a function that takes a nested list and pushes the values into an array

{ value: 10, rest: { value: 20, rest: { value: 30, rest: null } } }


function listToArray(list) {
var arrList = [];
for(var newList = list; newList.rest == null; newList = newList.rest) {
arrList.push(newList.value);
}
return arrList;
}


Why does this below works if it doesn't have any conditional to stop the for loop? But the code above doesn't when I specify to stop it when the rest value is null?

function listToArray(list) {
var arrList = [];
for(var newList = list; newList; newList = newList.rest) {
arrList.push(newList.value);
}
return arrList;
}
>>
>>55597304
Each time the loop runs, node becomes the inner object. So on loop one
[code{ value: 10, rest: { value: 20, rest: { value: 30, rest: null } } }
] [/code]
The second loop
{ value: 20, rest: { value: 30, rest: null } }

The third loop
{ value: 30, rest: null }


The loops runs once more, but value is null there. After each iteration node is set to the inner object
>>
Does anyone have experience with wireframes? How useful are they?
>>
>>55590861
See
>>55583484

This happens when you work with someone that doesn't know how to correctly declare directories.
>>
File: lmfaopham.jpg (19KB, 235x193px) Image search: [Google]
lmfaopham.jpg
19KB, 235x193px
hi /wdg/

I made a cute app engine page from following an online course

come make some shit posts

https://asciichan-071516.appspot.com/
>>
Man recursion is so confusing.
>>
>>55598522
function name(){
if (A){
name()
}

if (B){
return B;
}
}
>>
>>55598609
Wouldn't that become a fork bomb? Sorry I'm shit at CS that's why I do webdev
>>
>>55598650
Ideally there is more code to it than that.
>>
>>55598609
I get the basics of how it works, but I can't the logic behind anything more complex than that


function deepEqual(a, b) {
if (a === b) return true;
if (a == null || typeof a != "object" || b == null || typeof b != "object")
return false;

var propsInA = 0, propsInB = 0;
for (var prop in a)
propsInA += 1;

for (var prop in b) {
propsInB += 1;
if (!(prop in a) || !deepEqual(a[prop], b[prop]))
return false;
}

return propsInA == propsInB;
}

>>
>>55598846
it compares two objects with each other.
if it's an actual object, it checks every property too.
>>
>>55598846
Recursion is easy, you just worry about the current problem and let the "future you" worry about the next.
>>
>tfw basically just designing in a job, instead of doing frontend
>tfw actually gud at it

Now I don't even know what to do. I don't think there are/will be web designer jobs anymore. Maybe I could pass as a UI/UX guy since I know some of that too. I kinda feel bad about doing just HTML + CSS, but I have a full freedom on a design aspect and it is comfy.

Maybe I should have gone for a graphic design, since, even though I know frontend and have some experience in backend, I actually don't enjoy that.

It's crazy, on the one hand I don't want to do it, but on the other hand, I want it just because of a better status. Then I realize it's all just a plebdev and feel the need to learn more CS fundamentals and a "real" programming language, even though I actually don't like it at all. All because of the need to not appear like a failure who couldn't do better (which I could, I just picked a wrong path).

How did I become so insecure, guys...
>>
>>55599345
Nice blog, senpai.
>>
>>55593931
tools>build will compile a C program
>>
>>55599059
Good answer. The easiest way to do recursion wrong is to overthink it.
>>
>>55599345
Just push your way into being an actual frontend person after a year or so.
>>
Question guys, how do you like your web dev job? Good or bad?

I was a web dev for 1.5 years. I'm now NEET, looking for other jobs. I sort of fucking hate web dev but I'm incapable of anything else.
>>
/wdb/
>>
>>55599990

Also to answer my own question, my job was okay I guess, I think I could have made it better with more pro-activity.

For example me and my boss were the only devs. He wasn't that consistent on stuff like style, and that infuriated me. I wish I had insisted we codify and stick to a style guide.

Another thing was feedback. I never got any constructive feedback besides "yes this is okay", so again if I had stayed, I should have insisted on weekly code reviews.

Another thing was the clarity of my role. I was being asked by this marketing bitch to do work that I never agreed to, which basically wasn't my job, and just added more shit to my plate besides my ACTUAL job of keeping the fucking websites running.
>>
>>55599990

I hate it. I'm also looking for something else.
>>
>>55600021

How long have you done it, and what would the something else be?
>>
>>55599990
I'm just getting my feet wet with freelancing. It feels like there is so much to learn besides actually web dev.
>>
Been learning JS to get a job in the industry and I feel like I know concepts the average junior front end dev doesn't need to know. Every time I start a little project to put in my portfolio I learn new things and I just want to refactor the code so I end up never finishing anything
>>
>>55600168
Yeah I think if you're a freelancer you have to have enough business acumen / balls to make sure you don't get fucked in the arse.
>>
>>55600431
I've kinda gotten fucked. Slightly.

I've done 3 'phases' of work for Universal. The first phase I had to wait 4 months to get paid. The second phase I had to wait 2 months to get paid. And who knows how long I'll have to wait to get paid for phase 3.

I really don't dig their vendor system. They treat me like a business, not an employee, which means they can make me wait for my money for fucking forever.

(and no, I didn't do 'website configuration'. They mean I created a custom website from scratch, writing all the HTML/CSS/JS/PHP/SQL and everything else to make it happen. I started with a blank server, and did everything, from writing the website, to creating the databases, to generating the ssl certs, to writing the apache configs, to setting up the FirewallD rules and Filesystem ACLs, to... well, everything. 'website configuration' is just what they think it is called, because they only half-understand my emails)

I just got a new job though. I'm about to make $25/hr as a "Coder" for a company whose name I will not mention. They've already got designers who're going to use photoshop to design everything. I just have to write the markup/styles/scripts to make it all happen.

It's going to be awesome. Phase 3 with Universal took like 3 months of work, and I'm going to make about $1,900. With this new job, I can make $2,000 in basically 2 weeks.

Employee > Freelancer

I'll go ahead and give /g/ credit on one thing: I talked to you guys about the project with Universal before I even got that deep into it, and you guys told me I shouldn't waist my time. I chose not to listen, and now I realize I was mistaken to do this. You guys were right. Shouldn't have wasted my time.
>>
>>55600582
As a former employed web dev (now NEET because I'm stupid) I thought perhaps you'd say a story saying how freelancing is awesome because you can be your own boss. But you've basically said what was already my opinion on it.

Freelancing seems like a great idea, but when I've done little paid projects for people in the past (while I was at uni, so I wasn't relying on it for a living), you realise how you get treated like shit, you don't get paid enough, people will always try to jew you out of money, etc.

>$25/hr

That sounds pretty good, I used to get £12/hr which is $17.50/hr (but wages generally are lower over here so it was a good salary, especially for a junior like me).

So yeah I can see why you think being an employee is better, the money and security do seem better and the stress is often a lot less. But maybe one day I'll do freelancing or try and start a business. I think if you're more than one person, and if you can develop a name for yourself, then instantly you're going to be able to charge people higher fees, and people are going to respect you more as an organisation, rather than just one person. If you're a single person they will ALWAYS try to bully you around, that's just human nature.
>>
>>55600431
Well I've got zero business acumen so I'm probably going to get fucked alot, especially in the beginning. About how much should I start charging people for basic websites?
>>
>>55599990
back end developer, hate it.
See >>55594626

My dream is to get a masters degree and find a job where I do real software development
>>
>>55600582
>The first phase I had to wait 4 months to get paid.
yikes x10
and shit you did everything from scratch? holy fuck did you skip reading literally ALL of the 'how to into freelancing 101' blogposts out there?
congrats on your new job though!
>>
>>55601244
>you did everything from scratch?
Yes. Literally. Wrote everything in the geany text editor, starting with a 0-byte file. Every single api script. Every single js script and stylesheet. All the markup. The only things I didn't write, are the standard libraries I included. (jQuery, bootstrap)

I even created a custom CMS for them.

It didn't even occur to me until phase-3 that I could at least make some basic html & php template files, to save me from having to write the:
<!DOCTYPE html>
<html lang="en" ng-app="app">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="keywords" content="">
<meta name="description" content="">
<title></title>
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.6/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.6/css/bootstrap-theme.min.css" class="theme-stylesheet">
<script type="application/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.2.4/jquery.min.js"></script>
<script type="application/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.6/js/bootstrap.min.js"></script>
</head>
<body>

<style type="text/css"></style>
<script type="application/javascript"></script>
</body>
</html>

and the :
<?php
if (session_status() === PHP_SESSION_NONE){session_start();}
$input = json_decode(file_get_contents("php://input"));
header('Content-Type: application/json');
$lnk = new mysqli('127.0.0.1', '[censored]', '[censored]', '[censored]');
$output = (object) [];
echo(json_encode($output));
?>

every single time.

I did not read any intro to freelancing blog posts.
>>
>>55601861
But why literally everything from scratch???
>>
>>55601861
Oh man, and all for $1,900?
Well, at least you've learned better now.
>>
>>55602478
Because they wanted lots of custom features, a full eCommerce platform, etc

I wasn't sure if I could trust the security of things like Wordpress
I don't know how to use things like wordpress
They wanted to go with Wix, but I wasn't sure how versatile it would be, or if you could include your own JS or not.

When you build something from scratch, you know that any end-output is achievable.

When you use something like wordpress or wix, you're bound to the constrains of whatever the native functionality is, whatever plugins you can find, and your own ability to extend such systems.

Like, if I wanted a user-portal that keeps track of which tracks/bundles a user has purchased, I know how to code that myself. But if I were using wix/wordpress, how would I even begin to implement such features? I could look for an ecommerce plugin, a user registration plugin, a user login plugin, maybe some generic "user portal" plugin, then I have to connect all these systems (which I didn't write) together, and I have to find a way to create the requested functionality.

In short:
It's easier to work with code that you've written the entire way through, than to work with a bunch of other peoples' code.

However, since the project was so much work, and took so long, I'm honestly re-thinking my strategies here. Next time I'm just going to use wordpress. If that project turns out horribly, then I might go back to this method. But I have to try something else, because the project for universal just took too damned long.
>>
File: 2xZIls4.png (1020KB, 1428x900px) Image search: [Google]
2xZIls4.png
1020KB, 1428x900px
I need some help with this html/css.
I want the images to float into eachother better, removing all the whitespace created in height between images because of the variable height on every image.

html:
<div>
<a class="image-container" ng-href="{{image}}" last-max-width ng-repeat="image in vm.images">
<img ng-src="{{image}}" alt="{{image}}">
</a>
</div>


less/css:
.image-container {
display: inline-block;
padding: 15px;

img {
border: 1px #000 solid;
width: 100%;
}
}


What's the magic line I'm missing?
>>
>>55603991
what is it supposed to look like?
>>
>>55603991
something like this?
http://codepen.io/anon/pen/OXzGzy
>>
File: Untitled.png (2MB, 2173x2020px) Image search: [Google]
Untitled.png
2MB, 2173x2020px
>>55604272
Thought I made it clear in the text, but I guess not.

>>55604416
Nah, here it's set to an amount of columns you can't change. I want the images to wrap into more columns as they require space, which is the default behavior.
>>
Does anyone here develop with a statically typed language? Or is webdev completely dominated by dynamic languages?
>>
>>55604775
you can't do that with css alone.
>>
>>55604835
I used typescript every now and then.
or do you mean server side?
>>
>>55604835
I personally don't, but Java, C# and Go are popular for backend web development.
>>
>>55604846
How would I go about it in js?
>>
File: logo.png (8KB, 227x95px) Image search: [Google]
logo.png
8KB, 227x95px
Has anyone used this? Opinions?
>>
how would you design a generic system (interface + backend) where people can input their orders, ANY type of order, so that the system can be reused and adapted quickly? is there something like this already? is there a way to make this easily? could you do this quickly with, say, RoR or django?
by orders I mean something like: "I want to order this [product|document|feature|...] with these specifications. here are the details, here's my personal info"

I'm thinking about building a system to manage queues (in real life, not as a concept). I wouldn't care much about eye candy, but functionality and ease of use are key. otoh, I fucking detest frontend design/dev, so I'd prefer something easy to make
>>
>>55604929
Young language, may not be libraries for everything you want but it's pretty good and has great performance
>>
>>55604914
>>55604846
adding
width: 100%;
the the img css rule on >>55604416 makes it work just like you want, no need for js or anything else (you can even remove the auto margin stuff)
>>
>>55604775
shit, forgot to link >>55605171 to you
>>
>>55605068
Most online shops are built this way, you create products which are then linked to orders.
>>
>>55605171
Not really. As mentioned it sets an amount of columns in the html that you need to distribute images evenly across.

I could do it this way, but since I want the user to be able to specify how many to see in the width (amount of columns) I need a system that reads the amount of columns wanted, creates them in the dom and evenly distributes the images across them. It's not hard, it's just a piss way to do it imo. Was hoping there was a better way to just let the images occupy the free space, but since it sounds like there isn't, I'm not gonna bother with it.
>>
>>55605279
Why not
image-width = total-width/num-cols
and then float them left?
>>
File: cruel-intentions-b.jpg (63KB, 938x630px) Image search: [Google]
cruel-intentions-b.jpg
63KB, 938x630px
>>55604929
erlang for ruby programmers

I've been picking away at learning OTP/erlang and desu I don't see any reason I'd ever need to use this lol. It's a weird model where the VM does all the hard concurrency shit and you just write processes.

Learning go would probably be more practical, and this is coming from someone whos sunk a bunch of time into erlang already. I'm strongly considering jumping ship and learning something else.
>>
>>55605293
I might do it tomorrow, but I was really hoping to not have to make a directive that splits the images into as many arrays as columns and makes the dom for it. A lot more spaghetti than just having one array of images in one container.
>>
>>55605356
On second thought I don't have to do it that way. Thanks for the help - I've got it under control
>>
hey, does /wdg/ know some cool HTML/CSS/JS tricks to add to my page?
>>
>>55605681
Fancy css loaders
https://codepen.io/collection/HtAne/
>>
>>55605681
www.justinaguilar.com/animations/
https://daneden.github.io/animate.css

Use them sparingly unless you want your site to look like something built for users under 12.
>>
>>55605255
right, but do shops allow the user to input specifications regarding the product?
also, how would you make a shop for users that want to order, say, many types of documents?
>>
>>55606812
Product attributes as a third model connected to the product.
Color, size etc
>>
What's the best way to size table cells?
I set the width of the table to 100%, so it takes all of the space on the screen, but the cells overlap and the data is unreadable.
>>
So apparently I have to do a webapp by end of the yea for colleger, doing so in different steps

>Do a prototype with HTML/CSS/JS

>Do a full implementation on Angular 2 but without backend

>Do the backend (API REST, BDD, security, etc...) with Spring Boot

The probem I have no idea about what to do the webapp about, as I don't want to do the usual boring "rate my restaurant/shop/etc".
Any interesting idea that lets me explore new features?

Also, when is Angular 2 going to be completed?
Working with the beta was a nightmare.
>>
>>55607029
That shouldn't be happening unless you fucked up somewhere.
>>
>>55607623
>Any interesting idea that lets me explore new features?

Multiplayer poker with web sockets? Video conferencing application? Idk man think of literally anything. How difficult does the project even need to be and why does it have to be done with ng2?
>>
>>55594114
lol you have no idea how common this is.

>>55574787
>How do I work with a large legacy codebase without killing myself?

Impossible.
>>
>>55608536
My teacher wants some app with at least 5 entities in the DB and Social shit like comments, "likes" and shit.

It has to be ng2 because he says it's
>the future
and will be the most popular webdev technology.
I now AngularJS is dead, but going through ng2 non-existent documentation and dealing with constant changes and bugs was the worst experience I had in college.
>>
>>55604846
>what is flexbox?
>>
>>55608615
Its the future we deserve.

SPAs are cancer. Janky clunky wank.

Loading content via AJAX is fine, but rendering the whole thing in Javascript is fucking stupid.
>>
>>55605352
Go is definitely friendlier than Erlang. Pretty fun to write as well ;)
>>
>>55608615
>It has to be ng2 because he says it's >the future and will be the most popular webdev technology.

lol what a tard. the future of webdev is yet to be seen and it certainly doesn't lie with any single framework.
>>
>>55608615
>My teacher wants some app with at least 5 entities in the DB and Social shit like comments, "likes" and shit.

Just re-make tumblr, why do more work than you have to?
>>
>>55608702
You sound like the type of guy who got straight C+ in highschool.
>>
/G/ents, when and why should i use react and if not what would be good replacement to it?
>>
>>55608951
If you have to ask this question, you probably don't need it
>>
>>55609135
true, don't need it now, but wanna learn, so what kind of app should i try to make?
>>
>>55609318
If you want to learn then learn enough to get a job and do that job so you can learn more while getting paid.

There's not much point in investing time into learning specific meme frameworks unless you're getting paid to do so. what you learn in one will not transfer very well to another unless its an MVC framework, which React is not.

However if you learn your language(s) of choice and general computer science principals that kind of thing will transfer well between different things and you'll be able to pick up different tools and frameworks as you need them quite quickly.

If you really want to make a shitty app with your chosen meme framework, make a todo list or strawpoll clone or something.
>>
File: kmekmekm.jpg (42KB, 720x720px) Image search: [Google]
kmekmekm.jpg
42KB, 720x720px
I took a communicatons class in college a few years ago. We learned about the history of media (radio, tv, etc.) Are there any good documentaries on the evolution of computers online? I'm bored and feel like learning something. Will any of this help me understand how programming works?
>>
$query = trim($_POST['query']);
$search = $handle->prepare("SELECT * FROM users WHERE username LIKE ?");
$search->execute(array('%$query%'));
$result = $search->fetchAll();


Can someone tell me what the fuck I'm doing wrong here? The execute statement doesn't recognise the variable I pass to it. It just completely ignores it. If I remove the variable and put something like
array('%John%')
it'll find it.
>>
>>55609491
Try these.

https://www.youtube.com/watch?v=8pTEmbeENF4

https://www.youtube.com/watch?v=JxAXlJEmNMg
>>
I made this to remove a comment made by myself from facebook (desktop version), and post another comment, "asdf", all from the JS console (works in chrome at least):

/* this works */
document.querySelectorAll('[data-testid=ufi_comment_close_button]')[0].click()
document.querySelectorAll('[data-testid=ufi_comment_menu_delete]')[1].click()
setTimeout(function(){ document.querySelectorAll('[data-testid=ufi_hide_dialog_delete_button]')[0].click()},400);
/* this doesn't. yes, it's ugly as hell... */
var textbox = document.querySelectorAll('[data-testid=ufi_comment_composer]')
textbox[0].children[0].children[0].children[0].children[0].children[0].textContent = "asdf"

problem is, the first 3 lines work fine, but the last line don't. anyone knows how the fuck to post a comment in facebook? I can't find a way to do it, it's not a "normal" input box.
>>
>>55604835
TypeScript and Go reporting in.
>>
>>55609554
$ php -a
Interactive mode enabled

php > $a = 'asd';
php > echo '$a';
$a
php > echo "$a";
asd
>>
What does /wdg/ think of this http://react-etc.net/entry/your-license-to-use-react-js-can-be-revoked-if-you-compete-with-facebook

>If you are using or considering using React in a project you might want to consult a lawyer. Because of the patent clause you are not allowed to do anything that constitutes as competing with Facebook. If you do take legal actions or in other ways challenge Facebook, your license to use React is immediately revoked.
>Your license is also revoked if you have any legal disputes if you have legal disputes with any other company using React. So if you're looking to create a Facebook killer with React, you might want to call up your lawyer. Technology wise there are other viable alternatives like Vue, Angular and Aurelia, so your venture won't fall because of this.
>>
>>55610127
Right, but that wasn't the issue. Apparently you have to write some types of SQL queries differently in PDO.

$search = $handle->prepare("SELECT * FROM users WHERE username LIKE concat('%', :query, '%') ");
$search->execute(array('query' =>$query));
>>
>>55610828
ah. desu, I'm glad I don't code in PHP

>>55610560
cool, hopefully people will stop using these libraries made by big corporations
>>
Is there a reason to use jquery anymore? It seems like it adds a bunch of bloat for things that are already simple enough to do in vanilla js
>>
File: 1370855891249.jpg (63KB, 960x720px) Image search: [Google]
1370855891249.jpg
63KB, 960x720px
>have a series of bootstrap tables
>want to compare values between them and highlight the table with the greater value
>tried javascript and failed

Should I use

$("id.B tr").find("td") to look for tables with IDs?

or use Document.getelementbyID?

each table will have it's own unique ID
>>
>>55611185
collect all table id's and values
sort
pick the highest
add highlight css class
>>
>>55574020
What do you guys think of my website?
Http://www.sumtingwong.tech
>>
>>55610560
this kills the react
>>
>>55611660
embarrassingly bad

you are such a huge faggot i cannot even handle that i am on the same board as you
>>
File: Hacker_Times_1000000.gif (3MB, 320x180px) Image search: [Google]
Hacker_Times_1000000.gif
3MB, 320x180px
>>55611660
I'm not sure I trust that site.
>>
>>55611660
we're not in 1995 anymore
>>
>>55611660
Zuckerberg pls, no need to show off
>>
Why is there a need to loop on lists and shit like that just to add an event listener? It doesn't seem right. Am I missing something?
>>
>>55579551
thats some stupid ass logic.
but keep patting yourself on the back for being "right"
>>
who /rails/ here
>>
One of the things I seem to be having most troubles with is choosing a stack and the various tools/frameworks that are used to make everything work together nicely.

What if I want to create a webapp in node, have it hosted somewhere online, user authentication, a REST api, and have it look nice? I see a lot of guides that explain bits and pieces of each thing, but not a whole "this is how to get from no code to an app in production successfully and why we chose the tools we used for this"
>>
Is there a /wdg/ equivalent for UX/UI on /gd/?
I need to get into that shit, I always see job postings offering around $30/hr for UX.
>>
File: chrome_2016-07-17_00-50-21.png (419KB, 1920x911px) Image search: [Google]
chrome_2016-07-17_00-50-21.png
419KB, 1920x911px
I rewrote my imageboard software from scratch. The old one was filled with tons of security holes and was poorly written. That's okay though, because it was a learning project; I used it to learn php. My new one is (hopefull) a lot better. I'd like your opinions though, of course.
I should note that I'm terrible with UI, so you'll have to pardon me if my design doesn't appeal to you.

Additionally, I'm looking for a partner or partners to code with. I've really enjoyed creating these last two pieces of software, and would be highly interested in creating something a bit more creative/original with the aid of another person. Even if said person(s) have no coding ability, I'd be fine with that as long as they came up with good ideas.

Here's the original: https://github.com/4tran/VIB
Here's the rewrite: https://github.com/4tran/VIB2
Here's the live site: http://4tran.bid
>>
>>55612491
You again? why can't there be an imageboard that isn't a blatant clone of 4chan.
>>
>>55612861
That was the point. I wasn't trying to make an imageboard for the purposes of doing something original, which you would know had you read the rest of my post, I did it to learn. Now I'd like to do something original. I just don't know what that is yet.
>>
>>55612491
Don't put server-side code in /public. Anyone can run install.php, which resets the admin credentials to admin/admin.

Your new admin credentials are dont_put_php_in_public/1234.
>>
>>55613012
But anon, I need them in public because they need to take $_POST data. Would validating logins be enough, or is there a way that I don't know about to get user inputted data without the php file being in a public directory?
>>
File: 1468203162521.png (439KB, 400x400px) Image search: [Google]
1468203162521.png
439KB, 400x400px
>>55608908
Nope, I'm a high school drop out and I make 6 figures.
>>
A shitty web app for inventory in php.
my lack of experience and patience is showing up in the messed up code combinations of html/css/php/javascrip/mysql.
Is there an optimal way/tool to develop web based apps? i spent the whole day dealing with a simple data base validation inside a form and ended up with 20 diferent javascrip/jquery/ajax funtions in the same page.

it kinda works but i dont know, it just looks so messy and unprofesional, i wont feel good getting paid for this.
>>
>>55613043
>Would validating logins be enough
No, because passwords are inherently insecure. If you're not salting your password hashes, they can be broken via rainbow tables. That's not to say this idea isn't better than what you currently have, but it isn't generally enough.

The idea is that your 'app' and webserver serve content from public. public contains client-side stuff (i.e., things that you don't mind any end-user seeing/using/executing). Your 'app' and related files (configs, etc.) are alongside public (not in it), in the project directory, which is ideally access controlled via ACLs and webserver. Apache and nginx both have the ability to serve from public/.

If you're set on PHP, I recommend looking into Laravel or Zend. They'll handle a lot of the boilerplate that tends to be easy to get wrong without a lot of prior knowledge. Zend has decent documentation (https://framework.zend.com/manual/1.12/en/project-structure.project.html) on general project concepts, but can be overkill.

>is there a way that I don't know about to get user inputted data without the php file being in a public directory
Yes. You can easily send client data to the server (and vice versa) via JS (XmlHttpRequest, jQuery's $.ajax, etc.). You'll want to sanitize any data from the client (or have your framework of choice do it for you) before processing it or storing it, and check authentication/whatever else at this point in your secure, inaccessible PHP.
>>
is bcrypt REALLY secure?
I'm skeptical that Russian meme hackers haven't already broken it.
>>
How should I accept payment as a new freelancer? Cash? Credit Card? Bitcoin?
>>
>>55613544
blowjobs

my going rate is 20 bjs/ hour, my clients accrue quite the debt of sexual favors.

but to actually answer your question, you should use what ever is most convenient to you, and make sure that your contracts are well written so you can sue the shit out of anyone that wants to fuck with you. You do have a contract, right?
>>
>>55613567
Working on the contract.
>>
File: 1456307809900.jpg (34KB, 500x375px) Image search: [Google]
1456307809900.jpg
34KB, 500x375px
>Babbies first steps into webdev

I want to start with an actually doable project : a webpage with a blog, a section where I'd upload my lecture notes and a section where I'd publish my "linux shit fixes" such as "how did I changed the sensibility of the trackpoint"

The thing is, I only have very basic knowledge and most of it is outdated anyway I guess.

Independently, I know the synthax of html, css, javascript (and jquery), PHP.
I remember that one of PHP,s purpose was to sort of making templates so I don't have to manually deal with all the "previous post" "next post" "categories" links.

Since I don't want to pay to host this webpages, I figured out I'd better use github to host it.
My question is :

How do I maintain the website? Do I have to manually copy-paste all the "previous post" and the like by hand?
>>
https://www.google.com/webdesigner/

anyone tried this shit ?
>>
How do you guys develop locally? VM with a LAMP stack or just set up WAMP or otherwise?

Virtualbox is being a shit on my computer so i'm tempted to just say fuck it and go with WAMP
>>
>>55614342
Vagrant if it's a larger site with dependencies, otherwise just XAMPP
>>
>>55575002
>babby's
baby's
>>
File: macbookpro2015.jpg (185KB, 1200x630px) Image search: [Google]
macbookpro2015.jpg
185KB, 1200x630px
>>55614342
>>
Damn why all these new frameworks like express or laravel are so fucking unstable. Each time I update them, everything is broken.
I have a symfony based website from 2012 and I have zero issues when updating.
>>
>>55617017
Because they undergo major changes from time to time. That's why Laravel, for example, has 5 major versions with minor iterations in between. Symfony has 2.
>>
>>55617017
>Each time I update them, everything is broken.

http://semver.org/
>>
>>55617083
Oh shit my bad, Symfony has 3 now.
>>
>>55617098
3.1 :D
>>
>>55617104
3

3.1 is an iteration of the third major release.
>>
File: ShouldIwaste2yearsonthis.png (419KB, 819x613px) Image search: [Google]
ShouldIwaste2yearsonthis.png
419KB, 819x613px
Does this program look worth it?
>>
What's the intended way to use Docker containers?

Am I supposed to have a separate container for Python, one for Postgresql and so on, or put everything in one container/Dockerfile and develop my stuff using that?

Do you guys use orchestration programs in your work?
>>
I need a Frontend developer capable of using twig and building an awesome interface for my symfony3-based web messenger.

I have already implemented the whole messenger in Go and written a REST API in Symfony.

How much $ / hr should I offer to such a frontend developer? My requirements are definitely senior-level and I'm more than willing to pay what's adequate.
>>
>>55614342
XAMPP
>>
>>55614342
I usually just use the framework/language integrated server.
IIS Express/kestrel, phps integrated server or some web frameworks server that runs through node.
>>
>>55617204
>2 PHP courses

Bruv
>>
File: karliekloss.jpg (68KB, 640x640px) Image search: [Google]
karliekloss.jpg
68KB, 640x640px
>>55614342
>too retarded to set up a stable, trivial program like virtualbox
>wants to 'develop'
so this is what /g/ looks like away from /dpt/...
>>
>>55617255
hire a team of Indians to do it for US minimum wage
>>
>>55617316
I worked with Indians once, never again tbqh
>>
File: 1453897901213.jpg (50KB, 600x400px) Image search: [Google]
1453897901213.jpg
50KB, 600x400px
>>55617204
>web and digital media design
>photoshop
>marketing principals
>web aniation

Unemployment awaits you.

Learn programming. Web development is programming. Design cucks can make all the pretty pictures they want, but without someone to make it actually work, all they've created is some concept art.

Learning how to use photoshop is a complete waste of time, and "design" is pretty dubious, since the way a website actually looks is pretty superficial compared to how it functions in terms of UX. Plus most of the optimal design patterns for front-end have been well established, that's why CSS frameworks exist.

Also there's a myth that front-end web development is easier than backend, but its not really.

I do backend, if my code passes the linter, unit tests, and does pretty much what I want it to do, then its probably going to be fine for production. There's very little nuance involved in backend, either you got the right data out of the database or you didn't and your code is broken.

But on the frontend, UX is a far more nuanced subject, and requires more thought and faffing around. You can write perfectly good working code that does exactly what you wanted it to do... And it could still be a complete pile of wank, because it turns out that what you made is annoying and stupid and your users hate it.

So focus on programming, databases, computer science etc. Forget about design.
>>
new thread when?
>>
>>55617311
Man who the fuck codes on a laptop that small.
I have a 17' laptop and I still feel clustered.
>>
>>55617255
I'd do it for $30/hr. Hmu.
>>
>>55614342
>LAMP stack

I guess if I hated myself...
>>
>>55617384
Okay. Good advice.
>>
File: dontmindthenigger.png (430KB, 819x605px) Image search: [Google]
dontmindthenigger.png
430KB, 819x605px
>>55617384
What about this?
>>
>>55592454
This
>>
>>55618852
Looks pretty alright.

I mean personally I just taught myself without going to school, but if you can/want/need to go to school then that course looks okay.

Also at least you'll actually be taught to program on that course. Some computer science graduates can't program at all, which is why fizzbuzz is a thing.
>>
>>55617384
I'm in a somewhat similar degree. I had all the CS fundamentals in the first year, operating systems, digital electronics, networking, maths, physics etc. After that I had almost all of the classes mentioned in that picture, with addition to some video production and audio engineering. Yeah marketing was kinda stupid here too, and we just had a few weeks in a photoshop (thank god), but they are all still good things to know.

Anyway, some more backend shit and databases would be good on his program.

But I just wanted to drop by and say that it doesn't have to be a bad course, almost noone is unemployed from mine and people got into various fields, even though the most of them ARE in the web.

I'm currently even "just" doing a UI and UX design and have a control over a whole process, I am definitely not useless in a company.

I don't like when designers get disrespected here, that's all.
Thread posts: 328
Thread images: 35


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