[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: 315
Thread images: 23

File: wdg.png (251KB, 824x553px) Image search: [Google]
wdg.png
251KB, 824x553px
>Previous Thread
>>62246479

>Getting started
Get a good understanding of HTML, CSS and JavaScript.
MDN web docs offer a good intro (independent of your browser choice)
https://developer.mozilla.org/en-US/docs/Learn

>Free online courses
https://www.codecademy.com/
https://www.freecodecamp.com/
https://www.bento.io/

>Roadmap
https://github.com/kamranahmedse/developer-roadmap

>Resources
https://developer.mozilla.org/en-US/docs/Web - General documentation for HTML, CSS & JavaScript
https://stackoverflow.com/ - Developers asking questions and helping each other
https://caniuse.com/ - Check browser support for front-end web technologies

>Youtube channels
https://www.youtube.com/user/TechGuyWeb - Traversy Media
https://www.youtube.com/channel/UC8butISFwT-Wl7EV0hUK0BQ - freeCodeCamp
https://www.youtube.com/channel/UCO1cgjhGzsSYb1rsB4bFe4Q - funfunfunction
https://www.youtube.com/learncodeacademy - codecademy
https://www.youtube.com/derekbanas

>in-depth comparison of VPS hosts
https://www.webstack.de/blog/e/cloud-hosting-provider-comparison-2017/
>>
First for banning vueposting.
>>
>>62286298
>With AngularJS though it didn't really have that of a long time to establish itself, before Angular2/4 came around.
True, although people make way too much of a deal out of the differences between 1 and 2, it's really not that different. People act like learning angular 1 is like learning latin or something.
>>
>>62286280
third for jsx is shit
>>
I have a motherfucking problem and no one on the web helped me. Can /g/ do it?
https://stackoverflow.com/questions/46072792/how-to-run-3-scripts-in-a-specific-order-in-a-website-and-how-to-modify-html-cod
>>
>>62287624
running functions in a specific order is trivial, but what exactly are you doing with that python code?
How is that supposed to work in someones browser?
>>
>>62287624
callbacks
>>
>>62287954
It's the only way I found to get the url's. Is there a better way?

>>62288048
Thanks for the suggestion but, could you elaborate please?
>>
bootstrap or no bootstrap?
>>
>>62288578
Depends on project.
What is it you want from bootstrap and what's the project?
>>
>>62288182
I dont understand what you are trying to achieve, seems like you want to dynamically get the script tag content from the instagram site and add it to your own?
You are not very clear.

You can do normal ajax calls with Javascript and then handle the text response.
Once you have your data and processed it you then continue with whatever comes after.
>>
>>62288709
So I can do what I did with Python, with JavaScript? And after that, how do I change the HTML given that the div's have the same ID and I don't want to do that manually?
>>
>>62288758
An elements id has to be unique in your HTML.
No offense anon but did you just copy a bunch, glue it together somehow and expect it to work?
You need to have some basics covered.

>So I can do what I did with Python, with JavaScript?
Browser run JS not python and it doesn't seem like you intend to involve some kind of backend server there.
>>
Help i was learning php but got a Django internship, where can i get started with it? The official docs throws a lot of stuff at me help
>>
File: shitcoins8.jpg (230KB, 1286x1029px) Image search: [Google]
shitcoins8.jpg
230KB, 1286x1029px
Post what you're working on, doesn't matter how shit you think it is.

Pic related, a crypto-currency trading bot. Had to take a break from it due to actual work. Analysis module is complete, now I'm working on graphing the prediction model so that I can test different output weights.

Must.. stop... refactoring..

> should have bought at 3K
>>
>>62288933
No, I actually did the Python script from scratch. Maybe it's because it is my first project and I'm still learning.

Back to the issue, I'm going to delete the Python file and do it with jquery do that should solve the "order of the scripts" problem.
Now I just don't know how to change the HTML. Should I change the div's from ID's to classes and make class1, class2 and so son?
>>
>>62286190
Trying to post data to local sever with axios. Keep getting "404 not found" error.

Am I doing this right?

export const addFriends = () => {
const promise = axios.post('http://localhost:5000/friends');
return {
type: ADD_FRIENDS,
payload: promise
}
};
>>
>>62289442
A lot of people agree that it's best to just use classes and abandon id's altogether. So yes.
>>
Can anyone tell me what a "Full Stack" developer is? I keep hearing this over and over and it sounds like a meme to me.
>>
>>62289534
Ok, thanks for the help. I will pass by when I finish it. See you here.
>>
>>62289541
"Full stack" is someone that can work both the front and back end of a project.
>>
>>62289131
pls
>>
>>62289541

-make backend
-make frontend
-deploy your own shit
>>
>>62289541
Full stack is someone who can take and receive dick.
>>
>>62289577
https://djangobook.com/the-django-book/
or go search on youtube

learn to search the interwebz
>>
>>62289131
>>62289577

Goddamnit, if you are too stupid to google "Django tutorial", you're not gonna make it, brah.

It's not like Django is some exotic niche technology.
>>
>>62289609
That Anon probably has no AFK friends, so he came here to tell us about his internship. No h8 m8
>>
>>62289609
Or you know im looking for a good source that someone already knows instead of searching and dont even knowing if the source is good.

>>62289637
Thats not it but thx

>>62289603
Thabk you m8
>>
>>62289778
so you trust a random to provide you with a source rather than verifying yourself?
good luck with that job, you'll need it
>>
>>62289853
Yes because maybe you know that random person knows django and knows good sources? Why are you so salty?
>>
>>62289778
The point of search engines is to provide you with good, reliable sources.
>>
any recommended apartments in nyc times square? how much is the cost? planning to move there for a webdev job
>>
>>62289873
The question is about trust. Are you really this dense?
>>
I have £100 to burn, are there any courses on Udemy I should take a look at? I've already enrolled in a bunch of free PHP courses. Looking for anything.
>>
>>62290449
Buy some chips and follow a free tutorial
>>
>>62289155
pls keep us updated on this
>>
File: 1503139197672.png (11KB, 300x300px) Image search: [Google]
1503139197672.png
11KB, 300x300px
>>62290449
Learn whatever you want using free tutorials and ebooks, keep the money to host the stuff you make while learning.
>>
>>62289502
Have you checked the documentation on github? Basically, the data you're trying to post should be the second argument of the post() function, and you call .then() with an anonymous function handling the return info. Might be complaining because you aren't supplying any data.
>>
>>62290449

buy real books
>>
>>62287624
>>62287954
>>62288182
>>62288709
>>62288758
>>62288933
>>62289442

I'm honestly confused. I've doing web development for over 13 years and too tired to try and understand that mangled piece of shit you've managed to hack together.

What ARE you trying to do? What's the end goal here?

Are you simply trying to display data from an Instragram page? Is that it? Are you trying to replicate certain functionality from Instragram locally? Are you just trying to harvest data to display it in your own customized way for a client?

A clear, concise, and simplified answer could really help here. I mean, really take the time to describe what you want the end-result to be and why. I promise you'll get an answer.
>>
>>62290690
Well, I got it to work, sort of.

import axios from 'axios';

export const GET_FRIENDS = 'GET_FRIENDS';
export const ADD_FRIENDS = 'ADD_FRIENDS';

export const getFriends = () => {
const promise = axios.get('http://localhost:5000/friends');
return {
type: GET_FRIENDS,
payload: promise
}
};

export const addFriends = () => {
axios({
method: 'put',
url: 'http://localhost:5000/new-friend',
data: {
name: friend.name,
age: friend.age,
email: friend.email
}
});
};


Basically just hacking this shit together. Fuck it.
>>
https://regexly.chipto.io/
>>
>>62291007
For getFriends(), I'm simply displaying that data.
Then I have a forum for adding new data (addFriends()). Which is what I'm figuring out now.
>>
>>62289502
Try a get instead of post since your not passing data, need to see your backend or try to navigate to the endpoint in a browser
>>
>>62291007
And that's why you read the entire thread, I'm dumb
>>
>>62291018
It's cool, I just hack shit together, and I have a job.

I guess I was confused because you were showing a get earlier when you were asking about a post. Your consts there make me think you're using Redux or something though, so maybe that's why you're using the return for your getFriends() function? Either way, you'd probably want to use a .then() on your axios calls with callback to handle any responses from the server. Then again, you may be, but we haven't seen all the code.

Also, PUTs are conventionally for updating data that's in the database already, you'd want a POST if you're adding a new friend.
>>
>>62291007
https://github.com/mzabriskie/axios
They literally say to use .then() to handle the response when it comes around.
>>
Bumping from last thread:
>>62280554

1) Has anyone experience with Dokku?
2) How to secure this stupid Rails thing? Is Fail2Ban + "on board" stuff enough or do I need additional measures?


