diff --git a/.gitignore b/.gitignore index 18961931..8f3412b6 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,4 @@ cache public *.work* +node_modules diff --git a/content/posts/2017-08-23-shopify-hmac-verification.md b/content/posts/2017-08-23-shopify-hmac-verification.md index a6809e5a..9118be42 100644 --- a/content/posts/2017-08-23-shopify-hmac-verification.md +++ b/content/posts/2017-08-23-shopify-hmac-verification.md @@ -12,6 +12,9 @@ aliases: - "/blog/2017/08/24/shopify-hmac-verification" --- +> [!IMPORTANT] +> If the date doesn't make it evident, this is an old post. In the intervening years, Shopify has made a lot of changes, including a recent heavy overhaul. I'm leaving this up for posterity, but I don't know or guarantee that it still works in light of those changes. + I get the pleasure of writing integration after integration to Shopify at my day job. As a result, I have become quite familiar with their documentation and its gaps. The HMAC verification piece of the OAuth/embedded app installation process is a particularly glaring gap. So let's close it. # What's Wrong With The Docs? diff --git a/content/posts/2024-07-27-appalachia.md.md b/content/posts/2024-07-27-appalachia.md.md deleted file mode 100644 index b4a4dff5..00000000 --- a/content/posts/2024-07-27-appalachia.md.md +++ /dev/null @@ -1,35 +0,0 @@ ---- -title: Thoughts on Appalachia -subtitle: And The Resurgence of a Certain Book by a Certain Author -draft: true ---- - -JD Vance's ascension to VP pick in this year's presidential race has brought a great deal of attention back to his book, *Hillbilly Elegy*, and with it, the response both of people from the region, and...well...just about everyone else. The stark difference in response is...shall we say... entertaining. - -(And let me say this up front -- Vance's personal story is compelling in its own right, assuming it's true. Getting to where he is after starting out in an unstable, impoverished home is an accomplishment to be proud of. But he diminishes it by painting the region to be like his family members.) - -## Who am I to write about this? - -Because of the content, I feel the need to establish where I'm coming from. You see, much of Appalachian culture (particularly the rural one he tries to portray) takes great pride in one's roots. I hope to get to the reasons why in later sections. - -As for me, to be honest, I often hesitate to classify myself as Appalachian, since I spent my early childhood in the plains portion of Ohio after my grandparents moved, and moved to Columbus for college (an unfortunate commonality I share with Vance, though I hope it ends there; I didn't even attend OSU). It's the in-between time, however, in which I feel I can speak with experience on life in Appalachia, having spent my teenage years living on the banks of the Allegheny River, in the heart of Oil Country. Even before that, I spent many a summer in the hills of southeastern Ohio. - -That's right, there's more to the Buckeye State than just flat cornfields. - -Additionally, I didn't simply live in Appalachia, my family comes from there, and most still live there now. Even as I write this, I'm sitting in my teenage home on the aforementioned riverbank, visiting family. My own papaw, my maternal grandfather, was born in a hamlet outside of Charleston, West Virginia, and is buried in a town in southeastern Ohio literally called Coalton (where I spent many a summer playing in the creek and going to the gas station to get Ski, a local soda that to this day doesn't go any farther north than Circleville). His brother was a West Virginia coal miner, who retired as his job was automated away. We buried their mother on a hilltop overlooking the hollers outside Charleston. My paternal grandparents, too, hailed from the region, though I know less about the details there, aside from granny coming from North Carolina (so...much...grits...). - -I make no claims to expertise on the broader scale, however. Appalachian cultures are as diverse as the landscape. West Virginia differs from Pennsylvania differs from Tennessee from the Carolinas. While the regions share many similarities, they also have many differences, even down to the sub-dialects of the quintessential Appalachian dialect. - -## Vance ain't from here - -(...In the what should be immortal words of [Gov Beshear](https://www.msn.com/en-us/news/politics/kentucky-s-beshear-follows-up-on-he-ain-t-from-here-comment-jd-vance-possible-vp-role/ar-BB1qDpAP).) - -One thing about the book as a whole bugs me -- Vance isn't from Appalachia. From what I can tell, he only ever spent a year living anywhere that's considered part of the region (when he was a law clerk for the Eastern district of Kentucky). - -The thing is, the Appalachian region has an official definition defined by the [Appalachian Regional Commission](https://www.arc.gov/about-the-appalachian-regional-commission/), which names 423 counties across 13 states as part of the region. About 1/3 of Ohio's counties are part of ARC's classification. - -The *eastern* third. - -Officially, not even Cincinnati (or its Kentucky-side counterpart) is part of it, let alone Middleton, which is a fair distance north and *very much* in corn plains country. Not only does that matter, but it also makes it abundantly clear to Appalachians that he's...well...not. - -And though it is definitely the crossroads of the state in every sense of the word, Columbus very much isn't, either. And in fact, there's a marked difference between Columbus and its immediate exurbs, and the barely an hour away line where Appalachia officially starts. \ No newline at end of file diff --git a/content/posts/2023-12-08-modernizing-react.md b/content/posts/2024-09-08-modernizing-react.md similarity index 61% rename from content/posts/2023-12-08-modernizing-react.md rename to content/posts/2024-09-08-modernizing-react.md index 651276e7..40756113 100644 --- a/content/posts/2023-12-08-modernizing-react.md +++ b/content/posts/2024-09-08-modernizing-react.md @@ -1,7 +1,7 @@ --- title: "Adventures in Modernizing React" description: "Something, something, new paradigms" -date: 2023-12-08 +date: 2024-09-08 categories: [tech] tags: [react, legacy code] draft: true @@ -9,7 +9,7 @@ draft: true I spent the better part of my first year at Custom Ink upgrading an Electron and React application. That was an adventure unto itself, let me tell you. It also resulted in a list of "things I need to do when my priority isn't just get this thing working again to unblock the other team." Among that list was updating the code to modern standards -- something I got to make a bunch of headway on in the second half of my second year. -I got really good at converting class-based React components to functional ones. And now, I want to document how I did it. +I got really good at converting class-based React components to functional ones. And now, I want to document how I did it, because there are always legacy apps to update. ## Convert The Class To A Function @@ -29,6 +29,24 @@ const Foo = () => { This, of course, will promptly throw a bunch of IDE error syntax errors. That's okay, we'll fix those in the following steps. Just make sure the function is wrapping properly. + + +## Return the Template + ## Convert The Inner Functions -Now that we've done the easy part, the next step is to convert all the functions to either hooks or constants. This is where it gets a bit time consuming, because it requires more understanding of the code the than simply a syntax conversion. \ No newline at end of file +Now that we've done the easy part, the next step is to convert all the functions to either hooks or constants. This is where it gets a bit time consuming, because it requires more understanding of the code the than simply a syntax conversion. + +### Functions To Constants + +Converting functions to constants is primarily for functions that aren't used for reactivity. + +### Functions to Hooks + +## Convert or Remove Variables + +Class-based components often use a lot of `this` and `this.props` type references when referencing class variables. These are no longer needed, because of how function based components work. The context usually communicated with `this` is inferred using standard Javascript context blocking, and using arrow functions for function declarations retains the component's context and bindings. + +## Split Out Other Components + +## Delete Any Now-Defunct Things \ No newline at end of file