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

File: browsers.jpg (79KB, 445x629px) Image search: [Google]
browsers.jpg
79KB, 445x629px
>Díscord
https://díscord.gg/wdg

>IRC Channel
#/g/wdg @ írc.rízon.net
Web clíent: https://www.rízon.net/chat

>Learníng materíal
https://www.codecademy.com/
https://www.bento.ío/
https://programmíng-motherfucker.com/
https://gíthub.com/vhf/free-programmíng-books/blob/master/free-programmíng-books.md
https://www.theodínproject.com/
https://www.freecodecamp.com/
http://www.w3schools.com/
https://developer.mozílla.org/
http://www.codewars.com/

>Useful Youtube channels
derekbanas
thenewboston
learncodeacademy
funfunfunctíon
computerphíle
codíngraínbow

>Frontend development
https://gíthub.com/dypsílon/frontend-dev-bookmarks

>Backend development
https://en.wíkípedía.org/wíkí/Comparíson_of_web_applícatíon_frameworks
[Gíst] backendDevelopmentBookmarks.md

>Useful tools
https://pastebín.com/q5nB1Npt/
https://líbraríes.ío/ - Díscover new open source líbraríes, modules and frameworks and keep track of ones you depend upon.
https://developer.mozílla.org/en-US/docs/Web - Guídes for HTML, CSS, JS, Web APIs & more.
http://www.programmableweb.com/ - Líst of publíc APís

>NEET guíde to web dev employment
https://pastebín.com/4YeJAUbT/

>How to get started
http://pastebín.com/pDT82mQS
http://pastebín.com/AL6j7GEE

>cheap vps hostíng ín most western locatíons
https://lowendbox.com
https://www.dígítalocean.com/
https://www.línode.com/
https://www.heroku.com/
https://www.leaseweb.com
>>
>>60118493
>>
>>60118543
Sorry, my keyboard doesn't have an í key (the one wíth a dot)
>>
Which languages do I need to know to develop on browsers ?
>>
>>60118673
Norwegian
>>
Are there any hosting services with free options? I've been learning for a few months and I'm going to show a couple of examples for a new site for a family member's business and I want somewhere to store everything online.

Also what's a good text editor?
>>
>>60118820
>Also what's a good text editor?
vim and emacs are both good text editors.
>>
>>60118897
>emacs
>good
>>
anyone into websockets?
why can't I just connect that way in JS?
var ws = new WebSocket("/update");


Instead of this
var ws = new WebSocket("ws://localhost:8080/update");
>>
>>60118719
bokmal or ny-norsk?
>>
>>60118994
Bokmål, selvfolgelig.
>>
>>60118987
it would try to connect over http otherwise
>>
>>60119017
My problem is that I don't want to change the IP all the time.
I tried
var ws = new WebSocket("ws://./update");

Obviously it does not work.
>>
>>60119086
var ws = new WebSocket("ws://" + location.hostname + ":8080/update");
>>
>>60119017
That doesn't make sense. How does a protocol in the text string affect anything? It's the WebSocket API, so it should be trying ws by default...

Unless... Does it work if your WebSocket server is on the same port as your web server?
>>
>>60118590
>posting retarded memes and not having access to "i"
don't start the threads then
>>
File: C2uDMWpWEAEEfZw.jpg (121KB, 750x738px) Image search: [Google]
C2uDMWpWEAEEfZw.jpg
121KB, 750x738px
>>60119108
Thx !
>>
>>60119132
There's only one server using 8080 for both ws and http.
May be it tries WS by default only on port 80.
I'll give a try.
>>
>>60119133
Nobody else had started the thread though.
>>
>>60119193
It appears the WebSocket spec says that the URL must be an absolute one, and can't be relative.
>>
>>60119387
An other problem I had with ws , the handshake doesn't send cookies. I think it should.
>>
File: Dart_logo_wordmark.png (28KB, 613x163px) Image search: [Google]
Dart_logo_wordmark.png
28KB, 613x163px
>>60118493
Asking here again.
How does Dart compare to Typescript?
>>
So I spent a few hours learning redux-saga.
Crazy powerful stuff. Kinda wanna refractor my current work project but I can't really justify the time cost.
>>
File: 608.jpg (67KB, 709x765px) Image search: [Google]
608.jpg
67KB, 709x765px
>>60120070
>>60120070
>>60120070

Already posted to two wrong threads, are there any anons out there that can help me understand this problem?
>>
File: b35b6a1f1949f5f9998b2064b9932581.png (131KB, 1894x986px) Image search: [Google]
b35b6a1f1949f5f9998b2064b9932581.png
131KB, 1894x986px
how did react router website do this?

im trying to get my code in my blog to show like this
what library or how do i do this?

here is there website

