Skip to content

Instantly share code, notes, and snippets.

View amcgregor's full-sized avatar
🏢
I died! …well, I got better…

Alice Zoë Bevan–McGregor amcgregor

🏢
I died! …well, I got better…
View GitHub Profile
@amcgregor
amcgregor / 0-things-review.md
Last active September 6, 2023 20:53
The review I left on the App Store for the GTD task management app, Things. Which I like and can recommend, but can not recommend using for inspiration.

★★★☆☆

Excellent GTD task management, with quibbles.

A few of the keyboard shortcuts are a touch non-obvious, and in the early days I had some difficulty with task database corruption—I have a TON of items, projects, and areas. Those are the general quibbles.

The personal one: it amuses me to no end that while the latest update as of 2023-09-06 now includes vector graphics and dynamic scale, in 2009 they threatened to sue me when I demonstrated what might be possible using them by showing a tiny bit of HTML and CSS. It took 14 years to implement the functionality. 14 years.

"…or even talk about the fact that you copied the design, it has the potential to hurt us and cause damage to us."

@amcgregor
amcgregor / _example.py
Last active July 10, 2023 13:04
An example of a WIP WebCore resource dispatch implementation for "generic" database-backed collections and resources.
from webob.exc import HTTPConflict
from web.dispatch.resource.action import Action
from web.dispatch.resource.generic import GenericCollection as Collection
from web.secuity import when
from web.gilt.helper import _, L_
if __debug__: from web.app.static import Static
@amcgregor
amcgregor / comment.md
Created June 19, 2023 01:58
My video comment on this week's Free Style the News with Zaid Tabani, re: the Reddit Blackout and Twitter. https://www.youtube.com/watch?v=YMsps7jjLN0&lc=UgzoL2EpQB4x2YuUACF4AaABAg

What's a dit, and why is it red? I mean, I keep intoning to friends, "If it's free, you're the product." Reddit has just admitted y'all are worth nothing. At least, not enough to keep the lights on. Despite all of the content produced, and hours volunteered for curation. And software developers having professional teams writing software to extend the ecosystem.

Worth. Nothing to them.

Musk with Twitter has demonstrated that having a lying cheapskate fascist encouraging your one real revenue stream (advertisement) to abandon you may be an unwise life choice, and that not paying rent might not be a viable long-term strategy; but this is 🤬 obvious. You don't acquire a thing only to destroy it.

Or you do, and I'll herald Musk as the solution to our world's modern problems if Twitter is just step one, next up: Meta and Facebook. But… he's not actually that rich. Or that altruistic. Or that intelligent. He's just been coasting on the backs of the brilliant people around him. His "solo" ventures are quite literal

@amcgregor
amcgregor / backed-console.js
Last active August 4, 2023 19:01
Python-like prototype additions, polyfills, and server-backed client-side behaviour.
// console.* Polyfill and, in production, no-op replacement.
(function() {
// An inspired polyfill for standard web browser user agent console interactions.
//
// This serves several purposes:
//
// 1. Add standardized methods missing from the local implementation to prevent code calling these from producing exceptions which halt JavaScript execution.
// 2. Direct certain logging actions at a back-end server collection endpoint, for archival, analytics, and diagnostics.
// 3. Squelch (mute or silence) "noisier" console endpoints to prevent user agents from exposing diagnostic information to end-users.
@amcgregor
amcgregor / channel.log
Last active May 16, 2023 20:57
Chat logs of a disruptive / unhinged user ("cantelope"—can't even spell, or get a host mask 😑) from the #webdev channel on Libera.
GetShwifty
put out fire deploys :(
00:13:18
explore
is it IT related
00:51:10
i don't want to assume it's IT/sw dev
@amcgregor
amcgregor / _Multiple File Upload Capture.md
Last active August 19, 2023 13:22
A sample application to try out capturing multi-file uploads with nested structures.

Create a new virtual environment somewhere you'd like to place these files.

python3.9 -m venv uploadtest
cd uploadtest
. bin/activate

Then drop these files in that directory. Install dependencies:

@amcgregor
amcgregor / scroll-spy.js
Created March 28, 2022 05:39
A relatively light-weight "scroll spy" to pivot scrolling events from edge → level.
{ // Detect scrolling of the viewport away from the absolute top of the document.
function scrollHandler(e) {
if ( window.scrollY == 0 && document.body.scrollTop == 0 ) document.body.classList.remove('offset')
else document.body.classList.add('offset')
}
// Watch for the page being scrolled.
window.addEventListener('scroll', scrollHandler)
document.body.addEventListener('scroll', scrollHandler)
}
@amcgregor
amcgregor / dialog.js
Last active May 11, 2024 18:02
A fairly complete HTML5 dialog utility implementation with a few "advanced" features, with accessibility in mind. Utilizing https://github.com/GoogleChrome/dialog-polyfill as a polyfill for ancient browsers, omit the first block (and polyfill) if Internet Explorer isn't your bag, baby.
// Present dialog content "lazily loaded" from a dedicated endpoint.
// Additionally, support automatic transformation of navigational links to modal popovers when annotated: rel=modal
// Any element annotated data-dismiss=modal will close the active dialog when clicked.
// Clicking the backdrop will automatically close the dialog when no form is present [or the form is unmodified].
// MIT Licensed: http://www.opensource.org/licenses/mit-license.php
// Copyright (c) 2021-2022, Alice Bevan-McGregor (alice -[at]- gothcandy [*dot*] com)
if ( !document.getElementById("dialog") ) { // Populate the bare dialog element if missing.
let dialog = document.createElement("div")
dialog.id = 'dialog'
@amcgregor
amcgregor / imageflow.css
Created February 5, 2022 16:35
"ImageFlow" preservation; original location unavailable.
@charset "utf-8";
/* ImageFlow Settings
==================================== */
@media screen, projection {
.imageflow {
overflow:hidden;
position:relative;
text-align:left;
visibility:hidden;
@amcgregor
amcgregor / parametrics-to-the-rescue.md
Created January 17, 2022 16:23
A comparison between jsonpatch.com and typical "parametric" operators for the same manipulations such as those provided by Marrow Mongo or MongoEngine.

You Don't Need JSON Patch

For simplicity sake, excluding the first example and the Test example, other parametric examples will be provided with a JSON representation for clarity. (Fun note, my WebCore web framework supports endpoint argument collection from a variety of data sources, including form-encoded POST, or JSON-encoded POST.)

The Original Document
{
  "baz": "qux",
 "foo": "bar"