Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Knifegrab
Jul 30, 2014

Gadzooks! I'm terrified of this little child who is going to stab me with a knife. I must wrest the knife away from his control and therefore gain the upperhand.

Chenghiz posted:

This is what keys are for. Give each element in your array of components a key that is relevant to its contents (not the index) and that should solve the issue.

Perhaps I phrased this wrong, but its not an array of components. Its a single component that recieves an array of objects that represent that data of a table.

Adbot
ADBOT LOVES YOU

Professor of Cats
Mar 22, 2009

Anony Mouse posted:

Is there something specific that you are still trying to learn? If you've already gotten the basics then get out there and start making stuff. Experience is the best teacher.

I'm going to have to agree with this. Just go out and start on something. You won't know your roadblocks until you actually hit them. If you are way off base, you'll figure out a way...along the way, otherwise you'll remain in a project paralysis and get nothing done.

Love Stole the Day
Nov 4, 2012
Please give me free quality professional advice so I can be a baby about it and insult you

Professor of Cats posted:

I'm going to have to agree with this. Just go out and start on something. You won't know your roadblocks until you actually hit them. If you are way off base, you'll figure out a way...along the way, otherwise you'll remain in a project paralysis and get nothing done.

At what point do you go from "Learning the basics" to "I can apply to a job now doing this stuff"? I can spend years making stuff for myself, but if all my personal projects are like http://instantostrich.com/ chances are I won't be able to apply for anything. Where is the cut-off on "you now know enough to be able to get a job"?

Anony Mouse
Jan 30, 2005

A name means nothing on the battlefield. After a week, no one has a name.
Lipstick Apathy
It's hard to say because every person's path to web dev as a job is different. For me it was a few classes in college, an internship, some personal projects, and industry contacts made along the way. Once you have ~3-4 good projects under your belt that you can put in your portfolio, you should be hireable. If you're not getting any paid projects to start, aim lower (internships or entry level contract work) and make some personal stuff. Your own website is a good place to start. Come up with your own ideas or find old and busted sites to design and reimplement. For example I like NASA's Astronomy Picture of the Day website but it's just awful so I redid it as "APOD 2.0".

Kekekela
Oct 28, 2004

Love Stole the Day posted:

I've learned the hard way that when for programming stuff, you cannot just go from 101 and 202 level stuff to just going out there and making things.
This hasn't been my experience at all. Try Eric Elliotts stuff on Medium or anything from Dan Abramov on youtube, egghead etc I guess.

Lumpy
Apr 26, 2002

La! La! La! Laaaa!



College Slice

Knifegrab posted:

Perhaps I phrased this wrong, but its not an array of components. Its a single component that recieves an array of objects that represent that data of a table.

Post code, then someone can help you.

Lumpy
Apr 26, 2002

La! La! La! Laaaa!



College Slice

Love Stole the Day posted:

I've learned the hard way that when for programming stuff, you cannot just go from 101 and 202 level stuff to just going out there and making things. There's an education gap. That's why I'm posting here about it.

As for something specific I want to do, I had the idea of creating a Korean-vocabulary-learning site (because I live there) a la Wanikani. I have a basic uml thing that I sketched out recently:



As has been suggested, check out Dan Abramov's Redux classes on egghead. Even if you wind up not using Redux, I think the lessons learned are invaluable: https://egghead.io/courses/getting-started-with-redux

He has another one as well: https://egghead.io/courses/building-react-applications-with-idiomatic-redux

Not sure if the second one has been updated to deal with React Router completely changing (for the better, imho) but again, still amazing stuff.

Also piling on the "just start making your thing" bandwagon. You will learn better when you are solving problem you are encountering rather than "watching". Obviously everyone is different, but I have yet to meet anyone for whom this is not the case. I used to be paralyzed to start something until I had "figured it all out" and what I have learned from that is that I either never start, or I find out the things I thought I had figured out didn't quite match my reality. Then I'd either get frustrated and bail on the project, or wind up just learning what I needed to do to solve my problems as they came up anyway.

HappyHippo
Nov 19, 2003
Do you have an Air Miles Card?

Knifegrab posted:

Just touching back on this, I still haven't really figured out if there is a good way to do this other than just hidden content that is made visible when the screen sizes down. Kind of a real pain.

