Skip to content

Commit

Permalink
chore: update Prettier and re-run format
Browse files Browse the repository at this point in the history
  • Loading branch information
ilyvion committed Nov 10, 2024
1 parent b3973c9 commit 7059798
Show file tree
Hide file tree
Showing 28 changed files with 130 additions and 113 deletions.
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
package.json
package-lock.json
public
node_modules
2 changes: 1 addition & 1 deletion __mocks__/gatsby.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ module.exports = {
React.createElement("a", {
...rest,
href: to,
})
}),
),
StaticQuery: jest.fn(),
useStaticQuery: jest.fn(),
Expand Down
3 changes: 3 additions & 0 deletions content/blog/2020/06/21/hello-world/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ If you want to see exactly how I did what I did, you're in luck! My <ExternalLin
I don't intend on limiting myself regarding what to write about here, so upcoming posts will be covering whatever I feel like writing about. Still, my interests are mostly centered around software development, gaming and health and diet, and so I'd expect my blog posts to be, also.

[^cliche]: Oh good, a cliché for a start.

[^react]: Mostly because I had recently discovered and learned some React, and I wanted to use my newfound skills to improve my website.

[^cms-details]: Some were homemade, while others were among the <ExternalLink to="https://www.mediawiki.org/">familiar</ExternalLink> and <ExternalLink to="https://www.drupal.org/">popular</ExternalLink>. These were used with varying degrees of satisfaction and update frequency.

[^wayback]: Although who knows what the <ExternalLink to="https://web.archive.org/">Internet WayBack Machine</ExternalLink> may have saved deep in its bellows?
1 change: 1 addition & 0 deletions content/blog/2020/06/21/in-praise-of-rust-part-1/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,5 @@ Rust has bucked the trend of most modern programming languages, and does not sup
If you are a fellow Rustacean[^rustacean], I'm sure you know exactly what I'm going to bring up as the primary challenge I faced early on. Did you say "fighting with the borrow checker?" Congratulations! 🎉🎈 I plan on going into details about the borrow checker in a future installment of this series.

[^backstory-details]: Back in the summer of 2018, my wife and I had our firstborn child. While I don't feel like sharing intricate details about him or his predicament(s), suffice it to say that he basically did not sleep for more than 5–15 minutes at a time for his first 6 months of life, and for the next year after that, he would sleep _better_, but still wake up between 15-30 times every night. Severe sleep deprevation and an undue care burden over a period of nearly a year basically broke me, and I sank into a deep depression, from which I've still only scantly recovered. Maybe I'll write more about this experience some day.

[^rustacean]: The word users of Rust have chosen as their autonym.
4 changes: 2 additions & 2 deletions content/blog/2020/09/05/blog-schedule/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ draft: false
comment_issue_id: 14
---

When I first started this blog, I had originally intended to have a rough schedule of averaging one blog post per week. The intention behind it was that being forced to write about *something* every week would develop my writing skills, and that maybe one day it would become natural for me to write every week, instead of a forced chore. As you can easily see, I did not actually set this schedule up for myself, and consequently, there hasn't been a post made on the blog since late June.
When I first started this blog, I had originally intended to have a rough schedule of averaging one blog post per week. The intention behind it was that being forced to write about _something_ every week would develop my writing skills, and that maybe one day it would become natural for me to write every week, instead of a forced chore. As you can easily see, I did not actually set this schedule up for myself, and consequently, there hasn't been a post made on the blog since late June.

That changes today. Starting now, week 39 of 2020, I'm making it a goal to post one article on my blog every week.
That changes today. Starting now, week 39 of 2020, I'm making it a goal to post one article on my blog every week.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ While I'd certainly prefer seeing <Ruby rt="Tō">東</Ruby><Ruby rt="kyō">京</
Although I don't expect any of this to happen anytime soon, it's still worth thinking about. If you haven't already, I recommend you go watch J.J.'s video on the topic as well as linked at the start of this post.

[^yao-ming]: Yao Ming is a former professional basketball player.

[^maria-sharapova]: Maria Sharapova is a former world No. 1 tennis player.

[^malala]: Malala is a Pakistani activist for female education and a Nobel Peace Prize laureate.

