When monday morning begins with an electricity cut…
When monday morning begins with an electricity cut…
Open Source Software and Publications by Christian Kruse
This page contains random thoughts and impressions by me.
When monday morning begins with an electricity cut…
In case you are an Emacs user doing frontend development with TypeScript and React, there is a new major mode for TSX development: tsx-mode. It is a promising project. It uses tree-sitter for font-lock (syntax highlighting). My setup using use-package
can be found here and here. I also added it to my Doom Emacs config: see this and this.
„Tips for Improving Your Elixir Configuration“
Configuration has historically been a bit bumpy in the Elixir community, and this article has some interesting approaches to make it more flexible.
An good compilation of new(ish) command line tools. I myself use a lot of them, especially ripgrep
, difftastic
, fd
and bat
are really great tools.
„Orion Browser“ - WebKit UI supporting Firefox and Chrome extensions. Really an interesting project.
„Discover the IndieWeb, one blog post at a time.“ - what a great idea!
„Web3.0: A Libertarian Dystopia“ – a video about „Web 3.0“, explaining all the bullshit in a pretty funny way. I really enjoyed it.
I recently read a fascinating analysis about „The Joe Rogan Experience“, which is a pretty popular podcast exclusively published on Spotify. Definitely worth a read.
This whole cloud thing was a big mistake. Github down (git push
throws a 500), and my team can't work. Why did we ever think this is a good idea?
I just bought the first non-fiction book in ages: „Zero To Production In Rust“. I'm eager to read it!
After years of listening to the Linux Unplugged podcast I had to remove it from my feed today. Their Bitcoin praise just got unbearable. :(
I really like the SwiftUI tutorial videos by Martin Lexow, e.g. this one. He doesn't waste much time and just shows what SwiftUI is capable of and how to work with it.
„Nun sag doch etwas“. Tidbit:
Und ich habe keine Ahnung. Und ich möchte nicht Teil einer Desinformation sein.
Darf ich Sie um etwas bitten? Halten Sie es genau so. Das Web ist nur dann ein guter Platz, wenn wir es dazu machen.
The last few days I had a lot of fun with Relm4. It is an Elm inspired GTK abstraction.
The main problem I had when using gtk-rs directly was managing state. Either you use a Rc<RefCell<_>>
and pass it around or you use a background thread managing the state and channels to communicate with it.
Both ways are tedious.
Relm4 abstracts that away and helps managing state in a much better way:
use gtk::prelude::{BoxExt, ButtonExt, GtkWindowExt, OrientableExt};
use relm4::{send, AppUpdate, Model, RelmApp, Sender, WidgetPlus, Widgets};
#[derive(Default)]
struct AppModel {
counter: u8,
}
enum AppMsg {
Increment,
Decrement,
}
impl Model for AppModel {
type Msg = AppMsg;
type Widgets = AppWidgets;
type Components = ();
}
impl AppUpdate for AppModel {
fn update(&mut self, msg: AppMsg, _components: &(), _sender: Sender<AppMsg>) -> bool {
match msg {
AppMsg::Increment => {
self.counter = self.counter.wrapping_add(1);
}
AppMsg::Decrement => {
self.counter = self.counter.wrapping_sub(1);
}
}
true
}
}
#[relm4::widget]
impl Widgets<AppModel, ()> for AppWidgets {
view! {
gtk::ApplicationWindow {
set_title: Some("Simple app"),
set_default_width: 300,
set_default_height: 100,
set_child = Some(>k::Box) {
set_orientation: gtk::Orientation::Vertical,
set_margin_all: 5,
set_spacing: 5,
append = >k::Button {
set_label: "Increment",
connect_clicked(sender) => move |_| {
send!(sender, AppMsg::Increment);
},
},
append = >k::Button {
set_label: "Decrement",
connect_clicked(sender) => move |_| {
send!(sender, AppMsg::Decrement);
},
},
append = >k::Label {
set_margin_all: 5,
set_label: watch! { &format!("Counter: {}", model.counter) },
}
},
}
}
}
fn main() {
let model = AppModel::default();
let app = RelmApp::new(model);
app.run();
}
I really like that approach!
After about 20 years of using Emacs (not always exclusively) I now dabble into Neovim. 🤯
It's a bit sad how today everybody does a Twitter thread instead of writing a blog post. IMHO most Twitter threads should be blog posts. Same for Mastodon.
A pretty interesting article about Free Software, Open Source and the jndi issue. It sums up the reason why I don‘t want to be payed for my FLOSS projects.
Back to work… feels a bit unreal. Didn't have to work „between the years“ for ages.
Just released Webmentions 2.0.0 and Microformats 1.0.0. Be aware: support for Elixir below version 1.10 and OTP below version 23 has been dropped. Besides that it is just a maintenance release with updated dependencies.