Yeah, I eventually solved it without hidden content, but the solution was very specific to my situation (with the text/figures in two columns).

As someone pointed out though, you can use flexboxes to re-order content with css. Could that work for your situation?

Kekekela
Oct 28, 2004
Another excellent resource: http://reactivex.io/learnrx/

Jafar Husain (Netflix) wrote that and is someone else whose stuff is worth watching.

putin is a cunt
Apr 5, 2007

BOY DO I SURE ENJOY TRASH. THERE'S NOTHING MORE I LOVE THAN TO SIT DOWN IN FRONT OF THE BIG SCREEN AND EAT A BIIIIG STEAMY BOWL OF SHIT. WARNER BROS CAN COME OVER TO MY HOUSE AND ASSFUCK MY MOM WHILE I WATCH AND I WOULD CERTIFY IT FRESH, NO QUESTION

Kekekela posted:

Its not just about the result text.

Read the whole thing dammit... all they're saying is that they'll use the mobile version OF THE CONTENT to rank the page. Pages that don't supply a mobile-specific version will be COMPLETELY UNIMPACTED because the content will be identical on desktop and mobile. It's to address the problem of pages slimming down their content on mobile. It even explicitly states that in all of the associated articles. Opting to entirely neglect mobile devices will have absolutely no impact on your pagerank from desktop browsers. There are other reasons to support mobile devices obviously, but pagerank is not one of them.

putin is a cunt fucked around with this message at 07:03 on Jan 3, 2017

Knifegrab
Jul 30, 2014

Gadzooks! I'm terrified of this little child who is going to stab me with a knife. I must wrest the knife away from his control and therefore gain the upperhand.
For a react framework, what is the best method out there for protecting returned data from being injectable. Basically I have a comment section and I know some jackasses will try and inject javascript alerts or worse into their text box. I know jquery has a parse method but I am moving away from jquery these days.

Maluco Marinero
Jan 18, 2001

Damn that's a
fine elephant.

Knifegrab posted:

For a react framework, what is the best method out there for protecting returned data from being injectable. Basically I have a comment section and I know some jackasses will try and inject javascript alerts or worse into their text box. I know jquery has a parse method but I am moving away from jquery these days.

validate on the server and escape properly there. You can put javascript validation in if it makes the experience nicer, but that's the only reason to do Javascript validation, as server validation is mandatory to be any protection.

also don't render comments using dangerouslySetInnerHTML if you can do so.

putin is a cunt
Apr 5, 2007

BOY DO I SURE ENJOY TRASH. THERE'S NOTHING MORE I LOVE THAN TO SIT DOWN IN FRONT OF THE BIG SCREEN AND EAT A BIIIIG STEAMY BOWL OF SHIT. WARNER BROS CAN COME OVER TO MY HOUSE AND ASSFUCK MY MOM WHILE I WATCH AND I WOULD CERTIFY IT FRESH, NO QUESTION
I figure there's probably no easy answer to this, but is there a reliable way to detect mobile devices? I want to enable the native <input type="date"> date pickers for mobile devices and tablets (because they are actually not terrible) but not for desktop (because they are actually terrible).

Knifegrab
Jul 30, 2014

Gadzooks! I'm terrified of this little child who is going to stab me with a knife. I must wrest the knife away from his control and therefore gain the upperhand.

Maluco Marinero posted:

validate on the server and escape properly there. You can put javascript validation in if it makes the experience nicer, but that's the only reason to do Javascript validation, as server validation is mandatory to be any protection.

also don't render comments using dangerouslySetInnerHTML if you can do so.

What is the most up to date and throough escaping method on the server?

putin is a cunt
Apr 5, 2007

BOY DO I SURE ENJOY TRASH. THERE'S NOTHING MORE I LOVE THAN TO SIT DOWN IN FRONT OF THE BIG SCREEN AND EAT A BIIIIG STEAMY BOWL OF SHIT. WARNER BROS CAN COME OVER TO MY HOUSE AND ASSFUCK MY MOM WHILE I WATCH AND I WOULD CERTIFY IT FRESH, NO QUESTION

Knifegrab posted:

What is the most up to date and throough escaping method on the server?

What is your server-side stack?

Knifegrab
Jul 30, 2014

Gadzooks! I'm terrified of this little child who is going to stab me with a knife. I must wrest the knife away from his control and therefore gain the upperhand.

