[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: 319
Thread images: 31

File: 1493417856113.jpg (84KB, 445x629px) Image search: [Google]
1493417856113.jpg
84KB, 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
>>
File: django-unchained.jpg (596KB, 864x1281px) Image search: [Google]
django-unchained.jpg
596KB, 864x1281px
>>60208065
First for Django
>>
how do I bind my svg's in my doc to pieces of d3 data so I can
target them seperately with click events?
>>
File: 2017-05-04-153224_502x328_scrot.png (152KB, 502x328px) Image search: [Google]
2017-05-04-153224_502x328_scrot.png
152KB, 502x328px
how do i achieve this
tyvm
>>
$attempt = new Attempt();

then goes into my Vue
vue passes it back
$attempt = $request->attempt;

then I try to modify it like $attempt->body = 'x';
and error
Attempt to assign property of non-object

so how do I pass an unsaved thingy between functions in Laravel?
>>
>>60209184
and to add
this is what $attempt is but still throws the error
Object { task_id: 9, session_id: 55, task: Object, session: Object }

and the $request is working properly and all
i dun get it
>>
I have a bunch of small flask web services that will be all served under the same domain.

Is it better to make a single flask app or somehow use a reverse proxy? The second option seems better to me (and more practical), but I'm not sure how to set up something like nginx to do it.
>>
>>60209184
Wtf is attempt?
>>
>>60209653
it's a self-made model
>>
>>60209659
I suspect you are misunderstanding basics but it's hard to say without seeing code.
>>
>>60209727
I suspect so too
 public function attemptStart(Request $request)
{
$attempt = new Attempt();
$attempt->task()
->associate(Task::find($request->task));

$attempt->session()
->associate(Session::find($request->session));

$attempt->count = 55;
$attempt->body = '[';
$attempt->correct = false;

return response(['thing'=>$attempt],200);
}


public function attempt(Request $request)
{
try{
$attempt = $request->all();

// $attempt->count = 11;
$attempt->body = '11';
// $attempt->correct = false;
// $attempt->moi = 'moi';
// $attempt->body = $request->body;
// $attempt->correct = $request->correct;
// $attempt->count = $request->count;
// $attempt->fill($request->except('attempt'));

// $attempt->save();
}
catch(\Exception $e){
return response(['dbAnswer'=>$attempt],200);
}
return response(['dbAnswer'=>'$e->getMessage()'],200);


how should I do the attempt function? how do I complete the Attempt I 'new'd in attemptStart?
>>
>>60209584
if you had separate services running under the same path you could proxy the request by using something like:

 
listen ROUTE_NAME {
proxy_pass local_flask_route/command
}


hopefully that worked, otherwise using one flask app and multiple routes is much simpler/easier since you can just expose flask to 0.0.0.0 and proxy to the port from nginx for all routes. Or if you're in AWS land just use lambda and API gateway.
>>
>1GB file
>sublime text uses 3.7GB of ram

i wonder what kind of representation text editors use

>>60209762
thanks!
>>
>>60209751
here's the vue part

axios.post('/attempt/start', {
task: this.tasks[this.current].id,
session: this.sessionid
})
.then(response => {
this.attempt = response.data.thing;
console.log('rd ', response.data);
console.log('ta ', this.attempt.count);
})
.catch(error => console.error('attempt create err: ', error));


and
//register the attempt
axios.post('/attempt',
{
body: answer, correct: wasCorrect, count: this.tries,
attempt: this.attempt,
})
.then(response => console.log('attempt', response.data.dbAnswer))
.catch(error => console.error('attempt: ',error));

the latter fucks up.
some of this is obviously just for debugging
>>
>>60209751
Pretty sure request doesn't give you back model but generic representation of data.
>>
>>60209821
then how do I turn it into that model? I need the created_at timestamp there.
Is there a way? theres no model(continue) or something?
>>
>>60209835
RTFM? Seriously finding that kind of info is part of developing and you should be able to do it.
>>
>>60209997
just a no will do next time ty
>>
File: 76421764.jpg (36KB, 400x300px) Image search: [Google]
76421764.jpg
36KB, 400x300px
>tfw too lazy to setup LAMP so I can learn PHP
>tfw Django looks like a cluster fuck

Any good flask tutorial?
>>
>>60210022
yes. http://flask.pocoo.org/
learning from there right now
>>
>>60210022
just use xampp for linux
>>
UI/UX designer here. I'm tired of being a wageslave so I'm planing to learn iOS programming and get self-employed by building my own apps/games. I have all the background I need to bring good apps to the market that have a good usability and a modern design.

Anyone doing something like this? Is it worth? From what I read it takes years to master a programming language. I have some basic skills though, for example I did some coding in framer.js (coffee script).
>>
What is the best paid learning resource on line for PHP?
Has anyone tried Lynda.com?

Basically I am able to has my work to get them to pay for a few courses online and other things, so am looking at my options.

Also has anyone bought code online just to look at how they are doing something and then adapting it for a different use? I'm really tempted as it's difficult to work out what professional code looks like while trying to teach yourself for free online.
>>
Are models and views even efficient?

It seems requesting a fuckton of joined data in a view then selecting just what you want in the model is a giant waste of resources.

Maybe it's just how my company uses them. For some reason it's ok to join 15 tables in a view then use only 5 columns from it.

It seems like the better option would be to get exactly what you need with a custom query in the model.

Am I thinking about this all wrong?
>>
>>60210287
I would go with vendors like Zend - it's at least recognizable
>>
Best and easiest way to password protect a page?
>>
>>60210398
If you have just a few users the easiest is probably .htaccess Auth
>>
File: 1493214407316.jpg (97KB, 768x1024px) Image search: [Google]
1493214407316.jpg
97KB, 768x1024px
>>60210424
cheers senpai
>>
>>60210347
Thanks buddy, I'll look into it.
>>
>every single XML prettifier online doesn't accept malformed XML

why
>>
How do i get download link for youtube video?
I need that for my script
>>
File: Untitled.png (3KB, 391x141px) Image search: [Google]
Untitled.png
3KB, 391x141px
  <script type="text/javascript">
function refill1() {
var a = document.getElementById("1");
if(a.getAttribute("fill")=="red"){
a.setAttribute("fill","blue");
}else{
a.setAttribute("fill", "red");
}
}
function refill2() {
var a = document.getElementById("2");
if(a.getAttribute("fill")=="red"){
a.setAttribute("fill","blue");
}else{
a.setAttribute("fill", "red");
}
}
function refill3() {
var a = document.getElementById("3");
if(a.getAttribute("fill")=="red"){
a.setAttribute("fill","blue");
}else{
a.setAttribute("fill", "red");
}
}
var el = document.getElementById("1");
el.addEventListener("click", refill1, false);
var el = document.getElementById("2");
el.addEventListener("click", refill2, false);
var el = document.getElementById("3");
el.addEventListener("click", refill3, false);
</script>


I'm obviously reusing the code like an idiot not sure how functions or callback functions would work for this situation
>>
>>60210322
Model-View design is only efficient, if the model is kept in memory. Yes, they are doing it wrong.
>>
Haha you guys aren't real computers lol learn to technology losers haha
>>
>>60210643
I would use youtube-dl for the task. Why? You don't have to reinvent the wheel and it's regularly updated You can use a wrapper or do the calls yourself.
>>
>>60210685
Just a stupid question. If I understand the structure of this code and how it works, is it a good sign? Am I doing good in learning programming?
>>
>>60210760
eh i guess its a good sign if your just starting out, it's very basic atm it's just changing the color of a circle every time you click.

trying to stop repeating the code so when I have hundreds of elements i wont have to write all the function calls for each ID manually
>>
>>60210685
  <script type="text/javascript">
function refill() {
if(this.getAttribute("fill")=="red"){
this.setAttribute("fill","blue");
}else{
this.setAttribute("fill", "red");
}
}
var el = document.getElementsByTagName("circle");
el[0].addEventListener("click", refill, false);
el[1].addEventListener("click", refill, false);
el[2].addEventListener("click", refill, false);
</script>

shortened it down but still repeating the el[i] tried using a for loop to use the event listener for each child circle of the svg element but it wouldn't work
>>
File: 1490138359001.png (189KB, 600x429px) Image search: [Google]
1490138359001.png
189KB, 600x429px
>mysql update fucks up page by setting strict mode on
>need to change one line via ssh to fix
>root login with public key authentication required
>guy who built my page has the key but doesn't answer me
How fucked am I?
Please tell me that there's another way
>>
>>60210927
>root login
if you set that server too, it is probably hackable too
>>
>>60210856
>>60210685
this works
  <svg id="shapes" width="340" height="600">
<circle id="1" cx="50" cy="50" r="50" fill="red" />
<circle id="2" cx="170" cy="50" r="50" fill="red" />
<circle id="3" cx="290" cy="50" r="50" fill="red" />
</svg>

<script type="text/javascript">
var theParent = document.querySelector("#shapes");
theParent.addEventListener("click", refill, false);
function refill(e) {
var el = e.target;
if(el.getAttribute("fill")=="red"){
el.setAttribute("fill","blue");
}else{
el.setAttribute("fill", "red");
}
e.stopPropagation();
}
</script>
>>
File: me.jpg (72KB, 1280x720px) Image search: [Google]
me.jpg
72KB, 1280x720px
>want to use the typescript playground page to quickly test something
>search for "ts playground"
>>
why is the join method on strings and not on arrays in python? seems weird

>>60211196
lol
>>
>>60211196
should've look for "sandbox"
>>
>>60211020
well yea the account of the webprovider is mine
its just the rootlogin of the ssh that I need to get.
>hacking
I hope don't need to spend weeks for this
>>
>>60211437
Just ask your webhoster if they can reset the root password
>>
>>60211516
that's a good tip, thank you for that
>>
File: botnet.png (31KB, 1091x593px) Image search: [Google]
botnet.png
31KB, 1091x593px
MySQL keeps updating out of the blue almost every day taking the screen like this wtf
>>
what is wrong with this anons:
        shell_exec('youtube-dl -o \"'.$this->path.'%(title)s-%(id)s.%(ext)s\" '.$this->url);



error:
sh: -c: line 0: syntax error near unexpected token `('
>>
>>60211226
So that it can't be misused or its function misinterpreted. It will always produce a string.
>>
>>60211916
A lot of shit. Look up how shell_exec() works and how to properly escape and use arguments.
>>
>>60212003
i used it many times in this way, just with ffmpeg
>>
>>60211916
If you use single quotes you don't need to escape double quotes
>>
>>60212062
i tried different ways but i always get same error
        shell_exec("youtube-dl -o \'".$this->path."%(title)s-%(id)s.%(ext)s\' ".$this->url);

error
sh: -c: line 0: syntax error near unexpected token `('
>>
>>60211906
does the same thing to me, once a day or so I think. Should we be worried?
>>
>>60212176
You did exactly the same thing as before but changing single and double quotes kek

try this:

shell_exec('youtube-dl -o "'.$this->path.'%(title)s-%(id)s.%(ext)s" '.$this->url);
>>
>>60212242
i got it already, i left "/", after deleting it it works
>>
is there a such thing as freelance sysadmin that works from home? I mean could I get freelance work maintaining servers from my bedroom?
>>
File: 1493079489516.jpg (67KB, 1024x962px) Image search: [Google]
1493079489516.jpg
67KB, 1024x962px
>start project that should take 20 minutes at most
>takes five hours
>>
File: 1491315699523.jpg (56KB, 720x644px) Image search: [Google]
1491315699523.jpg
56KB, 720x644px
>>60212395
As long as you learned something worth the time
>>
What's the fastest way to shit out single page static website? Like, a landing page for a single product. Wordpress?
>>
File: aoaow.jpg (117KB, 1098x598px) Image search: [Google]
aoaow.jpg
117KB, 1098x598px
>>60212541
Probably buying a landing page theme with a builder.
>>
>>60212613
not him but what sites do I look for shit like this?
>>
Does anybody know of very stable language/framework suitable for very low maintenance. I'm sick of PHP pajeets changing APIs with releases that then break my application, which I don't have time to fix. Is C with cgi or fastcgi a good choice?
>inb4 django
Only 3 years of support with LTS release. I'm looking for 5+ years.
Page gets 1-2 visitors per day, just simple image gallery with content stored in database and gets updated regularly.
>>
>>60212681
This is from themeforest which I used quite a lot. There's also templatemonster
>>
##this is all inside a for-loop:
article = {"url": url, "score": score, "country": 0, "length": length_article} #dict

add_Article(db_article) #call funct
##end of loop

def add_Article( a): #def funct
p = Article.objects.get_or_create()[0]
p.urlId = a['url']
p.feels = a['score']
p.date = time.strftime("%c")
p.length = a['length']
p.save()
return p




Using django, I have a list of dicts, from where I take said dicts one at a time, populate them and then try to save them to my database with the save() funct. It all goes alright, except for the save part: the only dict saved is the very last one. Any help pls?
>>
>>60212830
Is article and db_article the same?
Did you try calling add_Article twice in a row with different dicts?
>>
i am considering to pay for a video tutorial series at udemy so i can learn node.js properly. cost almost nothing and looks like it covers everything a beginner needs to know.
thoughts?
>>
>>60212861
>Is article and db_article the same?
yeah, they are the same, just messed it up when pasting it onto the code box here.

so I found part of the problem: the [0] index (I think) makes it overwrite everything onto the same slot in the database (always the first slot). I have checked and as I run the script the dicts are being written one on top of each other, and at the end only the last one is left, of course. So I need to get rid of that [0] in the add_Article def, but if I just delete it, there's an error. Ideas?
>>
>>60212915
https://btdig.com/search?order=0&q=node+js
>>
>>60212922
It's a long time since I worked with django but you could try this:

p, _ = Article.objects.get_or_create(
urlId = a['url'],
feels = a['score'],
date = time.strftime("%c"),
length = a['length']
)
p.save() # no idea if you need save
return p

>>
>>60213022
nah, that won't even run, but thanks anyways
>>
>>60213076
Did you fix the indentations so it works with your code? It's pretty much what the doc says:

https://docs.djangoproject.com/en/dev/ref/models/querysets/#get-or-create
>>
>>60213128
alright, I'll take a break and give it a shot. Burnt out already from dealing with a lot of previous shit to get to this point. thanks again, I'll read the docs carefully this time.
>>
File: 1491627860758.png (16KB, 237x224px) Image search: [Google]
1491627860758.png
16KB, 237x224px
>>60213165
>>
File: front-end-vs-back-end.png (83KB, 1155x880px) Image search: [Google]
front-end-vs-back-end.png
83KB, 1155x880px
is this true?
>>
>>60213402

idk i look exactly like the guy on the left and im full stack

get at me
>>
Did anything noteworthy happen after the Opera what was it, 12.15? source code was leaked?
>>
>>60213501
i have not extensively researched the topic but i haven't heard of anything

it's probably super illegal to use the leaked code and there are better alternatives that won't get you sued to hell
>>
>>60213581
Well damn, that's a shame. I suppose it isn't anything worth getting sued over though. Thank you.
>>
>>60212935
fuck that crap. i paid just now
>>
>>60210287
Swift developer here. Used to be into php and laravel, if I were you I'd check out laracasts.com
>>
>>60213402
uhh, no. If anything it's the opposite. Front end is stacked with young guys, back is olds
>>
>>60208065
Anyone has a copy of From Newbie to Ninja with Node js?
>>
Is it possible to do Web deving entirely using Wincuck
>>
>>60214444
That title is everything wrong with webdev
Let me guess, some '''''code artisan''''' wrote it? Fuck
>>
>>60213199
yeah, alright, now it's working, thanks dude. I'm following another book, and trying to adapt the book's example to the project I want to do. Guess I fucked up somewhere in the process.
>>
>>60214509
I really don't care about code artisans or people in general I just want to learn.
>>
How do i remove that white border color?
https://jsfiddle.net/2uygL2v5/
>>
>>60214630
border: none;
>>
>>60214683
>border: none;
ty
>>
What's the simplest php engine out there? I am tired of pure html
>>
Just got off a phone interview for my first webdev job (was a network engineer prior), they liked the tech I used and liked my apps but obviously were concerned that I hadn't worked a dev role previously. The guy was interested in bringing me in on a 90 day contract and was going to propose this to HR. would you guys work on contract for your first job?
>>
>>60215212
yeah, if it's the only offer you've had in a while, go for it. If you think something better is just around the corner, wait a bit. But me, I'd take it. You trust you can show them you're actually worth something in those 90 days, right?

And maybe you can even impress them and go for a raise after the contract is up...
>>
is pastebin down?
>>
>>60215660
pastebín is down
pastebin is not
>>
>>60215705
sorry for spoonfeed

thank you
>>
>>60215732
>>60215705
lol OP needs to get his shit together!
>>
>>60215458
yeah I'd take it assuming I'd satisfy them and get a job out of it but that they'd lowball me when bringing me on full time so I'd stay 6 months and get a job elsewhere for more money
>>
>>60215811
>>60215732
It's a test.
A good webdev should pay attention to tiny details 24/7.
>>
>>60214496
you mean Winblows®? Yeah, why wouldn't it?
>>
>>60215877
again, I don't know your whole situation, but I'd take it unless you were pretty certain you could get other options in a short period of time
>>
>>60215660
http://isup.me/pastebin.com
>>
>everyone is scared of the terminal at first because its black
heh
>>
>>60216186
>powershell was made darkblue for that exact reason
hmmm
>>
My postgresql pgadmin gets stuck on loading, help.
>>
>>60216046
Well all Web development work seems to be almost entirely on macs so I thought there'll be some tools I'll miss out on windows
>>
>>60216843
Definitely won't miss out on any software. Everything is still very much windows driven
>>
Question my senpaitachi.

Built a page that allows pdfs, epub, and mobi files to be parsed through and returns a json object containing Author, date, book title, other shit, and importantly to me, a list of all the words used with a count next to them, and a list of uncommon word patterns - also with a count.

How the fuck do I store this? No database experience at all. do I sql, no-sql, mongo? Ideally I want to be able to look for things like total unique words across date ranges or vocabulary differences between authors etc.

code below is the basic schema of the json objects.
{
"title": "A Tale of Two Cities",
"author": "Charles Dickens",
"isbn": "9781909175914",
"date": "1859-01-01",
"totalWords": 142950,
"totalUniqueWords": 10867,
"words": {
"spy": 61,
"speak" : 60,
"saint" : 60,
"behind" : 58, etc...
}
}
>>
>>60217023
any sql-related db, just stay away form no-sql if you're just starting out, it's a completely different thing. Ideally you want to manage all your sql stuff through the ORM, object relational mapping, which saves you from explicitly writing out your sql queries. What framework/langs are you working with? Look into your framework's ORM.

And I'd recommend sqlite to begin with, it's very easy to set up, you can also get a GUI for it, etc.
>>
>>60217087

Node/Express, everything is Javascript.

I will look into sqlite, ty friend.
>>
>>60217023
if you're a newbie, you can just throw it into a nosql based db like mongo or litedb. They store documents like that as JSON (the same format you posted).

if you're feeling adventurous, you can break this into a series of classes and store it in a relational DB. JSON is handled by modern languages
>>
>>60217482

sqlite is the sexiest if youre project is a small or medium project, oh and don't forget to install the sqlite command line prompt

hnng
>>
>>60217608
What do you mean by breaking it into a series of classes?
>>60217819
It's a small project, but the jsons are pretty fat. One book usually has 10k unique words, making the json usually 165kb.
>>
>>60218018
Yeah, you'd have like a Book class
 public class Book
{
public string Title { get; set; }
public string Author { get; set; }
public string Isbn { get; set; }
public DateTime Date { get; set; }
public int TotalWords { get; set; }
public int TotalUniqueWords { get; set; }
public List<Word> Words { get; set; }
}


And a Word class

 public class Word 
{
public string name { get; set;}
public int count { get; set;}
}



so you'd make Book.cs and put the book class definition in there, and a Word.cs and put the word definition there. Then you set up a controller to actually interact with the DB. Does that make sense?
>>
>>60218151
Yeah that makes sense, ty senpai.
>>
>>60218151

ew C#.

you dont have to deal with making these meme classes if you just spit out the JSON normally and send a request to retrieve it.

M$ fags.
>>
So websites that have a URL scheme like this /thing/:id/:name, I've noticed a lot of websites don't validate :name against :id, so you can change the value of :name and the page still loads 200 OK. My question is, does anyone know if this impacts SEO or has any other negative side effects?
>>
Is there a decent tutorial on how to launch a vps for a beginner?
>>
>>60219126
The digitalocean tutorials are really good.
>>
class test
{
public function __construct()
{
$this->doSomething();
}
function doSomething()
{
doing something that will take a time to finish, maybe like 1 minute;
}
}


<?php

(new test());

If i do it this way, page tab will show that loading circle until shit is done
So my question is:
How can i call class test like in background, and show result only when is finished?
>>
>>60219358
I appreciate it anon. They look like they have quite a few.
>>
>>60219439
you need to return whatever you want after the function/class is done processing.
class test { 
public function __construct($a, $b, $etc) {
$this->a = $a;
$this->b = $b;
$this->etc = $etc;
}
function doSomething() {
$return = do whatever logic here;
return $return;
}
}

<?php
$test = new Test();
$test->doSomething();
?>
>>
>>60217819
Reminder that sqlite is for single user only. Although it looks like OPs app qualifies.
>>
>>60219439
Ajax?
>>
I need a live editor of HTML/javascript/CSS. What's my best bet?
>>
>>60219777
yeah we know. SQLite is just a beginner's tool, but a pretty damn good one. It allows you to get into the basic SQL logic and start running a database without dealing with any shit. It's just plug and play. Of course you move on, eventually.
>>
>>60219801
i was thinking about that but i dont know if it is possible?
>>60219773
man, my function is working with video files, converting/compressing/cutting/
returning wont help
>>
>>60219877
if you just echo shit during the process and have no return statement, you cannot do what you want. You don't have to return the video, you can just do whatever the fuck you want with it and in the end you return whatever the fuck you want
 return "man, I just worked with video files" 
>>
>>60219802
What's wrong with a text editor and a browser?
>>
I had to write a Perl implementation of http basic authorization. Is this good enough or are there things I'm overlooking?

sub lob_authenticate {
my ($self) = @_;

my $auth = $self->req->header('authorization');
$auth =~ s/Basic //;
$auth = decode_base64($auth);

my ($user, $pass) = split(':', $auth);

return 1 if $user eq $self->config('lob')->{webhook_user}
&& $pass eq $self->config('lob')->{webhook_pass};

return 0
}
>>
>>60219773
>>60219877
Ajax. Call it via jquery or XMLHttpRequest, or whatever frontend framework's ajax code examples advise you to use and set what you'd like to do after processing as a callback function
>>
Anyone know anything about dealing with uploaded PDF files? Anything I need to watch out for? Obviously I won't leave them executable or anything on my server, but besides that, how do I protect myself and my users from PDF related vulnerabilities?
>>
>>60210022
>too lazy to setup LAMP
Mate it literally takes 3 minutes
>>
>>60219860
>SQLite is just a beginner's tool, but a pretty damn good one
Well its way more than that. Its the perfect SQL server for prototyping shit. No matter what SQL variant you end up using in production, the SQL code you already wrote works. Moreover local dev environments are seamless to set up with SQLite as your choice of database diver for development
>>
who is the best poverty(free) host
>>
>>60219802
Check out live-reload and browser-sync
>>
react or angular lads?
>>
>>60223497
jquery
>>
>>60223533
not even the same thing.
>>
Has anyone tried using Golang for web development?

I am kinda fed up of the issues both Javascript and PHP have.
>>
File: jss1ogjprquy.jpg (697KB, 1429x907px) Image search: [Google]
jss1ogjprquy.jpg
697KB, 1429x907px
hey i'm a noob, building my own website by hand

this is what i'm doing right now: my homepage and subdomains share 90% the same code, other than content
eg home page has a welcome dialoge, contact page has contact form, etc, but the rest of the code is for header links, footer links, content formatting, and background photos

right now when i need to make an update, i have to update the html for every file

i know this is not the right way to go

what should i be doing? am i able to create a "template" for my site, and "link" to it from each of my files?
>>
Found out that the discord is full of underage redditors.
>>
>>60220665

read the OP, faggot.
>>
Though the OP should add OpenShift, it's a PAAS with a free-tier. Very similar to Heroku.
>>
>>60223712
>proprietary gaming chat program
what did you expect

being an underage redditor is a popular thing to do on /g/ and most other boards on the site

like how people on /g/ keep parroting that meme about indians like they're the funniest guy and it somehow never gets old to them

i have a friend who uses /a/ and i see that board as similar to /g/ in how it's mostly full of non-worthwhile shitpost threads where no one puts any effort into their posts

hope you enjoyed my blog post
>>
>>60208065
I just notice that your "i" is "í", atleast change it on the next thread
>>
>>60208065
Dude all your "i"s are fucked up, every URL that contains an "i" needs fixing.
>>
>>60224733
>>60224892
everyone just copy pastes that shit. it had dead links for months until i had the chance to make a new thread and remove those.
waiting for an opportunity to remove thenewboston because he is crap
>>
>>60223667
seconding, what is the easiest way of doing this?

like

<?php
include 'header.php';
?>
....
<?php
include 'footer.php';
?>
>>
>>60226365
pug, blade or some equivalent templating engine works wonders
>>
>>60223667
>am i able to create a "template"

of course, that's the way to go. Just look it up, pretty intuitive
>>
In PHP, is + only used with arithmetic?
I.E. you can't + two strings together unless they start with numbers?
>>
Javascript multiple timeout question:


var message = "bla bla";
var message2 = "bla bla 2";

function displayTyping(text){
//code that is not important here
}

function showMsg(msg, time){
setTimeout(displayTyping, time, msg );
}

showMsg(message, 0);

showMsg(message2, timeoutForMessage);


I want to be able to call showMsg() with different variables.
What I get is it uses the same variable all the time.

It uses message the first and second time I call showMsg().

Does anyone have experience with timers in js in general?
>>
How do I convince people I'm a freelance web-dev someone help an ashamed neet out
>>
>>60227248
just work on your portfolio. do all kinds of projects, as many as you can.

If you're up for it, start working on upwork asking for a low wage, just to get clients. Then gradually raise your price
>>
>>60227286
the only language I know is python, what web dev language should I start with

is it believable to say I get paid in bitcoin work different hours and get paid varying amounts each month? I mean would you as someone who knows web dev (assuming you thought I knew web dev) believe that? it's just for the time being to save myself the embarrassment of unemployment in social situations
>>
What is your workflow when building iOS apps? I started learning swift now but I can hardly imagine how you approach building apps. How do you start? Do you first build a site structure with all pages and then add content/functions? I have no idea
>>
>>60226855
Yes. . is concatting operator.
>>
>>60227322
python is not bad, just pick up Flask or Django, they are python frameworks for web dev. I'm learning Django right now and it's not bad at all.

You'd also need a bit of html/css/js, but not too much though, unless you want to do heavy front-end stuff.

Why do you want to say bitcoins? Why not just $$ through paypal? I don't think I've ever heard of any webdev getting paid in btc's.

Working different hours and getting dif. ammounts each month is the norm for freelancers, some months are good, others bad, it varies.
>>
>>60227403
>Why do you want to say bitcoins?
I just assumed web dev would get paid in BTC to avoid taxes and shit whats the common form of payment and how do I handle taxes? (UK)
>>
>>60227382
>https://www.djangoproject.com/start/

that's the official tutorial, pretty good, but you might also want to get some video tutorials from youtube, and you can find a bunch of books on genesis library (just google it if you don't know what genlib is).
>>
>>60227403
also I'll start learning django later today
>>
>>60227123
May be scope problem. Try assigning msg to temp var before giving it to settimeout.
>>
>>60227426
I'm sure many webdevs would like BTCs to avoid taxes, but the truth is most people who employ freelancers now nothing about computers or technology in general, so they don't generally do BTCs.

For a freelancer, I'd say you would have to pretend to be registered as self-employed. There's a specific tax category for that in the UK, can't remember exactly what it is right now.

Also, in the UK you can get some bennies if you're over 25 years old and making under £15k or something like that, so you could pretend to be getting that if you want to, just to give your story more credibility.

>https://www.gov.uk/working-tax-credit/overview
>>
>>60227403
What exactly can you do with Django? I assume not just simple websites because then you could just use HTML/CSS. What's the difference to php, javascript or other languages/frameworks?
>>
>>60227434
Tango with Django or something like that is a pretty good book. I'm following it right now, while also working on my little project.

A bunch of people lurking here use Django, so if you have any questions, somebody will most likely help you out.
>>
>>60227487
>>60227521
thanks lads
>>
>>60227542
Also, the UK is the best european country for webdev, there's tons of jobs. If you're decently talented, it shouldn't be too hard to get that first job. Again, it's all about the portfolio. The lack of a degree can always be overcome with a kick-ass portfolio.
>>
I want to build a website like dribbble where you can create your own profile, upload image files and upvote other user's uploads. The images with most upvotes are on top of the feed.

How do I get started? I know how to create UI assets, HTML/CSS and a bit of javascript. But I guess I need backend development, right? Is that something you can learn while doing?
>>
What are some comfy webdev setups? Everything feels like ugh. Should I try tinkering with vim?
>>
>>60227542
Amazon.com > Search Books > Django > Sort: Reviewer Ratings | bookzz.org > Download Ebook
>>
>>60227464
Tried it. Didn't help.
the temp just gets set to the message every call.
Any other ideas?
>>
>>60227464
>>60227878


forgot to log it.
So when I place a log inside showMsg()
I get both message and message2

It seems like it's a setTimeout() problem?
>>
>>60227464
>>60227937
nvm found the problem lol
>>
What are the cheapest geolocation services?

All I know about is google maps and mapbox.
>>
>>60223497
I'm an Angular fanboy, but honestly, it really depends on the project and your personal taste. Angular and React serve different purposes, so it's not simply a question of "should I make my background blue or red?"
>>
Launching two apps and building a bootstrap site for my sisters business this weekend. What are you all doing?
>>
>>60228962
>. Angular and React serve different purposes
as in what
>>
>>60229798
>What are you all doing?
Your sister.
>>
>>60229909
/thread
>>
>>60208065
>Díscord
What the fuck is wrong with you? Kill yourself.

>Useful Youtube channels
Same goes here.
Is this the normalfag thread of /g/?
>>
File: adwords google com home.png (286KB, 1482x2883px) Image search: [Google]
adwords google com home.png
286KB, 1482x2883px
>>60227618
Make it as simple as possible. Look at this website. This is near to website perfection. It works on any resolution because of text wrapping. My only complaints are minor complaints, because the site is beautifully design and optimized. One of my complaints is "Change language or region" is at the bottom of the page when it should be the first element. And there are broken images. Too many images are used in this website instead of using a few images well. Make your idea as simple as possible, because it sounds like a good one. I believe in you. You can do it!
>>
What stimulants does wdg use? I drink 6-12 red bulls throughout a 48 hour period and don't eat or sleep I do this maybe 4-5 times a year planning on migrating to caffeine pills - going to be doing it this weekend to hopefully learn my first web language since I mainly dpt anyway what does wdg use?
>>
>>60230093
don't forget that you don't need JS to operate the page and it's screen reader friendly
>>
>>60230155
>being a degenerate
>>
File: 1485889119752.gif (8KB, 645x773px) Image search: [Google]
1485889119752.gif
8KB, 645x773px
>he's not an asynchronous programmer
>>
>>60230155

jebus chrizt dude - youre gonna burnout and youre gonna burnout hard
>>
File: 232323.jpg (63KB, 982x550px) Image search: [Google]
232323.jpg
63KB, 982x550px
I'm not a /g/ent, but just came by to share this.

I attempted to sign up for this DirectTV service, and was very surprised to find out my browser(firefox) was rejected, but shit like Safari and IE are accepted?

Was I lied to all these years? I thought firefox was the most popular chad browser. Is this not correct?
>>
>>60230308

https://www.w3schools.com/Browsers/default.asp
>>
Am I allowed to scrape a dictionary api and just use all their data locally in my app?
>>
>>60230155
>stimulants

I just eat a lot of red meat and eggs. I also eat less carbos because they make you sleepy. Besides, don't study or do work more than 6h of real work - is a wasted of time since you do 80% of work in 20% of the time. Read Deep Work, nigga
>>
>>60230460
not without their permission
>>
any of you bois use NearlyFreeSpeech for web hosting? seems like a good deal (pay for what you use), wondering if anyone has any experience with it
>>
>>60230017
Yes.

/dpt/ can keep their 20 year old languages and 20 year old chat programs. We're trendy in /wdg/
>>
>>60230155
I can't anymore. Got Lymes I think. Caffeine fucks me up big time.

Dr is writing a script for ritalin though so we will see. Ritalin got me into web dev decades ago.
>>
Just finished an introductory course to plain HTML5, Javascript and CSS3, should I start practicing by making websites or should I learn a framework?
>>
>>60230754
framework imo. I've never used vanilla on a professional or personal project
>>
best resource for anything angularjs?
>>
>>60231068
angularjs.org
>>
>>60231102
best spinners?
>>
>>60231169
https://www.w3schools.com/howto/howto_css_loader.asp
>>
>>60231169
also, put a background on the spinner that prevents interaction on the page while the spinner is up. You'll thank me later
>>
>>60231181
best affix replacement for bootstrap4 without using its jquery library, using angularjs??
>>
>>60231199
>implying I don't hide the div when the state change begins and then show it again when the state change is done.
do you even route?
>>
>>60231204
>affix replacement
what is that?

>>60231221
>changing routes before your promise resolves
ISHYDDT
>>
>>60209235
>assinging to "body"
>here's what attempt is
>has no "body"
well I fucking wonder.
>>
>>60231236
how would you do that? I'm not in the mood for scouring stack exchange, but the way I do the routing basically relies only on the location manipulation, so I have standardized ways to reach views.

basically I use ui-router and change views with $state.go, passing it the view and params I want the view to access.
>>
>>60231401
//set promise for spinner
var d = $q.defer();
self.ClearErrors();
//put spinner up
self.Loading(d.promise)

$http.get("someURL")
.then((response) => {
//do something with response
})
.catch((error) => dealWithError(error))
//take down spinner
.finally(() => d.resolve());
>>
Is there any way that i could use rateYo plugin in the console?
>>
>>60231506
>rateYo
yeah, just go to the src and paste that into your console and fire away
>https://cdnjs.cloudflare.com/ajax/libs/rateYo/2.3.2/jquery.rateyo.min.js
>>
If you use angular, is there no need for jquery anymore?
>>
>>60231533
>yeah, just go to the src and paste that into your console and fire away
i think i'm autist cause i dont get it. what source?
>>
>>60231493
$scope.$on('$stateChangeStart', function(event, toState, toParams, fromState, fromParams) {
$scope.isLoading = true;
$scope.isCollapsed = true;
});
$scope.$on('$stateChangeSuccess', function(event, toState, toParams, fromState, fromParams) {
$scope.isLoading = false;
$scope.timeshow = caldateService.getTimeshow();
});
>>
>>60231580
the link I put there is to the source, also you'll need to paste it in the console of a page with jquery already in it (it's a dependency) like jquery.com
>>
how do u guys an animation from the wbe?
suppose you find a cool animation on the web and you want to copy how that person did it how would u go about it? Im trying the google chrome animation consolelog but its not showing me everything , when I play the animation I see the state of the div change but its so fast, how do I slow this down?
>>
>>60231613
ok i did it but when i try to use any of the functions from the source it doesn't work.
>>
How do I do this so it replaces it with "word": "bye"?
>>
>>60231680
dude breakpoints lomao
>>
What does /wdg/ think of ASP.NET?
>>
>>60231906
Response.Write('killurself');
>>
>>60231906
If you ignore webforms it's really good.
>>
>>60231931
I bet you like C# too.
>>
>>60231949
I do.
>>
File: 4cf.jpg (53KB, 600x563px) Image search: [Google]
4cf.jpg
53KB, 600x563px
>>60231963
>>
File: tumblr_oj6qz3sNRU1vjg8rio1_500.gif (437KB, 480x270px) Image search: [Google]
tumblr_oj6qz3sNRU1vjg8rio1_500.gif
437KB, 480x270px
>>60231984
>>
>>60231768
find: "word": "bye (1)"
rpw: "word": "something (1)"
>>
>>60231984
>Calls C# an "heretic language".
>While "programming" in JS.

(white power hand gesture)
>>
>>60231906
Ignore anything before MVC. Old one is really good and Core is god tier. C# is one of the best languages and light-years ahead of likes of javascript.
>>
This board makes me hate web development. What the fuck does it matter what language someone uses as long as people pay him to do it. All this anti-js/anti-net meme elitist fuckery makes me want to kill myself.

I work in c# at my day job and node/react freelance and I can't understand the bullshit you guys spout.

I understand it's all a meme but pls for the love of all that is holy ... stop. You're ruining it for the rest of humanity.
>>
File: stars.png (221KB, 1388x1008px) Image search: [Google]
stars.png
221KB, 1388x1008px
>>60231762
what is temp 4?
just paste the whole source in, target an element and play
>>
>>60232041
>implying I do frontend
LOL
>>
>>60232189
You just don't know that the only web dev language that's acceptable is HolyC.
>>
>>60232189
90% of people in here only know 1 framework or language (or less). They just defend what they know so they don't feel pressure to learn new things
>>
>>60210072
learn C# and use Xamarin instead, build apps for all mobile devices at once
>>
>>60231762
here
https://codepen.io/Cameron64/pen/NjaJMK?editors=1111
>>
File: 1493769259684.png (149KB, 668x668px) Image search: [Google]
1493769259684.png
149KB, 668x668px
Anyone have any experience following the
>NEET guíde to web dev employment
>https://pastebín.com/4YeJAUbT/

Was it worth it? American only? I know some web development and was considering learning a bit more, to make some neet bucks but im scared of learning about some meme frameworks and not getting anything out of it. I only know basic web dev stuff from college.
>>
>>60232689
>https://pastebín.com/4YeJAUbT/
doesn't work wtf
>>
>>60211906
>>60212235
Same, since I've installed Microsoft shit
>>
>>60232809
here anon:
>https://pastebin.com/4YeJAUbT/

OP messed up the link.
>>
>>60232689
>>60232809
Pedro used an accented i in the url
>>
>>60232689
fronted webdev here
if you want to work frontend you need
>gulp
>bower
to actually handle dependencies and minifications/CSS compiling, etc..

as for frameworks: ANGULARJS before diving in ANGULAR2

you also need a pretty fucking good CSS knoweldge and a good JS. jQuery is a relic of the past right now. try to never use it or any of its plugins.

PHP knoweldge might be required depending on the backend being used (if it's anything REST you don't need it tbqh).

This is the bare minimum if you want to work frontend.

for backend each employee has its own shit, some run a full java stack that uses SOAP, others run apashit+php+larave/zend, meme projects use mongodb/nodejs and everything JUSTJAVASCRIPTMYSHITUP. Some even layer a backend upon another backend (because the team is too scared to modify anything in the old backend because keeping track of the thousand of websites that use that backend can't be easily ported or aren't even tracked). Usually these situations also involve different types of DBs interfacing with each other (ew).

If the projects doesn't need/move a lot of data, it will use mariadb, anything serious uses ORACLE. Just learn one of them, they're mostly the same and the differences are documented.

TLDR: fronted is angular, backend is WILD WEST.
>>
Are all this frameworks necessary?
I feel like I can do everything with Wordpress or PHP + MySQL + JQuery
>>
>>60232871
>gulp
>bower
I still don't understand the need for taskrunners.
When would I actually need to use it, is it dependent on which meme frameworks im using like Sass/Less instead of pure CSS
>>
>>60232932
You can, but it's not going to scale very easily, other people won't be easily able to jump into your project to help because they won't recognize your patterns, and you're less likely to have reusable code
>>
best framework for a php, js (ajax) dev?
>>
Redpill me on Ruby on Rails /wdg/ I am learning Ruby as we speak and I am really interested in it replacing a full Stack like Mean.

I am fed-up of the inconsistencies Javascript has, the this shit and the scope rustled my jimmies, but retarded shit such as being able to declare several variables with the same name and Javascript not giving a shit made me go full triggered.
>>
>>60233059
well I've heard of Flask and larevel for PHP.. Angular is the swiss army knife of js frameworkds
>>
>>60232992
bower to handle libraries
gulp to compile CSS (learn how to use sass, it's a timesaver) and minify/concatenate .js/.css
sass/less aren't frameworks, it's like calling typescript a framework. Gulp also can "watch" your libs and re-complie everything needed on the fly. A real timesaver.

All said, the smaller the project, the less you need these tools. You'd only overcomplicate the procedure.

Also I forgot, you might as well learn how to do unit testing (jasmine for anything JS).

as for the IDE of your choice, if you want a hassle free solution it's INTELLIJ IDEA. If you're poor or too dumb to find a FREE license server just stick to Sublime/Atom and their snippets/linting plugins. Yes you actually need linting if you want to be productive and write good code.

That's it. There's a lot to learn, but I suggest jumping straight into angularjs. The other things you can learn on the way and they're mostly used to make a clean and functional project.

If you're planning to go freelance you can obviously do whatever the fuck you want as long as the client is pleased with the result, but if you work in a team, having these "build/testing" systems set up is very important.

Also don't forget to learn git and svn.

Good luck.
>>
>>60233122

you dont have to go MEAN to go full stack - plus i heard mongo is buggy
>>
File: getting_mean.jpg (19KB, 260x329px) Image search: [Google]
getting_mean.jpg
19KB, 260x329px
>>60233140
I worked halfway through this book and it was okay, but, I got stuck on the 6th chapter , which was about creating a REST API.

I pulled the code directly from the Repository and shit did not work no matter how many times I edited the entries of my database or skimmed through the source code.

I got fed up and started learning Ruby. So far I have found several advantages, it can be used as a strong typed language, it handles scopes AS THEY SHOULD BE in any other language and the syntax is simple yet familiar.
>>
>>60233212

ya i dont like following tuts or books, theyre useful if you need to look something up real quick though stackoverflow is probably better

whats best is to think of something to make and use the technologies to create it from scratch, that way you are in control and youre not relying on someone else to spoon feed you
>>
Kek, this thread is a time machine to mid 2000s with all this PHP and ES5.
>>
>>60233359

PDO didn't exist in mid 2000's though
>>
>>60232689
I got accepted to lionsbridge but got bored and got a web job instead.

I should write a new version of tha NEET guide.
>>
>>60233706
do it.. it's from 2015 and the owner hasn't used his trip on 4chin since that year
>>
https://www.youtube.com/watch?v=FJ7QsEytQq4
>>
Got the chance to make some money and do my first 'commercial' project for a friend whose site needs updating. Was made in dreamweaver many years ago with basic technologies. But over the years it's become HUGE in terms of content. I've got a decent design in mind and structure it's just I don't want to repeat the content so much and get lost in the routes.

He dislikes wordpress sadly would be easy imo.
What's a good way to migrate the content?
CMS or Static site generator for this?? The most advanced thing needed is a search function desu nothing else is really that hard
>>
I'm trying to disable password Authentication on Ubuntu 16.10 on digitalocean. To do this I need to uncomment #PasswordAuthentication = ye and then put no. The config file I'm in now doesn't display this. Is there another page I'm missing or can I just add PasswordAuthentication = no?
>>
>>60234167
Are you sure you are editing sshd_config thou
>>
>>60234254
Yes, but I'm still being dumb. I had to use the arrow keys to scroll. I though it would have just printed all of it out.
>>
>>60234345
wait what
sudo nano /etc/ssh/sshd_config

Press F6 or ctrl+w, type PasswordAuthentication, if there is one with # at the start, uncomment it. If not, add it yourself. I guess you should also enable PubkeyAuthentication
>>
>>60234462
That was enabled by default. I don't have page up or down and didn't realize the arrow keys could scroll, or the search keys, thank you anon.
>>
>>60232871
Except in frontend you have things like vue and react as angular alternatives. Angular is on 4th version each one breaking backwards compatibility. Then there is like 2 ways of improving CSS(LESS & SASS),million versions on javascript, libraries to add support for different things. And then there is million things to enhance actual developing (linters, bundlers, minifiers, live updaters etc). And everything has at least one alternative so you never know which one is current. Basically https://hackernoon.com/how-it-feels-to-learn-javascript-in-2016-d3a717dd577f .
>>
>>60234627
>Basically https://hackernoon.com/how-it-feels-to-learn-javascript-in-2016-d3a717dd577f .
do you know what framework he's using for the blog posts,
it's the same one medium.com and a few other sites use
>>
If I set RemoteLogins = no wont I just be locking myself out of root access?
>>
>>60234627
>>60233136

ffs what is this WebAssembly meme now aswell is javascript dead ?
>>
>>60210022
>wanting to learn PHP
It's just a template engine. Not a real language.

http://webpy.org/ Learn this, takes ten minutes at most.
http://www.tornadoweb.org/en/stable/ Then this, takes ten minutes after you've learned webpy.
>>
>>60235800
>>
File: 1493889037646.png (277KB, 728x522px) Image search: [Google]
1493889037646.png
277KB, 728x522px
Two JS-related questions. Code is in this Pastebin since 4chan thinks it's spam: https://pastebin.com/U7ZvhK50

1.) If I want a function to activate on a button press or whatever, would I attach the event handler to an anonymous function or do I link it to a separate function?

2.) My TA tells me that "var a" would be considered a global variable rather than a "module global" variable. Is he correct or is he full of shit? What would I do instead if I wanted something like a global variable?
>>
>>60236181
1.) Both work although first is used more often I think. Second is good for reusing function.
2.) var declares new variable, it's not directly connected to variable being global. For global variable you must put it in top of scope. Like declaring it outside of any function.
>>
File: images.png (60KB, 214x235px) Image search: [Google]
images.png
60KB, 214x235px
I'm currently graduanting in software engineering and i'm pretty average in C, Java, C#, C++, Haskell and some more. That said, i always had a soft sport for web development and i want to know how quickly can i learn.
Where should i start? Already took the html+css basics at codecademy and felt really slow.
>>
>"Warning: mt_rand() [function.mt-rand]: max(-1) is smaller than min(0)''

