migrate notes

This commit is contained in:
2025-05-21 07:29:45 +01:00
parent 6a087aae48
commit 1538fc7904
11 changed files with 788 additions and 31 deletions

View File

@@ -11,6 +11,7 @@
"doctrine/doctrine-bundle": "^2.14",
"doctrine/doctrine-migrations-bundle": "^3.4",
"doctrine/orm": "^3.3",
"league/commonmark": "^2.7",
"phpdocumentor/reflection-docblock": "^5.6",
"phpstan/phpdoc-parser": "^2.1",
"symfony/asset": "7.2.*",
@@ -43,6 +44,7 @@
"symfony/web-link": "7.2.*",
"symfony/yaml": "7.2.*",
"twig/extra-bundle": "^2.12|^3.0",
"twig/markdown-extra": "^3.21",
"twig/twig": "^2.12|^3.0"
},
"config": {

486
composer.lock generated
View File

@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "be4d1d2b4515d0af292b8887b9724e0b",
"content-hash": "c3cbc37c53092d5fb23e7a7e21304c25",
"packages": [
{
"name": "composer/semver",
@@ -87,6 +87,81 @@
],
"time": "2024-09-19T14:15:21+00:00"
},
{
"name": "dflydev/dot-access-data",
"version": "v3.0.3",
"source": {
"type": "git",
"url": "https://github.com/dflydev/dflydev-dot-access-data.git",
"reference": "a23a2bf4f31d3518f3ecb38660c95715dfead60f"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/dflydev/dflydev-dot-access-data/zipball/a23a2bf4f31d3518f3ecb38660c95715dfead60f",
"reference": "a23a2bf4f31d3518f3ecb38660c95715dfead60f",
"shasum": ""
},
"require": {
"php": "^7.1 || ^8.0"
},
"require-dev": {
"phpstan/phpstan": "^0.12.42",
"phpunit/phpunit": "^7.5 || ^8.5 || ^9.3",
"scrutinizer/ocular": "1.6.0",
"squizlabs/php_codesniffer": "^3.5",
"vimeo/psalm": "^4.0.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-main": "3.x-dev"
}
},
"autoload": {
"psr-4": {
"Dflydev\\DotAccessData\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Dragonfly Development Inc.",
"email": "info@dflydev.com",
"homepage": "http://dflydev.com"
},
{
"name": "Beau Simensen",
"email": "beau@dflydev.com",
"homepage": "http://beausimensen.com"
},
{
"name": "Carlos Frutos",
"email": "carlos@kiwing.it",
"homepage": "https://github.com/cfrutos"
},
{
"name": "Colin O'Dell",
"email": "colinodell@gmail.com",
"homepage": "https://www.colinodell.com"
}
],
"description": "Given a deep data structure, access data by dot notation.",
"homepage": "https://github.com/dflydev/dflydev-dot-access-data",
"keywords": [
"access",
"data",
"dot",
"notation"
],
"support": {
"issues": "https://github.com/dflydev/dflydev-dot-access-data/issues",
"source": "https://github.com/dflydev/dflydev-dot-access-data/tree/v3.0.3"
},
"time": "2024-07-08T12:26:09+00:00"
},
{
"name": "doctrine/cache",
"version": "2.2.0",
@@ -1371,6 +1446,195 @@
],
"time": "2025-03-06T22:45:56+00:00"
},
{
"name": "league/commonmark",
"version": "2.7.0",
"source": {
"type": "git",
"url": "https://github.com/thephpleague/commonmark.git",
"reference": "6fbb36d44824ed4091adbcf4c7d4a3923cdb3405"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/thephpleague/commonmark/zipball/6fbb36d44824ed4091adbcf4c7d4a3923cdb3405",
"reference": "6fbb36d44824ed4091adbcf4c7d4a3923cdb3405",
"shasum": ""
},
"require": {
"ext-mbstring": "*",
"league/config": "^1.1.1",
"php": "^7.4 || ^8.0",
"psr/event-dispatcher": "^1.0",
"symfony/deprecation-contracts": "^2.1 || ^3.0",
"symfony/polyfill-php80": "^1.16"
},
"require-dev": {
"cebe/markdown": "^1.0",
"commonmark/cmark": "0.31.1",
"commonmark/commonmark.js": "0.31.1",
"composer/package-versions-deprecated": "^1.8",
"embed/embed": "^4.4",
"erusev/parsedown": "^1.0",
"ext-json": "*",
"github/gfm": "0.29.0",
"michelf/php-markdown": "^1.4 || ^2.0",
"nyholm/psr7": "^1.5",
"phpstan/phpstan": "^1.8.2",
"phpunit/phpunit": "^9.5.21 || ^10.5.9 || ^11.0.0",
"scrutinizer/ocular": "^1.8.1",
"symfony/finder": "^5.3 | ^6.0 | ^7.0",
"symfony/process": "^5.4 | ^6.0 | ^7.0",
"symfony/yaml": "^2.3 | ^3.0 | ^4.0 | ^5.0 | ^6.0 | ^7.0",
"unleashedtech/php-coding-standard": "^3.1.1",
"vimeo/psalm": "^4.24.0 || ^5.0.0"
},
"suggest": {
"symfony/yaml": "v2.3+ required if using the Front Matter extension"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-main": "2.8-dev"
}
},
"autoload": {
"psr-4": {
"League\\CommonMark\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Colin O'Dell",
"email": "colinodell@gmail.com",
"homepage": "https://www.colinodell.com",
"role": "Lead Developer"
}
],
"description": "Highly-extensible PHP Markdown parser which fully supports the CommonMark spec and GitHub-Flavored Markdown (GFM)",
"homepage": "https://commonmark.thephpleague.com",
"keywords": [
"commonmark",
"flavored",
"gfm",
"github",
"github-flavored",
"markdown",
"md",
"parser"
],
"support": {
"docs": "https://commonmark.thephpleague.com/",
"forum": "https://github.com/thephpleague/commonmark/discussions",
"issues": "https://github.com/thephpleague/commonmark/issues",
"rss": "https://github.com/thephpleague/commonmark/releases.atom",
"source": "https://github.com/thephpleague/commonmark"
},
"funding": [
{
"url": "https://www.colinodell.com/sponsor",
"type": "custom"
},
{
"url": "https://www.paypal.me/colinpodell/10.00",
"type": "custom"
},
{
"url": "https://github.com/colinodell",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/league/commonmark",
"type": "tidelift"
}
],
"time": "2025-05-05T12:20:28+00:00"
},
{
"name": "league/config",
"version": "v1.2.0",
"source": {
"type": "git",
"url": "https://github.com/thephpleague/config.git",
"reference": "754b3604fb2984c71f4af4a9cbe7b57f346ec1f3"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/thephpleague/config/zipball/754b3604fb2984c71f4af4a9cbe7b57f346ec1f3",
"reference": "754b3604fb2984c71f4af4a9cbe7b57f346ec1f3",
"shasum": ""
},
"require": {
"dflydev/dot-access-data": "^3.0.1",
"nette/schema": "^1.2",
"php": "^7.4 || ^8.0"
},
"require-dev": {
"phpstan/phpstan": "^1.8.2",
"phpunit/phpunit": "^9.5.5",
"scrutinizer/ocular": "^1.8.1",
"unleashedtech/php-coding-standard": "^3.1",
"vimeo/psalm": "^4.7.3"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-main": "1.2-dev"
}
},
"autoload": {
"psr-4": {
"League\\Config\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Colin O'Dell",
"email": "colinodell@gmail.com",
"homepage": "https://www.colinodell.com",
"role": "Lead Developer"
}
],
"description": "Define configuration arrays with strict schemas and access values with dot notation",
"homepage": "https://config.thephpleague.com",
"keywords": [
"array",
"config",
"configuration",
"dot",
"dot-access",
"nested",
"schema"
],
"support": {
"docs": "https://config.thephpleague.com/",
"issues": "https://github.com/thephpleague/config/issues",
"rss": "https://github.com/thephpleague/config/releases.atom",
"source": "https://github.com/thephpleague/config"
},
"funding": [
{
"url": "https://www.colinodell.com/sponsor",
"type": "custom"
},
{
"url": "https://www.paypal.me/colinpodell/10.00",
"type": "custom"
},
{
"url": "https://github.com/colinodell",
"type": "github"
}
],
"time": "2022-12-11T20:36:23+00:00"
},
{
"name": "monolog/monolog",
"version": "3.9.0",
@@ -1474,6 +1738,154 @@
],
"time": "2025-03-24T10:02:05+00:00"
},
{
"name": "nette/schema",
"version": "v1.3.2",
"source": {
"type": "git",
"url": "https://github.com/nette/schema.git",
"reference": "da801d52f0354f70a638673c4a0f04e16529431d"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/nette/schema/zipball/da801d52f0354f70a638673c4a0f04e16529431d",
"reference": "da801d52f0354f70a638673c4a0f04e16529431d",
"shasum": ""
},
"require": {
"nette/utils": "^4.0",
"php": "8.1 - 8.4"
},
"require-dev": {
"nette/tester": "^2.5.2",
"phpstan/phpstan-nette": "^1.0",
"tracy/tracy": "^2.8"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.3-dev"
}
},
"autoload": {
"classmap": [
"src/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause",
"GPL-2.0-only",
"GPL-3.0-only"
],
"authors": [
{
"name": "David Grudl",
"homepage": "https://davidgrudl.com"
},
{
"name": "Nette Community",
"homepage": "https://nette.org/contributors"
}
],
"description": "📐 Nette Schema: validating data structures against a given Schema.",
"homepage": "https://nette.org",
"keywords": [
"config",
"nette"
],
"support": {
"issues": "https://github.com/nette/schema/issues",
"source": "https://github.com/nette/schema/tree/v1.3.2"
},
"time": "2024-10-06T23:10:23+00:00"
},
{
"name": "nette/utils",
"version": "v4.0.6",
"source": {
"type": "git",
"url": "https://github.com/nette/utils.git",
"reference": "ce708655043c7050eb050df361c5e313cf708309"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/nette/utils/zipball/ce708655043c7050eb050df361c5e313cf708309",
"reference": "ce708655043c7050eb050df361c5e313cf708309",
"shasum": ""
},
"require": {
"php": "8.0 - 8.4"
},
"conflict": {
"nette/finder": "<3",
"nette/schema": "<1.2.2"
},
"require-dev": {
"jetbrains/phpstorm-attributes": "dev-master",
"nette/tester": "^2.5",
"phpstan/phpstan": "^1.0",
"tracy/tracy": "^2.9"
},
"suggest": {
"ext-gd": "to use Image",
"ext-iconv": "to use Strings::webalize(), toAscii(), chr() and reverse()",
"ext-intl": "to use Strings::webalize(), toAscii(), normalize() and compare()",
"ext-json": "to use Nette\\Utils\\Json",
"ext-mbstring": "to use Strings::lower() etc...",
"ext-tokenizer": "to use Nette\\Utils\\Reflection::getUseStatements()"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "4.0-dev"
}
},
"autoload": {
"classmap": [
"src/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause",
"GPL-2.0-only",
"GPL-3.0-only"
],
"authors": [
{
"name": "David Grudl",
"homepage": "https://davidgrudl.com"
},
{
"name": "Nette Community",
"homepage": "https://nette.org/contributors"
}
],
"description": "🛠 Nette Utils: lightweight utilities for string & array manipulation, image handling, safe JSON encoding/decoding, validation, slug or strong password generating etc.",
"homepage": "https://nette.org",
"keywords": [
"array",
"core",
"datetime",
"images",
"json",
"nette",
"paginator",
"password",
"slugify",
"string",
"unicode",
"utf-8",
"utility",
"validation"
],
"support": {
"issues": "https://github.com/nette/utils/issues",
"source": "https://github.com/nette/utils/tree/v4.0.6"
},
"time": "2025-03-30T21:06:30+00:00"
},
{
"name": "phpdocumentor/reflection-common",
"version": "2.2.0",
@@ -7502,6 +7914,78 @@
],
"time": "2025-02-19T14:29:33+00:00"
},
{
"name": "twig/markdown-extra",
"version": "v3.21.0",
"source": {
"type": "git",
"url": "https://github.com/twigphp/markdown-extra.git",
"reference": "f4616e1dd375209dacf6026f846e6b537d036ce4"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/twigphp/markdown-extra/zipball/f4616e1dd375209dacf6026f846e6b537d036ce4",
"reference": "f4616e1dd375209dacf6026f846e6b537d036ce4",
"shasum": ""
},
"require": {
"php": ">=8.1.0",
"symfony/deprecation-contracts": "^2.5|^3",
"twig/twig": "^3.13|^4.0"
},
"require-dev": {
"erusev/parsedown": "dev-master as 1.x-dev",
"league/commonmark": "^1.0|^2.0",
"league/html-to-markdown": "^4.8|^5.0",
"michelf/php-markdown": "^1.8|^2.0",
"symfony/phpunit-bridge": "^6.4|^7.0"
},
"type": "library",
"autoload": {
"files": [
"Resources/functions.php"
],
"psr-4": {
"Twig\\Extra\\Markdown\\": ""
},
"exclude-from-classmap": [
"/Tests/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Fabien Potencier",
"email": "fabien@symfony.com",
"homepage": "http://fabien.potencier.org",
"role": "Lead Developer"
}
],
"description": "A Twig extension for Markdown",
"homepage": "https://twig.symfony.com",
"keywords": [
"html",
"markdown",
"twig"
],
"support": {
"source": "https://github.com/twigphp/markdown-extra/tree/v3.21.0"
},
"funding": [
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/twig/twig",
"type": "tidelift"
}
],
"time": "2025-01-31T20:45:36+00:00"
},
{
"name": "twig/twig",
"version": "v3.21.1",

View File

@@ -0,0 +1,18 @@
<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
final class Version20250519215136 extends AbstractMigration
{
public function getDescription(): string {
return '';
}
public function up(Schema $schema): void {}
public function down(Schema $schema): void {}
}

View File

@@ -0,0 +1,73 @@
<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
final class Version20250521000000 extends AbstractMigration
{
public function getDescription(): string {
return 'Migrating my links from my old website to notes in my new website';
}
public function up(Schema $schema): void {
$this->addSql(<<<'SQL'
INSERT INTO note(content, published_date, slug) VALUES
('[Is Stack Overflow Obsolete? An Empirical Study of the Characteristics of ChatGPT Answers to Stack Overflow Questions](https://dl.acm.org/doi/pdf/10.1145/3613904.3642596). ChatGPT 3.5 gives bad answers half the time, and programmers miss the mistakes almost half the time. Be careful out there, folks.', '2024-06-04', '2024-06-04'),
('[Primary and Secondary Values](https://www.colinmcginn.net/primary-and-secondary-values). Colin McGinn makes the case for primary and secondary moral values, just as there are primary and secondary qualities, apparently thereby managing to assert both moral realism and anti-realism at the same time without contradiction.', '2024-06-05', '2024-06-05'),
('[Pluralistic: They brick you because they can](https://pluralistic.net/2024/05/24/record-scratch/#autoenshittification). Cory Doctorow writes incessantly about the harms of monopolised markets. This essay is particularly good, because he collects many of monopolists greatest hits from recent years. Do keep reading to the end. It just gets better.', '2024-06-05', '2024-06-05-1'),
('[Parenting](https://johan.hal.se/wrote/2024/06/05/parenting). Once you find yourself in the position of being someones father youll quickly realize that youre not actually raising anyone here, you just happen to be the veteran in the trenches alongside them, showing them the ropes and hoping theyll survive and turn out okay.', '2024-06-05', '2024-06-05-2'),
('[Boys](https://www.bbc.co.uk/programmes/m001yshl). Catherine Carr did a fantastic job of unveiling how teenage boys are experiencing masculinity in Britain today. Plenty here to surprise, shock and inspire.', '2024-06-05', '2024-06-05-3'),
('[BCS manifesto](https://www.bcs.org/articles-opinion-and-research/the-computing-revolution-how-the-next-government-can-transform-society-with-ethics-education-and-equity-in-technology). Good for what it is. Good policies. Succinct. Should be the beginning (<em>not</em> the end) of some interesting conversations.', '2024-06-05', '2024-06-05-4'),
('[154 McDonald Road: Gone but not Forgotten](https://broughtonspurtle.org.uk/news/gone-not-forgotten). A superb tribute to the building and analysis of the failures of the planning system. This was published in my free local newsletter, and is worthy of any broadsheet newspaper.', '2024-06-07', '2024-06-07'),
('[Beware the cloud of hype](https://thehistoryoftheweb.com/beware-the-cloud-of-hype). Jay Hoffman spots some striking parallels between the current AI hype and the dot-com bubble.', '2024-06-07', '2024-06-07-1'),
('[Saving the News from Big Tech](https://eff.org/saving-the-news). Cory Doctorow, writing for the Electronic Frontier Foundation, argues that to save news media, we need to dismantle ad-tech monopolies, ban surveillance advertising, open up app stores and have an end-to-end web.', '2024-06-07', '2024-06-07-2'),
('[Instagram is training AI on your data. Its nearly impossible to opt out](https://www.fastcompany.com/91132854/instagram-training-ai-on-your-data-its-nearly-impossible-to-opt-out). Yuck, yuck, yuck. Makes me glad Im not on Instagram. For people already stuck there, though, this just sucks. Highly recommend either opting out of AI training or quitting Insta, if only to give the twits the middle finger they deserve.', '2024-06-14', '2024-06-14'),
('[State-based UI is an anti-pattern](https://gomakethings.com/state-based-ui-is-an-anti-pattern). Chris Ferdinandi has a hot take here. I would be keen to test this idea out one day: push the limits of how much complex state you can manage within the light DOM.', '2024-06-14', '2024-06-14-1'),
('[Big Data is Dead](https://motherduck.com/blog/big-data-is-dead). Did you know that most organisations store less than 100GB, and almost all analytics is run on the last 24h of data? I didnt. Though take it all with a pinch of salt: the guys writing on his company blog which sells traditional data warehouses.', '2024-06-17', '2024-06-17'),
('[Reverse Engineering TicketMaster''s Rotating Barcodes (SafeTix)](https://conduition.io/coding/ticketmaster). Who doesn''t like a classic David-and-Goliath hacker story? Also, if you''re American, please <a href="https://www.breakupticketmaster.com">break up TicketMaster</a>. If you''re in the UK, it''s not quite as bad, but <a href="https://assets.publishing.service.gov.uk/media/5519473540f0b61401000087/final_report.pdf">it''s still really bad</a>. Use alternatives where you can.', '2024-07-16', '2024-07-16'),
('[Dont use booleans](https://www.luu.io/posts/dont-use-booleans). A nice idea. But I think this advice only applies well when you''ve got many inter-dependent flags. If you have independent flags, re-writing those as enums will just end up with you re-implementing the boolean type for every parameter, and not getting much profit, I reckon.', '2024-07-16', '2024-07-16-1'),
('[Story points are wasting time](https://blog.scottlogic.com/2024/07/05/story-points-are-wasting-time.html). Pretty convincing to me. The biggest potential weakness in his argument is his claim that none of the most common reasons why devs disagree on story points exposes anything which ought to be resolved in an estimation meeting. If you can provide other common reasons besides the ones Dave considered, you could rebut his argument. I don''t feel experienced enough to judge this myself.', '2024-07-17', '2024-07-17'),
('[Goldman Sachs Top of the Mind, Issue 129](https://www.goldmansachs.com/intelligence/pages/gs-research/gen-ai-too-much-spend-too-little-benefit/report.pdf). Read the interviews. Economists give interesting, and diverse, opinions on the economic potential of LLMs.', '2024-07-18', '2024-07-18'),
('[The Human Cost Of Our AI-Driven Future](https://www.noemamag.com/the-human-cost-of-our-ai-driven-future). In case you''d forgotten: content moderation is still carried out by appalling worker exploitation. This is not news, but nonetheless an excellent and suitably chilling essay on the topic. Be aware that the essay describes some deeply traumatic content.', '2024-10-11', '2024-10-11'),
('[LLMs don''t ''hallucinate''](https://blog.scottlogic.com/2024/09/10/llms-dont-hallucinate.html). I posted on the Scott Logic blog a while ago about how the word ''hallucination'' doesn''t accurately capture how LLMs work.', '2024-10-11', '2024-10-11-1'),
('[Please just stop saying ''just''](https://sgringwe.com/2019/10/10/Please-just-stop-saying-just.html). A pretty good case for avoiding the word ''just'' in software engineering. I admit I''ve been guilty, too.', '2024-11-11', '2024-11-11'),
('[Sexual symmetry and asymmetry](https://alexanderpruss.blogspot.com/2024/11/sexual-symmetry-and-asymmetry.html). Alexander Pruss has a bizarre, but at first blush convincing, argument that complementarians about gender dont have to appeal to morally significant intrinsic differences between men and women.', '2024-12-17', '2024-12-17'),
('["Rules" that terminal programs follow](https://jvns.ca/blog/2024/11/26/terminal-rules). Handy for the next time you develop a CLI or TUI. Also handy as a user: now I know about <a href="https://readline.kablamo.org/emacs.html">readline key bindings</a>, which are everywhere apparently.', '2024-12-20', '2024-12-20'),
('[Bank of England''s ''Millenium of Macroeconomic Data''](https://www.bankofengland.co.uk/statistics/research-datasets). There was no long-term price inflation from 1200 (when these data begin) until 1550. WHAT?!', '2025-01-23', '2025-01-23'),
('[Free social media from billionaire control](https://freeourfeeds.com). I just donated $40. These guys are promising to do whatever it takes to make sure the AT Protocol is genuinely owned by everyone.', '2025-01-28', '2025-01-28')
SQL);
}
public function down(Schema $schema): void {
$this->addSql(<<<'SQL'
DELETE FROM note WHERE
slug = '2024-06-04' OR
slug = '2024-06-05' OR
slug = '2024-06-05-1' OR
slug = '2024-06-05-2' OR
slug = '2024-06-05-3' OR
slug = '2024-06-05-4' OR
slug = '2024-06-07' OR
slug = '2024-06-07-1' OR
slug = '2024-06-07-2' OR
slug = '2024-06-14' OR
slug = '2024-06-14-1' OR
slug = '2024-06-17' OR
slug = '2024-07-16' OR
slug = '2024-07-16-1' OR
slug = '2024-07-17' OR
slug = '2024-07-18' OR
slug = '2024-10-11' OR
slug = '2024-10-11-1' OR
slug = '2024-11-11' OR
slug = '2024-12-17' OR
slug = '2024-12-20' OR
slug = '2025-01-23' OR
slug = '2025-01-28'
SQL);
}
}

192
scripts/migrateLinks.js Normal file
View File

@@ -0,0 +1,192 @@
/**
* @type Digit = '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9';
*/
/**
* @type Link = { href: string, title: string, description: string, isoDateAdded: `20${Digit}${Digit}-${'0'|'1'}${Digit}-${'0'|'1'|'2'|'3'}${Digit}`, };
*/
/** @type {Link[]} */
const links = [
{
href: 'https://dl.acm.org/doi/pdf/10.1145/3613904.3642596',
title: 'Is Stack Overflow Obsolete? An Empirical Study of the Characteristics of ChatGPT Answers to Stack Overflow Questions',
description: 'ChatGPT 3.5 gives bad answers half the time, and programmers miss the mistakes almost half the time. Be careful out there, folks.',
isoDateAdded: '2024-06-04',
},
{
href: 'https://www.colinmcginn.net/primary-and-secondary-values',
title: 'Primary and Secondary Values',
description: 'Colin McGinn makes the case for primary and secondary moral values, just as there are primary and secondary qualities, apparently thereby managing to assert both moral realism and anti-realism at the same time without contradiction.',
isoDateAdded: '2024-06-05',
},
{
href: 'https://pluralistic.net/2024/05/24/record-scratch/#autoenshittification',
title: 'Pluralistic: They brick you because they can',
description: 'Cory Doctorow writes incessantly about the harms of monopolised markets. This essay is particularly good, because he collects many of monopolists greatest hits from recent years. Do keep reading to the end. It just gets better.',
isoDateAdded: '2024-06-05',
},
{
href: 'https://johan.hal.se/wrote/2024/06/05/parenting',
title: 'Parenting',
description: 'Once you find yourself in the position of being someones father youll quickly realize that youre not actually raising anyone here, you just happen to be the veteran in the trenches alongside them, showing them the ropes and hoping theyll survive and turn out okay.',
isoDateAdded: '2024-06-05',
},
{
href: 'https://www.bbc.co.uk/programmes/m001yshl',
title: 'Boys',
description: 'Catherine Carr did a fantastic job of unveiling how teenage boys are experiencing masculinity in Britain today. Plenty here to surprise, shock and inspire.',
isoDateAdded: '2024-06-05',
},
{
href: 'https://www.bcs.org/articles-opinion-and-research/the-computing-revolution-how-the-next-government-can-transform-society-with-ethics-education-and-equity-in-technology',
title: 'BCS manifesto',
description: 'Good for what it is. Good policies. Succinct. Should be the beginning (<em>not</em> the end) of some interesting conversations.',
isoDateAdded: '2024-06-05'
},
{
href: 'https://broughtonspurtle.org.uk/news/gone-not-forgotten',
title: '154 McDonald Road: Gone but not Forgotten',
description: 'A superb tribute to the building and analysis of the failures of the planning system. This was published in my free local newsletter, and is worthy of any broadsheet newspaper.',
isoDateAdded: '2024-06-07',
},
{
href: 'https://thehistoryoftheweb.com/beware-the-cloud-of-hype',
title: 'Beware the cloud of hype',
description: 'Jay Hoffman spots some striking parallels between the current AI hype and the dot-com bubble.',
isoDateAdded: '2024-06-07',
},
{
href: 'https://eff.org/saving-the-news',
title: 'Saving the News from Big Tech',
description: 'Cory Doctorow, writing for the Electronic Frontier Foundation, argues that to save news media, we need to dismantle ad-tech monopolies, ban surveillance advertising, open up app stores and have an end-to-end web.',
isoDateAdded: '2024-06-07',
},
{
href: 'https://www.fastcompany.com/91132854/instagram-training-ai-on-your-data-its-nearly-impossible-to-opt-out',
title: 'Instagram is training AI on your data. Its nearly impossible to opt out',
description: 'Yuck, yuck, yuck. Makes me glad Im not on Instagram. For people already stuck there, though, this just sucks. Highly recommend either opting out of AI training or quitting Insta, if only to give the twits the middle finger they deserve.',
isoDateAdded: '2024-06-14',
},
{
href: 'https://gomakethings.com/state-based-ui-is-an-anti-pattern',
title: 'State-based UI is an anti-pattern',
description: 'Chris Ferdinandi has a hot take here. I would be keen to test this idea out one day: push the limits of how much complex state you can manage within the light DOM.',
isoDateAdded: '2024-06-14',
},
{
href: 'https://motherduck.com/blog/big-data-is-dead',
title: 'Big Data is Dead',
description: 'Did you know that most organisations store less than 100GB, and almost all analytics is run on the last 24h of data? I didnt. Though take it all with a pinch of salt: the guys writing on his company blog which sells traditional data warehouses.',
isoDateAdded: '2024-06-17',
},
{
href: 'https://conduition.io/coding/ticketmaster',
title: "Reverse Engineering TicketMaster's Rotating Barcodes (SafeTix)",
description: 'Who doesn\'t like a classic David-and-Goliath hacker story? Also, if you\'re American, please <a href="https://www.breakupticketmaster.com">break up TicketMaster</a>. If you\'re in the UK, it\'s not quite as bad, but <a href="https://assets.publishing.service.gov.uk/media/5519473540f0b61401000087/final_report.pdf">it\'s still really bad</a>. Use alternatives where you can.',
isoDateAdded: '2024-07-16',
},
{
href: 'https://www.luu.io/posts/dont-use-booleans',
title: 'Dont use booleans',
description: "A nice idea. But I think this advice only applies well when you've got many inter-dependent flags. If you have independent flags, re-writing those as enums will just end up with you re-implementing the boolean type for every parameter, and not getting much profit, I reckon.",
isoDateAdded: '2024-07-16',
},
{
href: 'https://blog.scottlogic.com/2024/07/05/story-points-are-wasting-time.html',
title: 'Story points are wasting time',
description: "Pretty convincing to me. The biggest potential weakness in his argument is his claim that none of the most common reasons why devs disagree on story points exposes anything which ought to be resolved in an estimation meeting. If you can provide other common reasons besides the ones Dave considered, you could rebut his argument. I don't feel experienced enough to judge this myself.",
isoDateAdded: '2024-07-17',
},
{
href: 'https://www.goldmansachs.com/intelligence/pages/gs-research/gen-ai-too-much-spend-too-little-benefit/report.pdf',
title: 'Goldman Sachs Top of the Mind, Issue 129',
description: 'Read the interviews. Economists give interesting, and diverse, opinions on the economic potential of LLMs.',
isoDateAdded: '2024-07-18',
},
{
href: 'https://www.noemamag.com/the-human-cost-of-our-ai-driven-future',
title: 'The Human Cost Of Our AI-Driven Future',
description: "In case you'd forgotten: content moderation is still carried out by appalling worker exploitation. This is not news, but nonetheless an excellent and suitably chilling essay on the topic. Be aware that the essay describes some deeply traumatic content.",
isoDateAdded: '2024-10-11',
},
{
href: 'https://blog.scottlogic.com/2024/09/10/llms-dont-hallucinate.html',
title: "LLMs don't 'hallucinate'",
description: "I posted on the Scott Logic blog a while ago about how the word 'hallucination' doesn't accurately capture how LLMs work.",
isoDateAdded: '2024-10-11',
},
{
href: 'https://sgringwe.com/2019/10/10/Please-just-stop-saying-just.html',
title: "Please just stop saying 'just'",
description: "A pretty good case for avoiding the word 'just' in software engineering. I admit I've been guilty, too.",
isoDateAdded: '2024-11-11',
},
{
href: 'https://alexanderpruss.blogspot.com/2024/11/sexual-symmetry-and-asymmetry.html',
title: 'Sexual symmetry and asymmetry',
description: 'Alexander Pruss has a bizarre, but at first blush convincing, argument that complementarians about gender dont have to appeal to morally significant intrinsic differences between men and women.',
isoDateAdded: '2024-12-17',
},
{
href: 'https://jvns.ca/blog/2024/11/26/terminal-rules',
title: '"Rules" that terminal programs follow',
description: 'Handy for the next time you develop a CLI or TUI. Also handy as a user: now I know about <a href="https://readline.kablamo.org/emacs.html">readline key bindings</a>, which are everywhere apparently.',
isoDateAdded: '2024-12-20',
},
{
href: 'https://www.bankofengland.co.uk/statistics/research-datasets',
title: "Bank of England's 'Millenium of Macroeconomic Data'",
description: 'There was no long-term price inflation from 1200 (when these data begin) until 1550. WHAT?!',
isoDateAdded: '2025-01-23',
},
{
href: 'https://freeourfeeds.com',
title: 'Free social media from billionaire control',
description: 'I just donated $40. These guys are promising to do whatever it takes to make sure the AT Protocol is genuinely owned by everyone.',
isoDateAdded: '2025-01-28',
},
];
/**
* @type Note = { content: string, publishedDate: string, slug: string }
*/
/**
*
* @param {Note[]} prev
* @param {Note} param1
* @returns {Note[]}
*/
function notesReducer(prev, { href, title, description, isoDateAdded }) {
const numPrevOnThisDate = prev.filter(note => note.publishedDate === isoDateAdded).length;
const next = {
content: `[${title}](${href}). ${description}`,
publishedDate: isoDateAdded,
slug: numPrevOnThisDate ? `${isoDateAdded}-${numPrevOnThisDate}` : isoDateAdded,
};
return [ ...prev, next ];
}
/** * @type {Note[]} */
const notes = links.reduce(notesReducer, []);
/**
*
* @param {string} str
* @returns {string}
*/
function escape(str) {
return str.replaceAll("'", "''");
}
const sqlValueExpressions = notes.map(({ content, publishedDate, slug }) =>
`('${escape(content)}', '${escape(publishedDate)}', '${escape(slug)}')`
);
const sql = `
INSERT INTO note(content, published_date, slug) VALUES
${sqlValueExpressions.join(',\n')}
`;
console.log(sql);

View File

@@ -29,7 +29,7 @@ class GuiController extends AbstractController {
public function notes(
EntityManagerInterface $entityManager,
): array {
$notes = $entityManager->getRepository(Note::class)->findAll();
$notes = $entityManager->getRepository(Note::class)->findAllOrderedBySlugDesc();
return [
'title' => 'Joe Carstairs\' notes',

View File

@@ -30,28 +30,14 @@ class NoteRepository extends ServiceEntityRepository
return count($wherePublishedOnDate);
}
// /**
// * @return Note[] Returns an array of Note objects
// */
// public function findByExampleField($value): array
// {
// return $this->createQueryBuilder('n')
// ->andWhere('n.exampleField = :val')
// ->setParameter('val', $value)
// ->orderBy('n.id', 'ASC')
// ->setMaxResults(10)
// ->getQuery()
// ->getResult()
// ;
// }
// public function findOneBySomeField($value): ?Note
// {
// return $this->createQueryBuilder('n')
// ->andWhere('n.exampleField = :val')
// ->setParameter('val', $value)
// ->getQuery()
// ->getOneOrNullResult()
// ;
// }
/**
* @return Note[] Returns an array of Note objects
*/
public function findAllOrderedBySlugDesc(): array
{
return $this->createQueryBuilder('n')
->orderBy('n.slug', 'DESC')
->getQuery()
->getResult();
}
}

View File

@@ -7,7 +7,7 @@
<a href="/blog">Blog</a>
</li>
<li>
<a href="/links">Links</a>
<a href="{{ path('notes') }}">Notes</a>
</li>
</ul>
</nav>

View File

@@ -5,7 +5,9 @@
<section>
<h1>Note {{ note.slug }}</h1>
<time>{{ note.publishedDate.format('c') }}
<p>{{ note.content }}</p>
{% apply markdown_to_html %}
{{ note.content }}
{% endapply %}
</section>
{% else %}
<section>

View File

@@ -6,7 +6,9 @@
{% for note in notes %}
<h2><a href="/notes/{{ note.slug }}">Note {{ note.slug }}</a></h2>
<p>{{ note.content }}</p>
{% apply markdown_to_html %}
{{ note.content }}
{% endapply %}
{% else %}
<p>I have no notes.</p>
{% endfor %}

View File

@@ -1,5 +1,3 @@
Write an SQL script to insert all links from existing website as notes
Sort links on index page by date descending
Tidy up notes index page to match existing links index page
Make BlogPost entity
Add blog post page