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
Sedro
Dec 31, 2008
JavaScript code:
let promise = value ? Promise.resolve(value) : grabValueFromAPI();
promise.then(function(value) {
  doStuffWith(value); 
  doMoreStuffWith(value);
})

Adbot
ADBOT LOVES YOU

darthbob88
Oct 13, 2011

YOSPOS

Sedro posted:

JavaScript code:
let promise = value ? Promise.resolve(value) : grabValueFromAPI();
promise.then(function(value) {
  doStuffWith(value); 
  doMoreStuffWith(value);
})
Of course, because I only need one promise whatever happens, and this also lets me use a test more complicated than "if this value exists". Much thanks.

Thermopyle
Jul 1, 2003

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

https://twitter.com/kdzwinel/status/883102352034734082/photo/1

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
What kinds of website projects did you guys make for your own portfolios when you were looking for work?

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

On the subject of Chrome DevTools, am I the only one who has lost the ability to copy-paste document nodes in the element inspector?

DICTATOR OF FUNK
Nov 6, 2007

aaaaaw yeeeeeah

a hot gujju bhabhi posted:

On the subject of Chrome DevTools, am I the only one who has lost the ability to copy-paste document nodes in the element inspector?

I noticed this too as of like a month ago.

Right click > Copy > Copy outerHTML works all the same.

huhu
Feb 24, 2006

Love Stole the Day posted:

What kinds of website projects did you guys make for your own portfolios when you were looking for work?

Personal projects portfolio, volunteer development via idealist.org, Flask web apps that are almost like software
Also in my learning, I moved my portfolio from static HTML to WordPress to Django and claimed that as three separate projects.

Munkeymon
Aug 14, 2003

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




They're going full Visual Studio I see. Not sure how I feel about that.

Tei
Feb 19, 2011

Bloat always win because theres no way to convince people to stop when they have a small and very usefull feature. Nothing bad with that, software born, grown and dies of old age, like people. So their dead give room for somebody to innovate and try something different.

Dead, the great garbage_collector() of nature.

The Merkinman
Apr 22, 2007

I sell only quality merkins. What is a merkin you ask? Why, it's a wig for your genitals!
We've moved our site over to HTTP2 so I'm looking at how to optimize for it (as opposed to HTTP1.X). One thing I've seen is to stop inlining CSS. I don't understand, I thought the point inlining critical CSS was because CSS was render blocking, not to reduce the number of requests.

The Fool
Oct 16, 2003


The Merkinman posted:

We've moved our site over to HTTP2 so I'm looking at how to optimize for it (as opposed to HTTP1.X). One thing I've seen is to stop inlining CSS. I don't understand, I thought the point inlining critical CSS was because CSS was render blocking, not to reduce the number of requests.

https://www.smashingmagazine.com/2017/04/guide-http2-server-push/ has a good write-up.

TLDR; your style.css will get pushed in parallel with your html file, so inline css gives you no noticeable performance increase, at the loss of potential savings due to caching.

Scaramouche
Mar 26, 2001

SPACE FACE! SPACE FACE!

The Fool posted:

https://www.smashingmagazine.com/2017/04/guide-http2-server-push/ has a good write-up.

TLDR; your style.css will get pushed in parallel with your html file, so inline css gives you no noticeable performance increase, at the loss of potential savings due to caching.

Excuse me don't filename assume :colbert: I call it lack-of-style.css&v=314

The Merkinman
Apr 22, 2007

I sell only quality merkins. What is a merkin you ask? Why, it's a wig for your genitals!
But again, how does that solve the issue of CSS being render blocking?
Is it saying that what would normally be inline critcial CSS is instead Server Pushed, but the rest of the CSS is still loaded via JS? Or is it that all the CSS gets Pushed?

Tei
Feb 19, 2011

The Merkinman posted:

But again, how does that solve the issue of CSS being render blocking?
Is it saying that what would normally be inline critcial CSS is instead Server Pushed, but the rest of the CSS is still loaded via JS? Or is it that all the CSS gets Pushed?

Is CSS render blocking, thats kind of a choice browsers make. They can render a ugly web, or the wrong font, then blink and relayout everything to the right look.

JS is different because Javascript is not multitask to begin first. Javascript has no idea of the world changing while is reading a variable. So the whole world froze. A javascript function froze the whole browser until it ends.

What the experts are saying (I am not a expert in HTTP2) is that now that the new protocol allow to use the same socket to serve many files, instead of creating many sockets, you can use again the feature of caching in our favor. Instead of inlining, that CSS have his own file, that is cached. You break your css in many different files. And serve only what you need, datepicket.css, colopicket.css, modal.css, and you are not failing into a perfomance pit (it will be in http1) because the files are cached, because getting these files is faster.

If browser developers choose to make CSS blocking, and they don't render the page until they have all the CSS, then a 48KB page with 400KB of cached CSS will render faster than a 100KB page with 100KB of uncached css. If your CSS is cached, you want your HTML to be as small has possible.

