|
uncle blog posted:Yeah I meant what’s the most elegant way to get all the paginated data. The api has an upper limit of results per request, thus the next url. Sorry if I misunderstand but it seems like the answer is a rather obvious: a for loop of requests based on the total count and the number of entries in each page. SO you get the first response and then calculate how many more pages to go and for loop it, appending the response into the json string your lambda function will return. If I need the metadata in the response (e.g. has_more or if there's a time I want or something) I'll give each response a UUID. Otherwise I'll just clip the list in the 'data' key and make one big payload to send back.
|
# ? Jul 26, 2020 16:32 |
|
|
# ? Apr 23, 2024 21:00 |
|
My main client/reseller is obsessed with getting a high score on Google PageSpeed Insights, thinkwithgoogle.com, GTMetrix, etc. The main issue is that these are Wordpress sites loaded up with SEO and tracking codes, so there's only so much I can do. One problem I think I should be able to solve but can't for some reason is deferring Javascript. I use either of these:code:
|
# ? Aug 4, 2020 17:33 |
|
dynamically add those tags with javascript after load (probably dont do this) defer should be what you want. have you tried a hello world alert to see that it does, in fact, pop up before the page is loaded?
|
# ? Aug 4, 2020 17:54 |
|
Have you tried using autoptimize? That usually increases score by like 20 pts. I struggle to ever get a WordPress site mobile above like a 80 though.
|
# ? Aug 4, 2020 21:14 |
|
Empress Brosephine posted:Have you tried using autoptimize? That usually increases score by like 20 pts. I try to use as few plugins as possible because you never know when a PHP or WP update will happen that breaks it or the plugin author disappears or starts charging for previously free features. But I'll try that one.
|
# ? Aug 4, 2020 21:21 |
I'm still somewhat of a beginner so sorry if these are dumb/obvious questions. Does anyone know of a good resource or tutorial to learn about using Spring Security for user/role/session management with a React front-end? I've read through some of the documentation but it seems a lot more involved than what I'm looking to do with just using it as a REST API. Is Spring Security even necessary for that? In my testing I've gotten by with creating my own User and Role entities and creating a session cookie upon successful validation. In any request that requires a certain permission, the session cookie gets sent with the request, I query the User db for a user with that session, and then (provided that user exists) check the user's role to see if they have the permission to carry out the request. This seems pretty straightforward to me, but I'm not the most knowledgeable about web security and ,based on the amount of security gently caress-ups I read about online, I have to wonder if I'm missing something that would mean I'm better off learning how to use Spring's built-in functionality. Additionally, I'm unsure of how well this would work out with displaying certain things on the React front-end. Right now when the user goes to the app the front-end requests their User/Role objects using their session cookie, and then certain components may or may not be rendered depending on the permissions that their role has. Is it possible for them to force those privileged components to render by loving around with the dev console? The actual API requests for anything those components could change would fail anyways because the back-end verifies their permissions, but if there is some way for them to make those components render is there any way to prevent it?
|
|
# ? Aug 5, 2020 01:17 |
|
i vomit kittens posted:Additionally, I'm unsure of how well this would work out with displaying certain things on the React front-end. Right now when the user goes to the app the front-end requests their User/Role objects using their session cookie, and then certain components may or may not be rendered depending on the permissions that their role has. Is it possible for them to force those privileged components to render by loving around with the dev console? The actual API requests for anything those components could change would fail anyways because the back-end verifies their permissions, but if there is some way for them to make those components render is there any way to prevent it? No. No matter how much you gently caress with this you can always just edit the JS client side to always render it, or ignore your checks. This is why you validate server side.
|
# ? Aug 5, 2020 01:37 |
|
Biowarfare posted:No. No matter how much you gently caress with this you can always just edit the JS client side to always render it, or ignore your checks. This is why you validate server side. Or, you know, somebody can just do curl calls directly to your backend. Always assume that Dinkleberg is ready to catch you with your pants down at the worst possible moment.
|
# ? Aug 5, 2020 01:46 |
|
Inacio posted:dynamically add those tags with javascript after load do stuff like this these type of score testers are bullshit, so is okay to fight bullshit with bullshit this is what I hear people do: ....CSS should be in the headers, and script tags in the bottom, just before </body>. Scripts that don't depend on being loaded on page load can be marked defer. The order is very important to not break any script dependency. CSS can be cut in two, a small embedded, the big one linked. getting a good score in these testers is only possible making your website either trivial or not wc3 compliant. Tei fucked around with this message at 07:13 on Aug 5, 2020 |
# ? Aug 5, 2020 07:09 |
|
Tei posted:do stuff like this The best thing I've seen someone do to get a high score just to tick a box was make a stub loader that would request all the primary JS/CSS through a websocket, then cache it all in localstorage.
|
# ? Aug 6, 2020 06:41 |
|
Is there a site with Javascript puzzles for total dumbass beginners like me?
|
# ? Aug 6, 2020 12:57 |
|
Mira posted:Is there a site with Javascript puzzles for total dumbass beginners like me? https://leetcode.com/ is probably the most popular right now
|
# ? Aug 6, 2020 14:05 |
|
https://www.freecodecamp.org/learn/javascript-algorithms-and-data-structures/basic-algorithm-scripting/ https://www.freecodecamp.org/learn/javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/ https://www.freecodecamp.org/learn/javascript-algorithms-and-data-structures/javascript-algorithms-and-data-structures-projects/ FreeCodeCamp's basic algorithm tests are the best place to start. They are basically a Greatest Hits of all the baby's first algorithm challenge questions and even if you don't need help, you should definitely click "get help" followed by "get a hint", because they explain some common methods that you might not have heard of yet and since they're explained in context of a problem it gives you an idea of when it can be used in the future. Once you exhaust those, while you have a shitload of options you should probably just stick to https://www.leetcode.com. The primary reason being that, unlike a lot of these sites, you will not spend too much time just trying to figure out what the challenge is asking you to do. They're much more clear and better worded than most.
|
# ? Aug 6, 2020 14:13 |
|
It's been awhile since I've used a practice site, but I always liked Exercism. It isn't browser based, you pull the practice stuff down to your machine and I believe it is test driven, iirc.
|
# ? Aug 6, 2020 14:56 |
|
Appreciate it, all!
|
# ? Aug 6, 2020 22:58 |
|
So, we're using bazel as a build system on a project. When a pull request gets created, bazel runs through a bunch of tests. As the knowledgeable people are on vacation right now, I'm hoping somebody in here can help. The automated tests give me this error message: code:
|
# ? Aug 7, 2020 11:20 |
|
Here's the real error in there:code:
|
# ? Aug 7, 2020 11:47 |
|
Tei posted:do stuff like this They're obsessed with it and I'll have to learn some dirty tricks to make number go up. I think they're afraid their competition will try to steal customers by showing them these "low" scores and promising to do better. There's only so much I can do though since the sites are loaded with tracking codes and SEO plugins. DOMContentLoaded is at like 1.25 seconds but full Load is at 4.5 seconds or higher, it gets pretty nuts.
|
# ? Aug 7, 2020 14:07 |
|
LifeLynx posted:They're obsessed with it and I'll have to learn some dirty tricks to make number go up. I think they're afraid their competition will try to steal customers by showing them these "low" scores and promising to do better. There's only so much I can do though since the sites are loaded with tracking codes and SEO plugins. DOMContentLoaded is at like 1.25 seconds but full Load is at 4.5 seconds or higher, it gets pretty nuts. Having my bloated static served gzipped by cloudfront instead of by the EBS instance cut my pagespeed/gtmetrix and improved user experience.
|
# ? Aug 7, 2020 23:35 |
|
I have a generalist/hobbyist background and am looking for some expertise on CMS platforms for personal web sites and projects. Nothing commercial. I've been using Wordpress but have recently read more and more about security issues. I'm wondering if I there are viable alternatives. (Drupal etc.) For the basic structure I need, it might be better to learn CSS. Any recommendations on a low-barrier-of-entry CMS platform that's not likely to attract Turkish hacking groups?
|
# ? Aug 8, 2020 18:02 |
|
Drupal is not a low-barrier-of-entry. I've been using it professionally for 8 years now and it's still a pain to use sometimes. I'd suggest having a look at Craft CMS. It's free for personal use so you can muck around with it on your own.
|
# ? Aug 8, 2020 18:49 |
|
I also wouldn't rule out WordPress over security issues, especially for a personal site. Just make sure your password is strong and avoid unpopular and outdated themes/plugins.
|
# ? Aug 11, 2020 03:42 |
|
Netlify CMS + a static site generator might be worth looking in to. It will have a slightly higher barrier to entry, but the netlify free tier works fine for most low traffic personal sites.
|
# ? Aug 11, 2020 05:36 |
|
fsif posted:I also wouldn't rule out WordPress over security issues, especially for a personal site. Just make sure your password is strong and avoid unpopular and outdated themes/plugins. Run your build process, put the application into a squashfs, then mount it in the runtime server as read-only. Use an overlay mount for wp-uploads
|
# ? Aug 11, 2020 14:19 |
|
Using react-router-dom, is there a good way to intercept the user pushing the back button? I want to prompt them with a "You have unsaved changes..." confirm window before letting them go back. Edit: I'm using hash routes, which might complicate things. Edit2: I cobbled this together: code:
uncle blog fucked around with this message at 11:49 on Aug 13, 2020 |
# ? Aug 13, 2020 09:20 |
|
uncle blog posted:Using react-router-dom, is there a good way to intercept the user pushing the back button? I want to prompt them with a "You have unsaved changes..." confirm window before letting them go back.
|
# ? Aug 14, 2020 01:21 |
|
Has anyone here been successful using Google or Adobe fonts for Outlook.com? I've tried a bunch techniques (@import, <link>, @font-face, etc) but dice. Campaign Monitor's main table says no, but they also have a couple of articles stating it can.
Boosh! fucked around with this message at 04:03 on Aug 18, 2020 |
# ? Aug 18, 2020 03:43 |
|
Boosh! posted:Has anyone here been successful using Google or Adobe fonts for Outlook.com? I've tried a bunch techniques (@import, <link>, @font-face, etc) but dice. Campaign Monitor's main table says no, but they also have a couple of articles stating it can. Emails will look different in different clients. That's the way it goes.
|
# ? Aug 18, 2020 13:49 |
|
Lumpy posted:Emails will look different in different clients. That's the way it goes. Yeah, I get it. I was just tossing a hail mary for Outlook.com since I was reading conflicting opinions. The art director recently switched to Outlook.com and is not happy heh.
|
# ? Aug 18, 2020 13:55 |
|
Boosh! posted:Has anyone here been successful using Google or Adobe fonts for Outlook.com? I've tried a bunch techniques (@import, <link>, @font-face, etc) but dice. Campaign Monitor's main table says no, but they also have a couple of articles stating it can. I have never tried - Here some people got it working at some point https://www.campaignmonitor.com/blo...ting%20systems. Fonts are not software but kinda are software https://superuser.com/questions/1202551/can-truetype-fonts-contain-malicious-code A email client with webfonts capability could be a virus vector
|
# ? Aug 18, 2020 14:00 |
|
Email is dead. Send your mass emails as DMs across Slack servers around the world. I realized I mixed up the two dev threads I sub to, but I stand by my statement.
|
# ? Aug 18, 2020 14:55 |
|
Boosh! posted:Yeah, I get it. I was just tossing a hail mary for Outlook.com since I was reading conflicting opinions. The art director recently switched to Outlook.com and is not happy heh. If your art director is surprised by this, they are not qualified for their job.
|
# ? Aug 18, 2020 15:19 |
|
Boosh! posted:Yeah, I get it. I was just tossing a hail mary for Outlook.com since I was reading conflicting opinions. The art director recently switched to Outlook.com and is not happy heh. Actually, how important is it that copy is actually copy? If you just put all the copy in the alt/title is that fine? Is there any concrete proof/documentation that it isn't fine?
|
# ? Aug 18, 2020 15:19 |
|
Lumpy posted:If your art director is surprised by this, they are not qualified for their job. Seems a bit harsh, heh. Art directors usually work across different media and knowing the rendering capabilities of the third most popular email client is relatively arcane knowledge.
|
# ? Aug 18, 2020 21:25 |
|
fsif posted:Seems a bit harsh, heh. Outlook.com specifically, sure, but knowing that HTML email styling is fundamentally nonstandardized and unreliable is just basic expected knowledge for that kind of thing (and is why bigcorps usually just go for 'HTML table full of proportionally sized images' if they need anything complicated).
|
# ? Aug 18, 2020 21:42 |
|
Why are you sending emails that aren't plain text?
|
# ? Aug 18, 2020 22:22 |
|
rt4 posted:Why are you sending emails that aren't plain text? How else would people see our logo and accompanying image that hits all the right brand notes?
|
# ? Aug 19, 2020 02:05 |
|
I enjoy the forced email signature I have despite never actually sending emails
|
# ? Aug 19, 2020 04:18 |
|
rt4 posted:Why are you sending emails that aren't plain text? Why are people using chat clients that are not IRC?
|
# ? Aug 19, 2020 05:47 |
|
|
# ? Apr 23, 2024 21:00 |
|
I always end my email with a single dot in a line so SMTP know I want to sent the email, before closing telnet
|
# ? Aug 19, 2020 16:33 |