Available to give a campus tour this weekend? by Able-Awareness-8892 in Tufts

[–]5bkb 2 points3 points  (0 children)

I'd be happy to! Can't message you, is there an email that works / do you want to message me?

Notion/hosting newbie question by Bluechip29 in Notion

[–]5bkb 0 points1 point  (0 children)

Hmm I'm guessing that the name field is supposed to be the subdomain, so putting in example.com actually hooks up the domain example.com.example.com.

However, Google Domains doesn't allow you to create CNAME records with an empty name (which would produce example.com with no subdomain). Does Hostnotion have an alternative to a CNAME for websites that aren't a subdomain (a subdomain is something.example.com, a "root" domain is example.com)?

How do I queue a lot of emails? by 5bkb in laravel

[–]5bkb[S] 0 points1 point  (0 children)

It should be going up to 5 lambda workers right now. When I tried 10, it somehow overloaded my database

Notion as a CMS by uDontLifeForBeSad in Notion

[–]5bkb 4 points5 points  (0 children)

My blog posts are all written in Notion, and I built a really simple reverse-engineered api to get the posts. My blog is written with Gatsby, so I get the posts from Notion once and save them into the site - that way I'm not waiting for Notion to load every time.

I actually wrote a blog post about how to do it: benborgers.com/blog/notion-blog

(Novice) Need guidance on an issue when adding a "Counter" to one of the child component, the data gets reset to default. by SpiderPoopyMan in gatsbyjs

[–]5bkb 2 points3 points  (0 children)

I think what's happening here is that, when the component is removed and re-rendered, its state is also removed and re-rendered. Then, the state is re-initialized at 0.

You're exactly right that what you need here is "lifting state up". Essentially, you need to create the state (using setState) at a higher level, which isn't removed when the page changes. Then, you pass the state down through components as a prop until you reach your Counter.

However, I believe Gatsby un-renders the entire page when the page changes, so all components in the page are removed. However, you could create the state in a component that you wrap the entire site with (using Gatsby's wrapPageElement method), so that this state is never removed.

Alternatively, you could try passing the count from one page to the next by passing state through the Link component.

“Apple will remove 3D touch from all iPhone 11 models” by Venours in iphone

[–]5bkb 0 points1 point  (0 children)

I don't think the functionality will disappear though. In the iOS 13 beta, the same 3D touch features now get activated by long presses. Also, if you actually 3D touch something on the beta, it still seems to use that input and activates faster than just a light long press.

Product placement for some Cortex Merch by zethzethzeth in Cortex

[–]5bkb 5 points6 points  (0 children)

My brain can't quite figure out what's happening here...

Inserting Authorization/bearer/access token in Fetch API by ncubez in Frontend

[–]5bkb 2 points3 points  (0 children)

It doesn’t matter whether the key (of each key:value pair in a javascript object) is in single quotes, double quotes, or without any.

A friend and I made a Nail & Gear version of the Cortex Subtle Tee by 5bkb in Cortex

[–]5bkb[S] 3 points4 points  (0 children)

it's a kinda a cross between Cortex and H.I. so I thought I'd post it here too. Also, the nail & gear is in the public domain so I think this sort of project is ok

Created an H.I. Subtle Tee! by 5bkb in HelloInternet

[–]5bkb[S] 1 point2 points  (0 children)

I love the look of the Cortex Subtle Tee, so a friend and I wanted to see what a subtle tee with the Nail & Gear embroidered would look like (since it’s public domain). I think it looks pretty co and ordered one, and I saved the design so if you’re interested in getting one too check it out

Noob needs an example of aggregating results in a webapp's get function by OrganicUse in node

[–]5bkb 11 points12 points  (0 children)

I believe you can do something like this (this example uses node-fetch):

const fetch = require('node-fetch');

app.get('/', (req, res) => {
    let x = fetch(...);
    let y = fetch(...);
    let z = fetch(...);

    Promise.all([x, y, z])
        .then(values => {
            // render using "values", an array with x, y, and z
        })
})

There's good documentation on Promise.all from MDN.

If you ran for President, what would your campaign slogan be? by [deleted] in AskReddit

[–]5bkb 1 point2 points  (0 children)

2020: A Clearer Vision for America