This is how I understand all of this. Anyway I personally don't plan to stress things in this direction, yet. I still don't like the idea of pages to use many files. And my designer like to use 3 files (reset.css, main.css, foo.css) maybe the time to break CSS into many parts is not here yet.

Edit:
maybe I should not have posted that, I am reading more, and is more complicated than I trough

Edit:
I am always wrong

Tei fucked around with this message at 08:39 on Jul 21, 2017

huhu
Feb 24, 2006
I have several rows in a table, for each row I collect the data and then do an Ajax POST with it. Once each row has been processed, I want to build out the results of each row into a single HTML element. Is it bad practice to be doing more than one AJAX Post like this?

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

huhu posted:

I have several rows in a table, for each row I collect the data and then do an Ajax POST with it. Once each row has been processed, I want to build out the results of each row into a single HTML element. Is it bad practice to be doing more than one AJAX Post like this?

Possibly... depends on how this affects performance of your backend, and if you have the ability to make changes to the backend. If performance is good, don't worry about it until it matters. Or, if you can not make changes to the backend to allow making a more consolidated POST for all rows... then you can't do anything about it.

Tei
Feb 19, 2011

huhu posted:

I have several rows in a table, for each row I collect the data and then do an Ajax POST with it. Once each row has been processed, I want to build out the results of each row into a single HTML element. Is it bad practice to be doing more than one AJAX Post like this?

Is this like, sending 40 ajax request at the same time?

you may run in many sort of problems if thats what you are doing. multitasking problems. session control problems. connexion problems. server memory problems.

you can always change your ajax to deliver array of rows. so if you have 4 rows, you send 1 request with 4 rows, and if you have 20 rows, you send 1 request with 20 rows.

that way the user initiate a action, and it generate 1 ajax call. and you never run in problems.

sending 40 request at the same time may even work if this is a control panel for the administrator, so theres (in the whole server) a max of 1 user of this type. This type of thinking is perhaps flawed.

Ajax request are jealous and they kind of take control of a page. You cant navigate to other page while a ajax request is pending (but maybe the framework cancel them for you so you have never noticed).


Something fun you can do is to have some sort of queue, so the code that now sends, don't send but queue. And the code that now sends, get the data from the queue. And is the sending code that decide how much data send. Decouple things a bit. Adding a few layers here and there may allow you do something like caching. Or ignoring a update if is not really a change or is the same change too quick.

my bony fealty
Oct 1, 2008

Has anyone ever used TerminalFour CMS? I am transitioning a site to it now and holy hell it's annoying me, I've figured out well enough how to make it do what I want but it feels extremely limiting.

streetlamp
May 7, 2007

Danny likes his party hat
He does not like his banana hat

my bony fealty posted:

Has anyone ever used TerminalFour CMS? I am transitioning a site to it now and holy hell it's annoying me, I've figured out well enough how to make it do what I want but it feels extremely limiting.

lol I unfortunately have, I built 2 or maybe 3 sites with it around 2 years ago. It's super limiting and the only reason I built the two was to demonstrate to my department how limiting it was. does this happen to be for something related to VCU?

huhu
Feb 24, 2006
https://www.flickr.com/services/api/auth.oauth.html

Is this documentation as terrible as it appears to me trying to learn oauth and use Flickr's API in my app?

reversefungi
Nov 27, 2003

Master of the high hat!

huhu posted:

https://www.flickr.com/services/api/auth.oauth.html

Is this documentation as terrible as it appears to me trying to learn oauth and use Flickr's API in my app?

I had to implement 5 different OAuth strategies for a bootcamp assignment a few weeks back, and that was easily one of the most frustrating things I've ever had to deal with in the short time I've been programming. Going through all sorts of different kinds documentation and trying to make heads or tails of everything and how the drat hell I should set my token (is it access_token=TOKEN, or token=TOKEN? of course no one ever gives a simple example) is a great recipe for a headache, so good luck to you.

This one doesn't seem TOO horrible at a quick glance since they have some clear examples at least. Are there any libraries you can use that'll handle some of the grunt work?

Thermopyle
Jul 1, 2003

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

Yeah, oauth is poo poo.

I mean, it solves a problem and everything, but its super complicated and the docs are never great.

huhu
Feb 24, 2006
:sigh: I just want to get images from Flickr API by lat and long but that requires Oauth. This project was supposed to be about learning React.

Lumpy
Apr 26, 2002

La! La! La! Laaaa!



College Slice

huhu posted:

:sigh: I just want to get images from Flickr API by lat and long but that requires Oauth. This project was supposed to be about learning React.

Welcome to the wonderful interconnected world of tomorrow!

teen phone cutie
Jun 18, 2012

last year i rewrote something awful from scratch because i hate myself
Anyone else taking that Udacity React course?

Costed $500, but I'm getting reimbursed by my company which is pretty sweet.

huhu
Feb 24, 2006

Grump posted:

Anyone else taking that Udacity React course?

Costed $500, but I'm getting reimbursed by my company which is pretty sweet.

What do you get for $500 that I couldn't get for a fraction of the cost from a Pluralsight monthly subscription and random Youtube videos/Google Tutorials?