By the way, I think I'll do my next bigger project in Hanami, not Rails.
>>
>>62291007
You're using redux and going to run into issues with async code.

Your reducer functions need to be pure with no side effects like http calls.

What is your plan with the promise payload? Can you post your reducer function?

I think you may have to create an observable from the promise and put it all in an effect.
>>
>>62291407
The promise payload, I have no clue, man, I'm completely new to React/Redux/Axios.

Reducer function:
const friendsReducer = (friends = [], action) => {
switch(action.type) {
case GET_FRIENDS:
return action.payload.data;
case ADD_FRIENDS:
return action.payload.data;
default:
return friends;
}
};


Did I dun goof?
>>
>>62291325
Bruh, it's working without it.

But this Anon >>62291407
just brought my attention to the reducer. I definitely fucked up.
>>
>>62291602
I'm not sure what that is haha.

Reducer should take in state and action, you got the switch action type right but why are you returning the payload?

You should return an action like
HandleAddFriendsAction(state, <AddFriends>action)

Which clones the current state, make changes and return that.
>>
>>62291679
Idk man. I've been writing VanillaJS for like two years. React is making me feel like shit :/

Think I have to really dig into the documentation. Thanks for trying to help, anon.
>>
Why does /wdg/ hate Angular 2+? I've been trying it out and it's a gorgeous framework.
>>
>>62291715
Nah I got you,

K so the issue is the API http call will return after the reducer function is done. This means you can't do things like add the friend to the state because by the time it returns the function has competed already.

To get around this we need the http call to finish then call the reducer function with the result, in this case a friend or two I'm guessing.

Look up and read on effects, you'll need to use one to intercept the action dispatch, call the http call and then execute the results into the payload for your add friend reducer function.

This way the only thing your reducer function does is add the friends to your state, making it 'pure' (if you give it an input it should always return the same result and never waver).

I'm on my phone but I'll try to write the observable you need:

@effect()
Whatever = this.actions$.typeof(ADD_FRIEND).getLatestFrom(this.store$).exhaustMap(([action, state]) => {
Return Observable.fromPromise(observer => {
Put your promise here, when you get the result call :
Observer.next(result)
}} );
).map((result) => new Friend.AddFriend(result));
>>
>>62291736
Its lack of shittiness is a breaking change for literally everyone on the angular 1 bandwagon
>>
>>62291863
Should of mentioned, sorry been drinking.

You will have to deal with observables when using redux effects.

What that code does is:.
When the action observable emits an action with type of add friend, send it to the next in the chain

With that action, also get what the last state of the store (also an observable) was

With the action and the state, use exhaust map and pass these in. The exhaust map needs an observable which when it emits (observer.next(val)) it will pass the value to next in the chain. It will wait for async functions to finish so you create an observable from the promise that gets your api http call and passes the result on.

Finally you take the result from the exhaustmap and map it to a new action.

I know it's a lot but it is worth it.
>>
>>62286190
>use React
>rapidly develop your project
>intuitively manage the structure of your application by breaking things down into a hierarchy of components
>use TypeScript to improve solidity of your code
>still able to get runtime errors

>use Elm
>writing tons of boilerplate code
>all of your code is in one big file because prematurely separating things bones you
>constant challenge to figure out how to architect application to be purely functional
>funky-ass syntax and preferred formatting
>impossible to get runtime errors

Why can't I have the best of both worlds
>>
Has anyone here used WebAss yet?
>>
>>62292002
Kill yourself, you worthless subhuman sack of shit.
>>
>>62292957
Just use Angular 4+
>>
vue.js is so comfy to use.
sugoi!
>>
File: 1494653631381.jpg (10KB, 215x255px) Image search: [Google]
1494653631381.jpg
10KB, 215x255px
>>62293863
desu~
>>
File: 20170907_072108.png (37KB, 657x225px) Image search: [Google]
20170907_072108.png
37KB, 657x225px
Is there a big website that uses node.js as the main/only backend framework? Anything example I find on google also has another backend language besides node.js
>>
>>62294029
No, that would be retarded.
>>
>>62294029
Most if not all 'big websites', as in shit like youtube or facebook or twitter will always use more than just one backend language.
>>
>>62294112
Why would that be? Node.js is faster than any framework on PHP, Ruby, and Python. It uses javascript so both front and back end developers can easily work together. You can use libraries to make it multithreaded.
I understand companies like pic related using robust languages like Java in the back end, but websites like yahoo and wikipedia could be using node.js instead of PHP.
>>
>>62294356
I was thinking the same thing, but with GO. Like, why doesn't literally every website use such a 3000 times-folded, fully featured language like golang? It's like they don't even want to be expressive web artisans?
>>
>>62294029
Walmart.com
>>
>>62294356
Because node.js is fucking stupid
>>
>>62294356
>libraries to make it multithreaded
No you can't. You can spin up multiple communicating OS processes but that's not the same thing as multithreading. Calling into multithreaded C++ code isn't multithreading either.
>>
>>62294356
Also that's a fucking retarded systems model.
>>
>>62292957
>>constant challenge to figure out how to architect application to be purely functional
That's called being stupid, not working in a bad language.
>>
I don't know shit about databases. Is there a limit to the file sizes you want to store in one? Like let's say my site was serving short stories that could be tens of thousands of words - would I want to keep those in a database or would there be a better solution?
>>
>>62295293
"Files" are on OS concept, not really applicable in databases which think of data in higher level ways than "sequence of bytes".

