Death to PHP edition

Death to PHP edition

Previous thread >IRC Channel
#Sup Forumswdg @ irc.rizon.net
Web client: rizon.net/chat

> Discord
discord.gg/0qLTzz5potDFXfdT

>Learning material
codecademy.com/
bento.io/
programming-motherfucker.com/
github.com/vhf/free-programming-books/blob/master/free-programming-books.md
theodinproject.com/
freecodecamp.com/
w3schools.com/
developer.mozilla.org/
codewars.com/
youtu.be/JxAXlJEmNMg?list=PL7664379246A246CB - "Crockford on JavaScript" lecture series.

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

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

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

>NEET guide to web dev employment
pastebin.com/4YeJAUbT/

>How to get started
youtu.be/pB0WvcxTbCA - "WATCH THIS IF YOU WANT TO BECOME A WEB DEVELOPER! - Web Development Career advice"
youtu.be/zf_cb_Nw5zY - "JavaScript is Easy" - If you can't into programming, you probably won't find a simpler introduction to JavaScript than this.

>cheap vps hosting in most western locations
lowendbox.com
digitalocean.com/
linode.com/
heroku.com/
leaseweb.com

Other urls found in this thread:

jsonplaceholder.typicode.com/
stackoverflow.com/questions/37238085/embedding-only-a-json-object-to-website-and-let-client-handle-the-processing
lmgtfy.com/?q=angular 2
fonts.googleapis.com/css?family=Open Sans')
twitter.com/NSFWRedditGif

[Embed]
good job pajeet

I'm building a blog site in order to learn express.js and jade, but I need some blog appropriate JSON data, the type that I could format easily into a list of clickable "posts".

Does anyone know of any online APIs that would suit my needs for this?

Fuck me... Why is Angular 2 so complicated in comparison with Angular 1? I learned basics of Ang1 a few days ago but I can't comprehend this one. You have to import SHITLOAD of modules, everything is so spaghetti. I actually liked the first one when I began to understand it. What the fuck is this???

Is it bad if I only know Angular 1? Why is it "shit" like people say?

It sucks that companies need you to learn new frameworks constantly. I hate all of this spaghetti shit. I fucking hate web industry and I haven't even seen a day of work.

How long to learn git?

10 minutes should do

no angular 2 is just trash, its basically it's own ISA now(angular 1 being an operating system level of cluster fuckery), there's no way off this rape train except to jump, i suggest vue.js until that eventually goes to shit as well.

what about react.js??

>half of js libraries ending with .js
Stop this. I don't see this happen in any other language

DUDE

WHAT?? I'm using it and it works well? Come on, give me a bullshit argument to ditch it

i don't know shit about react so have an orielly instead

json.net, asp.net, log4net, xunit.net, aforge.net, quartz.net, facebook.net, dotnetzip
sharpziplib, postsharp, pdfsharp, itextsharp

>try to use pic related
>get the understanding of it, made quick easy things in one long index.html
"this isn't maintainable, better work on the modularisation"
>just use webpack!
>random errors
>no no you need webpack-vue-loader!
>can't install
>just follow this tutorial it'll show you how to set it up
>babel-runtime doesn't meet dependencies at install ( following the tut )
>we have a new tool to make it simple! vue-cli
>throws an error when init new project

Fuck i hate "webdev" - gentoo is literally easier than this shit.

forgot pic

Can confirm webpack is an utter bitch to set up properly

Why is PHP bad?

because microsoft pajeets who push asp.net say so

The problem is that you NEED to know all of this crap to get a job/internship.

I have a harder time learning this than anything else. There is so much shit going on and I hate all the imports and modules the most. I'm so... So lost...

What to even pick? Angular? React?
Node? What framework for node? Rails? Django?
Typescript? Ecmascript? Jade? Sass? Backbone? Underscore? Moustache? Coffeescript? Cappuccino? Versace? Mozzarella? Babel? Moses? Jesus? SCSS? Spring? Groovy? Grails? Grunt? Gulp? Burp? Fart? Kys? Djimsa? Flask? Laravel? Symphony? Padrino? Hanami? Picasso? Brackets? Sublime? Websocket? Webstorm? Wordpress? Joomla? Orchard? Ghost? Drupal? Sharepoint? .NET? Beard? Butts? Houdini? DiCaprio? Sinatra???

just don't use crap like webpack

try jsonplaceholder.typicode.com/