teen phone cutie
Jun 18, 2012

last year i rewrote something awful from scratch because i hate myself
Live chat help and the instructors will review your code and tell you where you could improve.

I agree it's totally not worth $500, though

huhu
Feb 24, 2006
Web developers who are also responsible for designing the front end - any recommendations for a good up and running book/tutorial on design? I've designed several websites myself and generally they look decent but sometimes I end up with things that are just a clusterfuck visually. My current project is exactly that and I'm trying to make it easier to navigate with the eyes but it's a bit difficult.

Harik
Sep 9, 2001

From the hard streets of Moscow
First dog to touch the stars


Plaster Town Cop
I'm setting up a site as a pure JSON api, with the same endpoints being used by browsers and mobile apps. What I don't want is people able to abuse the login cookies via javascript loaded from unrelated domains.

Where can I find a rundown on the rules of things like CORS and browsers sending cookies?

Normally I worry about protecting the server, but in this case I need to protect the webbrowser.

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

huhu posted:

What do you get for $500 that I couldn't get for a fraction of the cost from a Pluralsight monthly subscription and random Youtube videos/Google Tutorials?

By this logic, why even bother going to any school in general when you could just read a few books?

my bony fealty
Oct 1, 2008

streetlamp posted:

lol I unfortunately have, I built 2 or maybe 3 sites with it around 2 years ago. It's super limiting and the only reason I built the two was to demonstrate to my department how limiting it was. does this happen to be for something related to VCU?

It sure is, got contracted to move a VCU departmental site from its current antiquated Wordpress installation to T4. I'm having to rewrite stuff to accommodate T4 in a very asinine way, like having to output all the HTML for a slideshow in the page body (thanks display: none!!) to have it accessible to use in a script. The documentation is terrifically bad and I really get the sense that T4 is not designed for dynamic, constantly-updated sites at all. I've noticed that at least one other VCU site was using WP for the blog part even though the rest of it was in T4, presumably since T4 seems to be god-awful at blogging capability.

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

Love Stole the Day posted:

By this logic, why even bother going to any school in general when you could just read a few books?

In the internet age, this is a very good question. The only reason for higher education at this point is accreditation, and even that argument is getting weak.

Dominoes
Sep 20, 2007

Skandranon posted:

In the internet age, this is a very good question. The only reason for higher education at this point is accreditation, and even that argument is getting weak.
Love this COW. I've got more out of the Khan/MIT-OCW and edX classes over the past few years than I did in University.

huhu
Feb 24, 2006

Love Stole the Day posted:

By this logic, why even bother going to any school in general when you could just read a few books?

I taught myself enough to be hired as a software engineer with about $500 total. :shrug:

geeves
Sep 16, 2004

huhu posted:

I taught myself enough to be hired as a software engineer with about $500 total. :shrug:

Same. I now use those books as monitor stands.

DICTATOR OF FUNK
Nov 6, 2007

aaaaaw yeeeeeah
I make $140K a year as a web developer and did not graduate high school. Taught myself everything I know on my spare time. I have never purchased a book more nonfictional than Harry Potter.

I am 24 and live 10 minutes outside of Seattle.

Location, location, location, baby.

EDIT: I use PHP :q:

fuf
Sep 12, 2004

haha
Is there a current method for putting a contact email address on a website somewhere without it being easily crawled and getting bombarded by spam?

Kekekela
Oct 28, 2004
I have a college degree earned in the early 90s that taught me nothing I'd use later other than some database theory. It was great for getting in the door when I was starting out, but I learned everything that actually helped me do the work from the internet* and just doing the "fake it til you make it" thing (which was admittedly really easy in the 90s because the vast majority of everyone didn't know wtf)






* and even "books" in the early, early days

Kekekela fucked around with this message at 13:29 on Jul 27, 2017

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

DICTATOR OF FUNK posted:

I make $140K a year as a web developer and did not graduate high school. Taught myself everything I know on my spare time. I have never purchased a book more nonfictional than Harry Potter.

I am 24 and live 10 minutes outside of Seattle.

Location, location, location, baby.

EDIT: I use PHP :q:

I want to hear more about this. How did you get your first job? Did you make a portfolio and apply to job advertisements online or in the phone book? Or did you know somebody who put in a good word for you and got you an interview?

Adbot
ADBOT LOVES YOU

Lumpy
Apr 26, 2002

La! La! La! Laaaa!



College Slice

huhu posted:

Web developers who are also responsible for designing the front end - any recommendations for a good up and running book/tutorial on design? I've designed several websites myself and generally they look decent but sometimes I end up with things that are just a clusterfuck visually. My current project is exactly that and I'm trying to make it easier to navigate with the eyes but it's a bit difficult.

Phone posting to remind myself to reply to this with links, but there are a great number of good resources out there. One thing to do is read / skim through the Apple iOS human interface guidelines or Google's material design spec; not so much for a "do this" but to see how in depth the thinking is from a system perspective. Everything in your design is all part of the same User Experience, so treat it as a whole, rather than "ooh, this is a pretty button, I'll close that file and now I'm on to design a menu!"

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