The Wizard of Poz posted:

What is your server-side stack?

Nodejs, express, postgresql.

Knifegrab
Jul 30, 2014

Gadzooks! I'm terrified of this little child who is going to stab me with a knife. I must wrest the knife away from his control and therefore gain the upperhand.
edit: Double post...

Maluco Marinero
Jan 18, 2001

Damn that's a
fine elephant.

Knifegrab posted:

Nodejs, express, postgresql.

If it's just node, you can probably grab something like https://www.npmjs.com/package/html-escape to escape your strings. I'm assuming you're not directly accessing postgres either, using a library that uses parameter statements properly yeah?

Love Stole the Day
Nov 4, 2012
Please give me free quality professional advice so I can be a baby about it and insult you

Lumpy posted:

As has been suggested, check out Dan Abramov's Redux classes on egghead. Even if you wind up not using Redux, I think the lessons learned are invaluable: https://egghead.io/courses/getting-started-with-redux

He has another one as well: https://egghead.io/courses/building-react-applications-with-idiomatic-redux

Not sure if the second one has been updated to deal with React Router completely changing (for the better, imho) but again, still amazing stuff.

Also piling on the "just start making your thing" bandwagon. You will learn better when you are solving problem you are encountering rather than "watching". Obviously everyone is different, but I have yet to meet anyone for whom this is not the case. I used to be paralyzed to start something until I had "figured it all out" and what I have learned from that is that I either never start, or I find out the things I thought I had figured out didn't quite match my reality. Then I'd either get frustrated and bail on the project, or wind up just learning what I needed to do to solve my problems as they came up anyway.

This is a good post and the content of the first course, which I'm halfway through now, seems very good in quality. The speaker though is just so monotone and dull that I actually fell asleep for a bit in the middle of one of the videos.


Related question: where do I find simple lovely projects that I will probably be able to wrap my head around? Because whenever I look for stuff on Github I only see a bunch of convoluted, show-off, fancy poo poo written by Mozart's half brother.

Lumpy
Apr 26, 2002

La! La! La! Laaaa!



College Slice

Love Stole the Day posted:

This is a good post and the content of the first course, which I'm halfway through now, seems very good in quality. The speaker though is just so monotone and dull that I actually fell asleep for a bit in the middle of one of the videos.

The speaker is the guy who wrote Redux and a ton of other smarty-man stuff. I suspect he spent most of his time doing that instead of taking public speaking lessons, so I'll give him a pass. :v:

Love Stole the Day posted:

Related question: where do I find simple lovely projects that I will probably be able to wrap my head around? Because whenever I look for stuff on Github I only see a bunch of convoluted, show-off, fancy poo poo written by Mozart's half brother.

This I dunno... maybe check out interesting things here: https://react.rocks/ and see if any of them aren't "look at how smart I am" codebases.

Knifegrab
Jul 30, 2014

Gadzooks! I'm terrified of this little child who is going to stab me with a knife. I must wrest the knife away from his control and therefore gain the upperhand.

Maluco Marinero posted:

If it's just node, you can probably grab something like https://www.npmjs.com/package/html-escape to escape your strings. I'm assuming you're not directly accessing postgres either, using a library that uses parameter statements properly yeah?

Yup pg-promise, and I parameterize everything so sql injection is less of a concern.

I am probably going to use https://www.npmjs.com/package/escape-html

It seems a bit more popular so it seems to be the gold standard.

LifeLynx
Feb 27, 2001

Dang so this is like looking over his shoulder in real-time
Grimey Drawer
Has anyone ever had issues with a server where you'll download a CSS, PHP, etc. file to edit it, and there will be things changed in it? Such as an extra line break after each line, which is annoying but fixed with a find and replace of "\r\r" with "\r", or lines jumbled together? It's happening with Lithium Hosting and I can't figure out why. I know I had this issue many many years ago with another host, but I can't remember how it was resolved since it hasn't happened with any other host in like a decade.

Forgall
Oct 16, 2012

by Azathoth

BJPaskoff posted:

Has anyone ever had issues with a server where you'll download a CSS, PHP, etc. file to edit it, and there will be things changed in it? Such as an extra line break after each line, which is annoying but fixed with a find and replace of "\r\r" with "\r", or lines jumbled together? It's happening with Lithium Hosting and I can't figure out why. I know I had this issue many many years ago with another host, but I can't remember how it was resolved since it hasn't happened with any other host in like a decade.
Difference between windows and unix style line endings.

Love Stole the Day
Nov 4, 2012
Please give me free quality professional advice so I can be a baby about it and insult you
I tried e-mailing the guy who did the Learning ReactJS video and his advice for me was "give me $180 for an online workshop next week". nope

Lumpy posted:

This I dunno... maybe check out interesting things here: https://react.rocks/ and see if any of them aren't "look at how smart I am" codebases.

This looks not terrible for a change, thank you so much

FateFree
Nov 14, 2003

Sooo I am building a dashboard for a client, and he wants to implement SSO but of course, the sites we are linking to don't have SSO. What he's asking is for me to inject the login form of the site into html on our page, prepopulate the username and password, submit the form via javascript, and then open up an iframe with a link to the actual page in question. Then in theory they should be logged in and able to access the site as if they went to the login page themselves.

1st question - is this even possible? Before you say anything, yes I know how hideously ugly and stupid this is, especially injecting username/password values of clients into the html of the page. But would it work? Actually this is my only question. Would there be cross-site restrictions on submitting forms like this? Any info would be appreciated.

Skandranon
Sep 6, 2008
fucking stupid, dont listen to me

FateFree posted:

Sooo I am building a dashboard for a client, and he wants to implement SSO but of course, the sites we are linking to don't have SSO. What he's asking is for me to inject the login form of the site into html on our page, prepopulate the username and password, submit the form via javascript, and then open up an iframe with a link to the actual page in question. Then in theory they should be logged in and able to access the site as if they went to the login page themselves.

1st question - is this even possible? Before you say anything, yes I know how hideously ugly and stupid this is, especially injecting username/password values of clients into the html of the page. But would it work? Actually this is my only question. Would there be cross-site restrictions on submitting forms like this? Any info would be appreciated.

Even if everything you described is technically possible, some of those sites may have EULA that specify such a thing as not acceptable, and you or you users could get in trouble.

The Fool
Oct 16, 2003


Skandranon posted:

Even if everything you described is technically possible, some of those sites may have EULA that specify such a thing as not acceptable, and you or you users could get in trouble.

I used to not take that kind of thing very seriously, but recently just heard a story about a guy that got sued into near oblivion by Facebook for aggregating social network feeds on the behalf of users.

Munkeymon
Aug 14, 2003

Motherfucker's got an
armor-piercing crowbar! Rigoddamndicu𝜆ous.



The Fool posted:

I used to not take that kind of thing very seriously, but recently just heard a story about a guy that got sued into near oblivion by Facebook for aggregating social network feeds on the behalf of users.

He was also making money off of it. Mostly people will just have their accounts suspended or hacked because yeah lets just get all of our users used using what looks like a low effort phishing site NBD, right?

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

The Fool posted:

I used to not take that kind of thing very seriously, but recently just heard a story about a guy that got sued into near oblivion by Facebook for aggregating social network feeds on the behalf of users.

Also they tried multiple times asking him to just not do it but he wanted to fight.

(iirc, and we're talking about the same thing)

LifeLynx
Feb 27, 2001

Dang so this is like looking over his shoulder in real-time
Grimey Drawer

Forgall posted:

Difference between windows and unix style line endings.

On my local computer, I have a PHP file that is 102 lines long. I upload it to my Lithium Hosting server using Wordpress's plugin installer (it's part of a plugin), then click view/edit in FileZilla to edit it, and it's somehow 203 lines long with extra line breaks on the server.

This doesn't happen when I repeat the exact same steps on a site I have hosted with Media Temple. What can I do to stop this from happening?

Munkeymon
Aug 14, 2003

Motherfucker's got an
armor-piercing crowbar! Rigoddamndicu𝜆ous.



BJPaskoff posted:

On my local computer, I have a PHP file that is 102 lines long. I upload it to my Lithium Hosting server using Wordpress's plugin installer (it's part of a plugin), then click view/edit in FileZilla to edit it, and it's somehow 203 lines long with extra line breaks on the server.

This doesn't happen when I repeat the exact same steps on a site I have hosted with Media Temple. What can I do to stop this from happening?