that's because I placed mt_rand in a function that takes as an argument the string used for the 'max' argument of the mt_rand.

and because it's undefined at the completion of the function it has a value of 0, making it lower than the 'min' argument, and hence throwing the warning.

anyone have any idea how to bypass this?
>>
>>60236871

stop posting degenerate pics here you /b/tard
>>
Fuck everything.
I'm hermiting this whole month to learn all i can about webdev. C# MVC, core, Node.js, angular.js, angular 4, react, express, postgresql, orms.

What else?, btw fuck php.
>>
>>60237604
Probably gonna do the same anon. Got about a month till next semester. I just set up a vps and I think I'm gonna try to set up a MEAN stack and then learn react and try to do something less than useless with it.
>>
alright lads I'm pissed up, it's 5am is now a good time to learn django?>
>>
Since PHP spawns a process for each page, does that mean that when doing a mysql query it's creating a new connection for each page load? or is it daemonized somehow with a connection pool?
>>
>>60234958
lmfao are you serious

it's a medium integration
>>
>>60236880
You can shift your result:

mt_rand(-1, 5) is equal to mt_rand(0,6) -1
>>
>>60239927
Why does it matter?
>>
>>60237604
Yeah good luck learning even just half of one of those in a month you fucking retard.

Also, you piece of shit, php has plenty of jobs which you obviously need. It's a good language that is simple to learn and can do everything when combined with javascript. There is no reason to use node over a lamp stack unless you're needing websockets.