Almost all RMDBS have both max length and arbitrary string types. 100KB value in a text field is not going to be a big strain on your DB, although when profiling be away the transfer time can become significant in select * style queries if you don't really need every field.
>>
>>62289502
Try this
return axios.post(URL).then((payload) => ({type: ADD_FRIENDS, payload});
>>
>>62291173
>Try a get instead of post since your not passing data
This is not the criteria you should be using when deciding on an HTTP method.
>>
Explain SQL to me bois. Am I right in thinking it is a 'middleman' language between a database and a database-interacting language like PHP etc?
>>
>>62295170
I think you are right but I am trying to learn about this: couldn't you say that the pseudo multithreading does the job well enough for serving a webpage? This isn't about rendering 3D models or doing difficult calculations after all
>>
>>62295382
Would it be better to just store the text files as files and have the database simply reference the file?
>>
>>62296507
It's more than that. It's the most popular database. Think of it more like php supports it, along with other database types. DBAs don't even touch much server side code to do their job
>>
>>62296667
That's the most common practice
>>
>>62296655
>couldn't you say that the pseudo multithreading does the job well enough for serving a webpage
Yes, multi-processing is almost always a perfectly acceptable model for scaling a web service. The primary advantage of threads is they can share a stack and are a bit more light-weight than processes (it costs less to create and destroy them). The difference is close to negligible when we're talking about the time/resource scales involved in your typical dynamic webapp though.

To be I (>>62295170) am not who you were replying to. I don't have a particular issue with node per se, although I don't think JS is a terribly well designed language. I just wanted to point out that true OS multithreading is not supported by node.
>>
>>62296718
>It's the most popular database
lol SQL is not a database.

>>62296507
"middleman" doesn't seem real meaningful in this sense. It's the language you use to communicate with the database. I guess that makes it a middleman in some sense but it's not like there's some direct API you can employ instead. Some DBs in the NoSQL family use other languages or no specific language at all to communicate but it's not like SQL represents an additional layer you can skip, it's just the only language your DB recognizes.
>>
Node or golang?
>>
>>62296990
Whichever is the right tool for the job.
>>
Is there a way to have all the routing done on the backend using express and then have it serve different react files? As of now I'm doing all the routing in react. Not sure what's preferable.
>>
Are there any good sources for learning JS? I work as a PHP programmer and have solid knowledge in c++ and python but I feel like I'm lacking in the js area. I started YDKJS but it seems superficial in the way that it just glides over basic topics. Any recommended books that I could look into?
>>
>>62297444
Kill yourself my man.
>>
>>62297432
Yes. Depends on the app.
>>
>>62292957
you'll get very few runtime errors if you setup typescript to be very strict and your linter to never allow you to use any type.
elm is nice but it will never be very practical I think

>>62294871
as I understand it they only use node in the more front-facing side of the backend (to do react SSR for example). the rest of the backend is still Scala and Oracle Commerce
>>
I'm doing the log in part of my project and I wonder how to do the authentication with express + react. Should I send requests to the login server each time I go to a protected route in react to check if the user session is still valid? Presumably some request in ComponentWillMount. But on the other side it seems a bit expensive to send a new request everytime I update a protected page?
>>
hi guys, I'm trying to make tetris in Javascript for class (we have been given very little guidance) I want to return a cloned version of my grid which is stored as a 2D array.

i don't want to return references to these values but a deep copy

var gridClone = function(grid) {
}


What is the best way to do this? I feel like I could iterate over every value and assign them to in a new array
>>
>>62297733
cont.

But I don't know if this is efficient or not
>>
Hey guys, I'm trying to set up my own Digital Ocean server and SSH into it, but I keep getting Port 22: Connection refused error. Does anybody have any good walkthroughs to deal with this shit? Everything I find online is useless. Any tips or whatever.

Apparently my droplet(server) is up and running on DO, but I do ssh root@--ip number-- and I get that error. I have checked and I do have sshd installed, I ping the server and it works. No idea...
>>
>>62297785
I've decided to fuck efficiency and just trying to get something working for now. I feel like I get caught up when working with JS about trying to do things to fancily instead of just writing code that works.
>>
File: tag_growth_scatter-1-1-1024x896.png (127KB, 1024x896px) Image search: [Google]
tag_growth_scatter-1-1-1024x896.png
127KB, 1024x896px
>TypeScript
>142% growth rate
GOOD
>>
>>62297790
Did you set up firewall? If yes then you probably blocked ssh. Hope you have alternative access at that case.
>>
>>62297623
https://github.com/dcalsky/jwt-express-react
>>
>>62294112
>>62294951
I like Node

>>62297444
You know the basic syntax, right?
If you still need to familiarize yourself, then check learnxiny, do some code challenges and learn ES6.
Once you got that down, you just start building stuff and constantly look up things on MDN

>>62297790
fresh server with no changes should give you 0 problems
Are you logging in with a password or did you specify, that you want to use a SSH key?
Probably the latter if you are having issues.
>>
>>62298309
> learnxiny

Thanks, I think that will get me kickstarted! I particularly like their further reading section.
>>
>>62298290
>>62298309
yeah, the firewall was blocking ssh out, but not in, that's what confused me. I kept doing "ufw allow 22/tcp", but that didn't modify the tcp out being denied. Whatever...
>>
>>62298300
>https://github.com/dcalsky/jwt-express-react

Just what I needed. God bless you anon.
>>
Why would I ever want to use 'strict' javascript?
>>
>>62289541
someone who can do backend AND waste time & energy on worthless shit
>>
>>62299152
it's a gimmick for retards who can't code without running into a brick wall 4000 times
>>
noob here, I want to create a web extension for a custom new tab, what APIs dow i need to use in the .js file? and generally how do i go about doing this?
>>
Is CSS worth learning lads, or can I just use a program to create all the style sheets for me? I'm currently learning it in notepad
>>
>>62299697
>how do i go about doing this?
the first, fundamental step is to learn how to google
https://developer.mozilla.org/en-US/Add-ons/WebExtensions

>>62299745
>Is CSS worth learning lads
yes
>or can I just use a program to create all the style sheets for me?
theoretically yes, but in practice: no
>>
>>62299152
'strict' is obsolete if you write ES6
>>62299745
>Is CSS worth learning lads, or can I just use a program
You don't need to be a CSS wizard but basic CSS skills are absolutely crucial.
Get a proper editor with syntax highlighting like vsCode, Atom, etc, hell even Notepad++
>>
>>62299745
Jesus christ m8, it's not even a language. There's nothing to learn.

And no, you shouldn't be writing CSS. Ever. Go learn LESS or SASS.
>>
>>62299846
Thank you good anon
>>
>>62299899
he wasn't asking whether to write CSS or SCSS you mong.
The answer is 'yes you need to know CSS'.

Your answer is like saying 'you should never write JavaScript. Go learn ES7 instead'.
>>
I have a table which is centered on top of a container `div`. Is there anyway to allow one table row expand outside the table, and have 100% width?

pic shows my situation. i need the colored row to have 100% width.

any ideas? been stuck on this for hours. tried to make 2 tables but it fucks up with responsiveness.
>>
Does anyone use Django templates with some occasionally some Vue included? Can you post some code examples, google does not deliver anything
>>
>>62300276
post codepen
>>
>>62300363
more of less like this

https://jsfiddle.net/zvjaep1q/

i need the last blue column to expand full width.
>>
>>62300398
https://jsfiddle.net/f4Lde5w0/
>>
Brackets or Atom or ???
>>
>>62300433
i mean the last row should have no red at all. it must reach each side of the page, left and right
>>
>>62300467
Looks like you've been working on this for a long time, and you don't want to experiment anymore
https://jsfiddle.net/sbdfch1b/
>>
>>62300502
thanks anon, love you.
>>
>>62292957

>>all of your code is in one big file because prematurely separating things bones you

What do you mean?
>>
>>62300465
vscode
>>

function sumArray(arr){
var sum;
for(var i; i <= arr.length; i++){
sum += arr[i];
}
return sum;
}


why doesn't this work properly in adding together the elements of an array?
>>
Someone give me an idea for a side project.
Bonus points for including machine learning stuff
>>
>>62300836
rss feed aggregator with user article rating so that you can make content based recommendation
>>
>>62300778
sum isn't defined so it is literally 'undefined' rather than an integer variable which is what you want
>>
>>62300836
how about not having a side project and manning(our hero) the fuck up
>>
File: ss-2017-09-07-18-52-14.png (52KB, 677x423px) Image search: [Google]
ss-2017-09-07-18-52-14.png
52KB, 677x423px
>>62300778
USE TYPESCRIPT
>>
>>62301152
Wait why isn't everyone using typescript? I would save a lot of time if I could get error messages like this.
>>
Thoughts on this as a recourse for a beginner? https://github.com/P1xt/p1xt-guides/blob/master/wd-cs.md
>>
File: ss-2017-09-07-19-00-31.png (50KB, 819x442px) Image search: [Google]
ss-2017-09-07-19-00-31.png
50KB, 819x442px
>>62301224
adoption takes time, even though typescript is growing crazily fast.
also you can get some of the ts goodness in plain js too
>>
File: ss-2017-09-07-19-09-00.png (4KB, 180x82px) Image search: [Google]
ss-2017-09-07-19-09-00.png
4KB, 180x82px
>>62300778
>>62301152
and to answer your question directly: the loop body never executes because the condition can never be true
>>
>>62301279
is that eslint you're using? I use jshint atm and I don't remember getting any useful feedback other than I missed a semi colon.
>>
>>62301406
nah, it's typescript's type checker
>>
>>62286959

you are missing the point
>>
>>62289155

refactor when you're done sen-pai

Are you using a call to some API or - I can see a key up there? Where/how are you getting the data? Is this only for dollas to cryptos or just cryptos?
>>
why would one waste time with websites when web applications offer so much more interactivity?
>>
How would you go about storing data you received (and displayed) from an external API, later when you are offline.

Like I call to a movie db to get popular movies, display the info via template engine - somehow save it - and when the user comes back later and loads the page (has just one query) gets the old info.

If he's online tho, he gets fresh.

I'm thinking using cache but it's not clear if this could work. There's one header I can set that would make the browser check if the data I want is already in the cache, but I think this needs a live connection too...
I could also use a session manager like Redis.js but that would still need a connection?

Any ideas?
>>
>>62301929
Look into service workers.
>>
>>62302051

cheers
>>
people that use bootstrap/bulma/foundation, what do you do to optimize after making your alterations?

>>62301866
A web application is pretty much just a website. If your website doest need interactivity then why?
>>
vert.x seems interesting but I can't think of an application to build with it
>>
>>62301152
use common sense
Do people really have permanent problems with undefined values and wrong types? Are they half asleep when writing code or outsource everything to india?
>>62302284
what do you mean with "after making your alterations"?

You can use something like this to remove unused CSS rules
https://github.com/webpack-contrib/purifycss-webpack

also
https://github.com/NMFR/optimize-css-assets-webpack-plugin
>>
>>62301224
m$
>>
how do i start with nodejs, which source would you recommend me?
>>
>>62302776
Do you know how to use NPM?
In the end it's just Javascript with extra functionality from the Node API.
Are you planning on building something specific yet?
>>
Frontend-fag here. Boss wants to transition me to backend roles, everything is Java. Never touched Java in my life, where should I start /g/ents?
>>
>>62302863
npm sur

i just wanna learn some basics
like how to make node+mysql crud and things like that
>>
>>62302880
spring?
>>
which java implementation of scheme would you recommend for web applications with the jvm?
>Bigloo
>Kawa
>SISC
>JScheme
>>
>>62302367
everyone who programs 8 hours a day is bound to make a lot of stupid mistakes. if you don't then you're an exceptional genius and your advice still doesn't apply to us subhuman 99%

http://robert.ocallahan.org/2017/07/confession-of-cc-programmer.html
this is about rust and c++ but I think it applies every time someone makes a "hur dur just don't be stupid" argument against type checking and other safety mechanisms

>>62302880
I can't really recommend many books or courses because I've learned most of it by doing, but I used this guy's spring course as a refresher once and it was pretty good
https://www.udemy.com/java-tutorial/
so it's possible his beginner java tutorial is decent as well

>>62302975
clojure :^)
>>
>>62302900
don't really have a good tutorial at hand, sorry.

Something you might want to start with is a simple express server. Definitely the most widely used of the node http-servers and something you would see over and over again anyway.
If you are able to read and comprehend docs you are already halfway there though.
NPM modules and the associated git repos are usually very descriptive.
>>
Does anyone care about this? I'm a first year developer and thought maybe this might catch a recruiter's eye when I start looking for my next job.
>>
>>62302922
Yep.

>>62303029
Thanks. I'll have a look at that. I'll definitely need a beginner level start as I've been working on the design side for so long my fundamentals are very crufty.
>>
>>62302367
well don't you end up overriding a lot of the default styles? for instance you want to remove the boxshadow from input fields. you can modify the original frameworks css or you can override in your own file. overwriting the original makes updating impossible. will the tools you linked remove the original and keep the overwritten?
>>
>>62303113
you'll catch people's eyes alright

then they laugh
>>
>>62303127
bucky robers for basics
thenewboston
>>
>>62303113
haha
>>
>>62303197
with a frameworks SASS version you usually have some variables to adjust, but for changes like that, you would just override the property in your own CSS.
It's not unusual, that more than one class applies to an element, with the one with the highest specificity taking priority.

I wouldn't even say, that you override a lot of defaults. More often than not it's a binary choice of using the default or writing your own CSS for an element.
The extra bytes of the few rules you modify and extend are not worth worrying about, unless you are doing something seriously wrong.
>>
code.jewbook posts/274518539716230 Yarn 1.0
>>
I don't know why Free Code Camp's focus on community and people gathering together to code makes me angry but it does
>>
>>62303113
Did Sergey Brin and Larry Page send you that .png themselves? It is a very nice .png.
>>
>>62304210
are you saying you do not want to commit 900 hours to a non-profit with your fellow codefriends?
>>
>>62304210
natural reaction when you feel threatened
>>
>>62304374
I honestly don't know whether it is bitterness or not

I just fucking hate the idea that coding is a social group endeavour and that you have to do work for non-profits too