[^writing-direction]: One possible issue here is that due to the opposite writing direction, the ruby characters don't match well to the underlying foreign characters; it ends up looking like "یوسفزۍ" is "Malala," when it is in fact "ملاله" that is "Malala."
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ I was recently tasked with setting up internal/employee authentication using Mic

As I said, this was _internal/employee_ authentication, so when I was registering an application for this purpose in Azure Active Directory, I selected "Accounts in this organizational directory only (_&lt;Company name&gt;_ only - Single tenant)." If you try to use the `MicrosoftAccount` with this setup without special care though, you'll undoubtedly run into this problem as soon as you actually try logging in[^guids]:

<!-- Until <https://github.com/prettier/prettier/issues/3837> is fixed, we need Prettier to ignore this bit -->
<!-- prettier-ignore -->
> Exception: invalid\_request;Description=AADSTS50194: Application 'f552b3c4-1b53-4406-8009-03b8c5438927'(_&lt;Active Directory App Registration name&gt;_) is not configured as a multi-tenant application. Usage of the /common endpoint is not supported for such applications created after '10/15/2018'. Use a tenant-specific endpoint or configure the application to be multi-tenant. Trace ID: b3029a49-cb3d-443d-9280-662398d0701d Correlation ID: 80b4dfe5-970d-44d2-9dd9-f7c799c2094c Timestamp: 2022-06-16 07:15:37Z
I feel like this is something that the `MicrosoftAccount` library should've been updated to deal with back in 2018 when this change was made, but since it apparently isn't, we'll have to deal with it ourselves. Here's what you need to do in order to fix it.
Expand Down
5 changes: 5 additions & 0 deletions content/blog/2024/11/09/weight-loss-2024/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -589,8 +589,13 @@ If you made it this far, have a final graph showing the whole period so far:
![Graph of the weight lost so far](weight-summary.png "Graph of the weight lost so far")

[^exercise-buddy]: If you're not familiar with the concept of an exercise buddy system, the idea is that on days where you don't feel like exercising, you have soembody to hold you accountable. The supposed magic of this system is that even on days where you both would have avoided exercise individually, you plan to have one of you message the other something like "wanna go to the gym today?" and the other one should basically be obliged to always answer "yeah, let's go!" which means that you always end up going short of illness or other valid excuses.

[^no-lazy]: This is one of the reasons I don't believe laziness exists. I want to write more about that in its own post at a later time, but long story short—there's no such thing as a lazy person—if you actually try to get to the bottom of why any given apparently lazy person seems lazy, there's always going to be an underlying cause; anything from depression and exhaustion to unmet needs or an underlying medical condition. I intend to link to said future post here once I write it, but there's a chance I'll forget. 😅

[^tiktok-health]: If anyone's curious, the people on TikTok who ended up inspiring me to make the changes and choices I did were, in order of importance/influence: [Liam (theplantslant)](https://www.tiktok.com/@theplantslant), [Ben Carpenter (bdccarpenter)](https://www.tiktok.com/@bdccarpenter), [morticia 🥀 (𝔟𝔩𝔬𝔬𝔡𝔣𝔩𝔬𝔴𝔢𝔯)](https://www.tiktok.com/@MS4wLjABAAAAtUWuRxxxwoaCb2659sECxjGF0mt6Vga6jMxmhcrSV4SKy7zYBA57_38ipyc7jTUm) and a British TikToker whose account I forgot to follow/save apparently, which is rather embarassing. I'll add him in here if I find him later.

[^high-protein]: Don't worry, I've since realized this is quite unnecessarily high and I never even got close on any given day anyway.

[^calorie-app]: I'm using the app called [Calorie Counter by Lose It!](https://play.google.com/store/apps/details/?id=com.fitnow.loseit&hl=en-US) for which I bought premium a while ago since I found it to be worth paying for. I can't really comment on what it's like without premium anymore, as it's been too long. They also have an app for iOS if you uh... don't like being in control of your phone, I guess?

