The Minimalists speak with Judah Smith about how other people’s perception of us can be upsetting, the biggest things that send people into a mental spiral, advice for minimizing when you’re stressed out, and much more.
structeditorConfig {
intcx, cy; /* Cursor x and y position in characters */introwoff; /* Offset of row displayed. */intcoloff; /* Offset of column displayed. */intscreenrows; /* Number of rows that we can show */intscreencols; /* Number of cols that we can show */intnumrows; /* Number of rows */intrawmode; /* Is terminal raw mode enabled? */erow*row; /* Rows */intdirty; /* File modified but not saved. */char*filename; /* Currently open filename */charstatusmsg[80];
time_tstatusmsg_time;
structeditorSyntax*syntax; /* Current syntax highlight, or NULL. */};
typedefstructerow {
intidx; /* Row index in the file, zero-based. */intsize; /* Size of the row, excluding the null term. */intrsize; /* Size of the rendered row. */char*chars; /* Row content. */char*render; /* Row content "rendered" for screen (for TABs). */unsignedchar*hl; /* Syntax highlight type for each character in render.*/inthl_oc; /* Row had open comment at end in last syntax highlight
check. */} erow;
这里面有一个render字段,在editorUpdateRow()中,有这样的代码:
unsignedinttabs=0, nonprint=0;
intj, idx;
/* Create a version of the row we can directly print on the screen,
* respecting tabs, substituting non printable characters with '?'. */free(row->render);
for (j=0; j<row->size; j++)
if (row->chars[j] ==TAB)
tabs++;
unsignedlonglongallocsize= (unsignedlonglong)row->size+tabs*8+nonprint*9+1;
if (allocsize>UINT32_MAX) {
printf("Some line of the edited file is too long for kilo\n");
exit(1);
}
将反引号替换为双引号,使其与 PostgreSQL 兼容, 如果 macOS 执行有问题,在 Linux 搞下。操作前可以备份一下,避免搞坏了
sed -i 's/`/"/g' umami.sql
macOS
sed -i '' 's/`//g' umami.sql
sed -i '' 's/\\"/"/g' umami.sql
sed -i '' "s/\\\\'/'/g" umami.sql
sed -i '' "s/Xi'an/Xi''an/g" umami.sql
sed -i '' "s/Lu'an/Lu''an/g" umami.sql
sed -i '' "s/Ma'anshan/Ma''anshan/g" umami.sql
sed -i '' "s/Rui'an/Rui''an/g" umami.sql
sed -i '' "s/Yu'an/Yu''an/g" umami.sql
sed -i '' "s/Bo'an/Bo''an/g" umami.sql
sed -i '' "s/Tai'an/Tai''an/g" umami.sql
sed -i '' "s/Cao'an/Cao''an/g" umami.sql
sed -i '' "s/Chang'an/Chang''an/g" umami.sql
sed -i '' 's/ENGINE=[^ ]*//g' umami.sql
sed -i '' 's/AUTO_INCREMENT/[generated always as identity]/g' umami.sql
sed -i '' 's/unsigned//g' umami.sql
sed -i '' '/_prisma_migrations/d' umami.sql
可以手搓如下,我这里直接使用 DataGrip
psql -U username -d mydb < umami.sql
由于 MySQL → PostgreSQL 差异巨大,需要执行大量替换操作。报错太多,决定放弃升级改成使用 v3 版本, 还是重装方便
v3 版本镜像
由于兼容性问题太多,我最终选择放弃 v2 的 MySQL → PostgreSQL 迁移,转而直接部署 全新的 Umami v3。
Webmention is a simple way to notify any URL when you link to it from your site.
It is an open web standard (W3C Recommendation) for conversations and interactions across the web, a powerful building block used for a growing distributed network of peer-to-peer comments, likes, reposts, and other responses across the web.