FCC is fine for its tutorials but fuck what it actually stands for
>>
>>62304525
it's bitterness 4sure
>>62303113
it'd be much easier just to put a FBI seal of approval as your portfolio website's loading screen
>>
>>62291736
We use it at work and I agree. I'm new and haven't worked with it before but it all seems so intuitive. I'll probably give it a try next side project.
>>
>>62303659
Makes sense. Thanks anon.
>>
>>62300778
>not using reduce

var sum = [0, 1, 2, 3].reduce(function (a, b) {
return a + b;
}, 0);
>>
how do I get started with the framework Vert,x?
I've been using php to create web applications but want to branch out, I've not used a framework before and there's like, no tutorials on the subject.
>>
it's terrifying coming back into playing around webdev after about 6 years away.

downloaded a 2 page of a bootstrap demo.
came with 58 js files, that's the actual amount.
Also wtf is node, npm, .min.js, bower and .less and gulpfile?

How do people edit all this? I have about 12 separate files open in Notepad++

lol nvm i'm going back to php.
>>
>>62301929
Localstorage? IndexedDB?
>>
>>62304943
Is this some sort of new meme? Pretend to be shocked at projects having more than 1 file? What's the sitch
>>
>>62295273
as if

>>62297524
>you'll get very few runtime errors if you setup typescript to be very strict and your linter to never allow you to use any type.

This is true and I found working with strict Typescript + TSLint to be pretty comfy and made serious headway prototyping a game over the weekend. Thinking in terms of React is just intuitive, I don't know if that's strictly "I already understand this"-bias but then again learning React didn't take a lot of time or tutelage either.

My breaking point was realizing that I could break my app by not setting a component's `this.state` to anything in my constructor while having other functions that reference `this.state`. Compiler barfs if I explicitly set `this.state` to null, or if I set invalid properties, but I can straight up not set it to anything to begin with an a) it compiles b) linter says nothing about it.

This bothered me *a lot*; that I could neglect something so crucial and not know until I ran my app. Is there something I'm doing wrong? Am I missing something?

>elm is nice but it will never be very practical I think
That's the vibe I get from it as well, the way I want to describe Elm is "autistic" but I think the front-end community is going to settle on something that makes runtime errors impossible, it might not be Elm though.

>>62300579
The way pieces of code rely on each other makes splitting things apart not very intuitive, it's easy to end up with circular dependencies when you do. I've seen multiple people, including the person who introduced me to Elm, suggest to not split things out at all until you're basically "done" with your project.
>>
>>62304943
The golden rule of learning something new (or completely different after so long): don't immediately dive into the deep end
>>
Just been awarded my Bronze-level Good Boy Badge in HTML from W3Schools :)
>>
>>62303113
My job title is senior hybrid mobile developer and if you showed me that I'd crack up on the spot.

Go read documentation, I don't get why all these new Devs are so desperate to spend money on tutorials and certifications.
>>
>>62303029
>everyone who programs 8 hours a day is bound to make a lot of stupid mistakes

I program 8 hours a day as well does everyone on my team and we average very few stupid mistakes.

You tend to make less and less mistakes as you program more, not the other way around.
>>
>>62301929
Web app?
Localstorage, perhaps with a library that allows you to set a cache expiry.

Localstorage.get('movies')
Localstorage.set('movies', moviesobj.toJson())
>>
>>62305812
>You tend to make less and less mistakes as you program more
That's only true if you're working on the same general tasks over and over again rather than actually trying new things for the team. Which seems to be the norm very few actually bother doing much outside a comfort zone especially when work incentivizes the opposite.
>>
>>62304677
http://vertx.io/materials/
https://github.com/vert-x3/vertx-examples

>>62305307
>Compiler barfs if I explicitly set `this.state` to null, or if I set invalid properties, but I can straight up not set it to anything to begin with an a) it compiles b) linter says nothing about it.
surely you can write a tslint rule for that. I can't really say more because I've never used this.state in my life as I always keep all state in mobx observables

>>62305812
and yet 99% of companies migrate from less type safe solutions to more type safe ones. facebook even created a new language because they wanted to have static types
>>
Not about webdev but might get answers here.

What font looks good in Linux and Netbeans? Most fonts look like shit because lolJava
>>
>>62306016
inconsolata(-g) and monaco are the only fonts I find that look good regardless
>>
>>62306016
https://wiki.archlinux.org/index.php/Java_Runtime_Environment_fonts
are your settings ok? are your jdk and freetype up to date?
I used to use infinality-patched jdk but I think my fonts look fine on stock oracle jdk now. I'm not sure though because I've been doing an electron project exclusively for some time now and I haven't touched intellij in a while
I'm using DejaVu Sans Mono btw
>>
Been using Redux for 3 days now.

I absolutely love it and want to use it for everything.

Fuck react though.
>>
>>62306589
Depends on the complexity of the project and the team experience.
>>
>>62306001
Because it makes development a lot easier and faster? When you need 30s to compile the web pack an undefined variable is annoying.
>>
File: FinalRestingPlaceForAll.jpg (521KB, 1071x1068px) Image search: [Google]
FinalRestingPlaceForAll.jpg
521KB, 1071x1068px
Dear /wdg/,

I got a call yesterday for a junior php dev position. The interview is tomorrow morning. My php is shit, I honestly don't remember much of it. I just applied because /wdg/ told me to apply for everything. I thought I would have time to study!

What. The. Fuck. Do. I. Do? I was thinking about being honest with them but being honest has never helped anyone. Should I just Google some sample questions and study those and pray they ask those questions?

Pic is what i feel like in my soul.
>>
>>62306786
Just open some project and start looking at some code, you'll get up to speed in no time.
>>
>>62306786
Fuck php is so easy
What DO you have experience with?

Do you have any personal projects? You should. Take a laptop with you and demonstrate your project. It's a junior position and they're just expecting basic understanding of things. Relax and try to be personable. You'll be fine.
>>
File: Untitled.png (71KB, 1597x745px) Image search: [Google]
Untitled.png
71KB, 1597x745px
why javascript why

its literally the same code but with 1 instead of 2
>>
>>62307136
I got experience with design (html, CSS, bootstrap, adobe stuffs, etc..) and just started trying to learning javascript and c#. I took a php course in school and had made a php conversation tool via a tutorial about 7 months ago.

I got my website online with my projects.

>>62306983
I'll try, thanks for the suggestion anon.
>>
>>62306589
>Fuck react though.
But why
>>
>>62307264
#p1Display cannot be found, probably a div with a similar name exists in your HTML
>>
>>62307264
Did you double-check your HTML to make sure you have an element with that id?
>>
>>62307264
Another clue: identifiers are case-sensitive.
>>
What do you guys do about jobs offered by pajeets? I've been emailed for three different jobs and all of them have been by a pajeet. I normally don't trust them because they have a lot of scammers over there and all that.

Should I even respond? How would I even know if a position is real?
>>
Why do modern web devs think it's acceptable for websites to be sluggish on a 1GHz CPU and use hundreds of megabytes of memory?
>>
>>62301722
Yep, using the bittrex API. Only crypto to crypto on that market. USDT is Tether but I'm not sure that's a reliable indicator..
>>
>>62308515
Please provide more specs on your device and an example of a sluggish site. I believe most phones are about 1Ghz and most webshit artisans are mobile first thinkers.
>>
>>62305852
I feel like this is a really dumbass question, but is there any reason, for localStorage, to do

localStorage.set('favColor','blue');

as opposed to

localStorage.favColor = 'blue';
?
>>
>>62306589
>redux
>start work on a React project. Redux pipeline is nice and simple. Everything flows nice. It just worksTM
>genuinely happy
>new guy joins the project, React "veteran"
>absolutely fucks the pipe, add a bunch of unnecessary steps and helper functions, initial state built on the fly from multiple sources
>project is duct-taped together, barely working, needs fixing on every push
>want to die. considering suicide or throwing my comp out the window (worse)

I like redux. I just wanted to share my story.
>>
>>62308744
First example doesn't mutate the state. Same reason you use


const newState = {
...state,
keyToChange: newValue,
};

>>
>>62304943
Think of it this way: It's not that it's more complicated (tho it is). It's that there's much more of a tendency nowadays to separate files into multiple tiny modules. That way, if you have a problem with, say, accessing your Mongo database, you know EXACTLY what files to look at.

Node: JS runtime on the backend.
NPM: Its package manager. NPM is bae
.min.js: JS ignores linebreaks/commas, so this removes those, shrinks variable names, and otherwise shrinks shit so your file goes down jurassically in size.
bower: outdated(?) front-end package manager. Like NPM, but fucking ugly website.
.less: One of many preprocessors for CSS. Allows some (as yet) advanced features that aren't part of normal CSS, like loops.
gulpfile: Basically runs a whole bunch of 'maintenance' tasks for you, like converting LESS to CSS, minifying code, making sure your local DB is running, etc.
>>
>>62304626
My man.

const sum = [0, 1, 2, 3].reduce((acc, e) => acc + e);


To satisfy my autism.
>>
How come my bootstrap 4 navbar look nothing like the example even though I copy and paste the code?
Example:
https://v4-alpha.getbootstrap.com/components/navbar/
Mine:
https://jsfiddle.net/aybr5pmq/
>>
>>62307264

p1Score div was initially read as undefined or null at the start because its likely that your HTML hadn't rendered it yet.

Here's three options:

1. Include the script at the bottom of your body tag in your html structure.

2. Define the variable in your global scope like you're doing now but don't assign it. Use the Dom on content loaded event to assign the variable.

3. Call the selector inside your on click event
>>
>>62308744
>>62308789

Oops sorry, I thought you were the guy talking about react. localStorage is probably doing some other checks on your value other than just setting an object.
>>
>>62309685
Nevermind, i was using alpha code with beta .css and .js
>>
>>62290449
buy coke
>>
>>62300778
var sum = 0;


undefined + 1 doesn't make sense
>>
>>62306001
>http://vertx.io/materials/
>https://github.com/vert-x3/vertx-examples
yh, those are learning materials, neither of which explain how to physically get started.
I know i gotta download it but what do I do once I have? do I have to install it to a server like PHP? there's no explenation on the topic at all. I've never used frameworks before and this is all so intimidating.
>>
Eloquent javascript is a free and top tier resource
We'll place it in the next sticky
http://eloquentjavascript.net/
>>
I'm a professional web developer working in silicon valley and earning absurdly more than my burger-flipping-tier work justifies. AMA
>>
>>62312873
do you all gargle man seed for breakfast or is it just you?
>>
>>62312968
I read GEB so I know the answer is MU!
>>
>>62313015
this wasn't an irony post fyi
>>
I have to learn JavaScript for a course, is there a good book for it?
>>
>>62313224
https://learnxinyminutes.com/docs/javascript/
https://developer.mozilla.org/en-US/docs/Web/JavaScript/A_re-introduction_to_JavaScript
https://github.com/getify/You-Dont-Know-JS
>>
>>62313281
Thanks
>>
>tfw since opening up a GitHub account I cannot let a day pass without at least 1 commit
That green grid is a stroke of genius /wdg/. It keeps the contributions flowing in.
>>
>>62287624
promises
>>
File: Reddit Place.png (971KB, 4000x4000px) Image search: [Google]
Reddit Place.png
971KB, 4000x4000px
How much server power (or rent cost) would it take to handle something like pic related? It is a board where every user can edit one pixel every 5 or so minutes. It had around 90,000 unique users watching/participating when it was closed.
Will the backend language significantly affect the power/cost needed?
>>
>>62290449
buy snacks, go to youtube, learn
>>
>>62294029
https://stackshare.io/stacks
>>
>>62301152
nice
>>
>>62302776
install it first
>>
>>62302776
>>62313902

https://nodejs.org/en/download/package-manager/

sudo apt get install -y node

...just jump in already
>>
File: temp.jpg (7KB, 147x206px) Image search: [Google]
temp.jpg
7KB, 147x206px
>>62313538
The grey squares cause me pain.

>tfw you forget to commit before midnight
>>
>>62313771
>Will the backend language significantly affect the power/cost needed?
doubt it, if a user can only interact with it every few minutes.
Would be more concerned about traffic.
>>
>>62287624
learn a web framework like flask if you're in python
>>
so, I know that babel-minify webpack plugin minifies all of your dependencies
and I also know that my laptop is pretty shit
but how the fuck does it take 2 gigs of ram and not finish after 23 minutes and counting? 24 now

>>62312855
but they do
http://escoffier.me/vertx-hol/#_prerequisites
but overall vert.x doesn't look that beginner friendly. I would go with spring boot or spark framework
>>
>>62314066
>http://escoffier.me/vertx-hol/#_prerequisites
how the fuck did I miss that, thank you so much for putting up with my autism.
>>
>>62313538
It is a typical example of gamification.
>>
>>62314066
yeah, something wrong with your config most likely. Shouldn't take that much time or ram.
>>
>>62313771
For the record, I have a little experience, but I'm no expert.

You could probably probably get by on the lowest tier Heroku or Vultr server. You only need to store one image (one pixel array) and handle sporadic requests. If you had 90K users that might slow things down but it's not like you're streaming the image out right?

Also, where is that picture from? That's awesome.
>>
>>62314275
That was the april fools thing of reddit. Even 4chan raided it.
>>
>>62311834

underrated response

I find I personally work best on speed, especially before a deadline.
Adderal works fine too, if you can get it....and if what you get is actually Adderal....
>>
>>62313802
Youtube courses are shit. Cunts like bostonwhatever that burp into the microphone and don't bother to edit ot out, and they usually have shit examples and are unprofessional. Meanwhile on udemy the teachers answer questions in the Q&A all the time and their examples are more realistic and meaningful. They also update videos throughout the years. I always buy when they do the 90% off deals, costs like 10 bucks a course.
>>
>>62312873
How do I find code monkey jobs? What are good keywords to look out for in job postings?
>>
>>62314778
thenewboston is not the only programming channel on youtube, also i don't like watching tutorials i only read
>>
>>62314848
Agreed. I wish more people made video demos of the final overall design but didnt try to teach through narration.
>>
>>62314778
Brad Traversy is very good. I also like mmtuts. It's all a matter of filtering through the crap people who don't know what they are talking about vs. the ones who do. This involves cross-referencing whatever is mentioned in videos with MDN and other documentation sites.