Don't say "fuck php" like you have any idea what you're doing, parrot.
>>
>>60210022
Miguel Grinberg's flask mega tutorial is how I learned. I also know him a lil so maybe that's a bias
>>
>>60240246
Why are you so mad, i already know the basics of half of them and almost done with learning c# and core.

And what good jobs does PHP even have? old granny codebases full of dickheads devs like you? "good language" please PHP is a clusterfuck of mistakes worse than JS ever was.

Get with the times grandpa.
>>
>>60240230
Because I am curious about the performance impact of opening a mysql connection on demand like that. I know php can scale well, so was wondering if it uses connection pooling or a persistent connection at all to achieve that. From what I'm reading though it doesn't?
>>
>>60240316
You are so full of yourself considering you know nothing. You're never going to make it.
>>
>>60240413
I have no idea. I can tell say that I had limits with apache connections only once and that was definitely my fault. We are talking 10s of thousands concurrent uniques though.

I never had the problem with nginx.

All I know is that you make a connection when you need it and drop it when you don't. You can technically leave it open but that's not good. I don't know what else you're talking about because I'm barely a real programmer.
>>
>>60240454
>considering you know nothing
Nice projecting there buddy. I've already deployed apps to production, you don't know me.

I fucking loathe PHP, i consider it cringe worthy.
>>
Okay, does anyone know how to make SOAP requests with node or Javascript. I've been trying to do it for the last five hours and what works in other languages either doesn't client side, or since I'm using a router, fucks up the routing. Does anyone have any examples?
>>
>>60240483
that usually only happens with shared hosting or a PaaS. you can configure the max connection limit when you're running your own instance of apache/mysql.
>>
>>60240502
babby's first app.

