figbert.com-website

[ACTIVE] the website and home of figbert on the clearnet
git clone git://git.figbert.com/figbert.com-website.git
Log | Files | Refs | README | LICENSE

commit fc7b499af532ec4635d3ae57541150941619399e
parent bd7550dec7a8d5f5ff035b6bbb44c604c3b7c40d
Author: FIGBERT <figbert@figbert.com>
Date:   Sun, 16 Aug 2020 14:04:53 -0700

:bento: Add video and image shortcodes to posts

Diffstat:
Mcontent/posts/how-to-replace-keybase-in-three-easy-steps/index.md | 2+-
Mcontent/posts/i-wrote-this-one/index.md | 6++----
Mcontent/posts/i-wrote-this-three/index.md | 3+--
Mcontent/posts/i-wrote-this-two/index.md | 13+++----------
Mcontent/posts/pebkac-txtodo-rewrite/index.md | 40+++++++++++++++++++++++++++++-----------
5 files changed, 36 insertions(+), 28 deletions(-)

diff --git a/content/posts/how-to-replace-keybase-in-three-easy-steps/index.md b/content/posts/how-to-replace-keybase-in-three-easy-steps/index.md @@ -46,7 +46,7 @@ pretty great tutorials out there (I would recommend [this one][kev-article] by t go into too much detail about exactly how to do that. However, it's important to note that though Kev recommends hiding your h-card with the `display: none;` property: [don't do that][invisible-metadata]. I just merged my about and contact pages onto my homepage, and added the microformats classes to my existing markup. -![My IndieWeb h-card](h-card.png) +{{ image(sources=["h-card.png"], fallback_path="h-card.png", fallback_alt="My Indieweb h-card") }} ### Step #3: File Storage diff --git a/content/posts/i-wrote-this-one/index.md b/content/posts/i-wrote-this-one/index.md @@ -36,7 +36,7 @@ and downloaded what is supposedly "The ultimate Vim configuration." from [amix][ with the fantastic [Jetbrains Mono][jetbrains-mono] font. I'm still not that good at actually using vim to its fullest potential but I'm confident that I'll improve with a little practice and ascend to elite vim status in no time. -![The virgin classic developer vs the chad linux dev][vim-dev] +{{ image(sources=["chad.jpg"], fallback_path="chad.jpg", fallback_alt="The virgin classic developer vs the chad linux dev") }} ## Maybe Rust? @@ -53,7 +53,7 @@ and loved it – the chromium feel with a powerful built in adblocker? It sounde they [hijacked links][brave-hijack], launched a [weird Zoom competitor][brave-zoom] with no fanfare or announcement, and refuse to get rid of their [required KYC][brave-kyc]. Anyways, I dropped it. Now my dock is all blue! -![My dock with all blue apps][dock] +{{ image(sources=["dock.png"], fallback_path="dock.png", fallback_alt="My dock with all blue apps") }} ## New Music @@ -77,8 +77,6 @@ FIGBERT [signing-commits]: https://help.github.com/en/github/authenticating-to-github/managing-commit-signature-verification [ultimate-vim]: https://github.com/amix/vimrc [jetbrains-mono]: https://www.jetbrains.com/lp/mono/ -[vim-dev]: chad.jpg -[dock]: dock.png [hn]: https://news.ycombinator.com/ [brave]: https://brave.com/ [firefox]: https://www.mozilla.org/en-US/firefox/developer/ diff --git a/content/posts/i-wrote-this-three/index.md b/content/posts/i-wrote-this-three/index.md @@ -16,7 +16,7 @@ These past few weeks, my main work has been on interactive fiction as part of a I will refer to them for the rest of the article, becuase calling them "interactive fiction" makes me sound like ~~a dick~~ a snob). I gathered a collection of games to play in free time (if I ever have any more of that), from the very first of the genre – Adventure – to modern ones like Lost Pig. -![My collection of text adventures: Adventure, Bronze, Counterfeit Monkey, Curses, Hitchhiker's Guide to the Galaxy, Lost Pig, and Slouching Towards Bedlam][if-collection] +{{ image(sources=["collection.png"], fallback_path="collection.png", fallback_alt="My collection of text adventures: Adventure, Bronze, Counterfeit Monkey, Curses, Hitchhiker's Guide to the Galaxy, Lost Pig, and Slouching Towards Bedlam") }} In the second week, we all made our own text adventures. It was a really interesting experience – drastically different than any other programming I've done. The main thing I struggled with was the semi-NLP style of [Inform7][inform]. Rather than telling the computer what to do, I felt like I was making suggestions. I also struggled with the editor a @@ -137,7 +137,6 @@ keep finding cool and interesting things to do, and I need to work on finishing Salamat, FIGBERT -[if-collection]: collection.png [inform]: https://inform7.com/ [angry-wizard]: /content/One%20Angry%20Wizard%2C%20or%20the%20Tentac.gblorb [email]: mailto:figbert+textadventures@figbert.com diff --git a/content/posts/i-wrote-this-two/index.md b/content/posts/i-wrote-this-two/index.md @@ -25,10 +25,7 @@ stands in high contrast to the iOS App Store's ubiquitous freemium payment model All in all, I spent around USD$21 on tweaks, which is infinitely more than I have spent on the App Store – so maybe charging upfront does work. Huh. -<video autoplay loop muted playsinline> - <source src="jailbreak.webm" type="video/webm"> - <source src="jailbreak.mp4" type="video/mp4"> -</video> +{{ gif(sources=["jailbreak.webm", "jailbreak.mp4"]) }} ## Updating my iDevices to Developer Betas @@ -49,10 +46,7 @@ Interestingly, I was having a bunch of issues with brew (`curl` was broken?) aft For my next medium-large project, I'm going to need to make some 3D art and models. One problem: I don't know how to do that, or rather, I didn't. Thanks internet! I powered through the incredible [Blender Beginner Tutorial Series][18] by the [Blender Guru][19]. Here's my final animation: -<video autoplay loop muted playsinline> - <source src="doughnut.webm" type="video/webm"> - <source src="doughnut.mp4" type="video/mp4"> -</video> +{{ gif(sources=["doughnut.webm", "doughnut.mp4"]) }} ## Replacing Keybase @@ -75,7 +69,7 @@ mapping API (preferably not by Google) that will tell me the size of different l I'm also planning on revamping the txtodo macOS app with Mac Catalyst, which I feel I haven't properly explored. I've also discovered a bug in the app that causes issues when tasks are modified by CloudKit instead of the user, so I'm going to have to work on that as well. Shouldn't be hard! -![Let's go. In and out. Twenty-minute adventure.][29] +{{ image(sources=["rick-and-morty.jpg"], fallback_path="rick-and-morty.jpg", fallback_alt="Let's go. In and out. Twenty-minute adventure.") }} ## Interesting Blog Tidbits @@ -134,7 +128,6 @@ FIGBERT [26]: https://godotengine.org [27]: https://www.blender.org [28]: https://www.image-line.com/flstudio -[29]: rick-and-morty.jpg [30]: https://en.wikipedia.org/wiki/Present_continuous [31]: https://keybase.io/ diff --git a/content/posts/pebkac-txtodo-rewrite/index.md b/content/posts/pebkac-txtodo-rewrite/index.md @@ -2,6 +2,7 @@ title = "Problem Exists Between Keyboard and Chair: How I Spent 2 Days Chasing a Bug that Didn't Exist" description = "Post-WWDC2020, I decided to rewrite the backend of txtodo in SwiftUI using the new App and Scene structure. Rebuilding the app from scratch may have not been the best choice, but during that process I have massively simplified the app's data structure, despaghettified some messy UI code, and spent two full days trying to solve a problem that didn't exist. This is the story of that last bit." date = 2020-07-28 +updated = 2020-08-16 +++ Post-[WWDC2020][wwdc], I decided to rewrite the backend of txtodo in SwiftUI using the new [App and Scene structure][app-and-scene]. Rebuilding the app from scratch may have not @@ -36,15 +37,37 @@ removed some of the text styling, which I planned to port over after I got the U I ran the app on my device, and this happened: -![As you check off any task in the vertical stack, instead of checking off the task that you selected, tasks are checked off starting from the bottom and moving upwards in an -ascending order.][ascending-checkmarks-error] +{{ video(sources=["ascending-checkmarks-error.webm"]) }} Well that was unexpected. Instead of checking off the tasks I selected, tasks were checked off starting from the bottom and ascending – obviously not the intended behavior! My first thought was that it was caused by the use of `@ObservedObject` to declare the view's task property – I haven't seen it used to manipulate a Core Data entity before, but it's worked fine so far in txtodo – so I rewrote the variables to match version 2.0. -![The variables declared before the UI of version 3.0 and version 2.0. Version 3.0 has two variables, task and config, but version 2.0 has nine: task, completed, name, priority, -deleted, editingText, editingPriority, viewingNotes, and confirmingDelete.][contrasting-variables] +```swift +// VERSION 3.0 +struct TaskView: View { + @Environment(\.managedObjectContext) var managedObjectContext + @ObservedObject var task: Task + @State var priority: Int + @State private var config = TaskConfig() + // UI... +} + +// VERSION 2.0 +struct floatingTaskView: View { + @Environment(\.managedObjectContext) var managedObjectContext + @ObservedObject var task: FloatingTask + @State var completed: Bool + @State var name: String + @State var priority: Int + @State var deleted: Bool = false + @State private var editingText: Bool = false + @State private var editingPriority: Bool = false + @State private var viewingNotes: Bool = false + @State private var confirmingDelete: Bool = false + // UI... +} +``` Still no change. It was getting pretty late at this point, but I decided to stick it out for just a bit longer. I rewrote the `TaskView` struct from scratch *two more times* to no avail. Something was wrong, but I had no idea where it was and there was no way I was going to figure it out at two in the morning by coding it again the exact same way. @@ -88,8 +111,7 @@ newTask.daily = Bool.random() I ran the app again and saw this: -![The tasks were not being marked off in ascending order – rather, they were being moved to the bottom when completed, which I couldn't tell before because they were all -identical.][the-big-reveal] +{{ video(sources=["randomized-test-values.webm"]) }} ## Intentional Behavior @@ -106,7 +128,7 @@ you might think: [garbage in, garbage out][GIGO] definitely applies here. If all To make the sorting more clear, I randomized the tasks' priority, name, and category (as seen above) and added an animation with `.animation(.easeIn(duration: 0.25))`. The current prototype looks something like this: -![Animated, randomized tasks being checked off, deleted, and delayed.][current-txtodo] +{{ video(sources=["update-preview.webm"]) }} This has been a really fun blog post to write! A got a big laugh out of this bug chase, and I hope you've enjoyed reading it. @@ -114,9 +136,5 @@ Till next time, FIGBERT [wwdc]: https://developer.apple.com/wwdc20/ [app-and-scene]: https://developer.apple.com/videos/play/wwdc2020/10037/ -[ascending-checkmarks-error]: ascending-checkmarks-error.webm -[contrasting-variables]: variable-comparison.webp -[the-big-reveal]: randomized-test-values.webm -[current-txtodo]: update-preview.webm [GIGO]: https://en.wikipedia.org/wiki/Garbage_in%2C_garbage_out