thenewboston is absolute shit and promotes bad practices as you say. Most frustrating of all is his habit of naming variables with completely random terms, and I have seen code in the wild every now and again which perpetuates this shitty act.
>>
>>62314975
mind you thenewboston help me understand what is redux
>>
You know when you create account and you get email with a link to activate your account? Well why do they always generate some random number and append it to that link? I get it its about security but isnt already enough the fact that you have access to you email account to see the link?
>>
>>62314274
yep, I just ran uglify-es directly from the command line on my single, large bundle file and it took like 5 seconds
>>
Spill the beans on your experiences with Upwork /wdg/
>>
>>62315491
what's upwork?
>>
> * ctrl+f and type vue*
> nothing important
> go back to /pol/
>>
>>62315176

>https://en.wikipedia.org/wiki/Security_through_obscurity
>>
>>62315537
vue
>>
>>62315525
Not much, you? regards, work
>>
>>62315176
url collision or something, not sure
>>
>>62315176
it's a unique identifier which proves to the server that you have access to the email account where that link was sent to.
it wouldn't make much sense to have a www.example.com/validate link without it, who is trying to validate and what account?
>>
>>62312873
were you born in the states?

What languages do you know? Do you have a degree? Preffered/most used language/framework?
Where do you think this field is headed in the next 5 years and where should a noob concentrate on to be ahead of the curve?
>>
Sup webby devs

So I stumbled over this: https://github.com/koorchik/LIVR

A "language independent" ruleset for validation. You declare the rules using JSON, and use an implementation of the spec to validate.

Any alternatives to this also implemented in Go or Java? This sounds excellent, consider a SPA-setup (js frontend) and other backend. Having the same rules would be nice.

Any experience?
>>
>>62314975
I'm not the quoted.

I learn with the new boston because it's just a easy and fast way to understand certain features but I already noticed that he doesn't say how you should avoid bad practices.

I think the videos are "bite-sized" to help people understand faster, especially beginners, but there is no way you can learn an entire feature with just 5 - 15 minutes of video.
>>
>>62315588
>who is trying to validate and what account?
uhmm you? the one who provided an email and proved that have access to that email since he clicked the link?
what am i missing here
>>
>can into programming
>can't into design
Who knew, that creating a portfolio site for your projects would be so difficult.
>>
>>62316439

1) Josh, John and Jim are entering their email into your website. You send a link to each of them.

2) Now you see at your website that you got two IPs that clicked the link.

3) How can you tell which person has verified it's account?
>>
>>62316572
Their emails are unique,cant we use that to our advantage somehow?
>>
>>62316685
If you're doing it by clicking a link sent in an email, then all the information you're sending in that link has to be in the URL.

You don't want to use the email address itself in the confirmation URL, because then people can bypass the whole point of the email verification system. Also it's generally bad practice to put emails in URLs.
>>
>>62316461
If you can't work something up with HTML and CSS then it is too early to build a portfolio page
>>
>>62316858
I understand now. Good example with those three guys.
This is the main reason to send unique links to each email right? To differentiate between users?
>>
Anyone here build a shopping engine, small or large? I was curious if anyone ran into things like cost overruns with vendor api.
>>
>>62316907
This (>>62316858) was me, but the example was a different anon, so props to him.

>This is the main reason to send unique links to each email right? To differentiate between users?
Yeah, pretty much. It's basically just something only the person with access to the email account could possibly know.

Also, if you're ever implementing this yourself, make sure you use something random, and not something predictable (like a sequential counter or something). If a user can predict what the "random" link will be, then they can verify an email address that doesn't belong to them, which could be bad.
>>
>>62316907

This and security.

Imagine you would simply create an MD5 hash of the email adn put it in the link as parameter for verification:

https://blabla.com/verify?user=[MD5 of "[email protected]"]

Then you could create one real account, look at verification link and realize iit's only the MD5 hash.

So the next time I can make up an email adress or use an existing one (the user will probably think its spam and delete it). Then I wait a few minutes and then visit an verification link, where I simply put the MD5 hash of my fake email.

BOOM! I got a verification of an email that doesn't even exists or that I don't have access to.

So you want to use one-time token, so can make links that you can expire - for various reasons.
>>
>>62317081

Hah, you were faster than me:
>>62317124

Good job, I am always too lengthy..
>>
When it comes to creating basic websites that require some secure login, or utilize any amount of php, is there a good primer on how to write 'secure' php code?
>>
>>62317081
>>62317124
Thank you both for your answers.Really appreciate it.
Since I am inserting the user into the db along with the status and generated token before they even activate the account from their email what should I do if they dont activate it for more than few days or eve never? Is it good practice to just delete them from the db?
Is it even good practice to insert the user into db before they are fully activated although I dont see how else to store the unique token assosiated with that user to use for comparison with the token from the link i send them..
>>
>>62317161

For security, always use premade libraries and proven algorithms like bcrypt or oauth2. The less you implement yourself, the less problem's you'll have. Creating your own security implementation is not a good idea..

https://www.youtube.com/watch?v=8ZtInClXe1Q
>>
>>62316906
Not talking about "how do I center div, pls help"
it's the balance of over- / underdesigning things.
Do I include funky animations to show off some skills or keep it more plain and functional as I would do with a normal site/app.
Color scheme: Do I use something eye catching with more vibrant colors or keep it simpler and easier on the eyes, but risk it looking boring.
All these things to consider..
>>
>>62317345
So trust mathfags to create the scripts and just understand what you're implementing? Are good security protocols open source?
>>
>>62317284

>Is it good practice to just delete them from the db?

Yes, definitely!
You should clean up if they don't verify in 1-3 days. Also you should delete the link after verification.

>Is it even good practice to insert the user into db before they are fully activated

Yes, you have to save the information somehow. Make sure nobody can login, that isn't verified.

Also it's a really good idea to let a library take care of this while process. Every bigger framework has some kind of user library, many of them come with email verification.
>>
>>62317397

Let me put it like this:
Security is difficult. Really difficult.

Your best bet is to use some proven technology, follow all it's standards/guidelines, configure it in the right way and touch it as little as possible. Even if you think you are smart and try to add security by re-hashing or adding salt&pepper, you usually only weaken the security.
>>
>>62317463
I see. Can you implement security without buying middleware?
>>
>>62317421
Thank you anon I am developing in Laravel btw.
>>
>>62317463
>>62317564
Better question: where could I find a primer on what security issues I need to consider and find solutions for?
>>
>>62317589


See:
>https://laravel.com/docs/5.4/authentication

>>62317594

