I have been continuing my earlier virtual table
prototype
and it is slowly coming along.
I uploaded a version to codeberg
while I was debugging python packaging.
I do not have it quite working right, but I think I will be using setuptools-rust
for now (pr
).
This post is partly to help document what I have discovered over time so will not be complete code examples in every case.
In the future I will be uploading the project to Codeberg and later to PyPi.
Most of my rust code is likely not great, so would appreciate a mentor!
Read More →
I wanted to have some drag and drop web components that I could use with my django
apps.
I am planning on using them in another of my many todo/scheduling prototypes.
Basing heavily on the api docs
for drag and drop, I start with some basic components.
I start with my <drag-source>
component that I will use to wrap anything I want draggable.
class DragSource extends HTMLElement {
constructor() {
super();
// I use a random ID here to make something quick/simple but in a real version
// I should probably only set this if not already set.
this.id = Math.random();
}
dragStart(e) {
e.dataTransfer.setData("text/plain", e.target.id);
e.dataTransfer.dropEffect = "move";
setTimeout(() => {
e.target.classList.add("hide");
}, 0);
}
dragEnd(e) {
e.target.classList.remove("hide");
}
connectedCallback() {
this.addEventListener("dragstart", this.dragStart);
this.addEventListener("dragend", this.dragEnd);
}
}
customElements.define("drag-source", DragSource);
Next, I create a container that I will use to drop onto.
Read More →
Sqlite has support for virtual tables
which can be used for external datasources.
There is an example csv data source that allows you to query a csv file as if it was a regular table.
.load ./csv
CREATE VIRTUAL TABLE temp.csv USING csv(filename=FILENAME);
SELECT * FROM csv;
I do not really want to write C for this, but I found the rusqlite
project which allows writing a loadable_extension that provides virtual tables.
Using their vtablog
example (slightly modified) I was able to test from sqlite with a rust module.
Read More →
Recently completed Factorio: Space Age
with my weekend gaming group
.
This is a group who have been playing games together for many years, and we tend to rotate through various games.
While on Nauvis, two of our group kept biters in check, while one worked on the main factory parts and I often worked on resources.
Once we were ready to expand to space, we each took a planet to be in charge of.
I was in charge of Vulcanus which we tried to setup reasonably quickly, due to a few achievements we were also trying to go for this run.
Read More →
For quite a while, nearly every Saturday, I have a core group that plays games together.
Two of the core games that brought us together are Natural Selection
(2002) and Guild Wars
(2005) though our regular weekend gaming didn’t start till sometime later after that.
I am uncertain when we started doing regular gaming together since we previously used IRC
for collaboration, but our shared calendar’s oldest entry is 2018-11-25
.
One of the challenges of the group, is our distributed timezones with one in the United States, one in Canada, one in the United Kingdom, and one in Japan.
Our current game time is pinned to one member’s daughter’s bed time. This mostly works due to our UK member being fine with an all nighter.
Read More →
I have been using esphome
with various m5stack
controllers with home assistant
for collecting environment data in my apartment.
Being able to write a bit of yaml and have a fairly functional sensor is great.
I have been using the picture element
card with some state badges to have a nice overview of my apartment and it has generally worked well.
I noticed however with a recent update, that all of the badges had a much longer label and needed to look into what changed.
Read More →
As a developer, I tend to keep all kinds of things beyond just code managed with git.
In the past I have used a ~/.dotfiles
repo with multiple symlinks, though there are alternate ways to handle it.
Having remembered that bare
repositories and alternate work-trees are a thing, I did a short search before finding a tutorial.
Initially using their example directly, we arrive at commands that look like this.
Read More →
While most code forges have a decent way of navigating code, going back and forth becomes tedious and it can often be easier to check things offline.
The trick I use on my machine, is to combine alfred
and a alfred-repos
plugin for helping make things easier to search.
Using my own forked
version to add some icons, I have a configuration file that looks like this.
{
"__workflow_last_version": "4.1.0",
"app_alt": "Terminal",
"app_cmd": "Gitup",
"app_default": "Visual Studio Code",
"app_ctrl": "Browser",
"global_exclude_patterns": [],
"search_dirs": [
// Projects is self explanitory
{
"depth": 2,
"path": "~/Projects",
"icon": "project.png"
},
// References is any 3rd party code I might want to view
{
"depth": 2,
"path": "~/References",
"icon": "references.png"
},
// I keep some documents in git as well
{
"depth": 2,
"icon": "document.png",
"path": "~/Documents"
}
]
}
Adding icons gives me an extra visual hint what type of repo is found from Alfred.
Read More →
Even though I wrote about it in a previous week note
I have not been using my start page to much yet.
Yesterday I randomly decided to start using it after cleaning a few things up.
Combined with my dev server
I had some of the pieces ready.
First, I configured Firefox to change my start page to start.localhost
, where I have my page running.
Unfortunately, while you can configure the home page, you can not currently configure the new tab page.
Read More →
Over a year ago, I wrote my first draft dev proxy launcher
in Async Python, based on an idea I had to have something like xinetd
for my various in development projects.
[service.django]
host = "django.localhost"
port = 8001
cwd = "~/Projects/my-django-project"
command = "uv run manage.py runserver {port}"
delay = 3
[service.hugo]
host = "hugo.localhost"
port = 8002
cwd = "~/Projects/my-hugo-site"
command = "hugo server --buildDrafts --buildFuture --port {port} --liveReloadPort 80"
While the Python version validated the idea, and usually worked well, there were a few cases that did not work as well.
Recently, I decided to work on a new version using rust
and hyper
to handle the proxied requests, which I have named Norikae
(乗り換え).
Read More →