https://reacttraining.com/react-router/web/guides/quick-start
>>
>>60120206
for loop {
if str== e {
hits.push(str)
}

heres some sudo code can u tdlr what r u tying to do? or are u trying to understand something?
>>
>>60120384
I actually just figured it out thanks to another anon in the /dpt/ thread. My problem was I didn't know when the ++ iterator executes.

I found it executes once the nested 'if' and 'for' loop finishes. That way it resumes count where you left off. It feels even worse because the answer was so obvious but I could not think about it.
>>
File: 1493190963365.jpg (85KB, 580x563px) Image search: [Google]
1493190963365.jpg
85KB, 580x563px
Need some help.
I want to make the scrollbar in an iframe invisible while still being able to scroll.
How do?
>>
>>60121782
nvm fixed
>>
So this new javascript is like a functional version of it?
>>
which is faster?

im trying to make a blog,

should i build a full form post application, with user auth only for me so i can post to a database to then get the data n render it on my blog or built the database post thing in apart like a diffrent website thn just get the data by treating it like a rest api, and manipulating it on my blogging site?
>>
>>60119108
>>60119142
You could also steal the protocol by doing location.protocol.replace("http","ws") and that keeps also the "secure" letter.
>>
What are some comfy programming related irc chans, lads?
>>
>>60120206
I had to read that 3 times and I still don't understand what he's asking ...
>>
File: 1477835533001.jpg (41KB, 450x496px) Image search: [Google]
1477835533001.jpg
41KB, 450x496px
Everyone's seemingly using React nowadays, but I just cant get over the feeling that it's just a fad that will pass soon. The whole mixing html and css in javascript like it does doesnt feel right to me.

I think I'll just keep writing plain html the old school way with muh bootstrap.
>>
>>60119696
It's an own language that can be used for stuff other than web scripting, using the Dart SDK.
Typescript on the other hand is designed to be a JS superset and to compile to JS, so that is where you are heading.
>>
>>60125255
If React was gonna pass anytime soon, it would have already. We've got a few years left.
>>
>>60125255
>>60125464
Facebooks implementation is a fad, in particular with that license.
Preact and Vue or maybe Inferno are where the money is at.
>>
>>60120206
RTFM. Also this is very ineffective way to do this.
>>
>>60125495
There are more and more Vue jobs coming up in my city, but still very outweighed by React.
>>
I'm a professional (as in I get paid to do it 37.5h/week) web developer, I develop full stack, a backend in PHP that does some cool automation stuff for company procedures and some other cool stuff and I also develop the front end for which I use Bootstrap + jQuery pretty much.

Everything I program works VERY WELL, but I feel like these technologies are very 2011 and I feel like I should maybe probably learn a modern framework or some shit like that, maybe at least something like Less or Sass or some shit like that, so here goes the question: Which/what and why?
>>
>>60119696
Dart is much heavier and probably not gonna gain mindshare. Typescript is just a superset of javascript so is much easier to start with.
>>
>>60126801
a good next step would be node/express, react/redux, typescript. you don't really need sass, but it's easy to pick up. after that look at golang and microservices
>>
Quick question here
One of my company's servers is an ancient bare metal machine running Ubuntu 12.04.
We moved 99% of our customers to more modern VPSes running up to date software, but 3 of them can't/refuse to get their DNS done properly so they still run on the old server.
Since 12.04 is EOL, what would be the best way to mitigate?
We cant really upgrade, the old thing is fragile as shit and upgrading will probably break everything. Can I somehow redirect traffic to the new server even though the domain name points to old one?
>>
>>60126938
make your firewall point the old ip to the new internal one instead of the old internal one.
>>
>>60125255
>whole mixing html and css in javascript like it
exactly, feels really weird. Too dumb to explain it properly though
>>
>>60125255
It's not mixing html and css in javascript, it's a virtual dom, which makes it much easier to reason about than old school manual dom manipulation, once the app gets beyond a certain level of complexity. It's intended for very dynamic apps like facebook itself. But not worth it if you're just animating some stuff or whatever. It's just a tool, not appropriate everywhere.
>>
separation of concerns

people used to say to not put html and css in javascript but apparently it's okay now

can't you avoid it by using html imports though
>>
>>60127065
It is still bad if you use strings. JSX gets compiled into normal JavaScript so it has to be valid XML, it's a step forward at least.
>>
>>60126801

SASS is great, it will make your CSS much easier and cleaner. There are two "flavours" of SASS, the normal SASS and SCSS. You want SCSS.

Even if you use only a tiny part of SCSS you should already see the advantages of variables, nesting, inheritance and so on. So I'm not gonna explain that, just try it for a day and you'll be happy..

>http://sass-lang.com/guide


Typescript is a type-safe flavour of JavaScript, but I don't found it usefull. If you have the kind of problems, TypeScript solves, then maybe you shouldn't program websites in the first place.. Also you will lose some of the flexibility of JavaScript and write more verbose code (think: Java).

Then I'd rather use CoffeeScript, it only adds syntactic sugar but it looks good.

But to be honest:
Simply learn the "new" JavaScript standard, ECMA script 6. It solved a lot of JavaScripts old problems. All those JS derivates are not really necessary.

If you want to take the JavaScript route (no pun intended), you can also learn things like webpack, babel, node.JS.

And if you are working in a bigger company, react+redux could be interesting for you. Or Vue, it's a little simpler than React.
>>
>>60127154
typescript is definitely useful, especially when refactoring. it obviates a whole class of tests and provides more useful information to others working on a project. or do you not write tests?
>>
i just remembered why putting html/css in strings is bad:

it doesn't go through the html/css parser when it's loaded so it has to be parsed at runtime when it's inserted into the document or something

there's also no caching for just the html/css

jsx is better than strings but i think using native html would be even better

>>60127154
>Also you will lose some of the flexibility of JavaScript
underrated point, i dont see this come up often
>>
>>60127212

Of course I write tests. And I know a lot of people have a boner for TypeScript.

I don't think TS is bad, I just think it's just not necessary and it just looked a little bit verbose.

But to be fair, I haven't done a project with TS. So maybe I'm missing something?
>>
>>60127154
>Also you will lose some of the flexibility of JavaScript
Yes, I too love being able to write wrong code. Not.

>write more verbose code (think: Java)
You're a bit special in the head, ain't ya? I haven't seen type "types are inherently verbose because look at Java!!!" in a good long while. I can write statically typed code all day long without writing a single type.

Posts like this are why non-webdevs look down on webdevs.
>>
>>60127337
yeah, give it a chance with good editor support. might even get a boner
>>
How do webdevs keep up with each week's hot new JS framework?
>>
>>60125827
Remember when Angular was a hype and suddenly people recognized that the competition is much better?
Same thing with x-can't-handle-our-scale Facebook. In fact, they are rewriting react internally, whereas the sanely licensed clones are already on the level the rewrite will at best be.
>>
When will F# become the new king of webdev?
>>
>>60127648
Ignore them and keep using jquery
>>
>>60127697
When the Linux kernel gets rewriten in Rust.
>>
>>60127675
dude I ended up writing my own clone. around 300 LOC and much better performance. never looked back
>>
but not learning what everyone creams about won't get me a job. what do?????
>>
>>60127740
just learn the least shit one with the most jobs. react is that at the moment. it will take about a week.
>>
Webdev is crabs in a bucket.
>>
>>60127509

>Posts like this are why non-webdevs look down on webdevs.

Whoa, did someone piss in your coffee this morning? Just because I don't like TypeScript I'm "a bit special"?

I just don't think dynamic typing is the problem in JS. I never had any bigger problems here. If somebody can't deal with something like..

a = [];

for (i=0; i<3; i++){
a[i] = "This is number " + i;
}


..then I don't want to work with this person in one project. Yes, "+" can mean string concatenation and addition, soooo complicated..


>>60127630

OK, maybe I'll give it a second look.
But I think JSX is more sexy.

There, I said it.
>>
>>60127851
I'm down with + being semigroup combination, but you can't use it on arguments that are different types. That's not cool.
>>
>>60127940
>>
>>60127929

So no project for the two of us..
:^)

But honestly, it's not like I hate strong typing. I just think it's verbose. I don't think it adds so much value that I want to use yet another JS gadget.

If someone is coming from something like Java, then it might make someone feel more comfortable because they know "which kind of thing" they work with. Some people prefer using a bike helmet, I don't like them.
>>
>>60127960

God forbid anally retentive Haskell/C++ developers are invading web development..
>>
>>60128107
God forbid webdevs start acting like engineers instead of code monkeys.
>>
http://jsnice.org/

is there an alternative to this for unminifying/deobfuscating code mangled by uglifyjs?

the site was down when i wanted to use it earlier and it's ~cloud-based~ so they get all the code i send them