[^glycogen]: Most of the weight lost here was retained water. When you're eating in caloric maintenance or excess, your body will hold on to extra water due to stored glycogen in your muscles. As far as I can tell from the literature, your body will hold on to 3–4 times as much water as you have glycogen stored, and your body will typically store about <Measurement>1 kg</Measurement> of glycogen, meaning that if you wipe out all your glycogen, you lose up to <Measurement>5 kg</Measurement> of weight.
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,17 @@ magick $inputFilePath -crop 1032x726+24+3380 -fuzz 2% -transparent "srgb(13,26,4
where `$inputFilePath` is the path to the screenshot image and `$outputFileNameBase` is the file name base of the output file. An example of invocation was `./extract-images screenshot_20241103.jpg diet43`[^week43], which produced images named `diet43_{graphType}.png`, which I then used in my blog post.

[^joy-and-learning]: That said—if you get joy and/or learning out of automating the task, it may still be worth doing; not everything has to be measured solely against time spent or saved!

[^xckd-attribution]: xkcd comics are produced by Randall Munroe and licensed under a [Creative Commons Attribution-NonCommercial 2.5 License](https://creativecommons.org/licenses/by-nc/2.5/)

[^avoiding-tedium]: I will readily admit, though, that in this case (and many others), I would much rather waste some additional time than have to do the tedious task, because sometimes my sanity or reducing the effort of the task is worth more than the absolute time spent. Wanting pixel perfect crop-outs from a screenshot is simply an incredibly tedious and time-consuming task to be doing, and it's also so fabulously easily automated that it's an open and shut case for automation.

[^imagemagick]: ImageMagick truly feels like magic, and it's incredibly feature-rich and capable of enormously diverse and advanced tasks. If you haven't used it before, you're honestly missing out. I've been using it for as long as I can remember; it's been around since 1990!

[^scrolling-screenshot]: [Scrolling screenshots](https://support.google.com/android/answer/9075928?hl=en) are honestly one of my most favorite Android features. Based on a cursory web search, they also appear to be available on iOS. It's incredibly handy, and everyone should be aware they exist!

[^advanced-cropping]: I haven't really looked into this since I haven't needed it, but it would not at all surprise me if ImageMagick supported cropping that had rounded corners, which would probably have been my next go-to solution should I have needed it.

[^jpeg]: JPEG artifacts are close to—but not equal—to their surrounding color.

[^week43]: If you're curious what the 43 is about, I track my progress on a weekly basis, and this screenshot was for week 43 of 2024.
33 changes: 14 additions & 19 deletions gatsby-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,29 +21,24 @@ exports.createPages = async ({ graphql, actions }) => {
const { createPage } = actions

// Get all blog entries
const result = await graphql(
`
{
allMdx(
sort: { fields: [frontmatter___date], order: DESC }
limit: 1000
) {
edges {
node {
fields {
slug
}
frontmatter {
draft
title
tags
}
const result = await graphql(`
{
allMdx(sort: { fields: [frontmatter___date], order: DESC }, limit: 1000) {
edges {
node {
fields {
slug
}
frontmatter {
draft
title
tags
}
}
}
}
`
)
}
`)

if (result.errors) {
throw result.errors
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"enzyme-adapter-react-16": "^1.15.2",
"identity-obj-proxy": "^3.0.0",
"jest": "^26.0.1",
"prettier": "2.0.5",
"prettier": "3.3.3",
"react-test-renderer": "^16.13.1"
},
"repository": {
Expand Down
2 changes: 1 addition & 1 deletion src/components/ListGroup/ListGroup.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const ListGroup = ({ values, columnSize, icon }) => {
listEntries.push(
<li key={element} className="list-group-item">
<i className={"fa fa-" + icon}></i> {element}
</li>
</li>,
)
})

Expand Down
4 changes: 2 additions & 2 deletions src/components/Navigation/Arrow.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@ export default class Arrow extends Component {
arrowCalculationInProgress: false,
arrowPosition: this.calculateArrowPosition(),
})
}
},
)
}

