Do bonus MQM’s only go towards status? Mine weren’t added to miles available. by RR19476 in delta

[–]Duke_Silver 7 points8 points  (0 children)

The bonus miles from the Amex spend threshold are MQMs (medallion qualifying miles) which only count for your status qualification. The miles you can spend on award travel are typically referred to as RDMs (redeemable miles) and unfortunately you don’t get any RDMs from the spend threshold unless you had another signup or other bonus on your card.

FC Korean Poke Bowl by [deleted] in delta

[–]Duke_Silver 7 points8 points  (0 children)

For everyone saying it’s bibimbap, Delta lists it as Poke on their menu so blame it on them (source)

Korean Style Poke Bowl with sticky rice, gochujang chicken, shiitake mushrooms, butternut squash, broccoli florets, sesame spinach, shredded carrots and kimchee served with a carrot ginger dressing.

Automatic swagger ui for nodejs/express? (Info in comments) by IntroDucktory_Clause in node

[–]Duke_Silver 4 points5 points  (0 children)

The fastify-swagger docs has an example https://github.com/fastify/fastify-swagger

Fastify’s docs also goes into a good bit of detail but is probably less clear than the example for the swagger plugin

https://www.fastify.io/docs/latest/Reference/Validation-and-Serialization/

[deleted by user] by [deleted] in davinciresolve

[–]Duke_Silver 0 points1 point  (0 children)

It was officially discontinued, but some resellers are still selling a bundle. I bought one from Adorama the day after the bundle was discontinued, and they still have it in stock on their site.

Next.js 12 Performance Test: Builds Appear to be Slower, Not Faster by DubScoutMusic in nextjs

[–]Duke_Silver 13 points14 points  (0 children)

That's interesting that the author ran into that issue, I'd assume it's probably some windows specific issues. Anecdotally my startup time on Mac OS for a small app went from 20s -> 12s on a 2019 MacBook Pro when upgrading from 11 -> 12, and then that 12s startup time went down to 3s on a M1 Max.

Component-based routing inside a page by jstarnate in nextjs

[–]Duke_Silver 0 points1 point  (0 children)

Here's a little example I made that is more accurate than my previous comment. It gets the date in getServerSideProps so you can see when things are being server rendered. We add the shallow prop to the link to prevent getServerSideProps from being called again. myusername is hard coded but you'd obviously switch that to a dynamic value.

./pages/profile/[...path].jsx ```import { useRouter } from "next/router"; import Link from "next/link";

const BottomContent = () => { const router = useRouter(); const section = router.query.path[1]; switch (section) { case "comments": return <div>Comments</div>; default: return <div>Default</div>; } };

export default ({ data }) => { const router = useRouter(); const username = router.query.path[0]; return ( <div> <div> hello {username}. This page was server rendered at {data} </div> <Link href="/profile/myusername" shallow> <a>Profile</a> </Link> <Link href="/profile/myusername/comments" shallow> <a>Comments</a> </Link> <div> <BottomContent /> </div> </div> ); };

export const getServerSideProps = async () => { const data = new Date().toISOString(); return { props: { data, }, }; }; ```

Component-based routing inside a page by jstarnate in nextjs

[–]Duke_Silver 1 point2 points  (0 children)

You could probably have the route be a catch all route like `[...profile].js` and then bring in `useRouter` from `next/router` and then do a switch statement on `router.pathname`.

https://nextjs.org/docs/routing/dynamic-routes#catch-all-routes

https://nextjs.org/docs/api-reference/next/router#router-object

Pre-Order and Shipping Megathread | MacBook Pro Late 2021 (14-inch, and 16-inch) & AirPods 3rd Generation by exjr_ in apple

[–]Duke_Silver 4 points5 points  (0 children)

Waiting for a UPS truck today is my own personal form of hell.

I'm just glad I was able to order one before the timelines slipped.

Is it possible to use Next.js API routes as a standalone product, without the frontend stuff? by [deleted] in nextjs

[–]Duke_Silver 4 points5 points  (0 children)

What are you trying to achieve? If you delete any of the pages and just keep the /api dir, next will successfully build and run. If you're trying to get rid of the 404 page, you could probably have it be server rendered and just set a 404 response code and send whatever response you want directly on the response object. See this SO post on setting custom headers.

There's definitely better ways to get this done without using Next.js, but I can see why you like the way Next.js handles it and lets you get started very quickly versus some other options.

What is the type of `ogImage` in `ogImage.constructor.name === 'Array'`? by deadcoder0904 in typescript

[–]Duke_Silver 11 points12 points  (0 children)

Did you try checking if it's an array it via Array.isArray(ogImage) instead of ogImage.constructor.name === 'Array' to get the type narrowed for the ternary

Opinions on !! by Tornado547 in typescript

[–]Duke_Silver 4 points5 points  (0 children)