Or just set up your own with json-server and some lorem ipsum copypasta

>The problem is that you NEED to know all of this crap to get a job/internship.

You don't need to know it all. You need to have a general idea what most of it is and be able to learn whatever the company uses reasonably quickly. The only stuff you NEED to know for web dev is HTML, CSS, vanilla JavaScript, and common design patterns. The rest is just gravy on top.

Just learn Ember, m8. Super powerful out of the box, core team dedicated to not breaking things, not run by a big company, and a lot of jobs needing it.

Oh, and it's also really well documented and fun as fuck to write.

try writing a scraper that gets blog posts from an actual blog. or, you know, just put some dummy data in your database by hand

>What to even pick? Angular? React?
Angular is kind of a one-size-fits-all frontend js framework. You can make it do pretty much whatever you need it to do, but it's kind of clunky and also does a bunch of stuff you don't need it to do. React does UI/view stuff.

>Node? What framework for node? Rails? Django?
Node is a javascript runtime environment. If you want to use javascript anywhere other than on a browser, you need to use node. Rails and Django are backend web frameworks for Ruby and Python, respectively. They don't have anything to do with node, other than doing something similar.

>Typescript?
JavaScript except with syntactic support for static typing and classes and stuff. Actually breddy gud if you're doing a lot of OOP stuff and/or want your js to look more like java.

>Ecmascript?
"Official" name for standard javascript.

>Jade?
Now called Pug due to a lawsuit or something. Alternate syntax for web pages that compiles to html. Good for templating and such.

>Sass?
Like jade/pug for CSS. You know all that irritating shit about css? Sass tries to fix that. SCSS is Sass.

>Backbone?
Lightweight frontend js framework.

> Underscore?
General purpose javascript library with some useful functions and stuff.

>Moustache?
Templating engine

>Coffeescript?
Alternate syntax for javascript. Use this if you're a hipster who doesn't like semicolons and wants to make things slightly more difficult for other people.

Part II: Electric Boogaloo

> Grunt? Gulp?
If you have a bunch of tasks you need to done to prepare your site like compiling scss/less/pug/typescript/coffeescript/etc, minifying and concatenating js, compressing images, automatically reloading your browser page when something changes, etc. you would want to use something like these. Gulp is more popular and there are some newer ones like webpack also. I prefer gulp, personally.

>Flask?
Really lightweight python web framework

>Laravel? Symphony?
Web frameworks for PHP

>Brackets? Sublime? Webstorm?
IDEs/Text editors. Use whichever you want, they all essentially do the same thing.

>Websocket?
Bidirectional real-time communication over the internet. Use this if you want to make a chat thing or multiplayer game or something.

>Wordpress? Joomla? Drupal?
Content management systems. They allow someone to log in to a site and add/edit content without having to write code. Wordpress is shitty but popular, and the second two are like wordpress but shittier.

>Sharepoint?
Some kind of WYSIWYG website creator from Micro$hit for giant megacorporations' intranets or something?

Thanks for the links broskis

Learning some Javascript and came to something like this in my guide

var guy = {name: "alex"};

function search(name) {
if (name == guy.name) {
}
};

search("alex");

The surprising thing was, it worked. First 'name' took over parameter of function while the second 'name' just went for the object.

How does that work? I was surely expecting this guide to flop.

Kek, Sharepoint. Some company wanted me to come there and they are working with sharepoint and call themselves .net devs. I noped so hard.

Made me afraid though that this shit still exists and there still is a possibility I'll end up in something like that if I fuck up my life. At that point I'd rather just kill myself.

stackoverflow.com/questions/37238085/embedding-only-a-json-object-to-website-and-let-client-handle-the-processing

What do you guys think about this? Using JS as a API Frontend, and the backend as an API, instead of embedding code into the HTML server-side.

As far as I know that is not a same variable anyway. I mean, they are called the same, but when you call the "guy" and access his property, I don't think it matters if it's called the same as that parameter.

Recommend me must read books for web development

I know of a pretty good one for beginners:
It's called

"The post at the top of the thread" by The Faggot Formerly known as OP

Anyone here with adhd felt major difference between learning before and after meds?

Recommend me must read books for learning common sense

Read up on variable scope and hoisting in javascript

Because it was created by incompetent programmer and it still shows. Because of its simplicity and popularity there are way too many bad PHP programmers.