calculateArrowPosition() {
const activePage = document.querySelector(".site-navbar .active")
if (!activePage) {
console.warn(
"The current page is missing from the navigation; cannot calculate arrow position"
"The current page is missing from the navigation; cannot calculate arrow position",
)
return
}
Expand Down
62 changes: 32 additions & 30 deletions src/components/Navigation/Navigation.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,29 @@ import Progress from "@components/Progress"
import Arrow from "./Arrow"
import "./Navigation.css"

const NavbarTitle = React.forwardRef(({ title, toggleNavigationAction, clickTitleAction }, ref) => (
<div id="mainNavbar" className="navbar-header" ref={ref}>
<button
type="button"
className="navbar-toggle collapsed"
onClick={toggleNavigationAction}
>
<span className="sr-only">Toggle navigation</span>
<span className="icon-bar"></span>
<span className="icon-bar"></span>
<span className="icon-bar"></span>
</button>
<Link
to="/"
onClick={clickTitleAction}
className="navbar-brand page-scroll"
>
{title}
</Link>
</div>
))
const NavbarTitle = React.forwardRef(
({ title, toggleNavigationAction, clickTitleAction }, ref) => (
<div id="mainNavbar" className="navbar-header" ref={ref}>
<button
type="button"
className="navbar-toggle collapsed"
onClick={toggleNavigationAction}
>
<span className="sr-only">Toggle navigation</span>
<span className="icon-bar"></span>
<span className="icon-bar"></span>
<span className="icon-bar"></span>
</button>
<Link
to="/"
onClick={clickTitleAction}
className="navbar-brand page-scroll"
>
{title}
</Link>
</div>
),
)
NavbarTitle.displayName = "NavbarTitle"

class Navigation extends Component {
Expand Down Expand Up @@ -108,7 +110,7 @@ class Navigation extends Component {
body.offsetHeight,
html.clientHeight,
html.scrollHeight,
html.offsetHeight
html.offsetHeight,
)
var windowHeight = window.innerHeight
var offset = window.pageYOffset
Expand Down Expand Up @@ -149,7 +151,7 @@ class Navigation extends Component {
elapsed,
offset,
targetY,
settings.duration
settings.duration,
)
window.scrollTo(0, yScroll)
self.timer = setTimeout(step, 10)
Expand Down Expand Up @@ -200,7 +202,7 @@ class Navigation extends Component {
>
{menuItem.name}
</Link>
</li>
</li>,
)
if (menuItem.link === path) {
if (menuItem.pageNavs && menuItem.pageNavs.length) {
Expand All @@ -212,7 +214,7 @@ class Navigation extends Component {
>
Top
</a>
</li>
</li>,
)
menuItem.pageNavs.forEach(pageNav => {
const active = activePageNavigationItem === pageNav.id
Expand All @@ -224,7 +226,7 @@ class Navigation extends Component {
>
{pageNav.name}
</a>
</li>
</li>,
)
})
}
Expand All @@ -235,7 +237,7 @@ class Navigation extends Component {
<Link to="/blog/" activeClassName="active" partiallyActive={true}>
Blog
</Link>
</li>
</li>,
)

// Kludge to get transparent page navigation on main page
Expand All @@ -254,10 +256,10 @@ class Navigation extends Component {
>
<div className="container-fluid">
<NavbarTitle
ref={this.mainNavbarRef}
ref={this.mainNavbarRef}
title="Alexander Krivács Schrøder"
toggleNavigationAction={() => this.toggleMobileNavigation()}
clickTitleAction={e => this.clickSiteNavigation(e)}
toggleNavigationAction={() => this.toggleMobileNavigation()}
clickTitleAction={e => this.clickSiteNavigation(e)}
/>

<div
Expand Down
6 changes: 3 additions & 3 deletions src/components/Progress/Progress.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ class Progress extends Component {

componentDidMount() {
window.addEventListener("scroll", e => this.handleScroll(e), {
passive: true,
})
passive: true,
})
}

componentWillUnmount() {
Expand All @@ -29,7 +29,7 @@ class Progress extends Component {
body.offsetHeight,
html.clientHeight,
html.scrollHeight,
html.offsetHeight
html.offsetHeight,
)

const progress = document.scrollingElement.scrollTop
Expand Down
5 changes: 0 additions & 5 deletions src/components/__tests__/__snapshots__/externalLink.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,6 @@
exports[`ExternalLink renders correctly 1`] = `
<a
href="http://example.com/"
style={
Object {
"whiteSpace": "nowrap",
}
}
>
 
<i
Expand Down
2 changes: 1 addition & 1 deletion src/components/__tests__/iconLink.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ describe("IconLink", () => {
icon="icon"
text="text"
columnSize={6}
/>
/>,
)
.toJSON()
expect(tree).toMatchSnapshot()
Expand Down
Loading

0 comments on commit 7059798

Please sign in to comment.