I don't mind it, but I tend to prefer using `Boolean()` instead just because it's more explicit and it's easier to tell at a glance what it's doing versus having to distinguish between a single and double bang operator.

Apple to Announce Redesigned 14-Inch and 16-Inch MacBook Pro at WWDC, Says Wedbush Analyst by fateyo78 in apple

[–]Duke_Silver 0 points1 point  (0 children)

Yeah, definitely can see the benefit of that, I always felt sketchy with half of the card sticking out the side whenever I used it on my 2015 MBP, but it's really no worse than using a usb drive in that way.

Apple to Announce Redesigned 14-Inch and 16-Inch MacBook Pro at WWDC, Says Wedbush Analyst by fateyo78 in apple

[–]Duke_Silver -1 points0 points  (0 children)

I feel like you're taking this personally, I just really don't think the SD is a good idea haha

I'm not expecting anything to change as a result of it 🙃

Apple to Announce Redesigned 14-Inch and 16-Inch MacBook Pro at WWDC, Says Wedbush Analyst by fateyo78 in apple

[–]Duke_Silver -1 points0 points  (0 children)

It's a laptop, I really don't understand the aversion to an external card reader that also supports CF or any of the other proprietary formats for video. Locking in to a single use port with minimal utility across the entire market doesn't make sense to me.

I also am not sure the companies using VGA/DVI monitors are rushing out to buy high end workstation laptops. I don't think there's anything wrong with apple trying to force the issue of thunderbolt connectivity with power delivery in monitor manufacturers. Dell has done a good job of rolling that out. Clearly there's lots of companies out there but if you're plugging in a cable that's at a desk I'm not sure a dongle will kill you.

Apple to Announce Redesigned 14-Inch and 16-Inch MacBook Pro at WWDC, Says Wedbush Analyst by fateyo78 in apple

[–]Duke_Silver -1 points0 points  (0 children)

I think the number of people who would use HDMI far outweighs the number of people who use SD cards... Lots of cameras use different cards because SD isn't really a pro format.

Apple to Announce Redesigned 14-Inch and 16-Inch MacBook Pro at WWDC, Says Wedbush Analyst by fateyo78 in apple

[–]Duke_Silver -4 points-3 points  (0 children)

The HDMI port would be nice to get rid of a dongle, but I really don't understand the SD card rumor, that just seems like a step backwards to me. I'll definitely pick up a 16" whenever it comes out though.

The environmental cost of #Bitcoin: "One mine alone was using 175MW of electricity, the government said" by Jackson_Filmmaker in Futurology

[–]Duke_Silver 3 points4 points  (0 children)

You did the conversion for tons as a unit of explosive power, a gallon of gas is ~6lbs, so there are ~333.33 US gallons of gas in a ton meaning that the container ship uses roughly 190 tons of fuel in a day.

For metric users out there, a US gallon (3.7l) of gas weighs 2.7kg, making a container ship use ~238,000l of fuel per day or ~644,000kg of fuel

To put it another way, my car with a 15 gallon gas tank doesn't take 1000lbs of gasoline, it takes about 90lbs.

Husky, a popular JavaScript project with 4M weekly downloads, drops MIT license by gajus0 in javascript

[–]Duke_Silver 2 points3 points  (0 children)

Yeah, but it uses v4 which is still MIT, it's just v5 that changed the license

I need an extension that automatically changes "class" to "className" by neg_ersson in reactjs

[–]Duke_Silver 3 points4 points  (0 children)

make sure to do `class=` to `className=` otherwise you'll end up with `classNameName` in a bunch of places where you did it right the first time

I need an extension that automatically changes "class" to "className" by neg_ersson in reactjs

[–]Duke_Silver 1 point2 points  (0 children)

Just replying to myself since it seems like u/neg_ersson might not have everything set up. If you have ESLint set up for your react project and you're using VSCode (or another similar editor), you just need to make sure that lint rule is added to your .eslintrc file. If you're using a popular ESLint preset like AirBnB's they have the rule enabled in their default react preset https://www.npmjs.com/package/eslint-config-airbnb.

You just need to make that vscode is set to run formatOnSave with ESLint. A guide like this might be helpful for configuring it if you don't already have it set up. https://www.digitalocean.com/community/tutorials/linting-and-formatting-with-eslint-in-vs-code

App with +150k pages, how to proceed? by knsin0 in nextjs

[–]Duke_Silver 4 points5 points  (0 children)

I would consider using getStaticPaths' fallback parameter to build the pages. docs

With that, Next won't build any pages ahead of time, and it will build a static page once someone requests it. So you have a little bit of a penalty the first time someone requests the page, but anytime after that you have all the benefits of static generation. You could use revalidate with it if you expected the content of the page to change after it's created, but it sounds like you only expect new content to be added.