[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: 316
Thread images: 15

File: 1462453773600.png (747KB, 824x553px) Image search: [Google]
1462453773600.png
747KB, 824x553px
/wdg/ - Web Development General

Previous Thread: >>56486683

> Discord
https://discord.gg/wdg
OR
https://discord.gg/0qLTzz5potDFXfdT
(they're the same)

>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://youtu.be/JxAXlJEmNMg?list=PL7664379246A246CB - "Crockford on JavaScript" lecture series.

>Useful Youtube channels
derekbanas
thenewboston
learncodeacademy
funfunfunction
computerphile
codingrainbow

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

>Backend development
https://en.m.wikipedia.org/wiki/Comparison_of_web_application_frameworks
https://gist.github.com/dypsilon/5819528/

>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://youtu.be/sBzRwzY7G-k - "2016/2017 MUST-KNOW WEB DEVELOPMENT TECH - Watch this if you want to be a web developer "
https://youtu.be/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
>>
I'm
>First time really using node, I sometimes hit some type of condition where a certain GET will fail and in the logs it will show as taking a really long time. I essentially load the main page and then use the public js to load /foo. The main page loads fine. And even if I navigate to /foo directly it will never load. Only solution is to restart the node server process.
>GET /foo 200 104659ms
>What could this be?

>>56538827
>Post code

This is all called by the home page:
//public.js
$.get( '/videos', parameters, function(data) {
$('#vid').append(data);
});


//app.js
app.get('/videos', home.videos);


//index.js
exports.videos = function(req, res){
var first = returnSanitizedNumValOrDefault(req.query.first, 0);
var max = returnSanitizedNumValOrDefault(req.query.max, 1); // must be > 0
var go_to_page = returnSanitizedNumValOrDefault(req.query.goToPage, 1);

req.getConnection(function(err,connection){
var queryString = 'SELECT * FROM vids LIMIT ' + first + ', ' + max;
var query = connection.query(queryString, function(err,rows){
if(err)
console.log(err);
if(rows.length) {
res.render('layouts/vids_regional', {
go_to_page:go_to_page,
data:rows
});
}
});
});
};


vids_regional is an ejs file

Any way I can debug this? It's a sporadic problem and all the google info I found was all or nothing, this works 99% of the time. console.log(err) never happens as it eventually return 200, just after the browser has given up.

Also first
>>
>>56539509
thanks, OP
>>
Hint for all the noobs - F12 opens browser developer tools where under console javascript errors are shown.
>>
>>56539659
First of all, you should be following the standard express way of handling errors instead of just logging them: http://expressjs.com/en/guide/error-handling.html
(If you used the official express generator or some variant, this is already set up, you should see an error handling function near the bottom of your main js file.)

Secondly, if your server is hanging like that, it almost always means you have an unhandled request. In other words, in a route somewhere you have some condition where you don't actually terminate the response. Make sure you're always using the built in express response methods (res.send(), res.redirect(), res.render(), etc) or otherwise explicitly returning something.
>>
when you hold down a key on your keyboard, there's a short delay before it starts repeating until you let go

can i get rid of that delay somehow?
>>
>>56540353
If you're making a game or something, you can listen for specific key down and key up events.

In general, the OS or keyboard firmware handles debouncing the key press signals. You might be able to turn it off in your accessibility settings or something.
>>
>>56540425
>key up key down

that'll work thanks
>>
>>56540319
Thanks anon. I copied most of the express code from some tutorial and it did deviate quite a bit from the standard generator.
>>
>>56540488
>it did deviate quite a bit from the standard generator
There isn't necessarily anything wrong with that as long as you're handling it in some way using the next(err) convention. It also makes your code a lot cleaner and DRYer and helps you to avoid mysterious non-error errors like you're dealing with, especially as your application gets bigger.
>>
Working on a website for my university which will help students find study groups based on their classes and schedule and professors. Want to implement Google maps support so people can just click on a school building to meet at (library, student commons, etc.) But Google maps API costs money in some circumstances
>>
>>56541024
If you're getting enough traffic to bump you up out of the free tier, you're getting enough traffic to monetize and pay for it.

Alternatively, just list the buildings or create a simple campus map with css with clickable buildings.
>>
>>56541024
openstreetmaps
>>
What is next after code academy?
>>
>>56541753
read the documentation and make whatever you want
>>
>>56541024
Our school had something like this implemented and I got a chance to play around with it, but I since deleted the files from my own comp (fugg).
iirc there are really 2 or more maps APIs, my school I think was using, which is free and doesn't require any authentication.
>http://google.com/jsapi
In combination with an xml file defining coordinates and onclick events to pull up description, pictures, directions.
I think the paid for api would let you do all this within the app rather than have the xml file ride on top of it, but functionally there's nothing you can't do one way or another.

I guess the only downside is this method only allowed shaded building outlines to click on, no fancy 3d buildings.
>>
>>56541024
samefag >>56542033
Actually KML
google.maps.KmlLayer
>>
I need help with a nested Wordpress loop. The code block is pretty large, but I dropped it into a gist on Github. Half of it works as intended, it's only the nested part that's breaking. Would anyone be willing to look at it for me?
>>
>>56542930
why don't you just post it?
>>
>>56543085

Feels rude to post it assuming someone here wants to fuck with Wordpress. Most people hate php, myself included.

Here it is. Line 19 starts the broken nested loop. I've included comments on what it's supposed to do.

https://gist.github.com/AlexBonney/56889ebdbec376301bd93960ac94f675
>>
can somebody recommend a good html5/css3 course? doesn't have to be free, just needs to be good and teach fancy things i don't already know
>>
>>56543238
sorry, I myself can't help you with that, at least not directly.
do you know how to debug scripts in php? my suggestion would be to learn how to do it, using var_dump(), print_r() or something. I read some days ago that some IDEs can even show lots of info.

>>56543397
I'm interested in this, too. I already know some html5/css3, but I'm still lacking knowledge... hell, I still don't know which things are/are not html5
>>
>>56543602
if it's in a css file or a inside style tag it's css

i would just like to know common practices for like, putting things side by side instead of stacking everything
and how do i make my own bootstrap
>>
>>56543602

I don't know how to debug php. I know it sounds lazy, but this is probably going to be my only php project I'll ever complete unassisted (minus random help from /g/), and I'd much rather use my time learning how to better unit test javascript.

I'll probably throw it up on stackoverflow in a bit. It's just a random Wordpress thing, and I do not want to be an expert at Wordpress.
>>
>>56544027
don't give up, m8. php is easy, you can probably solve your problem simply by using var_dump()
>>
I am new to this stuff and have been stuck on this one problem for about 6 hours, its made me so pissed i have been punching the wall
I am trying to make an ordering system for a project, where you input the quantity you want to a form, but i have no idea how to process it correctly or make it go into the cart($_SESSION array) without adding unneeded stuff
I cant find any websites that gives me a code template which works in the way i need my site to, i have just been going back and forth with w3schools and the stuff i can remember from my head, if you know any and can link them it would be appreciated
This is the form(Using Post)
$result = mysqli_query($conn, $sql);
while($row = mysqli_fetch_assoc($result)){
echo "<div>" . $row["name"] . "<br>$" . $row["price"] . "<br>Qty<input type='number' size='4' name='itemQty[".$row['productID']."]'></div>";
}

I'm pretty sure there is a problem in the name part or there is another problem with me trying to process it as most of my errors were about arrays/index
This is my current attempt at merely testing processing, i have been doing this for hours so have tried a few different things
    foreach ($_POST["itemQty"] as $qty) {
if ($qty = NULL or '0') {
unset ($qty);
}
else {
echo $qty)
}
}
>>
>>56544794
No ; after echo $qty you put a)
>>
>>56544913
I just ctrl+z'd back to that state in my processing file because i cleared it so i could copy it here, must have went too far back to before i fixed syntax
Ignoring syntax should the code be working fine?
The processing thing doesn't work, i either get all $qty even with zeros, or nothing at all depending on != or = on the if()
>>
>>56544975
That, and i have no idea on how to get the product id, all my attempts get errors
I need that so i can query/input to the database later
>>
>>56545023
The code should work, I think you need to say == if you want it to work that way, = will set the var. To get the id just pass it to post and use $_POST["id"]
>>
>>56539509
https://youtu.be/sBzRwzY7G-k [Remove] - "2016/2017 MUST-KNOW WEB DEVELOPMENT TECH - Watch this if you want to be a web developer "

This video in the OP says that Python and Node.js are pretty similar. Is that true? My impression was that Python was super easy, some call it pseudocode just cause it's not really structured at all; whereas Node.js is a huge clusterfuck. Am I wrong?

I took a Python course years ago, how hard would it be to transfer that knowledge to Node.js?
>>
>>56545174
>you need to say == if you want it to work that way, = will set the var
I deserve death
But for some reason it still doesn't work and i get 0's
foreach ($_POST["itemQty"] as $qty) {
if ($qty == NULL or '0') {
unset ($qty);
}
else {
echo $qty;
}
}

I even did unset ($_POST["itemQty['$qty']"]);
Sorry for all the bother
When you say pass the id to post do you mean there is a better way then i am trying now that also keeps it together with the quantity? Every time i tried to get the ID out of post i always got index errors, i used $_POST["itemQty"]['0'] and $_POST["foodQty['0']"] when testing it
>>
Completely new to webstuff and I wanted to get a simple slideshow, so I downloaded a jquery plugin. I wondered how hard it would be to write one myself and took a look at the code

It was like, 600 lines and I didn't understand any of it. Shit's a bit discouraging, how much JS should I know before I even attempt to touch web design?
>>
for (var i = 1; i <= 5; i++) {
setTimeout(function() { console.log(i); }, 1000*i); // 6 6 6 6 6
}


Can you explain me why does 'for' loop in this example first increments 'i' to final value and then executes the console.log? I mean why is it not executed per iteration? Its as if setTimeout is frozen until the loop finishes with incrementation but without doing anything with it.. Weird

I know, its about closures but no one mentions why is setTimeout frozen until 'i' gets to final value? Doesnt it seem that there is missing explanation here besides closures? Of course Its probably me missing something out so any advise would help a lot.
>>
>>56546730
the callback uses a reference to i
>>
>>56546784
I get it and I dont get it.
I know that 'i' is called by reference and not by value here but looking at it step by step still makes confusion for me.

In the first iteration i = 1 so setTimeout is called (and even if timeout is 0 seconds) it will not get called immediately so that it can log 1, instead it mysteriously waits for 'for' loop to finish as if 'for' loop is empty and just incrementing 'i' for nothing.
>>
>>56546838
The timer callbacks only start firing once the loop is completed. At that time, i is 6.
>>
>>56545513
Is there anyone else that could possibly help? I have been doing this project for weeks and am only stuck here, but its due tomorrow (In less then 12 hours)
The site will be pretty much an empty shell with errors if i cant get it to work and ill have wasted weeks to end up getting no marks
>>
>>56546838
the snippet creates 5 callbacks which, once the timeout is reached, will be run at the next possible opportunity (javascript uses a single-threaded event loop)

the callbacks use a reference to i, so when they are eventually run they use the current value of i instead of the value at the time the callback was created

the event loop cannot pause in the middle of a for-loop to run any callbacks, so, no matter what you put for the timeout it will always print the final value of i
>>
>>56546913
what are you even trying to do? is $_POST["itemQty"] an array?
>>
>>56546878
>>56546916
Oh thank you so much, I was hoping that someone will mention that timer start firing once the loop is complete. That was the thing that was confusing me and was obvious to me that it is happening , I just didnt know why.

So the reason is that because javascript is single-threaded it first finishes 'for' loop and then setTimeout? To be precise setTimeout is indeed called 5 times, its just that its callback function is fired only at the end of 'for' loop because of order of single-threaded queue?
>>
>>56546913
What exactly are you trying to achieve?

I can see a few issues:

1. User input in $_POST always come as strings, comparing to null is therefore pointless.
2. You are unsetting the scoped variable $qty in the foreach loop.This doesn't really do anything in your case. If you want to unset empty inputs (and '0') in the $_POST array, unset them via their keys:

foreach ($_POST["itemQty"] as $key => $qty)
{
if (empty($qty))
unset($_POST["itemQty"][$key]);
else
echo $qty;
}
>>
>>56546982
>its just that its callback function is fired only at the end of 'for' loop because of order of single-threaded queue

Correct, even if you set the timeout to 0 ms.
>>
Any guys around here who know Zend Framework?
>>
>>56546982
yup here's an article explaining it in more detail: https://developer.mozilla.org/en/docs/Web/JavaScript/EventLoop

specifically look under the "Zero delays" header
>>
>>56547010
>>56547034
thank you so much anons
>>
>>56546953
Its meant to become one right?
The page the form is on has the name and price of the item, and a input section next to it where you say the qty you want
I'm trying to then get it so once the form is submitted, the items which have not recieved any input, or have 0(No qty), will be ignored
Then those that do have a qty will be put into a shopping cart of sorts, which will have the id of the item so i can query the db for the name on that cart page as well as input it once the order is complete
One thing i am confused about too is getting the ID and qty to match up, i originally thought getting a multidimensional array with the ID, then qty and maybe name to just make it easier, but i cant figure out how
>>
>>56547058
here uhh.. try this

session_start();
$_SESSION["cart_tems"] = array();
foreach ($_POST["itemQty"] as $qty)
{
if (boolval($qty))
{
$_SESSION["cart"]["items"][] = $_POST["itemID"];
}
}


"$_SESSION["cart_tems"][] =" appends to the $_SESSION["cart_tems"] array
>>
Is there a guide for "What to do if you have a good idea for a website"

Like how to protect the idea (if possible) to a stage where I can then go on here and ask for partners to help develop the website if they think its a good idea.
>>
>>56547107
Thanks, it looks kinda good in my head, but just to make sure the itemID also intervals with the foreach right? And how is qty tied to the itemID index? Also is ["cart_tems"] just you typing ["cart"]["items"] differently or does it mean something else?
Sorry if this is annoying basic stuff but i pretty much only teaching myself how to do php when i began the project
>>
Anybody using vim for php projectS?
>>
>>56547532
Only for single page experiments, honestly.
>>
>>56539509
hey guys, I need an advice.

I want to move my dev blog from blogger to a personal domain.

I don't want to write from zero my blogging platform since I've not the time with a full time job. What blogging platform would you suggest ? Ghost seems really fresh but requires node.js I've never used wordpress but it seems to be the most common choice.
>>
http://localhost:8080/

this is my first nodejs app, can you guys give some honest feedback? also when do you think i can start applying for junior dev positions
>>
>>56548257
>I want to move my dev blog from blogger to a personal domain.
You can setup a domain with blogger. If you want more control over the site itself, then I see no issues with wordpress (but I don't have much experience with it.)
>>
>>56548339
I'm the tard who cant do basic php
But did you seriously just link us to localhost for your app?
>>
>>56548390
Or is this some epic /g/ meme?
>>
>>56548339
>http://localhost:8080/
Not sure if b8, but nobody but you can access that.
localhost, as the name implies is a local only address - every computer has it's own localhost or 127.0.0.1
People on you're home network can using your lan ip address
192.168.x.y:8080
And if you opened your internet facing router to forward to your computer only then we could then access it with your main ip address (that's a bad idea though, don't do this).
>>
>>56548343
yeah I know but I would like a fresh start. After some years of using it I'm not really found of blogger as a development blog platform. Sometimes things feels just too messy.
>>
>>56548339
>when do you think i can start applying for junior dev positions
Eh, I'm afraid it will still take a while.
>>
>>56548339
9/11
>>
>>56543397
>>56543602
http://www.htmldog.com/guides/
>>
>>56539509
Hey guys I've a question about digital ocean and vps pricing in general. They have a 5$ per month plan, does it means that I pay that at maximum and that if I waste more resources they will terminate the instance or that they will charge more ?
>>
>>56545459
Python is pretty easy. Not really sure what you mean by not structured since it has probably the strictest structure of any modern language. JavaScript (Node is a runtime environment not a language) can be a bit of a clusterfuck sometimes, but overall it's evolving into a pretty great language. Also, if you want to do anything web dev related in ${CURRENT_YEAR} you pretty much have to know JS, just like you have to know CSS and HTML so you might as well learn it.

>I took a Python course years ago, how hard would it be to transfer that knowledge to Node.js?

If you took it years ago and haven't done anything with it since, it's going to be hard because you're basically starting from nothing.
If you do practice regularly, you'll have a much easier time, though. JS is a C-like language and Python is vaguely C-like, so you will see some familiar constructs and keywords and things that will do what you expect for the most part.
>>
>>56549356
Have you ever messed around with virtual machines on your PC? Basically VPS providers have datacenters full of hundreds of powerful, rack-mounted computers running virtual machine software. When you sign up for a plan, one of those computers starts up a VM instance according to that plan. Then, you basically have a computer (not a powerful one for the $5/mo plan, but plenty to run a web service on) sitting in a datacenter somewhere that you can SSH into and install/run whatever you want (As long as you abide by their ToS, no CP, etc.). You can run it at 100% resource utilization or leave it idling as far as they're concerned.

There are also services like Heroku and and OpenShift that handle all the dev ops and provisioning stuff for you. Basically, you upload a Node or Rails app or whatever, and they just run it for you. Then there's FaaS providers like AWS Lambda where you just give them a function that you can call remotely and they charge you by the microsecond of execution time.
>>
>>56549657
A lot of providers don't allow you to run CPU at 100% all the time because it's usually shared to some degree with the other instances in the rack.
>>
>>56549356
Regarding traffic it depends on the VPS provider.

Digital Ocean doesn't charge for people who exceed their traffic limit. But they do intend to in the future. The forums say 0,02 dollars per gb.
Ramnode just suspends your account until you buy more bandwidth.

Not sure about the others. It's usually stated on their website somewhere. And you can also just email them.
>>
>>56549682
You're right but I didn't want to complicate things. I should have said you can "theoretically" use 100% or something. They'll usually bitch at you for using 100% because each host machine is running over capacity with VMs. If your web app is at 100% all the time, you're probably doing something else wrong anyway.
>>
Scaleway might be a better option if you don't have the need for super fast IO, it's unmetered with a dedicated CPU for €3/month
>>
>mobile version works perfectly from pc but only works on some pages from phone
I'm made of rage
>>
>>56549657
thanks anon, from my experience with virtual machine I would tell that what you said it's the expected scenario.

I was taking a look at their billing page and this made me think it was more like a cloud service billing method:

>Each Droplet is billed per hour up to its monthly cap. The monthly cost of your Droplet is calculated by running the hourly rate for 28 days (672 hours). Once you reach that amount (e.g. $10/mo for a 1GB VPS), you will not be charged for your server's additional runtime. This allows you to destroy your server before the maximum monthly charge and pay only for what you use.

but I misunderstood the last phrase, they are just stating that I wont pay more than 5$ if I just destroy the instance at some point.
>>
File: 1450648178094.gif (1MB, 268x274px) Image search: [Google]
1450648178094.gif
1MB, 268x274px
>run a node websocket server on a different computer on my network
>connect to it via my external IP
>connection keeps dropping every 10 seconds
>connect to it through any other network or through cloudflare
>it works perfectly
>>
>>56549179
thanks m8
>>
I have a website that uses lots of images. And I'd say 60% of my images are my own, 30% creative commons, 5% public domain and 5% unknown licences. This last category forms a commercial risk to me so I plan to replace them in the future.

I dont mind taking images down on request. But I'd like to keep my hoster out of it because I just need the website to stay online.
Is there some kind of hoster that just ignores or forwards dmca's and let me handle the complaints myself?
>>
>>56550515
It's a travel site btw.
>>
>>56550515
Just put a visible link to a DMCA form/email in each page? That way they'll send them directly to you instead of going after your host.
>>
>>56550712
That's a good idea actually.

Things like these got me worried.
http://mashable.com/2016/09/06/warner-bros-dmca/
>>
Any of you memers use SQLAlchemy?

Say I have the following tables/columns:
User: id, name
Proposal: added_by, approved_by

How would I pull names of both submitter and the person who approved?
I tried doing:
proposals = Proposals.query.filter(Proposal.expired == 0) \
.join(User, and_(User.id == Proposal.added_by)) \
.join(User, and_(User.id == Proposal.approved_by))
.order_by(Proposal.approved_at.desc()).all()


But that just returns an empty result set, what do?
>>
>>56550771
disgusting, so glad Django's ORM is a thing
>>
I'm currently trying to make a program that scrapes data from a website. Ideally I would like to make it a static website which does all the work clientside. This would make it fully cross-platform, and I'm most comfortable doing UI in HTML/CSS.

Is there a way to load an external page using Javascript? I've tried using XMLHttpRequest, but this is blocked by same origin policy, and the site doesn't allow cross-origin resource sharing. I also tried loading the site into an iframe in order to traverse the DOM, but they seem to block this, and even if I could, some stuff I've read online says that the embedded site can block access to the DOM within the iframe.

Doing the same thing in, say, Python is easy, using a library at least. Is there really no way to do a normal HTTP request using Javascript in the browser?
>>
>>56551819
You cannot load anything from a different website with XHR if it doesn't send an Access-Control-Allow-Origin header. You also cannot interact with a different website at all inside an iframe. It only works if the website is on the same domain AND protocol.

This should be obvious, if it was allowed it would be a HUGE security risk.
>>
>>56551819
That shit is blocked for a reason, friendo.

If you're dead set on using HTML/CSS/JS instead of python, you could make an Electron app. Or just learn how to use curl.
>>
>>56551890
>>56551998
Yeah, I knew it was blocked for a reason, but this seems like a thing that other people may have wanted to do in the past, and I was hoping there was some kind of built in functionality to load it in a safe mode, that used a new session for the connection or something.

Maybe I'll check out Electron, or just do it in Python and maybe QT or something.
>>
File: 1x-1.jpg (147KB, 630x420px) Image search: [Google]
1x-1.jpg
147KB, 630x420px
Anyone here in Berlin?

Thinking of moving there to work in a meme startup.

How much should a Django weeb dev be earning in Berlin?

No professional web dev experience yet, but I've working in an analyst job in a tech startup for the past two years
>>
I want to do Iron Yard but I'm terrified of loans.

I would need everything financed including the cost of living allowance.

This bricks my financial stability but I don't know what else to do. I can't get a job with just my portfolio here.

Anyone good at this school stuff have any opinions?

Smalltown USA, didn't even know college loans existed until I was 20.
>>
>>56552520
>Code school

Just learn it yourself my mang
>>
>>56552504
is the startup sellics ?
>>
>>56552804
Nope, haven't applied anywhere yet, just looking around at the moment.

Who are sellics?
>>
>>56544027
just throw your code into PHPStorm and debug it that way

xdebug isn't difficult to set up
>>
>>56552504
Ask on /int/. It has a German general.
>>
>>56552687
I know some of it. Expert level vanilla js, bb.

I need something like it to focus on building an impressive portfolio in the shortest amount of time while learning node. Also maybe companies will pity-hire me like real degreefags because nothing says I am serious about a career choice like 20 grand of debt.
>>
I feel like setting up a vps is unnecessarily complicated. It's not hard, but there is no reason why images shouldn't have everything preinstalled. And you could just change a password and enter a list of domain names and done. The folders and config files would just automatically be generated.

Although I guess that's what cpanel, plesk and directadmin are for.
>>
i've been going through codeacademy, and now have got a private github repo linking from a domain of mine from AWS so that's all good, and I'm using atom.io and git.kraken to manage everything.

One thing I'm confused at and don't think codeacademy do a good job of explaining is how you link to bootstrapper, JS, etc. How does this work? Do I store these files in the root of my repo, can I link to external ones like the ones codeacademy do, are there differences between them?
>>
>>56553165
CDNs are cached so they don't need to be redownloaded between several websites using the same CDN.

That decreases load time.

I only link locally when I heavily modify whatever I'm using which I always do.
>>
>>56553091
make some scripts for that. in fact, I bet there are easy scripts for that already. I know there are some that let you download and install wordpress automatically from the CLI
>>
>>56550008
If you don't send a ping every once in a while, the connection will be dropped
>>
>>56553218
>CDN
Great, thank you, I'll use this in the future then thanks https://developers.google.com/speed/libraries/

Seems the same CDN thing for bootstrapper too https://getbootstrap.com/getting-started/. Thanks for the help
>>
>>56553276
I'm using socket.io which pings automatically, I even tried manually pinging and it still happened.
It works fine by simply not connecting to it via external IP while on the same network so it's not that big of a problem.
>>
File: screenshot_00104420160901000900.png (499KB, 407x575px) Image search: [Google]
screenshot_00104420160901000900.png
499KB, 407x575px
What's a socially acceptable language to build a website's backend with nowadays?
>>
Curious about one little thing:

With python on CodeAcademy you can just

>print "string"

and it's fine and prints to console. I just downloaded PyCharm and instead you have to

>print("string")

and the first gives a syntax error. Why? I thought it's the same language and the syntax should be respected by both.
>>
>>56553371
One of them is Python 2, the other is Python 3
>>
Is there anyone here who does not use a prettify/beautify plugin in their editor of choice? I was watching a js training video and I couldnt believe the instructor was spending more time reindenting code by hand that got added instead of just hitting a hotkey to do all that for him
>>
>>56553423
this

>>56553371
just use the second form for everything

>>56553444
vim: gg=G
probably all editors have auto-indentation features
>>
>>56553371
there are two active versions of python, 2 and 3, and the different print syntax is one of the most well known differences between the two

retards who can't be bothered to port their code insist on using the legacy 2 version and for some reason the developers refuse to tell them to fuck off and continue supporting it
>>
>>56553337
a few thousand lines of C code is the only reasonable answer
>>
>>56553283
Just call it "bootstrap" dude, you sound special.
>>
>>56553423
>>56553465
>>56553474
Alright understood, thanks all
>>
>>56539659
there are several things that could cause 'res.render' not to be hit. getConnection could be taking a long time because the db is doing some blocking transaction, the query itself could be blocked, but the most obvious thing to me is your missing branch for 'if (rows.length)'. You'll never write a response if that's 0
>>
>>56544794
Can you post the form or a var_dump of $_POST?
>>
File: 1461531873804.jpg (112KB, 900x900px) Image search: [Google]
1461531873804.jpg
112KB, 900x900px
How viable is it to work in web dev without being too passionate about it?

It's a better career choice than working in retail (money-wise), and yet I'm not sure if I'm gonna regret spending a ~year learning something I don't care much about
>>
>>56553586
I think most computer jobs require you to enjoy it. Otherwise it might be just as exciting as accountancy.
>>
>>56553337
Go (golang)
>>
>>56553586
If you don't enjoy it then don't do it.

I can only imagine how awful a web dev would be if I didn't enjoy web dev.
>>
should i learn typescript and angular2.0? just got done with my first course in angular 1.x, which was a course from 2014-2015.
>>
What's a good style guide for JS if I'm using it with Django?
>>
>>56553803
fuck it i'll just learn it what's the harm i'm unemployed and it'll only take a day
>>
>>56553337
LuaJIT

Anything else 2slow plebshit
>>
>>56553860
What framework do you use to make websites with Lua?
>>
>>56553371
Forgot how little codeacademy explains about fundamental stuff like that. It's a totally shit platform.

use Learn Python the Hard Way, it's better
>>
>>56553874
I'm meming- I like Lua, but I've actually never used it for dev stuff.

Decent list of frameworks here though:
http://lua.space/webdev/the-best-lua-web-frameworks

Hadn't realised Wikipedia and Taobao actually use it
>>
>>56553904
>>56553860
Is Lua a bad idea for making websites with?
>>
>>56553945
Give it a go and find out.

It's a simple language, and fast as fuck, but it's a bit limited. Definitely less flexible than something like python
>>
>>56553969
How is it less "flexible"?
>>
>>56553980
>>56553980
More like Python is pretty great for a lot of things like string manipulation, I found Lua is a bit more clunky for that sort of thing, but just my experience.

If you want to try it for weeb devving, go for it and report back
>>
>>56553969
How fast is Lua? Is it faster than Python (especially when it's precompiled)?
>>
Best book to learn Javascript? No shitty codeacademys or whatever, I can't stand that crap. Beginner here.
>>
>>56555317
everyone says Eloquent Javascript
>>
>>56555317
Why do think CodeAcademy's shit?

Eloquent Javascript is the best
>>
>>56555193
Lua is interpreted, not compiled
>>
>>56555362
I just hate learning to code online, it's not my style at all. I much prefer a heavy, 500-paged book to go through, and a console to try everything out.

Learning is about making mistakes and trying everything out, and I hate these online courses where you can't move forward until you produce the exact fucking answer they want, and you can't go back to test something out in a different way. That's all.

Plus, I can't stand all their flashy animations and the whole "Congratulations!!!! You gained 750 Chocolate Rainbow Stars for learning how to do a for-loop!!! Keep it up, Champ XP" attitude. Sickening.
>>
>>56555461
1) What is LuaJIT
2) Implementation is not defined by the language
>>
>>56555351
Checking out the book right now, yes, thank you, this is the type of book I like. I tried some Head First before, it's ok, but it's too flashy and shit. I don't have ADHD, I can handle a couple of paragraphs without colorful pictures.

And is there any environment or IDE or whatever for Javascript? Should I first learn the plain flavor and then go to node.js, how does it work?
>>
>>56555469
>I much prefer a heavy, 500-paged book to go through, and a console to try everything out.
My nigga. Learning like a real man does.
>>
>>56555461
I was referring to python, which gets compiled to bytecode which is cached.
>>
>>56555541
you can use a browser console
>>
>>56555362
>CodeAcademy's shit
CodeAcademy *is shit*, they "teach" you by rote repetition instead of explaining things and teaching you some history to understand why things are done one way or another.
>>
>>56555679
I agree, and the whole "keep clicking to keep learning" approach is bullshit.

>Screen 1
"There are many types of variables in language x. To find out what they are, click on the NEXT button!"
>Screen 2
"One type of variable is called the int, short for integer. To find out what you can do with it, click on the NEXT button!"
>Screen 3
"The integer type can store a whole number. To find out how to do it, FUCKING KILL YOURSELF ALREADYYYYYYYY!!!!!!! I CAN'T TAKE THIS ANYMOREEEEEEEE!!!!"
>>
>>56555541
Node.js is basically just a runtime environment for Javascript on the server. You need to program in Javascript in order to use it.

Learn regular Javascript first, and then learn Node.js.

Once you have that down, there are other things that are optional. There are languages that compile to Javascript, like Typescript, Coffeescript, or Dart. There are frameworks for Node.js like TotalJS or ExpressJS. And if you're doing frontend stuff as well, you can use JQuery for adding graphical stuff to your website.

All of these are optional though, so don't feel like you have to learn any of them, and consider whether the benefits of whatever you include outweighs costs in performance or whatever else.
>>
Angular 2 is fucking great.
>>
>>56555679
>they "teach" you by rote repetition
Rote learning is far more effective than explaining from the ground up and dealing with the inevitable arguments about "why didn't they do it the way I imagined they did?".
>>
Can someone help me figure out what's going on with my connection settings? I'm working with Openshift and a web database for the first time, and I keep getting the 2002 error. I believe it might have something to do with a port issue, but looking it up hasn't given me much info. It's really quite short, so I'm confused at where the error is.

            <?php>
$dbhost = constant(getenv('OPENSHIFT_MYSQL_DB_HOST')); // Host name
$dbport = constant(getenv('OPENSHIFT_MYSQL_DB_PORT')); // Host port
$dbusername = constant(getenv('OPENSHIFT_MYSQL_DB_USERNAME')); // Mysql username
$dbpassword = constant(getenv('OPENSHIFT_MYSQL_DB_PASSWORD')); // Mysql password
$db_name = constant(getenv('OPENSHIFT_GEAR_NAME')); // Database name

$db = new mysqli($dbhost, $dbusername, $dbpassword);

if($db->connect_errno) {
die('Connection Error (' . $db->connect_errno .') '
. $db->connect_error);
}
mysqli_select_db($db,$db_name);
?>


Is the code.
>>
>>56555907
Are you replacing the host, port, username, and password?
>>
File: imgur-2016_07_15-20:16:49.png (62KB, 835x94px) Image search: [Google]
imgur-2016_07_15-20:16:49.png
62KB, 835x94px
>>56539509
VSCode, Atom, Sublime Text?
>>
how do i reduce the height of a bootstrap warning thing? this changes the margin and affects the text but the height of the box remains unchanged

span.alert.alert-warning{
margin-left: 20px;
font-weight: bold;
height: 50%;
}
>>
>>56556061
VS Code
>>
>>56556061
Atom
>>
>>56556096
Bugged and slow.
>>
i changed in php.ini
upload_max_filesize = 30M

but still i cant upload files bigger then 2m
>>
>>56555986
I tried that, and it didn't work. Although to be fair, trying to echo out the variables to see what they output isn't doing it either.

It's weird.
>>
>>56556127
restart php5-fpm
>>
>>56556249
i restarted apache
>>
>>56555879
no.
it's intellectually boring, it doesn't help you remember or understand concepts. for me, "learning" is about memorizing things, understanding why things are done in some way or another, AND extracting a sort of "sense" from the things I'm learning. the idea being, the next time I do something, I say "well, I assume this must be done this or that way, because I was taught this story about how it was made in the first place."
>>
Is Coda worth it? I have money to burn.
>>
>>56556127
did you change
post_max_size
too?
>>
In sublime in a .js file I can type just the start of a function and then complete to the whole thing with syntax and brakets filled in

Can I do this in atom too?
>>
>>56557172
Same question for html tags, too. Sublime will go from "<bo" to "<body></body>" on tab/enter, but atom only goes from "<bo" to "<body". I've tried a few packages but they only add the closing tag after I've added the > to the opening tag
>>
Visual Studio Code > Webstorm > Sublime > Atom > Brackets > Notepad++
>>
>>56557310
Try emmet
>>
>>56542930


if you're doing a WP_Query object then you should do this,

[CODE]
$query = new WP_query( $args ); $count = 0;
if ($query -> have_posts()) : $query->the_post() ?>
[/CODE]
>>
Node.js question:

I'm trying to install bcrypt so that I can hash my passwords. I'm using Windows 8.1.

Unfortunately, running npm install bcrypt throws an error relating to node-gyp.

There's a lot of shit written about this online, involving installing VC, Python, etc.

Does anyone have any advice on the most convenient way to surmount this issue?
>>
>>56550008
>

I also have that problem. When I connect to the socket.io server via own pc (localhost), it works. But if I connect to it via other PC on the LAN, I cannot for the life of me get it to work.
>>
the more i get into webdev, the more i feel like the browser system is horribly outdated garbage from 90s

everything feels so backward, powerless and fiddly. like, why am i writing how my webpage looks? a process meant to produce something visual should be visual unless you're fucking blind, or am i wrong?
>>
What is the best way to get the new posts from a forum in python without destroying it with requests?
>>
>>56558569
The whole DOM thing is stupid. Just use something like Backbone or Angular. Makes the whole process of creating websites more clear and less dated. Removes the hassle of interacting with the DOM yourself and gives actual standard desktop application structure and design patterns to your projects. As far as creating the looks of your website with code, yes that's how it's supposed to be, you need that control, an interface won't be as flexible.
>>
>>56539509
what are some good open source e-commerce platforms.?????
>>
Can I become a self-taught web developer putting in minimal effort with a good salary?

I really don't like working.
>>
>>56558569
Actually what you suggested is far more 90's (dreamweaver)
>>
>>56558569
i get a more visual understanding and structure of my website by looking at the code than previewing it on a browser.
>>
>>56559751
you're reading one line at a time you fool, how could that possibly be true lmao

are you retarded
>>
>>56559829
{body

[nav]
{sub-nav-content}
[content]
{sub-content-content}
[foot]
{sub-foot-content}

/body}

that's basically it, idiot.. iit's all about structure. you're not reading one line at a time. you break them into understandable, organized blocks which can be broken down to "lines" idiot.
>>
>>56560172
Not the guy you're responding to, and I don't necessarily agree with him either, but do you not have any kind of CSS or any nested containers or anything?

You can get an idea of the structure, yeah, but that's barely an indication of the actual look and feel of the website.

>>56558569
Trust me, markup languages are much better that wysiwyg editors. I used Dreamweaver a little bit a while back, and it's a pain in the ass to get something to do what you want. Sure, it may look decent when you're editing it, but then you resize the window and it looks like shit, so you have to change the way it's positioned.
>>
>>56557999
I confirm this, and I use vscode even for shit like python general purpose and c++ on debian
>>
>want to live closer to parents
>literally zero web jobs within 200 miles of them

WEW 100k people in town and zero websites
>>
How do I properly save a website in my computer (as in, to see it later for "inspiration")? Anything other than 'Save Page As...' on Firefox?
>>
>>56560976
'Save Page As' in Chrome

But seriously though, what do you mean?
>>
>>56560976

>ever heard of bookmark
>>
>>56560976
Grab a pen and a notebook and write down the url of the website.
>>
>>56561044
yeah i mean that. sometimes it hasn't worked well for me so i was wondering if there was a more proper way to do it.
>>56561076
>>56561154
they change though.
>>
>>56561221

what do you mean by they change?
>>
>>56557999
Agreed.
>>
>>56561253
the design, it changes. i'm interested on the particular design that the site has today, not the one when they renown it, or change a font, or whatever.
>>
>>56561599
You might have to load the webpage once after you 'save as'. All the supporting files (css, js, images, etc) get downloaded the first time you load from the downloaded html file, and get saved in a folder next to the html file.

If you 'save as' a site today, and don't load the html file in a browser until a month from now, I think it will end up downloading the newer versions of all those supporting files.

If sites still look different after you do that, then either the browser you're viewing them in had a major upgrade (unlikely) or the site is doing something weird (not that likely either).
>>
>>56561727
oh, no, that was in response to the people who told me to just write down the address instead of saving the actual page as afile.

can you save this one succesfully?

http://michaellewiswrites.com/index.html

it isn't working properly here. about only half of it loads from the local file.
>>
>>56561599

then make a full page screenshot . damnit .
>>
how do i pass data from an sql call to a new page in php? at the moment i'm doing

            echo "<script>window.location='results_page.html'</script>";
but i dont know how to pass it data from a variable $row
>>
>>56561756
Alright, so it looks like this is kind of a weird website, and I don't think you'll run into this too much in practice. (And I don't recommend emulating it.)

I think the site is trying to use file:// requests instead of http:// requests, and same origin policy prevents file:// requests when the client is a local file. There's also some weird stuff going on with the "../img/tile.jpg", which you can fix by removing the "../".

Basically the only way to load it properly is to either:
1. Load it in a browser that ignores same origin policy, like Electron, or the file previewer on OS X. The downside of this method is that if the files on the server change, then your downloaded copy will get the new files instead of the old ones you wanted to keep.
2. Go into the Javascript and manually change the file:// request to http:// requests. It's using some JQuery ajax libraries or something, so I'm not sure exactly how you would do that, but you can try.

Either way, I don't think this is the case for most websites you'll encounter, and again, I don't think this is a good example to learn from or to copy things from.
>>
How do you design shit that's aesthetically pleasing in mobile and desktop views? I use absolute positioning and fixed widths to make stuff look nice, but that basically fucks over mobile users
>>
>>56562189
You can override style using @media queries.

Basically you can say "if the width of the screen is 4 inches or less, override these properties on these classes."

http://www.w3schools.com/cssref/css3_pr_mediaquery.asp
>>
>>56562224

That's what I was planning to do, but I've got divs with like 15 nested divs inside and it's a pain to overwrite position and style for all of them. Just checking to make sure there isn't a more efficient way
>>
>>56561875
This will have to do for the odd sites.
>>56562086
Oh, interesting. Thanks for the explanation! i won't follow this example other than for visual reference, then.
>>
>>56562502

or do the styling first then leave the positioning in the media queries .
>>
What do you guys recommend as a first language?

Many say JS is a clusterfuck so it's better to start with Ruby

Or Python
>>
>>56560976
There are extensions and special programs for that. Basically use Google.
>>
>>56562555
Bump.
>>
>>56562555

JS is not "optional", if you are interested in WebDev you have to learn HTML, CSS and JavaScript at some point.

After that you can decide to use something prettier like CoffeeScript, Typescript or Dart, but without JS knowledge you will eventually run into problems. So start with learning them.


Congratiulations, you can make a static website with HTML, CSS and JS? You also understood responisble webdesign with stuff like flexboxes?

Than up to the second level: Learn some JS frameworks like Normalize.css, Bootstrap.js and jQuery.js.

So can make a website that looks beautifull? Fine, than you should already know (or learn) stuff like AJAX, JSON, YAML..


Well, you made it this far, so let's get serious:
Learn some basics of one a Database (SQL or Mongo).

Now learn a frontend framework like React or Angular to make single page applications.


You can do this?

Fine, now you can think about cases where you need a backend framework.

Rails or Django are both fine, depends on wether you prefer Ruby or Python. You can also try PHP with something like Laravel. MAtter of fact you have to learn the langauge first, so wether you pick Ruby, Python or PHP, make sure you get some language basics before diving into a frame work. (Rule of thumb: If you can do a simple challenge from the "/g/ programming challenges" chart without breaking sweat, you are ready to use a framework).

Personally I'd stay away from Node.JS as a beginner, it will teach you a lot of bad habits. If you are advanced you might give it a look though.

A backend framework will teach you a lot of stuff, but you have to add the missing parts (what are GET / POST requests?) wherever you face a question..


Of course it's doable in a different order. It's totally possible to start with the backend language (Python/Ruby/PHP.. even something like Perl if you want to) and THEN add the backend framework (Rails, Django) and THEN fill the gaps about HTML, CSS and JS. It depends on your goals..
>>
>>56562555
im also new to the game and Django is comfy as fuck.

from what i can tell Python is more explicit whereas Ruby has more magic shit hidden in the background; Python follows the ideology of "one obvious way to do one thing well" as opposed to "there are 10 different ways to do this one thing", both of which suit me.

like the tl;dr anon says, Javascript is also mandatory, but for backend you're better off learning another language first.
>>
>>56558554
>>56550008

SockJS works like a charm (but it's documentation is quite lacking)

https://github.com/sockjs/sockjs-node
https://github.com/sockjs/sockjs-client

I've also done some work with ws and it woks kinda well.

https://github.com/websockets/ws

Socket.io is not reliable
>>
>>56558520
Use bcryptjs or node-bcrpt instead of bcrypt.
>>
>>56563419
>node-bcrpt
`node-bcrypt` I mean
>>
>>56562794
Thanks for writing this out, very helpful anon
>>
>>56558520
Install VS, Python and whatever else was mentioned in https://github.com/nodejs/node-gyp#installation . If you need C++ extensions on Windows, those hoops are required.
>>
I am using header to redirect away from my processing page at the end of the script, but it's not working
I am only using PHP and adding stuff to mysql, it should be working right or does adding to databases also count as output?
If so is there any other way i can redirect to the next page?
>>
Sorry if I am a little bit rude but I literally don't understand people who shill the asp.net ecosystem. Look a this little introduction
https://medium.com/@mikezrimsek/setting-up-a-net-core-server-with-entity-framework-core-using-a-postgresql-database-242438f7d9c3#.dnzd77baf

How can this shit compete with php/laravel or node/express/hapi?
It's a fucking mess with atrocious design patterns and overcomplicated file structure.
>>
No minimap scroll extension for VScode like you get in Sublime and Atom?
>>
>>56564563
Headers should be sent before the response body. I don't know how PHP handles this, but if even a single byte is written, you can't change the headers anymore. If you really need to do it at the end of the body, add a JS redirect.
>>56564573
It's MicroSoft Java. Both Sun's and an MS's marketing have so deeply ingrained this forced OOP cancer into the industry, that of course there are plenty of people developing Stockholm syndrome along with their Pajeet-tier over-patterned Enterprise™ applications. I mean yes, it pays bills, but that's about the only thing good about the languages.
>>
>>56565105
So can i put a header at the top of the script but it will only redirect after the rest has been processed?
New to this stuff
>>
>>56565127
If PHP does not exit, when the header is sent, you should be. Not a PHP dev, this is just how HTTP works.
>>
>>56564573
>https://medium.com/@mikezrimsek/setting-up-a-net-core-server-with-entity-framework-core-using-a-postgresql-database-242438f7d9c3#.dnzd77baf


I don't know, but maybe the fact that it's Microsoft certified has something to do with it. Like, they guarantee 100% compatibility with all the rest of their shit, right?
>>
>>56565151
Thanks, turns out im just an idiot and typed 'url=' instead of 'location:'
>>
How come I have to double tap tab/enter to autocomplete stuff like html tags in Visual Studio? Conflicting extensions or normal behaviour?
>>
>>56539509
requesting success of people learning web dev from this general and landing heir first job. Must include their pay and also what they know/do in a list.

NOW.
>>
Probably shooting in the air here, but whats the best excel library for php? Using phpexcel atm and it works fine except when importing excel files with over 5000 or so rows. Request times out before backend is able to extract data, process it, and insert into database.

Or is my only option to be a better developer and start using threads n shit?
>>
>>56566300
Sound's like PHP itself is your bottleneck. Consider writing that part of the application in a faster language.
>>
>>56566272

>/g/
>success
>>
>>56565405
normal behavior, double tabbing is the standard in VS
>>
>>56566735
alright thanks, wasn't sure I wasn't just being retarded and had messed something up
>>
>>56566272
ha, I'm in there with you, buddy. Started learning how to program in C# and javascript maybe a week ago, taking it step by step. I'm giving myself a few months before I start looking for work; let's say, six months.

Btw, this might not be the most suited thread for that. Try the Certs and accreditations thread, some guy was doing those quite regularly.
>>
>>56566272
>>56567316
I'd have a job if it wasn't for muh mental illness. It's too scary to interview so I just fight with pajeet for work on freelancer and upwork
>>
>>56567395
so tell us about your work, those of us just starting out want to know what it's like. What languages do you code in and with what expertise, how much money you make in general and per assignment, what is a typical request from a client, anything really.

If you have any examples you'd like to share through github, we'd love to see them.
>>
Help me

I fucked up my mysql server.
I wanted to create an expect-script to change the mysql password from a blank one to "pass"

This is the script:

#!/usr/bin/expect -f
spawn /usr/bin/mysqladmin -u root -h localhost -p password ''
# Look for password prompt
expect "Enter password:" {send "pass\r"}
expect eof


It worked! But it hasn't fucking changed it to "pass"! If i try to log in with "pass" it wont let me. What have i done wrong? What has it actually changed into?

(I have tried it with and without Quotation Marks)
>>
>>56567468
what if you change
> {send "pass\r"}
to
>{send "pass\n"}
or simply remove the \r?
I have never used expect...
>>
>>56567646

Nah, the "\r" is necessary.

I guess it's something aoubt your db, maybe you have to confirm the password?
Do you have the rights to change it?

Impossible to tell from here..
>>
>>56567755
>>56567646
>>56567468

Solved it!
I thought that the line

spawn /usr/bin/mysqladmin -u root -h localhost -p password ''


was to input the old password in the '' brackets

and the

expect "Enter password:" {send "pass\r"}


was to enter the new one. But it was the other way around. Thanks anyway!
>>
How do I design good looking websites? Even when I try ripping off parts of a design it just looks off. What's the fucking secret?
>>
>>56568422
Take a look at Bootstrap!
>>
When will companies start using Angular 2? I've been using it for a while and it's much better, cleaner, faster and easier than Angular 1.
>>
File: 1470742768347.gif (56KB, 500x474px) Image search: [Google]
1470742768347.gif
56KB, 500x474px
$year  = 2018; // want this to print as 18
$format = sprintf("%d/%d/%d", $day, $month, $year);

How do I format the month to print just 18 instead of 2018? Thanks in advance
>>
>>56568761
Companies that developed on Angular 1 are going to continue to use Angular 1.
>>
>>56569820
console.log($year - 2000);
>>
File: 1473452979159.jpg (62KB, 500x503px) Image search: [Google]
1473452979159.jpg
62KB, 500x503px
>>56569885
Thank you for your time.
>>
>>56564573
It's still in its infancy, so it's still a little rough and unfinished.
>How can this shit compete with php/laravel or node/express/hapi?
By being a good language, far better than your two examples.
>It's a fucking mess with atrocious design patterns and overcomplicated file structure.
Not so atrocious if big companies and banks choose C# or Java for their code instead of your meme languages. When you are risking billions of dollars you want proper patterns and strongly typed languages that can keep running for years to come.
Also if you consider that file structure complicated you haven't seen any big project yet so you're probably a NEET.
>>
>>56569820
$x = strtotime($day. '/' . $month . '/' . $year);
echo date('d/m/y', $x);
>>
>>56566272
Not sure if successful, but I make 63k/year and this is my first web dev job.

Prior to this, I was learning web dev on my own. Started with C# webforms, then moved to MVC. My project consisted of parsing my autistic shit writing into a database and displaying it on an internal website. Did it in webforms and used MS SQL, then redid it in MVC using MySQL (I also did it again in NodeJS for shits and giggles).

Of course, my job consists of doing none of that since they're using ColdFusion. When I interviewed, I didn't know what language they were using since their technical test for me was all MS SQL related (their ad said you needed C#, but I guess they can't find any ColdFusion devs).

My job has me develop new stuff for the site and debugging the disaster of the code, but it's so god-damned easy that I spend a lot of time dicking around on Reddit or 4chan. They don't monitor my Internet and they don't really give a damn when I show up, so long as I stay the 8 hours per day. Their timecards are all Excel, so you can lie about how much time it took for a project. It's a pretty sweet gig, and I really don't feel like jumping for higher pay.
>>
Very new to webdev -

So I've got a nav bar at the top using bootstrap, with three 'about', 'contact' etc <p> headers. They link to their respective pages using <a href="about/index.html">about</a>, etc. How do I stop them being automatically coloured for being a link, and respect my css header p class and take the colour from there?

I've found I can use <style> a {color: inherit;} <style> but this means that all the links on the whole page lose their link colour, which I want for the text lower down. Any way I can make this selective, or an easier method to do it?
>>
>>56570428
Make the style specific to the navbar.

I think they use the nav tag, so your css would be:

nav a {color: inherit;}
>>
>>56570624
Thanks a lot, works perfectly
>>
>>56570122
>I was learning web dev on my own.

Really cool to hear you can get a first job starting at 63k. What area do you live in?

And just how long were you learning on your own before you got hired? Did you apply for the job or did they make first contact? Any good resources for learning C#/MVC?
>>
>>56570717
Orange County, California.

I was doing my own shit for about a year before I applied for jobs. I never felt I was "ready" for a job since there was a bunch of shit I didn't know. It was only after I was comfortable with MVC that I felt I should at least try for a job.

I applied. Just shotgunned resumes on Craigslist. I lied about what experience I had and how much I was making and put my family as reference (I told them I was currently making 50k, so they offered 60k. Jokes on them, I was making 0.).

I used StackOverflow mostly.

MVC was the hardest for me to learn, but I was using Kendo controls at the time, but their demos and shit really helped me learn.
>>
>>56570824
>Jokes on them, I was making 0

kek, awesome story. Did anybody actually bother to check your references? And what about your workmates, do you feel like they have their shit together or are they just as clueless as you are?
>>
>>56571102
They did not. Which is good for me, but I don't think they cared. On their forms for reference, I simply put "will provide", and they never bothered to check up on it.

My boss (who was the hiring manager) said that he was impressed by my answers during the technical portion compared to any other applicant. Even after I started, people were coming in for interviews, but no one else was hired. I felt pretty good about myself for that.

I don't know how to describe the environment here. Like, we all work on the same project, but we work on different parts of it. That means that we don't really need to interact.

They have absolutely no source control. You modify production code directly (or you create a test page and direct to it using your client token). Even my fuckin' home project had TFS.

All I know is that they're competent, I guess. But without the ability to stalk their code from source control, I don't know how much code they produce a day.

I just know that they try to avoid using javascript as much as possible, since most of their pages work through form submissions and shit. Their client-side code is handled by a library called ColdExt, which is kinda like the controls from the asp.net toolbox.

I'm not totally clueless. I thought I was, but the workload is so easy (even developing new pages is a cakewalk). I'm fuckin' about on 4chan right now on my work computer.
>>
>>56571229
you're living the /g/ "From NEET to WebDev" dream, congrats. You don't have any examples of your work to share, do you? The stuff you were doing before getting hired. I started coding recently, but I want to know what I need to aim for.
>>
>>56571366
Thanks. Feels pretty good.

It's extremely autistic I don't really feel like sharing. The only version I have of it is the nodeJS one (I lost the other two versions in ASP.NET, but doesn't matter, since the file it parses, but that doesn't matter since they were bad).
>>
>>56571440
Wow, fucked up the wording. Doesn't matter since it parses from a file, and the code for it is pretty bad.
>>
>>56571440
now that you got a job, are you back on cruise mode, or are you still trying to study and learn new languages so you can move up?
>>
>>56571478
I'm still learning shit. The newest thing I learned is websockets for that push notification crap. And I'm starting to implement it here at work.

And my NodeJS project is acting as a scaffold, so it wasn't a complete waste. Basically, Coldfusion is a piece of crap so it can't do it, but nodeJS can. So the nodeJS project can be used simply as a websocket server that the main sites can connect to to push notifications to each other.
>>
>>56571550
>push notification
>websockets
That's for bidirectional communication. For push messages use SSE. Both easier and more reliable.
>>
>>56571693
Yeah, but too late. It's already created.
>>
>>56571693
But I'll keep it on the backburner for my home project. Will add it to that just because.
>>
I've messed around almost barely enough to know hello world tier shit on unity for making game and I want to say I don't completely know anything but I'm pretty sure what I know which is next to nothing prob still puts me in the "don't know prior coding" tier.

I'm about to apply for app academy and I don't live in NY (NJ lel. 50 min drive). How fucked am I.
>>
>>56569967
I am not against the language but the framework.
It's from another age, even symfony or spring are less pathetically verbose.
>>
>>56568761
It definitely won't see widespread usage until the stable release comes out. It's fine for playing around with now, but I wouldn't use it for production until they're definitely done making breaking changes to shit.
>>
Are Angular 1 and 2 really that different?
>>
File: helpplease.jpg (183KB, 1997x660px) Image search: [Google]
helpplease.jpg
183KB, 1997x660px
can somebody please explain to me how i move this input group to the right of the "remove extension" button?
>>
>>56573016
Yes. They removed a lot of the bloat from Angular 1 for Angular 2. It makes it not backwards compatible.
>>
>>56573123
>using jade
>>
>>56573123
since you're using bootstrap, I recommend reading up on how it's grid system works, especially the 'row' class.

tl;dr:
<div class="container">

<div class="row">
<div class="col-xs-12">
<!-- row of buttons and shit goes here -->
</div>
</div>

<div class="row">
<div class="col-xs-12">
<!-- row of buttons and shit goes here -->
</div>
</div>

<div class="row">
<div class="col-xs-12">
<!-- row of buttons and shit goes here -->
</div>
</div>

<!-- etc -->

</div>


Obviously you could split each row up into multiple columns for the different buttons, but fuck you I'm not doing your entire layout for you. Also see: >>56573174 If you want it in jade, you can do that yourself.
>>
>cram tons of shit into your brain for 12 hours
>forget all of it
>>
Can we just acknowledge for a second how terrible the code in the OP image is?
>>
>>56573123
This >>56573738 should work.

You could also give the button and the input display: inline-block;, and then give the parent container whitespace: nowrap;
>>
>>56548339
Is this b8?
>>
>>56553337
PHP or Python.
>>
>>56573957
Uhhm... Java!
>>
>they send competitors website to you
>it looks like your geocities website from when you were 10 years old

It's good feeling no pressure for once.
>>
File: neptune is concerned.gif (180KB, 426x528px) Image search: [Google]
neptune is concerned.gif
180KB, 426x528px
I have been, little by little, starting to use Javascript as a scripting language instead of Bash.

That's it. I wanted to tell someone, but I have no one to talk.
>>
File: 1378794091684.png (212KB, 373x471px) Image search: [Google]
1378794091684.png
212KB, 373x471px
So, I live in a state that requires freelancers to charge sales tax on web dev stuff. How would I go about doing this on sites like Upwork where you have to state exactly how much the client will be charged? Do I just factor it into the total amount/hourly rate?

Kind of an awkward question I know. I'm new to freelancing and I find it fucking creepy how google turns up absolutely nothing.
>>
>>56574311
Post screenshot.
>>
Are 15K boot camps into 50k+ jobs a scam?
>>
>>56574760
In one way, yes. In other ways, probably. Hard to tell because modern society puts a lot of value on personal debt if it's related to education.
>>
>>56574760
Yes. You're better off learning on your own.

Unless you have no willpower.
>>
>>56574858
>Unless you have no willpower.

in which case it would be ideal if you are ok with a small debt?
>>
>>56575023
You gotta spend money to make money.

If spending money gives you the motivation to actually learn that shit to get a job, then sure.
>>
File: fixed.jpg (111KB, 2315x326px) Image search: [Google]
fixed.jpg
111KB, 2315x326px
>>56573123
your suggestions didn't work for me and/or i didn't understand what you mean but i eventually learned how to do it via google so thanks
>>
>>56573957
Maybe C++ or Go.
>>
I'm going to make a game with phaser and put it on my portfolio. fuck it.
>>
>>56575416
Why? Game development is so retarded, it's often a shame.
Clients don't trust game developers because they think they are retarded gamers.
>>
What unit is best for displaying text, vh/vw or em? Up until now I was going full retard and using fixed px measurements
>>
how do i transition from having learned nodejs for backend to learning c# for backend? i know c# fairly well from gamedev but i wouldn't know how to use it to create a server
>>
>>56575761
look into rem
>>
Is there a way to use a ternary operator in PHP that has no function UNTIL it evaluates?

In other words, I'm looking for something equivalent to:
($chkBan == 'BAN') ? echo "You can't post. You're banned!" : postMessage();

Basically, I don't want it to echo anything or assign any variables BEFORE processing the statement. I want it to do completely different and unrelated things if the user is banned or not.
This is only a test, though. I wanna see if I can get it to work. This one task can EASILY be replaced by a standard IF-ELSE, but I may want to do more complex things with it later on.

So, can this be done? I keep getting syntax errors.


Further, can I actually run multiple statement if true or if false?

Using above, for example, could I get it to BOTH echo "You're banned!" AND redirectToBanPage()?
>>
>>56577331
And if you're wondering why:
>Basically, I'm trying to improve efficiency by obfuscating code
>>
>>56577331
Ternary operators are not the same as if statements. They're meant to be used to, for example, assign values to variables based on conditions without having to write a big if else block with the variable in it twice, for example
$variable = ($condition ? $value1 : $value2);

'echo' is a language construct and not a normal function so you can't use it there, nor can you have multiple statements inside one (unless you group them with && || etc).

tl;dr use if/else instead

>>56577352
>improve efficiency by obfuscating code
This also makes no sense, how do you become more efficient by writing worse code that is harder to read?
>>
>>56577461
>Ternary operators are not the same as if statements. They're meant to be used to, for example, assign values to variables based on conditions without having to write a big if else block with the variable in it twice
Ah, I see. Ok, I'll just use If/Else, then

>This also makes no sense, how do you become more efficient by writing worse code that is harder to read?
Save space, shave a few microseconds off processing and memory management by not doing things that aren't necessary, etc.

But, I guess it won't work here... =/

BTW, what exactly is <=> for? (apparently called "spaceship". Just happened to see it in the php website's documentation for PHP7)
Is that the same as like the compareTo() method in Java, where you'd be like:
if(thing1 > thing2){
return 1;
}else if(thing1 < thing2){
return -1;
}else{
return 0;
}
>>
>>56577522
Else statements are pointless
>>
>>56547422
do better by it by making it open source
it'll be better that way and you'll make friends and learn new stuff
once you have a good network of people you like working with finding the right people to start things with becomes easier, and more often than not you'll be contributing to projects you yourself (nor anyone else) is capable of realizing or seeing through if done alone.
>>
>>56548409
it was always bait
>>
>>56547422
like the thousands of people before you who had the exact same idea, make it and see if it sticks
>>
>>56555317
If you want to learn syntax then you should use CodeWars. Refer to Eloquent Js as needed
>>
Can anybody explain why w3schools is in the OP?
It teaches many bad practices and is all-around awful, and has been this way since its inception.
>>
>>56578990
It's pretty useful for quick references.
>>
>>56579086
Mozilla Developer Network is far better and more accurate
>>
>>56579094
But not as user friendly.
>>
i just got hired as a ruby on rails developer

i don't even know ruby on rails!
>>
>>56579110
https://en.wikipedia.org/wiki/Lie-to-children
>>
>>56579113
ruby on rails is the gayest dumbest name i've ever heard and i would shoot whoever hispter faggot cocksucker who made it up
>>
I've been learning programming for like 2 months, Js for like a month

I just do coding challenges on CodeWars all day. It holds my attention a lot more than reading a book or taking a tutorial.

I go to Js meetups multiple times a week and, after recently meeting a Hack Reactor Alum who said I was ready to apply, I scheduled an interview at MakerSquare - the interview is Wednesday morning - the outcome of which will decide how quickly I apply for Hack Reactor.

The average graduating salary for both are apparently ~$105,000. I'm a major neet. It's very hard to see myself making even $80k

I dream for a time when I can be surrounded by normal people and working toward something
>>
>>56579162
He has some good talks
https://www.youtube.com/watch?v=9LfmrkyP81M
>>
>>56579338
Also if anyone wants to solve challenges over skype or something, I have an account for CoderByte.

If you're very new, I can teach you a thing or two.
>>
>>56579338
also new, been using codecademy for like 2 months, signed up on codewars now, seems pretty good but is some cringey shit.
>>
>>56558520

These sorts of problems are just going to keep recurring and being there when you don't want them to be if you keep running this shit on Windows.
>>
When and how did websites get so bloated?
>>
File: codewars.png (17KB, 991x156px) Image search: [Google]
codewars.png
17KB, 991x156px
>>56579503
I have no idea why you'd call it cringey. I've essentially learned on codewars.

I recently got an email from Hack Reactor that basically validated that as the route to go.

Coderbyte is more consistent in terms of quality and doesn't come with a little story, but it consts and there are a lot less challenges (about 50 for 3 difficulties)
>>
>>56579503
Also if you don't know about it, you might want to use repl.it (website). It's a non annoying sandbox and it allows you to save your code,
>>
in mysql is there a better way to retrieve a field given any parameter then

select * from testImport where commonName like 'leopar' or speciesName like 'Panthera pardus';
(that is the multiple
column like value
>>
>>56579591
I'll say it again, no challenge beats

cryptopals.com

Particularly if you get your hands on set 8.
>>
>>56579591
it looks like good content but there's shit like clans and kyu like it's some autistic ninja academy
>>
>>56579695
I don't think anyone thinks of it like that, but between CodeWars and Eloquent Javascript there is definitely an Asian vibe going on

>Tzu-li and Tzu-ssu were boasting about the size of their latest programs. ‘Two-hundred thousand lines,’ said Tzu-li, ‘not counting comments!’ Tzu-ssu responded, ‘Pssh, mine is almost a million lines already.’ Master Yuan-Ma said, ‘My best program has five hundred lines.’ Hearing this, Tzu-li and Tzu-ssu were enlightened." - Master Yuan-Ma, The Book of Programming

>>56579690
Bookmarked. I've also been referred to Over The Wire
>>
File: am i fa yet.jpg (146KB, 720x1280px) Image search: [Google]
am i fa yet.jpg
146KB, 720x1280px
Pls help

Pic related has better sense of style than me.

What's a good looking review website that I can copy?
>>
>follow the VPS tutorials of my hoster
>everything goes wrong

>follow the VPS tutorials of Digital Ocean
>everything works flawlessly
Why is this allowed?
>>
>>56577522
test dat shit
>>
>>56579338
>I go to Js meetups multiple times a week

are these real, live meetings? Where do you live? I doubt I could find anything like that in my shitty town.
>>
How does stuff work if I find code online or look at a website's code to see how they write something, and then copy/replicate that for my own which I then go on and use commercially?
>>
Has anyone gone from 0 experience to boot camp to job in this thread? Recommended bootcamp for doing so?

I'm about to get a loan and pull the trigger just don't know who to go with. Looking for an online one as well since I don't live in NYC or San Francisco or Cali
>>
>>56580823
Not that anon, but check meetup.com. I live in bumblefuck nowhere north carolina and there are plenty of interesting meetups happening in every city. I don't actually go to them because it's a long drive and muh social anxiety, but still.
>>
>>56579113
I hate you.

I can't get hired for anything.
>>
new thread when?
>>
>>56579338
I just started doing codewars. What level of kyu or kata or whatever are you? Just wanna know how much progress I need to be able to apply to Hack Reactor.
Thread posts: 316
Thread images: 15


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