it's very nice and even correctly fixes uglifyjs's expression thing where it puts many statements in a single expression (i don't know any other unminifiers that can do that)

would something like google closure compiler or another pass of uglifyjs with different settings work for making mangled code readable?
>>
>>60118937

>implying it's not
>>
Who's a good reliable host? I was with godaddy for 3 years for $5/month but now they're going to bump it up to $10/month. I don't mind paying more, but I'll want a lot more freedom if I'm going to.

>>60118493
Pastebin is down and I really wanted to check out that NEET guide
>>
>>60128821
>https://pastebín.com/4YeJAUbT/
It's not down, its "í" meme, here you go https://pastebin.com/4YeJAUbT/

I use digitalocean and yourserver.se
>>
What will webdevs do when webdev is automated to the point that normies can quickly and easily get a site up and running?
>>
File: 1492675302316.jpg (269KB, 1920x1080px) Image search: [Google]
1492675302316.jpg
269KB, 1920x1080px
Is there any kind of CMS, that gets out of your way and does nothing but provide a simple REST API, so you can get some JSON, that you then can handle in your page however you see fit ??

Literally everything insists on you setting up some special folder structure, router, views, templates etc.

I made an extremely basic component in Vue.js, that lets me post and get some text-content, but it would be great to use some existing system, so I can focus on other things instead.

>>60129541
That's already possible
>>
>>60129541
You can't automate dev, just design.

The best you can do for dev is make something like wordpress. Obviously that doesn't work so well since devs make a killing with wordpress.
>>
>>60129720
Drupal 8 can do REST
>>
>>60127851
jsx and ts do different things. in fact, you can write jsx with ts support. it's way better to have statically-checked props than using runtime-checked propTypes.
>>
>>60127851
static types are not gonna help you with basic language features like for loops. you don't need help with that. it's more for structuring data entities. it's really helpful to be able to check what kind of shape (interface) of object you're gonna get from an ajax request, for example, or for making sure that functions you define don't take the wrong kind of argument or expect the wrong kind of result.
>>
>>60128821
linode. digitalocean has flaky customer service
>>
>>60130258
I read linode's wiki page and they seem very sketchy. 40,000 bitcoins going missing from customers? Getting Ddossed last summer?
>>
>>60129766
>make a killing with wordpress

>web devs
>making a killing
LOL pick one alone
>>
how much do you charge people?
>>
>>60131590
i tell them im jewish and charge as many jews died in the holohoax
>>
>>60131590
150euros an hour
>>
how well would node.js do in a complex app that gets millions of requests / min?
>>
aren't there big companies using node.js in production
>>
Say I have an endpoint that accepts a JSON body, and whether or not the request is valid is determined by the content of said JSON body. What status code do I return if the request is invalid? 404 doesn't seem quite right
>>
>>60132051
400
>>
How do I git gud at web design bros? I like web dev but I hate CSS and making shit "responsive" because I'm really horrible with it. Any advice?
>>
>>60118493
someone post discord
>>
>>60132076
Practice, like with everything else.
Just copy designs and implement features until you git gud.
>>
>>60130778
I know an oz making 300k a year doing wordpress sites.
>>
>>60132076
Draw it on paper first.

Design takes me about 10x longer than dev does.
>>
>>60132076
>how do i get good at something I don't like

you won't
>>
>>60125255
It is a fad. I guarantee this shit will dead or dying in ~3-5 years.

These big complicated front end frameworks only exist because JavaScript is a pile of horse fuck. But its getting better over time. As it becomes better the need for those frameworks will die out. Things like vue.js can do what 90% of people probably need i.e html templating and databinding, and thats simply dropping one file into your application and using it, no domain specific language, no transpiling, no non standard bullshit.

Shit written in Angular/React will be the future piles of shit that noone will want to work on. i.e where Angular 1 is now.
>>
>>60119696
Both are for people that are bad at Javascript.
>>
>>60125495
This right here. I'm seeing more and more shops switch to Vue.

Angular 2 is also getting traction but only by people that don't understand how Front-end development works.
>>
>>60127154
>Typescript is a type-safe flavour of JavaScript, but I don't found it usefull. If you have the kind of problems, TypeScript solves, then maybe you shouldn't program websites in the first place.. Also you will lose some of the flexibility of JavaScript and write more verbose code (think: Java).

This is SO true and VERY few developers understand it.
>>
>>60132332
>Things like vue.js can do what 90% of people probably need i.e html templating and databinding, and thats simply dropping one file into your application and using it, no domain specific language, no transpiling, no non standard bullshit.

Hell we have had knockout.js for almost 10 years now and it supports IE6 still.
>>
>>60132332
>angular 1 is worse than angular 2
for your own sake, i beg you reconsider
>>
>>60132487
>supports IE6
What, is it designed for the Chinese and Malay market?
>>
>>60118493
Does anyone use JSP anymore?
>>
I have a laptop and vps both running ubuntu and nginx, what's common practice for setting up dev environment/deploy to vps? App will be fastcgi, not php necessarily
>>
>>60132954
Actually Is this what docker is for? I've never used it before
>>
>>60132988
With docker you create an image with all the software needed and ship that image to the server.

In development you can use the same image but use a volume to load your software from a shared folder.

So you don't need to care that both server and dev machines use the same distro, just that both load the same docker image.
>>
<form action="?cut=<?= trim(strip_tags($_GET['video']))?>" method="POST">
Starting time:
<input type="number" size="2" maxlength="2" name="Min" placeholder="Minutes" min="0" max="0">
<input type="number" size="2" maxlength="2" name="Sec" placeholder="Seconds" min="0" max="60">
Duration in seconds: <input type="number" placeholder="Seconds" min="0" max="<?php (new CalculateDuration()); ?>" name="Duration">
<input type="submit" value="Cut" name="Duration">
</form><br>
</form>


<script>
function checkingInput()
{
var Min = document.getElementByName("Min");
var Sec = document.getElementByName("Sec");
var Duration = document.getElementByName("Duration");
var Max = document.getElementById("Duration").max;
if (Duration > Max){
document.getElementById(Max)
}
}

</script>

What do i need to do to check if entered number is > then max with js?
I tried script above but that is not working, i'm no rly into js
>>
>>60133221
you want to check if the value is larger than max, not the element itself.
>>
>>60133221
well fucking shit anon, the duration is a button.
what do you want to check if a button is larger than the max value of duration?
the fuck you doing.
>>
>>60133221
>
action="?cut=<?= trim(strip_tags($_GET['video']))?>"


?video="%20onmouseover="alert(1)

(i think you should be using htmlspecialchars there)
>>
>>60133237
should i add .value?
>>60133257
kek, changed
<form action="?cut=<?= trim(strip_tags($_GET['video']))?>" method="POST">
Starting time:
<input type="number" size="2" maxlength="2" name="Min" placeholder="Minutes" min="0" max="0">
<input type="number" size="2" maxlength="2" name="Sec" placeholder="Seconds" min="0" max="60">
Duration in seconds: <input type="number" name="Duration" onkeyup="checkingInput()" placeholder="Seconds" min="0" max="<?php (new CalculateDuration()); ?>" name="Duration">
<input type="submit" value="Cut" >
</form><br>
</form>


<script>
function checkingInput()
{
var Min = document.getElementByName("Min").value;
var Sec = document.getElementByName("Sec").value;
var Duration = document.getElementByName("Duration").value;
var Max = document.getElementById("Duration").max.value;
if (Duration > Max){
Duration.value = Max.value;
}
}

</script>
>>
>>60133291

added, thanks
>>
Anyone knowledgeable about modern web dev in Perl know how many external modules is too many? Excluding what my Framework pulls in on its own, here's what I'm using:

use DBI;
use POSIX;
use Net::IP;
use JSON::JWT;
use File::Copy;
use Lob::Client;
use MIME::Base64;
use Data::Dumper;
use HTML::Escape;
use JSON::MaybeXS;
use Mailjet::Client;
use Encode qw(decode);
use List::Util qw(any none);
use Image::ExifTool qw(ImageInfo);
use Bcrypt::PasswordUtil qw(password_hash);


Four of them are really tiny utilities I wrote myself that I use in other projects, but the rest are from cpan and vary in complexity and size
>>
>>60132332
Is React really that much bigger and slower than vue? Also I feel like React has some staying power thanks to React Native being a thing. I don't know how well it works in practice, but it sounds amazing
>>
>>60132954
I use Perl for my bigger projects, and between git, plenv, and cpanminus with a cpanfile I have zero issues deploying stuff
>>
>>60127675
I still see some Angular jobs but ~ s u r e l y ~ they're on the downfall.
>>
>>60118493

I want to make a Javascript script that is capable of cross site scripting

How do you do this with webextensions?
>>
>>60132076
I am shit as at design and javascript, but I know CSS like the back of my hand
>>
>>60134570
Can you explain me modern css concepts?
I don't know what shit like display: flex, block... means.

Also can't figure out the proper use of transform.
>>
>mfw got react/electron gig, like shiny webdev shit
>mfw still wanna write in C/C++
>gonna code part of backend in C, part in C++, just because i need git gut with those
oh boi i have found the light
>>
>>60133300
Max is attribute so you use .attr to get it's value. Also try learning some javascript and googling before asking here.
>>
>>60118493
when its
<div class="content"></div>
>>
Should i learn PHP? I already know dotnet and node.

A lot of jobs require PHP but for me it's kinda eh.
>>
>>60135297
You will easily find a job doing PHP for the next 10 years+
But why would you do that unless you like suffering and working through shitty legacy code..
>>
If I'm sending a plaintext email, do I need to escape special HTML characters? Is XSS a possibility?
>>
I want to make a multiplayer draw poker game using websockets. How hard is this going to be? I feel like there is going to be a ton of async trickery.

ie
wait for player 1 to go
if 30 seconds pass, disconnect player 1
receive player 1's move, validate
notify player 2 it's his turn

is rxjs a good candidate for this? I'll be able to cancel the timeout listener easier I think...
>>
How do I get gud, like really gud
>>
>>60132332
>some framework will not last forever
wow good work there sherlock
doesn't mean React isn't on top of things right now and for the foreseeable future

Angular 1 was the first proper solution to SPA but in v2 they fucked it up with a totally different API and TS (which is a nuisance unless you are working on a *huge* codebase)
Vue performs better but basically is babbys first SPA framework. Remembering some shitty 3rd party HTML tags to iterate over things is just awful
Meanwhile React lets you write vanilla/ES 6 JS and enforces functional programming which makes it super easy to reason about code and test it too.
Sure getting the meme stack with webpack babel and shit up and running takes some patience but there simply is not a better JS solution nowadays than React.

t. making a living with this shit since tables were the non plus ultra for layouts
>>
>>60135426
Learn to crud on every backend.
Make generic components so you can just slap 'n load for a crud on every js meme.
then you're set.
>>
Redpill me on open graph protocol
>>
>>60135439
>npm install -g @angular/cli
>ng new PROJECT_NAME
>cd PROJECT_NAME
>ng serve
>start coding
Nothing stopping you from writing vanilla JS or functional code.
>>
>>60135368
Anyone?
>>
>google finally gets web components up to par
>react dies over night
>webdev becomes so easy that a 4 week black girls code camp produces an employable webdev
>webdev salaries fall to McWage levels

lol can anyone else not see this coming a mile away? if javascript wasn't a steaming pile of shit of build tools and memescript compilers everything would be so easy.
>>
>>60135759
That's why i play it safe with C#. If anything fails i can go desktop/mobile dev and while at it learn electron or something. if everything goes to shit I'm going to do IT work.
>>
>>60135439
Angular 1 was NOT the first, not even close.

Backbone dominated the market for a long time. The problem is people will literally do whatever Google or Facebook are doing even if it's stupid (see Angular 1, Angular 2-4, and React).

You can ALWAYS tell who's a beginner by getting their opinion on React. It's absolute garbage outside of the virtual DOM.
>>
>>60132831
No, everyone coding in Java uses Spring
>>
File: 1344204474031.jpg (26KB, 219x252px) Image search: [Google]
1344204474031.jpg
26KB, 219x252px
>>60132367
Why would I want to be good at JavaScript? Have you seen what the transpilers output? I don't want to write all that boilerplate shit just to get some semblance of organization.
>>
>>60135846
Not really beginner, but their level of competence.
A senior developer at my work, when approached with the drawbacks of React or other major libraries we use, will just say we're not using it properly rather than ever acknowledge a drawback.
He refuses to come up with any in-house solutions to problems and always turns to what Facebook is doing, even if it's only tangentially related. If you show him how we still need the in-house solution, he'll just tell us to use the shiny Facebook tool alongside a second custom solution, so now we have to maintain setup and a wrapper for that tool as well as the in-house solution.
>>
>>60133411
Anyone?
>>
>>60136060
Mine giving an example or two?
>>
>>60136216
We use material UI. Have a page where we hit some render issues. Client won't budge on the page design. We're also in healthcare and we need keyboard accessible components because of accessibility laws.
He insisted that React was very efficient and we were doing something wrong.
I had to create an example where we just render components and do nothing else to show him that we're not doing anything wrong. He finally accepted it after an hour of back and forth.
We propose making our own components because there's no one else in healthcare with efficiency problems using material design. Input components are not even that hard to create.
Instead he comes up with another material design library that he wants us to use alongside it which isn't even keyboard accessible.
The real kicker there is that our designers don't even follow material design. All of our components are heavily customized.

The other example is when we needed a way to mock connect from react-redux for tests because we needed the inner component to be the root node. I just did it because I thought it was no big deal.
He insisted that we scrap testing component logic and just do screenshot testing instead because that's what facebook does, even though I had already written the utility.
>>
I'm doing more LibreJS compatibility WebExtensions add-ons for Stallman

There is this one script on sumofus.org (a website he requested I do)

This is the broken script:

  new window.Campaigns({
language: "en",
source: 'campaigns',
apiHost: "https://actions.sumofus.org"
});


window.Campaigns() does not show up in IceCat (Gnu's official browser that comes with LibreJS).

How to get around this fascist javascript?
>>
>>60136310
Oh wow your examples were way more helpful than they needed to be. I work for a lawyer who is trying to specialize in computer accessibility cases so I've been dealing with similar issues and how to avoid them with popular web technologies for months
>>
are all webdevs cute like this?
https://www.youtube.com/watch?v=gTBCHu0btn8

how do i get a webdev gf?
>>
>>60136762
Get a job at Google for starters...
https://youtu.be/0q9FOeEELPY
>>
File: feelrunner.png (114KB, 883x990px) Image search: [Google]
feelrunner.png
114KB, 883x990px
>>60136762
>first day at work
>here's Leila, you're going to be pair programming with her all day for the next few months
>she starts snuggling up very close next to you while she shows you the webpack config file
>she complements the way you smell and grabs your thigh a few inches above your knee
>after lunch it's your turn to write some tests
>she becomes unusually quiet but is pretending to pay attention
>you feel some slight vibration in the desk
>look down and she's rubbing herself frantically through her jeans
>she realizes you noticed so she stops and starts talking about the tests as if it never happened
>a few minutes later she slides her hand down your thigh and starts rubbing your cock through your jeans
>she leans over and starts sucking on your earlobe and whispering in your ear that she's going to suck all the cum out of your balls
>hear the manager walking around the corner
>"Leila, your husband just dropped off your laptop you forgot. How's your first day going, anon?"
>>
File: ULTRA-rage-feels.jpg (106KB, 601x601px) Image search: [Google]
ULTRA-rage-feels.jpg
106KB, 601x601px
>>60137088
>tfw leila cucks you for a /dpt/ brainmore bc she doesn't want her kids to be dumb
>>
>>60136762
https://github.com/lhofer

I bet she doesn't even work as a programmer any more lol women programmers

gurls c0de@!!
>>
>>60137277
1. maybe she's not putting code on github for free because she has a job where she gets paid to do it
2. she's cute and is just teaching a class, the fact you have animosity for her for no reason than she's a cute girl means you probably don't have a lot of sex
3. webdev's are on the same level as gurls can code!! so you shouldn't really be talking
>>
What are your favorite wdg-related books?
>>
In SQL, I want to change the ID of a particular customer. They have a unique key (phone number) so I append an underscore to it so that I can create a copy record with the proper values and new ID, then I update the invoice table records referencing the ID to point to the new record and delete the now-unused old record.

Is there a simpler way of doing it than this? (even if you probably shouldn't be in the first place; I'm just learning stuff)

UPDATE Customer SET phone = CONCAT(phone, '_') WHERE customer_id = 64;
INSERT INTO Customer (SELECT 72, first_name, last_name, SUBSTRING_INDEX(phone, '_', 1) FROM Customer WHERE customer_id = 64);
UPDATE Invoice SET customer_id = 72 WHERE customer_id = 64;
DELETE FROM Customer WHERE customer_id = 64;


I know I can change the foreign key constraints so that they automatically update but in this case I want to do it using only DML commands (and no unsetting foreign key checks either).
>>
>>60138026
stored procedure maybe? Just keep SQL easy to understand imo unless there is a performance issue. There is so much other shit you should be worrying about.

t. wasted time learning sql in depth only to never use anything more complicated than a few joins and group bys once a year
>>
>>60138736
I wasn't really worrying about performance or anything, I was wondering if there was anything I might be missing/haven't learned yet that makes it easier to write (e.g. someone writing a bunch of subqueries instead of using JOIN).
>>
>>60136310
>use garbage 3rd party library
>blame React
>>
>>60133386
Seems about right.

Maybe split your stuff into multiple files and include only the modules that are needed in the separate file.
>>
>>60127253
>underrated point, i dont see this come up often
Because it's not true. Any JavaScript is valid TypeScript.
>>
>>60118820
You could probably configure a free AWS instance to do what you need.
>>
>>60139817
>a free AWS instance

there's free options on AWS? Cool
>>
File: takbir brothers.png (343KB, 750x400px) Image search: [Google]
takbir brothers.png
343KB, 750x400px
Stupid Question: How do you guys manage the workflow between DEVELOPMENT and PRODUCTION?

I just use two different folders, but it might not be the best solution. Pls share advices
>>
>>60139889
I have a CI server set up on a local gitlab instance.
When I merge from master into testing it'll publish it on a test site where I check out that everything still works.
Then I merge from testing into release where it'll publish everything to the live environment.
>>
>>60139889
I have a laptop repurposed as a dev server. It has a tiny script to pull from git (the repo is just in Documents), wipe its server root directory, and re-populate it from the files in the repo. To deploy from there to the real server I just rsync.

As a bit of a cheat, the server runs the databases for both live and testing, under different names and credentials.
>>
>>60139835
Yeah, as long as you use t2.micro, you've got 750 hours per month.
>>
>>60139988
How do those hour measurements work, anyway? Do you have to turn the server on an off, or does it only count if the CPU is above some threshold? Some other metric?
>>
>>60139988
seems like it's only for the first 12 months after registering, or am looking at it wrong?
>>
File: chrome_2017-04-30_17-43-26.png (20KB, 784x208px) Image search: [Google]
chrome_2017-04-30_17-43-26.png
20KB, 784x208px
>>60140086
It's literally just time per EC2 instance. 750 hours per month is enough for one EC2 instance running full time, if you set up two, then you're only gonna be able to run them both, freely for half that time, after that you'll be paying Amazon's per hour cost.

>>60140099
Yeah that's right, but even then it's just $9.50 a month after that, you'll be a big boy web developer by then. Certainly not some Junior ICT Coordinator (Only ICT staff for 70 users) bumbling around AWS struggling to put a php based asset management tool on it, on top of the company doing a restructure and having to find a cost effective provider for Citrix sessions and managed services.

haha
>>
What's the best option for hosting multiple portfolio projects that get almost no traffic but still need to be available in case someone wants to look at them? I'd rather not have to pay for a VPS that's going to just sit idle 99.9% of the time. I guess heroku or something?
>>
any of you guys familiar with hosting dotnet core stuff not on azure

i've set up some random thing on ec2 following a guide but i'm really new at this kind of stuff and not too familiar with dotnet core either, but i like c# and don't want to fall for the windows server meme
>>
>>60123469
I'd go for the second option: you could make it abstract so you can could use the same restful api for multiple blogs without much hassle.
>>
Do you use service workers /wdg/?
>>
Is there something like Less/Sass/Stylus for JSON?
A JSON Preprocessor?
>>
>>60142924
What should it do?
JSON is just a serialized object, so your serializer would be one already.
>>
>>60142924
>JSON Preprocessor

nigga what
>>
File: styl.jpg (44KB, 693x652px) Image search: [Google]
styl.jpg
44KB, 693x652px
>>60143002
>>60143038
I want to be able to write like pic related

and have it be processed to something like this

{"menu": {
"id": "file",
"value": "File",
"popup": {
"menuitem": [
{"value": "New", "onclick": "CreateNewDoc()"},
{"value": "Open", "onclick": "OpenDoc()"},
{"value": "Close", "onclick": "CloseDoc()"}
]
}
}}
>>
>>60143081
Oh, you probably want something like YAML.
https://en.wikipedia.org/wiki/YAML

Most languages have a YAML parser of some kind which you can then serialize back out as JSON. Just out of curiosity, why are you trying to write JSON by hand in the first place?
>>
oi bibbas I'm writing a SPA and nothing seems intuitive at all when it comes to security or anything really

Is SPA a meme or am I am meme?
>>
I'd like to share my SPA experience and would like to ask for advice..

After learning some MVC frameworks I decided to finally take a look at single page apps. So I did a quick review (basically bb's first tutorial) with Angular2, React and Vue.

At first Iooked at Angular2. The component based logic is not bad, the two way data binding seems pretty straight forward and overall not bad. But it's not really slim since it's a complete grown-out framework and I the syntax felt somehow clumsy (but of course it's a matter of how well you know something).

Then I took a look at React. I really liked that it's pretty much only the "View" component. That "HTML embedding" looked kinda weird, but the explanation they give on their website is OK and I'm open for new ideas. Overall the syntax was more appealing to me than Angular's.

Then I took a look at Vue and was pretty impressed. As I understand it, it has the best of both worlds (i.e. virutal DOM and simple two way binding). I really liked that it "gets out of my way". The React syntax is not bad, but Vue just seems much more "to the point". In React (and even more so in Angular) I felt like I had to learn how the framework/library wants me to do things, while Vue felt more like a power add-on, that gives you cool possibilities, where you need them but doesn't interfere with your productivity.


So my questions:

Is Vue really as powerful as React or are there certain things which you can't do in Vue?

And are there other frameworks/libraries besides Ang/React/Vue that are great? I wouldn't mind something more unknown.

Where would you use a SPA and where would you use a classical MVC framework like Node/Express, Django or Laravel?
>>
>>60143175
Oh yes that looks more like it.

But I'm gonna tell what I'm doing because maybe I'm looking for something completely else.

I'm trying to build a website template and I want the contents to be loaded from some kind of file.

Let's say the file I load in looks like this
div
h1
textContent 'Example Header'
ul
li
textContent 'List Item 1'
li
textContent 'List Item 2'
a
href 'javascript:alert("2nd Listitem");'


Then I process this file in JavaScript and show the content on the page
>>
>>60143355
why not just use existing templating frameworks?
>>
>>60143355
Looks like HAML so you could just use that.
I hate HAML.
>>
>>60139749
yeah, once you jump through a million hoops to get the type system to shut up about its inflexibility
>>
>>60118493
I used to be really into web development (back end stuff).
Then I switched to game development.
Now I don't want to an hero anymore.
>>
>>60135892
>Spring and JSPs are somehow mutually exclusive
also, everyone uses Grails now
>>
>>60143467
Mainly for practice
I got less courses this semester and because of all this free time I'm trying to work myself through the ways of the web
I'm not in 2017 yet when it comes to web

>>60143493
I'll check it out

So YAML, HAML, what else is there? Just so I can get an overview
>>
>>60143544
>game development
>not a million times more tedious and difficult than back-end webdev
come on now
>>
>>60143560
Thing is I actually enjoy doing the work now.
>>
>>60118987
use socket.io
>>
>>60143552
Yaml for json, haml for html, scss for css, coffeescript for JavaScript, Kotlin for Java, vala for c, boo for c#, nano for vi

For everything hard for noobs there's always someone willing to make a baby alternative.

Most suck because eventually the moon stops being a noob and requires things that the alternative can't do. Ultimately having to learn the real thing the hard way.
>>
>>60143316
>Is Vue really as powerful as React or are there certain things which you can't do in Vue?
They're both just javascript so ultimately you can do the same things in either one. React is more popular so if you're looking for something to do some esoteric edge-case thing, you might be more likely to find a ready-made lib to do it I guess. Generally speaking though, they're pretty equivalent. According to the Vue team, it's actually faster in some cases.

>And are there other frameworks/libraries besides Ang/React/Vue that are great? I wouldn't mind something more unknown.
Those are the big three at the moment. Backbone, Ember, and Knockout are all pretty good options too, if less popular these days, but they all do basically the same thing.

>Where would you use a SPA and where would you use a classical MVC framework like Node/Express, Django or Laravel?
SPA:
- You have several different products that all interact with the same backend (Web app, desktop app, android app, iphone app, (lol) windows phone app, etc)
- You want the frontend to be available offline
- You want to minimize server load (Serve up static files from a CDN, your backend only has to worry about passing JSON objects around
Old-school server-rendered app (not necessarily MVC)
- You need to support older browsers that don't know how to handle all those flexboxes and arrow functions the kids are using these days
- You need to support mobile browsers that don't quite have enough horsepower to handle javascript-heavy SPAs.
- Your clients don't want to run any javascript code (i.e. you're running an onion site or your users are neckbeard freetards (usually go hand in hand))
- You don't want to write 2+ entirely different applications just so people can look at your blog or whatever.
>>
>>60143552

>So YAML, HAML, what else is there? Just so I can get an overview

Nah, YAML is a markup language, more like JSON or XML. It's a way to structure text.

HAML is a template language.
>>
>>60143750

>For everything hard for noobs there's always someone willing to make a baby alternative.

I think you somehow misunderstood a few things..

YAML is a superset of JSON, HAML is a template engine language where you can embed something like Ruby in HTML. And your other examples are stupid as well.

Also "nano for vi", what the fuck?
They are completely different, it's like saying "babys use cars, real men use a ship". You can't compare those two.
>>
>>60143947
Auto for stick, out k ow where I'm going here.
>>
>>60143825

Thanks a lot for the explanation.

I guess I'll start with building something with Vue for fun and see if I can use it in the future..
>>
>>60144018

Are you on your mobile?
>>
>>60143606
Isn't socket.io for node backend only?
If not, how is it better than plain ws ?

>>60143316
I don't know about react or Ang.
I like Vue, it's easy and quick to get into it and make JS front dev less painful.
>>
>>60143316
>Where would you use a SPA and where would you use a classical MVC framework like Node/Express, Django or Laravel?
The two categories aren't really mutually exclusive. Frameworks like Express, Django, Laravel, etc. can all be used to power the backend of an SPA. You aren't forced to render HTML with them. They're all capable of spitting out JSON for React, Angular, Vue, etc., to deal with
>>
Is there anything like React Native for vue or other Javascript frontend frameworks? If not, are there any cross mobile platform technologies that don't completely suck that aren't React Native? I don't want to ship a wrapper around a website as an app, but I don't think I can dedicate time to multiple native codebases -and- a web app for desktop browsers
>>
Can anyone post admin/control panel design inspo? I'd like to spruce up something I'm working on. Basic bootstrap stuff looks tidy but its boring and you can't really base a brand around it
>>
>>60140650
github sites
>>
>>60139916
what ci server are you using senpai
>>
>>60144801
>Isn't socket.io for node backend only?
No, there's a server lib and a client lib. There are also some serverside implementations other languages (swift, cpp, java), but nobody uses those.

>If not, how is it better than plain ws ?
It has some additional features like auto-reconnection and fallback to long-polling.

>>60144962
There's nothing else quite like React Native at the moment. Weex for Vue looks promising, but last I heard it wasn't quite mature enough yet. There's also nativescript, but that's even less mature than weex and mostly aimed at angular.

Hybrid apps (a la Cordova) work pretty well for the most part. You obviously aren't going to be able to run a massively complicated 3d game or something with it, but then again if you're trying to do that you shouldn't be using javascript in the first place. For normal usage with a typical crud app it's fine.

Ionic is a hybrid app platform based on Cordova specifically for Angular, so if you're an Angular kind of guy, there's that. Personally I think it's just too much of a clusterfuck with all the constant breaking changes to the api and retarded version numbering.
>>
>>60145167
That's for static files only. You can't run a Django app on it.
>>
>>60145236
>Hybrid apps (a la Cordova) work pretty well for the most part
Do they? Would you say they've improved since say ~3 years ago? Maybe I have a bad taste in my mouth from shitty movie ticket ordering "hybrid" apps on Android
>>
>>60145200
gitlab on my own server.
>>
>>60145254
Ah i misread, azure?
>>
What is Flash of Unstyled Content caused by?

I don't think I've ever seen it on any site I've developed. Is it only caused by not having your CSS links in your head?

Is the only way to fix it to do a document.ready check?
>>
How do I send this request?
>>
Say I have a PHP/Python/Javascript/whatever your scripting language of choice is with a SQLite database running on my local machine with average specs. What kind of response times should I be expecting per page load assuming I didn't write completely crap code? I'm getting like 30ms on average and I'm worried that its a bit on the high side considering I'm the only user
>>
>>60145332
There are hundreds of different ways you could do that. A jquery ajax method, XMLHttpRequest, Curl, a library in your language of choice, a browser extension, etc.
>>
Going for a Javascript interview, apparently will require a written test. What type of questions should I expect? Fizzbuzz? Comp sci stuff? Concept questions?
>>
File: 1462904526992.jpg (197KB, 1000x1000px) Image search: [Google]
1462904526992.jpg
197KB, 1000x1000px
>>60120346
just look through their code man
https://github.com/ReactTraining/react-router/tree/master/packages/react-router-website
>>
>>60145374

Probably XMLHttpRequest... I Can't figure out how to do this, usually I just get a blank response
>>
>>60145293
Do they have a free tier? I know AWS has the free trial, but once that expires, it can get kind of pricey. I'm currently wagecucking as a forklift driver for $9/hr until I can get into the industry so I don't exactly have money to burn.

I've been looking at some cheap used servers on ebay recently though. If I can get a good deal on one, I may just self-host my stuff on that.
>>
>>60145437
>https://actions.sumofus.org/api/pages/featured.json
navigating to it directly works so it doesn't seem to require anything special
it has "api" in the url, maybe there's an api reference somewhere you should be looking at
>>
>>60145478
Yeah, free tier is a bunch of webapps and 1db sql servers.

I don't think those expire ever.
>>
>>60145332
try the "edit and resend" button

>>60145343
30 ms/req is fine
>>
>>60145312
>Is it only caused by not having your CSS links in your head?
Sort of. It's caused by the browser rendering the html before it gets the css to render. That could happen because of the <link> being at the bottom, or because it's getting the css from a slow CDN.

>Is the only way to fix it to do a document.ready check?
Generally speaking if your css is hosted locally and you put the links in the head it should be fine. document.ready is more to tell your scripts when the DOM is finished loading so they don't try to modify nodes that don't exist yet.

>>60145343
30ms sounds fine. Consider that you might be running the app in some sort of debug mode and/or using a dev server rather than a full production web server (i.e. for django, having DEBUG = TRUE in the settings and using ./manage.py runserver)
Really, the only way to be sure is to do a load test to see how it handles a lot of concurrent requests.
>>
>>60143316
Definitely check out Aurelia. So fast and easy, and most of all, I had fun learning it.
>>
>>60145486

>it has "api" in the url, maybe there's an api reference somewhere you should be looking at

the API doesn't have any reference it's just part of the architecture of the website

Perhaps I'm supposed to submit a post request with "language=en"?
>>
>>60145653
So, a link doesn't cause the HTML parser to stop parsing and only move forward until it's totally finished with the link, in the way that a script tag would?
>>
>>60145730
your screenshot shows it's a get request to https://actions.sumofus.org/api/pages/featured.json?language=en

i think you're just fucking up your xmlhttprequest somehow
>>
>>60145420
When I interview candidates, I usually ask if they know what a Fizzbuzz is. If they do, then they know how to write it out, so that's not a good test. I always have a couple backup questions to go with as well.
The point is to see how they think and approach a problem, I don't care about the answer. If they approach a problem nicely, they can probably apply that to any problem in the future and are a good hire.
>>
Are there people in here that actual have one of the work from home jobs?
>>
>>60145420
answer every question with "I would use jQuery for that."
>>
>>60139749
My favorite thing to do to typescript devs is to hand them some of the compiled JavaScript and ask them what it's doing. They can never tell me how prototype inheritance works.

Typescript is for idiots, plain and simple
>>
>>60145730
you can't make ajax calls to different servers unless the server explicitly states you are allowed to do that.
sumofus.org does not do that.

see https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS
>>
>>60127253
But muh JSX
>>
>>60145762


var xhr = new XMLHttpRequest();
var url = "http://www.actions.sumofus.org/api/pages/featured.json?language=en";
xhr.onreadystatechange = function() {
console.log("XMLHttpRequest update:");
console.log("Response Text: ");
console.log(this.responseText);
console.log("This: ");
console.log(this);
};
xhr.open("GET", url);
xhr.send();


gives me

+-MAIN.JS-+

XMLHttpRequest update:
Response Text:
<nothing>
This:
XMLHttpRequest { onreadystatechange: xhr.onreadystatechange(), readyState: 1, timeout: 0, withCredentials: false, upload: XMLHttpRequestUpload, responseURL: "", status: 0, statusText: "", responseType: "", response: "" }
XMLHttpRequest update:
Response Text:
<nothing>
This:
XMLHttpRequest { onreadystatechange: xhr.onreadystatechange(), readyState: 4, timeout: 0, withCredentials: false, upload: XMLHttpRequestUpload, responseURL: "", status: 0, statusText: "", responseType: "", response: "" }
>>
>>60145832
that's ridiculous. thats like asking a C programer to explain the assembly. prototypical inheritance is incomprehensible to people not using javascript because prototypical inheritance is incomprehensible to people with undamaged minds
>>
>>60145886

It's a webExtensions add-on I'm using so it's allowed to break same-origin poo-licy I thought
>>
Help me out hombres.

I created a react app with hashrouting that uses express api. Developing was nice and dandy with proxy server but now I'm having trouble with creating a build.

So I need to serve all routes to reacts index.html but some of my api resources has same names. What would be the best approach for this?
>>
>>60145832
i agree that typescript feels non-javascripty sometimes with classical-like oop features tacked on for people who refuse to learn javascript

>>60145909
does furryfox have a network inspector
>>
>>60145972

It has every debugging tool chrome has
>>
>>60145909
>www.actions.sumofus.org
the url is without www.

>>60145944
why did you leave out that detail in the first place?
add the url to your manifest.json
https://developer.mozilla.org/en-US/Add-ons/WebExtensions/Content_scripts#Cross-domain_privileges
>>
>>60145993
then use them
>>
>>60145750
No, modern browsers use multiple threads to download and parse external resources concurrently.
See this for details:
http://stackoverflow.com/questions/9271276/is-the-recommendation-to-include-css-before-javascript-invalid#9272730

Also, you can add the defer attribute to script tags to make them wait until the dom is finished loading to execute.
>>
In django i have a form made in html, and when it returns to the view after a post action, i have a piece of code that determines whether some fields were left blank. So, I have a bug which I narrowed down to these lines. Assuming that the dictionary attribute context is already designed elsewhere, this code works:

error = { 'error_message' : 'Please fill in all fields!' }
context.update(error)
return render(request, 'my_important_form.html', context)


and this second does NOT work

error = { 'error_message' : 'Please fill in all fields!' }
return render(request, 'my_important_form.html', context.update(error))


it throws this error:

Reverse for 'grade_edit' with arguments '('',)' not found. 1 pattern(s) tried: ['/(?P<id>[0-9]+)/$']

Why?
>>
I'm in the middle of making a website for some friends, when another old friend of mine approaches me about a job.

I'm literally just hacking totally static bootstrap stuff together, and pulling a decent hourly wage..
I don't even "know" html or css.

Anyone else get sort of sucked into this kind of work? Advice on how not to drown?
>>
>>60146637
I'm not a django expert, but does context.update() return the updated context? If not, your third argument to render() isn't what it should be.
>>
>>60146950
oh god damn, that's it. yes, you're right, context.update(error) does not return a dictionary, it returns None. Thanks anon!!!
>>
Why on earth is relative URLs in the :root and html selectors relative to the .html and not the .css file in chrome?
On firefox they are relative to the sheet as it should be.
Am I crazy or whats going on?
>>
>>60120007
That's often an issue with these kinds of things. Your only hope is that you're gonna save enough time in the future to justify the investment. If your project is ready (or close to) you won't have enough future updates to justify it.
>>
>>60120487
Happens to the best of us bro.
>>
>>60146833
A ton of people. The only advice I can give you is READ. When you find code that can do what you want (eg answer on stack overflow) always read the whole thing. Don't just copy and paste shit. Read what it's doing and why, even though you might not understand it.
>>
>>60145832
Ridiculous. Better tools are better tools. Move with the times. If something helps you do your job better why even think about it.
>>
>>60147106
Why not just always write relative to root? That would be simplest.
>>
>>60147288
The file needs to be able to be run locally. Then root become C:/ for example.
>>
>>60147353
locally as in file:// locally? Don't do that, just run a web server and serve up over localhost.
>>
>>60147353
Oh god no. I thought you meant root of site.
>>
Is there a simple way to apply some CSS to a page that forces it to be centered and have a margin in Javascript?
>>
>>60147885
Wrap the inner element with a margin on it?
>>
>>60147919

I want an automated way to do this to every element on a page

It has to work for a lot of different pages (not rely on a specific element)
>>
Can someone explain the purpose of Kotlin?

Why did Jetbrains randomly create some language that they're now trying their hardest to shill?
>>
>>60147885
document.body.style = "text-align: center; margin: 0 20px;"

newfag
>>
>>60148037
to make money obviously
>>
Can someone give me a proper use case of Prototypes in Javascript?
>>
>>60147515
>>60147552
>>60147106
Have to do it file:// way, but thats irrelevant.

I have found that it is during the css variable stage it is parsed differently between the browsers.

html (or :root) {
--ex: url(img.png);
}
div {
background: var(--ex);
}

In the above example, firefox DOM looks for img.png in the same folder as the .css file while chrome DOM looks for img.png in the same folder as the .html file.
>>
>>60148154
but why would I ever use it
>>
File: 3N0WPfx.gif (172KB, 800x336px) Image search: [Google]
3N0WPfx.gif
172KB, 800x336px
I could really use some help here, I'm complelty stuck. Really don't know what I'm doing wrong.

So, I'm trying upload an image to a server, while sending some information to my database. But I can't seem to be able to send the data to my database. The image uploads to the server, but the data won't upload to my database. In addition, I can't seem to find a way to send the current date to my database.

I won't post the whole php code, but here's the gist of it:
 
<?php

@$registrerBildeKnapp=$_POST ["registrerBildeKnapp"];
if ($registrerBildeKnapp) {

$bildenr=$_POST ["bildenr"];
$opplastningsdato=date("Y-m-d");
$beskrivelse=$_POST ["beskrivelse"];

include("db-tilkobling.php");
$sqlSetning="SELECT * FROM bilde WHERE bildenr='$bildenr';";
$sqlResultat=mysqli_query($db,$sqlSetning) or die ("not able to get data from database");
$antallRader=mysqli_num_rows($sqlResultat);

if ($antallRader!=0) {
print ("Image already registered");
}
else {
move_uploaded_file($tmpnavn,$nyttnavn) or die ("not able to upload file");

$sqlsetning="INSERT INTO bilde (bildenr,opplastningsdato,filnavn,beskrivelse) VALUES ('$bildenr' , '$opplastningsdato' , '$filnavn' , '$beskrivelse');";

print ("The following image is now uploaded:<br/> bildenr: $bildenr <br/> opplastnings dato: $opplastningsdato <br> filnavn: $filnavn <br/> beskrivelse: $beskrivelse <br/> <br/>");

}
?>


That's not all of it, but the gist of it. I'm not sure what I'm doing wrong, but I think it has something to do with the datte format. The image uploads to it's server, but the data isn't sent to the database.

Any idea what I'm doing wrong?
>>
I'm total noob. Can somebody explain to me how this works?

HTML:

<input type="submit" onclick="clicked(event)" />

Javascript:

<script>
function clicked(e)
{
if(!confirm('Are you sure?'))e.preventDefault();
}
</script>

Source: http://stackoverflow.com/questions/16849117/html-how-to-do-a-confirmation-popup-to-a-submit-button-and-then-send-the-reque

My question is. is the "e" representation of the input tag or the mouse click event on the input tag? Therefore if the confirm dialog is true then proceed with realizing the click event on the submit button, otherwise, act as is submit button was never clicked on?
>>
>>60150338
e represents the event (people usually use e = event, but you could've named it whatever you wanted)

prevent default consumes the click event so it acts as if the user has never clicked the button, otherwise the form gets submitted like normal
>>
>>60150400
then I've figured it correct. thanks anon, really appreciate your help
>>
>>60149767
nvm, got it, forgot a mysqli_query
>>
>>60131814
you could handle it with enough horizontal scaling
>>
>>60135426
learn scheme before js
>>
>>60135590
just makes your site easier to parse for facebook
>>
>>60136310
react isn't the problem, material ui is. I ran into this too. ended up reimplementing the components i needed to the same interface.
>>
>>60138026
First, I'd question why you need to change the ID? it's an ID. seems like an antipattern
>>
>>60139889
config in environment variables + git branches
>>
What can React achieve that no other framework can?
>>
>>60149767
For the mother of god use prepared statements for user input.
>>
>>60150908
Prevent you from developing a better Facebook.
>>
>>60145832
After many years of coding js, you stop using shit like inheritance and use composition instead. Good javascript/typescript devs don't even use classes, just interfaces, generics and functions.
>>
Why am I so autistic with micro optimizations? I feel like my site is slow once I hit over 10ms render time.
>>
>>60118493
hi I'm starting a web dev internship tomorrow and the company uses angularjs any good guides / cheatsheets? looking for good resources in general, anything helps, thanks a lot
>>
>>60151246
if it's angular kill yourself. If it's angular2 only slit your wrists.
>>
>>60151246
>>60151272
The angular docs are pure shit, I have yet to find any good guides except for sifting through numerous scotch.io assholes
>>
JS frameworks were a mistake.
SPAS were a mistake.
JS was a mistake.
>>
>>60151309
computers were a mistake
>>
>>60151309
use typescript you filthy pleb
>>
>>60151420
>too stupid to learn javascript
>>
>>60151428
I know how to use JS, but the advice was given to the shitmeister saying JS was a mistake
>>
Anyone here have experience using SourceVoid as a hosting service? I'm looking at them cause they're one of the only ones that support a huge list of languages and are fully managed.
>>
>>60151420
>>60151428
>>60151503
I know js too, that's why i said it was a mistake.
>>
>Just now learning Javascript now that I have a solid foundation of HTML and CSS (CSS3 really fucking interests me and I can't wait to make some awesome shit in it but I can't keep putting off learning JS because JS would make my CSS even better)

Anyways learning about strings..variables.. literally only done a few things in the Chrome console. I have a few resources (an online course, the Jon Duckett Javascript & Jquery book and Youtube videos).

But this shit looks.. intimidating. Please tell me anons that you don't have to be a mathematician or wizard to learn javascript and that it isn't as intimidating as it looks
>>
File: 1484817389376.jpg (57KB, 596x601px) Image search: [Google]
1484817389376.jpg
57KB, 596x601px
>>60152505
like with anything, mastering is hard, but the entrance to javascript is very friendly

you only have to be a mathematician if you want to do mathematics

debugging with the console is easy aswell and if you get stuck on an error you can just google the problem and you should get an infinite amount of stackoverflow posts dealing with your problem
>>
File: bullshit.png (9KB, 541x240px) Image search: [Google]
bullshit.png
9KB, 541x240px
ok. why does this happen.
never mind id's
<div class="withdrawals">
<h1>Make a Deposit to this account</h1>
<p class="current-money">You have This much money in your account: </p>
<p id="money"></p>
<br><br>
<input type="number" id="userinputdeposit">
<button onclick="myFunction()">Deposit</button>
</div>

<script type="text/javascript">
var x = 5000
function myFunction(){
x += document.getElementById("userinputdeposit").value;
document.getElementById("money").innerHTML = x);
}
document.getElementById("money").innerHTML = x;
</script>


The "-=" version of this code works as it should.
>>
>>60153206
When you add
document.getElementById("userinputdeposit").value


put it in a parseInt()

right now it's taking var x = 5000
and appends a string instead of an int
just something javascript does if you're not being careful
>>
File: 1462995828285.png (324KB, 472x408px) Image search: [Google]
1462995828285.png
324KB, 472x408px
What does /wdg/ think of CUBA Studio?
>>
if facebook could magically and instantly rewrite their PHP code to node.js, would it run faster?
>>
<div id="portfolio-header">
<h2 class="post-title">St. Catherine of Sweden</h2>
<p><strong>Client:</strong> St. Catherine of Sweden Parish<br />
<strong>Location:</strong> Wildwood, Pennsylvania<br />
<strong>Size:</strong> 28,300 SF</p>
</div>


How do I access "Wildwood, Pennsylvania" with CSS identifiers?
>>
>>60156657
You can't.
>>
hey i just installed imagus for chrome and i'm wondering if there is some css i could use to make it so any image im hovering over is enlarged in the top right corner. I don't like how images move with my mouse and would prefer if they were just in the top right.
>>
where do i start learning laravel? almost all tutorials on udemy is outdated or recommend me a good laravel book
>>
>>60156657
Put in a span tag
>>
Hey guys I might need some advice, I'm trying to achieve the following:

I have 3 'client' servers, 1 'host' server. Periodically, the client servers need to send a HTTP request to the host server with some info.
Thing is, this needs to be secure: both the client and the server must be identified/authenticated (info from a fake client must be rejected, clients must never send readable info to a fake server).

Now, I could just generate an RSA keypair on each server, exchange public keys and encrypt each message with the client's private and server's public key. Is this the way to go?
My current scheme would be something like:
encryption:
Kc: client's private key
Kh: hosts' private key
Pc: client's public key
Ph: hosts' public key

Sending:
base64(payload+time+nonce) => RSA(Kc) => RSA(Ph) => C

Send C, nonce over HTTPS

Receiving:
C => RSA(Kh) => RSA(Pc) => unbase64(...) => 'hello' + payload + time + nonce

The message will be rejected if the nonces don't match.

I feel like there must be a better way.
Worth mentioning that the host server has an SSL cert (of which I have the private key ofc), so maybe there's a scheme to use that? I'm not really a crypto expert

>>60156793
laracasts
>>
>>60156986
Ignore the 'hello' btw
>>
>>60156986
Yes.
>>
If you don't have HTML fallback for when your javashit code breaks then your website is plain trash.
>>
>>60156986
dont you have to pay for that?
>>
>>60157049
JavaScript code doesn't break.
>>
>>60157049
I can't make a GIS viewer with plain html.
>>
>>60157091
When I disable it does.
>>
>>60157115
>car breaks when I remove the screws

Whoop-di-fucking-do.
>>
File: meme.jpg (111KB, 448x700px) Image search: [Google]
meme.jpg
111KB, 448x700px
>>60157049
>>60157115
>if your site doesn't work when i go out of my way to disable a feature it uses it's trash
>>
>>60157152
Everything javashit can do should be simplified to HTML. It doesn't have to look pretty or be snappy but it should still work. No user wants to see a blank canvas when your javashit bloat rolls over and there's nothing to fallback on.

>>60157139
Irrelevant comparisons are not arguments.
>>
>>60157022
Yes that's the right way or yes there's an easier way?
>>
Is there something like The Odin Project, just concentrated on Python and Django?
>>
>>60157453
also curious about this
>>
Why is HTTPS Everywhere still more popular than Smart HTTPS (Revived)? The latter is more effective and faster, and it's future proof (web extension, FF 57+). HTTPS Everywhere uses a whitelist, so it's slower and misses sites like DeviantArt and Nexus Mods. However, Smart HTTPS (Revived) does not exist on mobile.
>>
>>60156342
Looks like old graph because PHP7 surpassed HHVM.
>>
File: 829479384792.png (16KB, 643x337px) Image search: [Google]
829479384792.png
16KB, 643x337px
>>60156342
>>
>>60158623
Go is fastest if u use fasthttp library
>>
>>60156342
No, but would mean fewer servers would be needed to carry the same load
Thread posts: 314
Thread images: 26


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