Before that function, there is no "name" variable at all. There is a "guy" variable that contains a "name" property. Inside the function, you have defined a "name" variable. This doesn't conflict with anything because the previous "name" is not a variable.

Honestly I'm not sure why you wouldn't expect that to work. How else could the interpreter interpret it?

is

$.ajax({
url: 'www.blablabla.com',
})
.done(function(data) {
alert(data)
})
.fail(function() {
alert("Ajax failed to fetch data")
})

a good way to open json api ?

I was expecting it to interpret as

if ("alex" == guy."alex")
giving me an error.

After it worked I thought it works like this:
first it tried to put in the string 'alex', after getting an error it looks up for the second best thing, which is that objects property.

I don't know, I am dumb.

what happens with guy[name]

That might be what happened. It could also be the case that dot notation, the method you used to access a property on the object, doesn't take strings or something? I don't know, shit is pretty confusing -- I certainly wouldn't be naming parameters that share names in real world coding, but as a mind experiment shit is weird

Before:
>don't code
After:
>code for 2 days straight
>crash
>repeat

Are projects that you do by just following tutorials legit? (if you actually learned something from them).

Theoretically, could I just copy paste a bunch of tutorials and pass the interview if I can explain how things work?

>I was expecting it to interpret as
>if ("alex" == guy."alex")
>first it tried to put in the string 'alex', after getting an error it looks up for the second best thing, which is that objects property.

It's a variable, not a macro. Following a property accessor, the interpreter expects a property name, not a variable, so it's not even going to check if what you gave it is a variable. There is no conflict here and no fallback. It worked exactly as intended. guy.name is always going to access the "name" property of "guy". That is the only thing it will ever try to do.

If you actually ever want the behavior you expected, you can do guy[name], which would resolve to guy["alex"], which is equivalent to guy.alex

>That might be what happened
It's not.

StackOverflow is making me a terrible developer.

It's so hard to try to work through a problem when I know I could do it faster and better by searching SO.

pajeet pls

They don't just ask how your little project works. They're going to ask you things like "How do you think you could have done this part better?" and "Why did you use dependency X instead of Y" and also a lot of general knowledge questions related to the project. And you better not leave in a single shred of evidence to indicate it's not legit.

If I was interviewing someone and noticed that they were trying to pass off some bullshit tutorial as their own, I would mercilessly fuck with them and have them shitting bricks the whole interview. And then I would hire someone else.

I don't mean I would just copy paste it, I would go through it and try to understand everything. I'm asking if I can have tutorials projects in my portfolio. Maybe change a few things at the end. I have to learn from somewhere anway.

>setting up gunicorn on ubuntu 16.04
>service gunicorn start
>Failed to start gunicorn.service: Unit gunicorn.service not found.
d-do we have to use systemd now?

ADD here. Meds are basically the pill from Limitless for me.

It takes me a while to ponder if code is a good fit, so I'm slow, very very slow. On meds I am a machine.

Trying to get my doc to put me on then again (havent taken since highschool)

There used to be this workout stuff called Craze that had some kind of amphetamine it, I made a HUGE website in 3 months with it. It got banned. I've been working on a tiny app for 3 months now with no end in site.

I would disclose that it's based on a tutorial at and be sure to have a few original projects as well. ("original" meaning I did it on my own, not necessarily that the idea is original.)

Why did it get banned?

Also thanks. Needed to hear that. Been depressed lately. Hopefully getting an appointment soonish.

I apologize in advance. But I must confess.

In order to curb some of the spam problem in a system I've been involved lately, I implemented a rather drastic system. Captchas aren't useful, because some of our legit users can't figure them out.

I noticed that most of the spam was written in languages like Russian and Chinese. Since those are not spoken natively in the (Western European) country I'm in, I decided to reject their moonspeak.

I take the form submissions and split all strings into plain Unicode codepoints. Then I brutally remove any and all characters that are not in our alphabet and reassemble new strings from the leftovers. If the reassembled strings are empty, the whole form submission is rejected.

Almost all of the spam disappeared instantly, yet normal form submissions go through just fine. I've been logging all submissions for a while now and I haven't seen any failures. It also handily strips emoticons and most other crap, leaving only clean readable text.

Here's the "fun" part: the whole system is written in PHP.

I might implement IP whitelisting at some point.

I feel dirty.

Ok, if I've gone through Hartl's Rails tutorial and built a Twitter clone and then went and built an Instagram clone by myself, even if I again used information from Hartl's tutorial when I got stuck, would that pass as my "original" project?