It's depends on your language/framework.
>>
>>62317656
basic login systems, maybe api calls. So, PHP and JS?
>>
What's best for indentation, tabs or spaces?
>>
>>62318201
It's whatever you prefer.
>>
>>62318201
I feel wrong indenting in any other way than with two spaces.
>>
File: urinating.jpg (133KB, 1920x1080px) Image search: [Google]
urinating.jpg
133KB, 1920x1080px
>>62286190
What's the best way to deal with widows and orphans? My client is pretty pissy about this shit for some reason. I've tried using jQuery Widowfix plugin, but it didn't work.
>>
I'm new to servers. I want to be able to connect via an FTP client like Filezilla to my apache2 server on Digital Ocean. Is that possible and is there a resource available which guides me on how to do it without being too complex
>>
File: nosferatu.jpg (30KB, 450x530px) Image search: [Google]
nosferatu.jpg
30KB, 450x530px
I have a React application that makes an API request. There are two pieces of state to consider: loading and apiData.

I want to set loading to true, then make an API request. When it returns, update loading to false and apiData to the data we just got back from the request.

Is there a better way to do it than this code below?
  this.setState({
loading: true
}, () => this.setState({
data: getApiData(),
loading: false
}));


It feels a bit awkward using the setState callback to make things happen in this sequential manner.
>>
>>62318968
use your linux user account to log in via sftp in filezilla or something

>>62319012
can't you just use a callback or promise to do that, once the ajax returns? Is that a problem in react?
>>
>>62318201
the one that's in the official or the de facto official style guide for your language
>>
is the official PHP site, the best place to start learning or is there a better resource?
>>
>>62319149
>linux user account
So an account on my computer or the account on the server?
>>
>>62319785
There are many good resources

https://github.com/ziadoz/awesome-php#resources

The official site is the most reliable one obviously but there are many sites which explain concepts in simpler terms. Also I learned a lot from YouTube but just keep a critical eye open on there.
>>
>>62308744
>>62308789
>>62309731
Sorry for the late response, but yeh, I figured you had to be talkin about react or something. It SEEMS like 'localStorage.customItemName' is TECHNICALLY doing the same thing (i.e., .get() or .set() depending on context), but that it's also not officially standardized. So if you're suporting some weird-ass browser, it may be worth doing .get and .set. Otherwise, it seems not to matter hugely.
>>
>>62311834
Why not just install it with npm?
npm install coke
>>
>>62313224
>is there a good book for it?
Is there any particular reason doing stuff like freecodecamp or something isn't an option? I'm honestly not trying to be sarcastic, just that books are kinda notorious for being outdated as far as development.
Would much more recommend you do what >>62313281
says, or the sites I mentioned.
>>
>>62319898
thanks

>>62319876
On the server.
Think of it like SSH for file transfer.
>>
>>62314275
>>62313771
Well, it's mostly going to depend on how popular it is, as much as that's an unhelpful answer. I wrote something related - an anonymous drawing app in Angular/Express/Node - but mine had no database component. The main difference between mine and r/place is that that with mine, you could continuously draw (using socket.io). The actual software behind it is so simple that you can set it up in about 5min to run on an RPi in your house.

I feel your biggest concern here would be storing users. As I see it, you'd probably want to store the IP of the user, and possibly the time they last visited. Depending on the DB you're using, you'd then either set some sort of EXPIRE key (i.e., for Redis), or have a reaper function that checks to see if the time difference between now and the entry time of a particular entry is greater than a certain value (i.e., 5 min). I wrote a (horrifically bad) RPG with a voting system for users to enter their own monsters/weapons/armor to be included in the drop table. The votes on an item are counted after a particular period, which I use the reaper function for. That is, after N milliseconds, the item is removed from the Votes table and then optionally moved into an armor/monster/weapon db depending on votes.
>>
>>62319012
this.setState({ loading: true });
fetch('stuff').then(data => this.setState({ data, loading: false }));
>>
File: temp.jpg (34KB, 434x470px) Image search: [Google]
temp.jpg
34KB, 434x470px
>>62318968

I used this guide

https://www.digitalocean.com/community/tutorials/how-to-set-up-vsftpd-for-a-user-s-directory-on-ubuntu-16-04

and then connect like pic related
>>
Best place to start learning django?
>>
File: Cm4IPQLWYAALzzG.jpg large.jpg (97KB, 1024x923px) Image search: [Google]
Cm4IPQLWYAALzzG.jpg large.jpg
97KB, 1024x923px
do you have a job?
are you earning money with web development?
>>
>>62322114
>having to work with asians and pajeets
I feel her pain
>>
File: large[1].jpg (102KB, 819x1024px) Image search: [Google]
large[1].jpg
102KB, 819x1024px
>>62322145
she seems to be quite content
https://twitter.com/codergirl__
and earns more than I do
>>
>>62322321
Lol she looks like she has fun alright
>>
>>62322321
>>62322367
>tfw reverse harem
>>
read
the
fucking
manual
>>>/thefuckingdocsgarry/
>>
I fucking love GitHub.
>>
>>62314844
>How do I find code monkey jobs? What are good keywords to look out for in job postings?
Depends on what you're trying to optimize for. If you want something that's easy to interview for, easy to do, good-but-not great pay then look for job descriptions that were made by HR, long lists of tech that probably should be mentioned, like if they list CSS and HTML, as well as like LESS and jade, typically you wouldn't bother to list any of those if you're a programmer writing a job description, much less a target language for some tool being used. Doesn't matter if you haven't worked them, there's a good chance you'll be interviewing with HR and they won't either so as long as you at least know _what_ they are you'll get through. Actually programmers won't care if you haven't checked the relevant language box.
>>
>>62322321
>she
>>
>>62318897
white-space: pre-line?
>>
>>62323213
Or pre-wrap, sorry
>>
>>62315803
>were you born in the states?
Yeah, I was. It helps a lot, having an immigration status attached to you is signing up to be fucked unfortunately. I mean a lot of immigrants in tech are pigshit bad but the problem was importing them

>What languages do you know?
It's kind of a long list, I enjoy picking up languages but have never been paid to use most of them. Professionally I use javascript day in and day out, and java when I'm dealing working with server side. Although I do mostly client side stuff and hate Java, having server side and UI people who don't have a shared language and can't touch each other's code is a horrible development experience so I put up with it.

>Do you have a degree?
I do, bachelors in CS. Personally I recommend it, it's not that you can't be a good programmer without it, it's just I think the most interesting things about programming are hidden at the upper end of a CS degree.

>Preffered/most used language/framework?
For hobby projects I really love closure/closurescript. I've used Python/Django and just vanilla JS more than anything else and it's probably what I know best.

>Where do you think this field is headed in the next 5 years and where should a noob concentrate on to be ahead of the curve?
MVVM style frameworks are definitely winning in the client side space. You should know one, but don't lean on it too much, marketshare division is extremely volatile and I don't think what will be the standard 5 years from now has been written yet.

I expect the server/client side separation of jobs will endure for a while to come but salaries will continue to slide relative to full stack.

((more) purely) functional programming, after kicking around in academia for decades, is now a big thing over the horizon in industry. Most smart people have the general attitude of "that's the general direction we need to go in" but good ideas at this stage have fizzled and died before, or been co opted into dogmatic trash (see TDD).
>>
very interesting.
>co opted into dogmatic trash (see TDD).
could you expand on that point?


>>62323269
>>62323269
>>
>>62322851
Gitlab is better if you want to have private repositories cause they're free
Thread posts: 315
Thread images: 23


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