From fcfac26f040dcf42e03e31e40c827c3a3113fb5b Mon Sep 17 00:00:00 2001 From: "Zack M. Davis" Date: Tue, 14 Jul 2026 18:05:43 -0700 Subject: [PATCH] fixes: image alignment and strikethrough --- content/2013/app-academy-diary-week-eight.md | 8 ++++-- content/2013/app-academy-diary-week-five.md | 8 ++++-- content/2013/app-academy-diary-week-seven.md | 4 ++- content/2015/app-ideas-i.md | 4 ++- content/2015/californian-raktajino.md | 17 ++++++----- content/2016/pose.md | 4 ++- pelicanconf.py | 1 + requirements.txt | 1 + theme/static/css/style.css | 30 ++++++++++++++++++++ 9 files changed, 63 insertions(+), 14 deletions(-) diff --git a/content/2013/app-academy-diary-week-eight.md b/content/2013/app-academy-diary-week-eight.md index 490f162..acc992e 100644 --- a/content/2013/app-academy-diary-week-eight.md +++ b/content/2013/app-academy-diary-week-eight.md @@ -7,8 +7,12 @@ Slug: app-academy-diary-week-eight _Tuesday 5 Novembmer 2013—_ Yesterday was our last pair-programming project; I worked with _Ben Watts_ on a little chat server in Node using WebSockets. I felt like perhaps there was something regrettable about shoving so much functionality into a big callback, but maybe that's just the nature of JavaScript, and not really regrettable at all? On Sunday I started my RSS-aggregator capstone project, now called Superscription. -[![superscription_entity-relationship-diagram](http://zackmdavis.net/blog/wp-content/uploads/2013/11/superscription_entity-relationship-diagram-300x188.png)](http://zackmdavis.net/blog/wp-content/uploads/2013/11/superscription_entity-relationship-diagram.png)_Thursday 7 Novembmer 2013—_ I guess Superscription is going okay. Here's how it works. You can sign up and sign in and stuff. (I used [Devise](http://rubygems.org/gems/devise) for this rather than rolling my own.) There are forms for adding a category or a subscription URL. When you add a URL, stuff happens which depends on stuff. More specifically, if you enter a URL which the system has never seen before, then a new `Subscription` model (which [`accepts_nested_attributes_for`](http://apidock.com/rails/ActiveRecord/NestedAttributes/ClassMethods/accepts_nested_attributes_for) an associated `UserSubscription` join model) is created, and it requests the feed from the URL you supplied and tries to parse the XML using [Nokogiri](http://nokogiri.org/). If that doesn't work, it suggests that maybe you got the URL wrong, but if it _does_ work, then it makes a bunch of Entry objects for all the stories in the feed, saves everything, and redirects you to your subscription index page. But if the system has already seen your URL before (presumably from another user with similar reading tastes), then it doesn't wastefully fetch all that data again: it just makes a new `UserSubscription` that points to you and your `Category` and the `Subscription` that it already has. It's efficient! Then when you click the "Read!" button (which is non-hideously positioned thanks to nearly an hour of fighting the CSS), all your news is organized by category under [Bootstrap tabs](http://getbootstrap.com/javascript/#tabs). And on the subscription index page, when you click the little trash can next to a subscription, then it does [the cool jQuery fade-out thing](http://api.jquery.com/fadeOut/) and sends an Ajax request telling the server to destroy that `UserSubscription`. +[![superscription_entity-relationship-diagram](http://zackmdavis.net/blog/wp-content/uploads/2013/11/superscription_entity-relationship-diagram-300x188.png)](http://zackmdavis.net/blog/wp-content/uploads/2013/11/superscription_entity-relationship-diagram.png){: .alignleft } -[![superscription_early_demo](http://zackmdavis.net/blog/wp-content/uploads/2013/11/superscription_early_demo-282x300.png)](http://zackmdavis.net/blog/wp-content/uploads/2013/11/superscription_early_demo.png)_Sunday 10 Novembmer 2013—_ You know, I don't think I'm happy with Superscription's current state. As currently written, it's fetching feeds _inside of the request-response cycle_, which is just awful on a technical level even if I seem to have gotten away with it so far. I'll want to do some serious rework this week (_next_ week?—I suppose these entries have been following the Monday-indexed convention) so that the fetch happens as a background job (even though that will cost money to host on Heroku, which only offers one free web dyno). And it could do with a lot more JavaScripty features on the frontend, and I need to read the Bootstrap documentation more carefully. +_Thursday 7 Novembmer 2013—_ I guess Superscription is going okay. Here's how it works. You can sign up and sign in and stuff. (I used [Devise](http://rubygems.org/gems/devise) for this rather than rolling my own.) There are forms for adding a category or a subscription URL. When you add a URL, stuff happens which depends on stuff. More specifically, if you enter a URL which the system has never seen before, then a new `Subscription` model (which [`accepts_nested_attributes_for`](http://apidock.com/rails/ActiveRecord/NestedAttributes/ClassMethods/accepts_nested_attributes_for) an associated `UserSubscription` join model) is created, and it requests the feed from the URL you supplied and tries to parse the XML using [Nokogiri](http://nokogiri.org/). If that doesn't work, it suggests that maybe you got the URL wrong, but if it _does_ work, then it makes a bunch of Entry objects for all the stories in the feed, saves everything, and redirects you to your subscription index page. But if the system has already seen your URL before (presumably from another user with similar reading tastes), then it doesn't wastefully fetch all that data again: it just makes a new `UserSubscription` that points to you and your `Category` and the `Subscription` that it already has. It's efficient! Then when you click the "Read!" button (which is non-hideously positioned thanks to nearly an hour of fighting the CSS), all your news is organized by category under [Bootstrap tabs](http://getbootstrap.com/javascript/#tabs). And on the subscription index page, when you click the little trash can next to a subscription, then it does [the cool jQuery fade-out thing](http://api.jquery.com/fadeOut/) and sends an Ajax request telling the server to destroy that `UserSubscription`. + +[![superscription_early_demo](http://zackmdavis.net/blog/wp-content/uploads/2013/11/superscription_early_demo-282x300.png)](http://zackmdavis.net/blog/wp-content/uploads/2013/11/superscription_early_demo.png){: .alignleft } + +_Sunday 10 Novembmer 2013—_ You know, I don't think I'm happy with Superscription's current state. As currently written, it's fetching feeds _inside of the request-response cycle_, which is just awful on a technical level even if I seem to have gotten away with it so far. I'll want to do some serious rework this week (_next_ week?—I suppose these entries have been following the Monday-indexed convention) so that the fetch happens as a background job (even though that will cost money to host on Heroku, which only offers one free web dyno). And it could do with a lot more JavaScripty features on the frontend, and I need to read the Bootstrap documentation more carefully. I made some improvements to Wires today. I got logout working, introduced redirection after logging in or out, and added a favicon! Yet I still don't have associations working, due to unforeseen scoping issues. diff --git a/content/2013/app-academy-diary-week-five.md b/content/2013/app-academy-diary-week-five.md index ac53e07..1c784e2 100644 --- a/content/2013/app-academy-diary-week-five.md +++ b/content/2013/app-academy-diary-week-five.md @@ -4,7 +4,9 @@ Status: published Category: computing Slug: app-academy-diary-week-five -[!["Getting Down to Business"](http://zackmdavis.net/blog/wp-content/uploads/2013/10/starlight_music-getting_down-203x300.png)](http://zackmdavis.net/blog/wp-content/uploads/2013/10/starlight_music-getting_down.png)_Monday 14 October 2013—_ I'll confess that I didn't have a productive weekend at _all_. No excuses; I just got distracted. You could argue (I won't, but you can) that it's perfectly healthy and fine to take some well-earned relaxation on one's days off, but even relaxation is something that can be done better or worse: hours of the latest ephemeral internet amusements are probably _much less_ rejuvenating than hours of ... I don't know, some sort of activity that _doesn't_ involve sitting in front of a monitor?—I presume such things still exist even if I can't remember them anymore. +[!["Getting Down to Business"](http://zackmdavis.net/blog/wp-content/uploads/2013/10/starlight_music-getting_down-203x300.png)](http://zackmdavis.net/blog/wp-content/uploads/2013/10/starlight_music-getting_down.png){: .alignleft } + +_Monday 14 October 2013—_ I'll confess that I didn't have a productive weekend at _all_. No excuses; I just got distracted. You could argue (I won't, but you can) that it's perfectly healthy and fine to take some well-earned relaxation on one's days off, but even relaxation is something that can be done better or worse: hours of the latest ephemeral internet amusements are probably _much less_ rejuvenating than hours of ... I don't know, some sort of activity that _doesn't_ involve sitting in front of a monitor?—I presume such things still exist even if I can't remember them anymore. Still no deal in the BART contract talks; I took an evening train and slept at the office last night because we didn't know whether there would be trains in the morning. As it turns out, there were, but there likely won't be tomorrow. A moment of amusement is provided by imagining what kind of vicious and histrionic things a frustrated commuter might say if they were angry ("Curse the unions! Curse anyone who won't curse the unions! Curse anyone who won't put a light in their window and sit up all night cursing the unions! Let management fire them and hire scabs! Let hackers insert their names into the public sex-offender registry!" _&c._), but in truth, I ain't even mad. (This is in accordance with policy; even if we were to suppose that I somehow knew how the labor dispute [should ("should")](http://zackmdavis.net/blog/2012/10/the-quieted-scare-convention/) be resolved, it would still be [a waste of cognition to think about it unless](http://zackmdavis.net/blog/2012/12/counterfactual-social-thought/) we were also to suppose that people care what I think—and _that's_ ridiculous.) @@ -14,7 +16,9 @@ Tomorrow there's an assessment scheduled, and I _really_ ought to have taken the And that's terrible. -[![My Friend Circle](http://zackmdavis.net/blog/wp-content/uploads/2013/10/my_friend_circle-300x277.png)](http://zackmdavis.net/blog/wp-content/uploads/2013/10/my_friend_circle.png)_Tuesday 15 October 2013—_ I got all the specs to pass on the assessment with time to spare. Today's designated project was _Friend Circle_ (!), a Google+ish thing where users can put other users in circles and share posts with them. I was scheduled to pair with _Jeff Rosen_, but apparently he was ill, and so I worked alone after lunch. The instructions described a somewhat ambitious project; I only got as far as letting users create circles and will have to catch up later. Associations are actually really powerful! Still no BART settlement ... and no strike, either; I decided to come home tonight, the allure of a shower and bed and privacy outweighing the travel uncertainty. Tomorrow we're going to make a very simple clone of some of the functionality of Rails itself (following up on our [earlier](http://zackmdavis.net/blog/2013/10/app-academy-diary-week-four/#monday) very simple clone of some of the functionality of ActiveRecord). I guess I'll call it ... Ruby on Wires? +[![My Friend Circle](http://zackmdavis.net/blog/wp-content/uploads/2013/10/my_friend_circle-300x277.png)](http://zackmdavis.net/blog/wp-content/uploads/2013/10/my_friend_circle.png){: .alignleft } + +_Tuesday 15 October 2013—_ I got all the specs to pass on the assessment with time to spare. Today's designated project was _Friend Circle_ (!), a Google+ish thing where users can put other users in circles and share posts with them. I was scheduled to pair with _Jeff Rosen_, but apparently he was ill, and so I worked alone after lunch. The instructions described a somewhat ambitious project; I only got as far as letting users create circles and will have to catch up later. Associations are actually really powerful! Still no BART settlement ... and no strike, either; I decided to come home tonight, the allure of a shower and bed and privacy outweighing the travel uncertainty. Tomorrow we're going to make a very simple clone of some of the functionality of Rails itself (following up on our [earlier](http://zackmdavis.net/blog/2013/10/app-academy-diary-week-four/#monday) very simple clone of some of the functionality of ActiveRecord). I guess I'll call it ... Ruby on Wires? _Thursday 17 October 2013—_ Writing Ruby on Wires yesterday (albeit building off the supplied skeleton) was really fun; I hooked it up to SedentaryRecord and started a blog engine ("blog engine"—well, okay, so you fill out a form and it adds your content to a page) that actually works, without Rails! Today I worked with Ben Hass [again](http://zackmdavis.net/blog/2013/09/app-academy-diary-week-one/#friday) on a Reddit-like thing with RSpec tests (and FactoryGirl and Faker to construct test objects). Near the end, under Ben's leadership, we used JavaScript and jQuery to get comment forms to appear on the page in response to a user clicking "Reply", but didn't have time to actually get the comment submission to work. The trains are really going away tomorrow; perhaps I'll be able to join an _ad hoc_ carpool at the station? diff --git a/content/2013/app-academy-diary-week-seven.md b/content/2013/app-academy-diary-week-seven.md index 0e68b53..21b5c21 100644 --- a/content/2013/app-academy-diary-week-seven.md +++ b/content/2013/app-academy-diary-week-seven.md @@ -8,4 +8,6 @@ _Monday 28 October 2013—_ The governor of Delaware was supposed to visit us to _Wednesday 30 October 2013—_ Our focus this week is _Backbone.js_, a library for doing client-side stuff. I hadn't been sure what to do for my capstone project, but now (perhaps inspired by remembering how I really ought to use feeds instead of manually navigating to my favorite blogs for all the world as if it were 2003) I'm thinking of making an RSS reader and calling it Event Listener. In the evening, I made a small improvement to the Wires template engine, and I started working on an improvement to how objects inherit from the ORM base class, but it's getting late and I'm not done debugging and I wasn't planning on sleeping over tonight, so rather than pushing egregiously broken code to GitHub, I backed up my work as an online paste of a diff obtained by redirecting `git stash show -p`. -[![Learning Backbone](http://zackmdavis.net/blog/wp-content/uploads/2013/10/learning_backbone-241x300.png)](http://zackmdavis.net/blog/wp-content/uploads/2013/10/learning_backbone.png)_Thursday 31 October 2013 (or, very early Friday)—_ _Speaking_ of online pastes, today I worked with _Vincent Park_ on another make-a-Backbone-app exercise inspired by GitHub's [Gist](https://gist.github.com/). It simply cannot be doubted that practice, as always, makes perfect. In the evening I bought a new clipboard at the Target inside the Metreon (as my old clipboard had been broken for some time, and the way in which the broken-off piece makes a great coaster had been small consolation indeed), and I hung out and made a few small improvements to Wires. I received a reminder of the importance of catching only _specific_ exceptions—an `except:` block in my code was silently catching a type error that was the source of a bug, when really all I wanted was an `except KeyError:`—it was an easy fix this time, but in a larger project one might not be so lucky! Wires's current "template language" (if you can call it that; I'm just replacing identifiers inside "<%=" and "%>" delimiters with substitutions from a supplied dictionary) doesn't support conditionals the way EJS or ERB do, but it would be awfully nice to at least, say, render _logged in as this-and-such_ depending on whether the user is logged in, but I have a cheap workaround in mind. +[![Learning Backbone](http://zackmdavis.net/blog/wp-content/uploads/2013/10/learning_backbone-241x300.png)](http://zackmdavis.net/blog/wp-content/uploads/2013/10/learning_backbone.png){: .alignleft } + +_Thursday 31 October 2013 (or, very early Friday)—_ _Speaking_ of online pastes, today I worked with _Vincent Park_ on another make-a-Backbone-app exercise inspired by GitHub's [Gist](https://gist.github.com/). It simply cannot be doubted that practice, as always, makes perfect. In the evening I bought a new clipboard at the Target inside the Metreon (as my old clipboard had been broken for some time, and the way in which the broken-off piece makes a great coaster had been small consolation indeed), and I hung out and made a few small improvements to Wires. I received a reminder of the importance of catching only _specific_ exceptions—an `except:` block in my code was silently catching a type error that was the source of a bug, when really all I wanted was an `except KeyError:`—it was an easy fix this time, but in a larger project one might not be so lucky! Wires's current "template language" (if you can call it that; I'm just replacing identifiers inside "<%=" and "%>" delimiters with substitutions from a supplied dictionary) doesn't support conditionals the way EJS or ERB do, but it would be awfully nice to at least, say, render _logged in as this-and-such_ depending on whether the user is logged in, but I have a cheap workaround in mind. diff --git a/content/2015/app-ideas-i.md b/content/2015/app-ideas-i.md index 342b8f9..e433ebc 100644 --- a/content/2015/app-ideas-i.md +++ b/content/2015/app-ideas-i.md @@ -5,4 +5,6 @@ Category: asides Tags: baseball, notation Slug: app-ideas-i -[![scorecard_attempt_SFG_vs_CIN_2015-09-15](http://zackmdavis.net/blog/wp-content/uploads/2015/10/scorecard_attempt_SFG_vs_CIN_2015-09-15-300x191.jpg)](http://zackmdavis.net/blog/wp-content/uploads/2015/10/scorecard_attempt_SFG_vs_CIN_2015-09-15.jpg)baseball scorecard tablet app that downloads the official scorekeeper's version after the game and grades you on accuracy +[![scorecard_attempt_SFG_vs_CIN_2015-09-15](http://zackmdavis.net/blog/wp-content/uploads/2015/10/scorecard_attempt_SFG_vs_CIN_2015-09-15-300x191.jpg)](http://zackmdavis.net/blog/wp-content/uploads/2015/10/scorecard_attempt_SFG_vs_CIN_2015-09-15.jpg) + +baseball scorecard tablet app that downloads the official scorekeeper's version after the game and grades you on accuracy diff --git a/content/2015/californian-raktajino.md b/content/2015/californian-raktajino.md index 90c10f4..f8a9b0b 100644 --- a/content/2015/californian-raktajino.md +++ b/content/2015/californian-raktajino.md @@ -13,12 +13,15 @@ _Ingredients:_ [![californian_raktajino1](http://zackmdavis.net/blog/wp-content/uploads/2015/11/californian_raktajino1-216x300.jpg)](http://zackmdavis.net/blog/wp-content/uploads/2015/11/californian_raktajino1.jpg) - _Instructions:_ -1. Pour coffee powder in bottom of glass. -2. Add enough water to dissolve the coffee powder; stir. -[![californian_raktajino2](http://zackmdavis.net/blog/wp-content/uploads/2015/11/californian_raktajino2-196x300.jpg)](http://zackmdavis.net/blog/wp-content/uploads/2015/11/californian_raktajino2.jpg)3. Pour Soylent. Soylent will mostly sink below the coffee; stir with a somewhat vertical motion until color is uniform. -[![californian_raktajino3](http://zackmdavis.net/blog/wp-content/uploads/2015/11/californian_raktajino3-208x300.jpg)](http://zackmdavis.net/blog/wp-content/uploads/2015/11/californian_raktajino3.jpg) -[![californian_raktajino4](http://zackmdavis.net/blog/wp-content/uploads/2015/11/californian_raktajino4-220x300.jpg)](http://zackmdavis.net/blog/wp-content/uploads/2015/11/californian_raktajino4.jpg) -[![californian_raktajino5](http://zackmdavis.net/blog/wp-content/uploads/2015/11/californian_raktajino5-204x300.jpg)](http://zackmdavis.net/blog/wp-content/uploads/2015/11/californian_raktajino5.jpg)4. Today is a good day to live! Drink; enjoy; move fast; break things! +
    +
  1. Pour coffee powder in bottom of glass.
  2. +
  3. Add enough water to dissolve the coffee powder; stir.
    +californian_raktajino2
  4. +
  5. Pour Soylent. Soylent will mostly sink below the coffee; stir with a somewhat vertical motion until color is uniform.
    +californian_raktajino3 +californian_raktajino4 +californian_raktajino5
  6. +
  7. Today is a good day to live! Drink; enjoy; move fast; break things!
  8. +
diff --git a/content/2016/pose.md b/content/2016/pose.md index bd1623a..5be848e 100644 --- a/content/2016/pose.md +++ b/content/2016/pose.md @@ -5,7 +5,9 @@ Category: philosophy Tags: Rust Slug: pose -[![stable_features_version_lint_before_and_after](http://zackmdavis.net/blog/wp-content/uploads/2016/06/stable_features_version_lint_before_and_after-300x151.png)](http://zackmdavis.net/blog/wp-content/uploads/2016/06/stable_features_version_lint_before_and_after.png)I used to look down on posers who submit some contrived one-off trivial patch to a big, famous project like Django or whatever, sheerly for the glamor and ego-gratification of being able to say, "_I'm_ a contributor to _Django_." I thought that if it wasn't a fix that you needed for your own work and you're not going to be a seriously involved contributor, it's more dignified to only work on your personal projects (which would be more authentic) or some non-super-famous but still widely-used library (which would have more socially-useful unfinished work left). +[![stable_features_version_lint_before_and_after](http://zackmdavis.net/blog/wp-content/uploads/2016/06/stable_features_version_lint_before_and_after-300x151.png)](http://zackmdavis.net/blog/wp-content/uploads/2016/06/stable_features_version_lint_before_and_after.png) + +I used to look down on posers who submit some contrived one-off trivial patch to a big, famous project like Django or whatever, sheerly for the glamor and ego-gratification of being able to say, "_I'm_ a contributor to _Django_." I thought that if it wasn't a fix that you needed for your own work and you're not going to be a seriously involved contributor, it's more dignified to only work on your personal projects (which would be more authentic) or some non-super-famous but still widely-used library (which would have more socially-useful unfinished work left). Then I landed [a patch](https://github.com/rust-lang/rust/commit/06c9e0f5) in the Rust compiler. diff --git a/pelicanconf.py b/pelicanconf.py index 8f6d424..f75c3f6 100644 --- a/pelicanconf.py +++ b/pelicanconf.py @@ -79,6 +79,7 @@ MARKDOWN = { 'markdown.extensions.codehilite': {'css_class': 'highlight', 'guess_lang': False}, 'markdown.extensions.extra': {}, 'markdown.extensions.meta': {}, + 'pymdownx.tilde': {'subscript': False}, 'markdown.extensions.toc': { 'title': 'Table of Contents', }, diff --git a/requirements.txt b/requirements.txt index 685f053..99422c5 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,6 @@ pelican==4.12.0 markdown==3.10.2 pelican-render-math==1.0.5 +pymdown-extensions==11.0.1 pygments==2.19.2 typogrify==2.1.0 diff --git a/theme/static/css/style.css b/theme/static/css/style.css index 7745a80..6375fb3 100644 --- a/theme/static/css/style.css +++ b/theme/static/css/style.css @@ -175,6 +175,36 @@ header h1 a:hover { height: auto; } +/* WordPress-style image alignment classes (may land on the or its + wrapping , depending on how the source markup attaches them) */ +.post-content .alignleft { + float: left; + margin: 0.3em 1.5em 1em 0; +} + +.post-content .alignright { + float: right; + margin: 0.3em 0 1em 1.5em; +} + +.post-content .aligncenter { + display: block; + margin: 0 auto 1em; +} + +.post-content .alignnone { + margin: 0 0 1em; +} + +/* contain any trailing float so the post box doesn't collapse around it, + without clearfixing individual paragraphs (which would stop text from + wrapping alongside an aligned image the way it's supposed to) */ +.post-content::after { + content: ""; + display: table; + clear: both; +} + .post-content table { border-collapse: collapse; margin-bottom: 1em; -- 2.53.0