Now I'm building some new functions for a JS pong game, but I made the main thing by following a YT tutorial. Can I say that's my original project?

It got banned for having amphetamines in it.

It was a shame since it was the only thing OTC that worked.

Also yeah, don't get depressed over it. You arent the only sand grain on shitty ADD beach.

Can anyone share a PHP image upload script? One which also puts the url info a database?

I have no idea how to do it properly and can't find any tutorials which aren't about fucking blob.

It's hard to say where the line actually is. Tentatively, I'd say that for you to consider it an original work, it needs to meet a few criteria:

1. A significant majority of the app, especially "core functionality" should be your own. In other words, if you rip someone else's work off and just slap a different name on it and change the color-scheme and layout a bit, that wouldn't be original. Using something else as a rough guideline = probably okay.

2. It should be obvious which parts aren't yours. For example if you use jquery, it's pretty obvious that you didn't write it, and that's fine. If you copypasted parts of the jquery source code into your code with the intention of passing it off as yours, that wouldn't be okay.

3. You should familiar enough with your codebase to confidently explain what each part does. (This is where it really gets tricky.) If you were trying to do an ajax request with jquery and copied part of the example from the docs, that would be okay as long as you could explain what you're doing. Mindlessly copypasting from the docs without reading = no good.

Guys, where to learn Angular 2?

if your page has ads or js its shit

lmgtfy.com/?q=angular 2

>lmgtfy.com/?q=angular 2

Are you literally retarded?

They exist. Stop looking to copy/paste

Anyone know if you can host multiple HTTPS websites (with different domain names) on the same server, without needing distinct IP addresses?


Been routing about HTTP websites for a while, but I've moved one to HTTPS, and ran into this problem trying to get the others on HTTPS as well.


My shitty ISP doesn't allow multiple IP addresses unless I opt for their shitty business package.

yes, it's called SNI which is integrated in I believe all modern webservers and browsers already for some years already

oh, nice. Looks like I've got a bit of learning to do, but it's good to know hope is not lost.

thank you based user

The language is not bad, incompetent programmers are

before i post a big old help post, what are the code tags again?

code with square brackets

var lat;
var lon;

(function findPosition() {
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(showPosition);
} else {
alert('Your browser doesnt support geolocation');
}
})();

function showPosition(position) {
lat = position.coords.latitude;
lon = position.coords.longitude;
document.getElementById("posi").innerHTML = "latitude: " + lat + " longitude: " + lon;
}


var myUrl = "api.openweathermap.org/data/2.5/weather?lat=" + lat + "&lon=" + lon + "&appid=6497fd3fb664e5c26f7072e3eea70f83";
var somecity = "api.openweathermap.org/data/2.5/weather?lat=35&lon=139&appid=6497fd3fb664e5c26f7072e3eea70f83"

$.ajax({
url: somecity
, })
.done(function (data) {
document.getElementById("ha").innerHTML = data.wind.speed;
})
.fail(function () {
alert("Ajax failed to fetch data")
})

why are "lat" and "lon" undefined ater the 2nd function ? i want to use to them to create links for the ajax

okay so apologies for what might come off as a "do this for me" post, but right now i'm learning backend dev by making a simple chatroom. i'm not super interested in being a frontend dev, just making it not look like absolute shit (like it is right now).

ideally, all i really want is the submit box and the list of messages aligned with horizontal wrapping and the ability to scroll up and see previous messages, with the list of participants on the right of both the submit box and messages boxes. below is the code i have

index.jade
doctype html
html
head
link(rel='stylesheet', href='fonts.googleapis.com/css?family=Open Sans')
link(rel='stylesheet', href='/css/style.css')
script(src='//code.jquery.com/jquery-1.11.0.min.js')
script(src='/socket.io/socket.io.js')
script(src='/js/index.js')
title ChitChat
body
h1 ChitChat
div
div#messages.inlineBlock.scroll
div.inlineBlock.topAligned.scroll
b Participants
br
div#participants
div
div.inlineBlock
span Your name:
input(type="text", value="Anonymous")#name
br
form#messageForm
textarea(rows="4", cols="50", placeholder="Type your message, then press Enter", maxlength=200)#outgoingMessage
//input(type="button", value="Share", disabled=true)#send


style.css
body {
padding: 3em;
font-family: 'Open Sans', sans-serif;
font-size: 1em;
}

textarea {
resize: none;
}

.flex {
display: flex;
}

.inlineBlock {
display: inline-block;
}

.topAligned {
vertical-align: top;
}

.scroll {
overflow: scroll;
word-wrap: break-word;
}


again, i not asking for my hand held or someone to do it for me, just tell me what's wrong and what shit should be done instead

because getCurrentPosition is asynchronous and you set your myUrl variables before it finished.

good that the tutorials doesnt mention anything about such things... well, how do solve this problem ?
I tried window.onload before and it didnt really work..

what tutorial? I'm sure they'd mention something like this.

run your second request after the first finished.


(function findPosition() {
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(showPosition);
} else {
alert('Your browser doesnt support geolocation');
}
})();

function showPosition(position) {
var lat = position.coords.latitude;
var lon = position.coords.longitude;
document.getElementById("posi").innerHTML = "latitude: " + lat + " longitude: " + lon;

getWindSpeed(lat, lon);
}

function getWindSpeed(lat, lon) {
var myUrl = "api.openweathermap.org/data/2.5/weather?lat=" + lat + "&lon=" + lon + "&appid=6497fd3fb664e5c26f7072e3eea70f83";
var somecity = "api.openweathermap.org/data/2.5/weather?lat=35&lon=139&appid=6497fd3fb664e5c26f7072e3eea70f83";
$.ajax({
url: somecity
})
.done(function (data) {
document.getElementById("ha").innerHTML = data.wind.speed;
})
.fail(function () {
alert("Ajax failed to fetch data")
});
}

it was a german site... whatever

just did something similar, I pushed the whole second part of the code in the showPosition function
is this a good way to "code" ?

EVERY FUCKING TUTORIAL TEACHES HOW TO BLOB

HOW DO I LEARN IF NO ONE TEACHES HOW TO FUCKING DO IT

>is this a good way to "code" ?
No. You should be using either callbacks or promises. Preferably promises.

Use your brain mate. I know how to do it and I've not even read any tutorial related to php upload.

user uploads something
take the file name and other info and put it into a database
generate a UID and save the file somewhere on the filesystem
when a user browses that UID select the file info and return the file with it.

it should be almost identical on what your tutorial is saying, just don't save images as a blob in the database but on the file system.

What are the best ways to generate UIDs? I don't want to make any stupid mistakes

let your database generate one, how depends on which one you're using.

OK so I'm ready to start on my JavaScript journey.
I just have a question: recommended environment to code in JS (IDE, etc)? Thanks.

brackets

webstorm

What's the opinion on building through wordpress? I've built a few websites for clients in the past but got out of the game for a few years and I've suddenly been thrown back in to web development through some pretty lucrative project requests. Is building with wordpress really as important for the client as it's made out to be, in regards to SEO? All this emphasis on SEO wasn't even really an issue the last time I was involved in web development.

well, why does the script works in brackets preview but not on codepen or by opening the html file with other browsers.. I dont even get the location question

works for me, did you disable geolocation?

REEE fucking opera

Well technically it's still not happening in any other language. .net is a framework, C# would be the most commonly used language in combination with that framework.

This. It seems everyone is skipping scoping class these days...

Stackoverflow, by "Every Programmer Ever". The text is not final though, so the book might change over time.

I'm looking for new technos to establish a bloat-less full stack for my personnel website.

Atm I got stylus (css pre-processer), mithril.js and yahoo's pure.css. For the backend I'm not sure between werc, flask or something in written in Go.

Any other project I should look at?

Tutorials don't all give you the full intro to JS. Synchronicity is a defining property of the JS language, so most tutorials assume you know about it. You should read up on the event loop, asynchronous / synchronous functions, callbacks and future/promise-constructions. The "You don't know JS" series has some great chapters on this.

Anything which has line numbering. All the debugging will be done in your browser, so the most basic editor will do. Mac Textedit is fine, and so is Webstorm or anything in between. Just don't use Visual Studio.

VS has been actually pretty nice for writing javascript.

WP is shit for anything beyond the most basic blog/website.

Stack is a lifesaver. I spend more time there than actually writing code. fml.

How could I make a weboage scroll automatically?

I want to scroll from top to bottom slowly. Like a movie credits roll.

window.scrollTo(0, yPos);

best MVC framework? also is MVC pretty much the standard nowadays for web dev?

FRP is popular right now with React and the like