Your choice of postgres instead of mysql shows how little you know. Jumping on the memewagon. Go look at datatype allocations and realize how retarded you are.

>>60240504
I haven't seen soap in over a decade. God speed.
>>
>>60240568
>mysql
Now i can say that you're just a meme.
>>
>>60240591
You can say whatever you want.

I won't care what you say until those apps you launched hit second round seed funding.
>>
>>60240568
I know... I'm doing it for a competition and I can't even get anything with it. I just literally wasted to much fucking time trying to get the damn thing to work. I'm just going to head home and get some shut-eye.
>>
>>60233359
>"trendy framework/language/whatever of the week" meme
>>
>>60230468
>Read Deep Work, nigga
this. For all of you seeking motivation, read this shit right here, free on your favorite torrent site
>>
>>60237604
you gotta learn some security, which is basically the OAuth library, but you gotta know it well enough not to fuck it up. Also deployment, if you've never done that.
>>
>>60211131
  <svg id="shapes" width="340" height="600">
<circle id="1" cx="50" cy="50" r="50" fill="red" />
<circle id="2" cx="170" cy="50" r="50" fill="red" />
<circle id="3" cx="290" cy="50" r="50" fill="red" />
</svg>

<script type="text/javascript">
var colorTable = {"red": "blue", "blue": "red"};
var theParent = document.querySelector("#shapes");
theParent.addEventListener("click", refill, false);
function refill(e) {
var el = e.target;
el.setAttribute("fill", colorTable[el.getAttribute("fill")]);
}
e.stopPropagation();
}
</script>
>>
javascript idea: functions extending functions

function getAttribute (element, attributeName) {
return element.getAttribute(attributeName);
}
function getAttributeNumeric extends getAttribute (element, attributeName) {
const attributeValue = super(element, attributeName);
return Number(attributeValue);
}


add it now plz
>>
Now that I've got a vps server all set up. What would be the next thing to acomplish? I would like to serve a web page and kind of want to install caddy for it. DO I need other software to be able to do this or should I just go through a node.js tutorial to learn about the full stack of things?
>>
>>60208065

Is it possible to change the onaction value of an HTML form with JAvascript when one doesn't exist already?
>>
>>60243436
err, just call the function instead of super?
what's the point?
>>
>>60214444
>From Newbie to Ninja with Node js
>40 bucks
Fuck.
>>
Working on a project for my portfolio
>>
>>60244504
watcha doing?
>>
>>60244520
http://collinoswalt.com/woof/12
>>
class CheckUrl
{
private $url;

public function __construct()
{
$this->checkIfIsWorking();
}


public function checkIfIsWorking()
{
if(isset($_GET['working']) && $_GET['working']='1' && isset($_POST['url'])){
include_once('includes/Working.php');
}

else{
include_once('includes/Form.php');
}

}
}


class Youtube{
private $url;
private $path = '/...something.../videos/';
public function __construct($url)
{
$this->url = $url;
$this->startDownloading();
}

public function startDownloading()
{
sleep(3);

shell_exec("youtube-dl -o '".$this->path."%(title)s-%(id)s.%(ext)s\' ".$this->url);
header('Location: videos/');

}
}


Working.php
<html>
<head>
<title>
Preparing video
</title>
</head>

<img id="loader" src="img/loading.gif">
</html>


<?php
(new Youtube($_POST['url']));

Form.php
<form class="cd-form" method="post" style="align-items: center" action="?working=1">
<input style="align: center" class="URL" type="text" name="url" placeholder="Paste YouTube URL here" id="url"/><br>
<br><input type="submit" class="cd-submit" value="Submit">
</form>


and index.php

(new CheckUrl());


My problem is that page "Working.php" is never loaded(the gif animation that should be loaded, class called inside file is working), it goes from index.php, download file and redirects to /videos. It should after submitting form go to "Working.php" and after its finished, go to /videos/.
What i did wrong here?
>>
>>60245023
action="?working=1"


the form is being submitted to index.php?working=1

change action to "working.php"
>>
>>60245078
Have you seen first class?
>>
>>60245023
>using new solely for side effects
>class that doesn't use any class features
>passing untrusted input to shell_exec
0/10 wouldn't hire
>>
>>60245023
Why are you even using classes?
Your code is broken: a single = is an assignment, not a comparison.
>>
>>60245152
>Why are you even using classes?
This is just written in 20 minutes and not even close to finish. Also because of __autoload

>Your code is broken: a single = is an assignment, not a comparison.
Well it works with 1 or 2 or 3 desu, problem is that it never renders that working page.
btw i changed =
>>
>>60245023
there's multiple problems with this.

First, PHP buffers its output, so when you include your Working.php it'll execute its contents before it outputs anything. You need to flush the buffer if you want to output the HTML before the sleep, but then...
Second, the Header() will not work after you've sent output, because at that time you already have sent the header and can no longer modify it.

Note that because of output buffering the Header() works because PHP didn't send anything yet, but once it's done it sends back the html with your loading gif including the new location, and browsers just follow the header and ignore the content.

You'd be much better off doing some ajax polling/event streaming to check progress instead of doing it like this.
>>
>>60244610
>http://collinoswalt.com/woof/12

lel. let me guess, you do front-end?
>>
>>60246092
Full stack
>>
WHY DOES COPY AND PASTING A URL IN THE URL BAR BEHAVE DIFFERENTLY THEN SETTING WINDOW.LOCATION.HREF IN JAVASHIT???????????
>>
>>60247238
differently how
>>
>>60247238
because when you manually enter one you don't "come from" that website, so the referer should not be sent to the next page.
when you do a redirect using javascript (be it location.href or replace) then you do come from that website and the referer is supposed to be sent.
>>
save
Thread posts: 319
Thread images: 31


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

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.