Make sure you're not transferring any files in text mode.

http://stackoverflow.com/questions/554960/how-can-i-stop-filezilla-changing-my-linebreaks

Scaramouche
Mar 26, 2001

SPACE FACE! SPACE FACE!

Yeah, one line difference is probably a transmission problem. Straight up double-lines is Windows/Linux EOL problems. As an aside for anyone worried about this, I know Textpad lets you set what style of line ending you want when saving, and I believe Notepad+ and UltraEdit do as well.

Data Graham
Dec 28, 2009

📈📊🍪😋



Frankly any text editor that doesn't have line ending translation by now doesn't deserve the name.

fuf
Sep 12, 2004

haha
A few sites I host with google map embeds have suddenly started throwing up:

code:
Google Maps API error: RefererNotAllowedMapError [url]https://developers.google.com/maps/documentation/javascript/error-messages#referer-not-allowed-map-error[/url]
Your site URL to be authorized: [url]http://domain.com/[/url]
In the Google Maps API Manager I have key restriction set to "HTTP Referrers" with "*/domain.com/*" as the referrer. This used to work fine. Did something change? :confused:

Maluco Marinero
Jan 18, 2001

Damn that's a
fine elephant.
The protocol shouldn't be in the whitelisted domain should it? It should be this I think:

*.domain.com/*
domain.com/*

fuf
Sep 12, 2004

haha
Oops I meant *.domain.com/* not */domain.com/*

Adding domain.com/* fixed it, thanks. That makes sense because the sites are just domain.com not www

Warbird
May 23, 2012

America's Favorite Dumbass

Not sure if this is the right place to ask, but someone here might have the insight I need.

I have beyondsecurity doing security scans on my debian 8 webserver from time to time and it's started complaining that my version of apache2 is too old and needs to be updated to a newer version for vulnerability reasons. I've got 2.4.10 on the box and it appears to be the most current version via apt-get. Do I need to go do some weird poo poo to get the new version in place or should I wait for the package fairy to add the newer version to whatever repos I'm drawing from?

Lumpy
Apr 26, 2002

La! La! La! Laaaa!



College Slice

Warbird posted:

Not sure if this is the right place to ask, but someone here might have the insight I need.

I have beyondsecurity doing security scans on my debian 8 webserver from time to time and it's started complaining that my version of apache2 is too old and needs to be updated to a newer version for vulnerability reasons. I've got 2.4.10 on the box and it appears to be the most current version via apt-get. Do I need to go do some weird poo poo to get the new version in place or should I wait for the package fairy to add the newer version to whatever repos I'm drawing from?

You can get the latest (2.4.25) from non-official PPAs like this one: https://launchpad.net/~ondrej/+archive/ubuntu/apache2

code:
sudo apt-add-repository ppa:ondrej/apache2
sudo apt-get update
And then you should be able to get 2.4.25

NOTE: that that link is an Ubuntu PPA, since that's what I know / use. I dunno if that will work on Debian proper, but you do the same thing.

Lumpy fucked around with this message at 16:29 on Jan 6, 2017

Warbird
May 23, 2012

America's Favorite Dumbass

Gave it a shot, but it started complaining. I'll keep messing with it. Apparently you have to run
code:
sudo apt-get install software-properties-common
to enable the
code:
sudo apt-add-repository
stuff in Debian now.


While I'm here, what's considered the sane way to push files to your box? I've got a domain I'm using for just piddling around, but I'd prefer to have the editor hook into the files on the box as opposed to messing around and then waiting for WinSCP transfer everything in place. Is that a thing? I know it's a drat good way to break a site, but I'm not concerned about that.

Warbird fucked around with this message at 21:38 on Jan 6, 2017

Adbot
ADBOT LOVES YOU

Munkeymon
Aug 14, 2003

Motherfucker's got an
armor-piercing crowbar! Rigoddamndicu𝜆ous.



Warbird posted:

While I'm here, what's considered the sane way to push files to your box? I've got a domain I'm using for just piddling around, but I'd prefer to have the editor hook into the files on the box as opposed to messing around and then waiting for WinSCP transfer everything in place. Is that a thing? I know it's a drat good way to break a site, but I'm not concerned about that.

If WinSCP's in-place editing is too slow for your liking, I'm not sure how anything else would be better.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply