#LunchBreakFOSS: Runestone for Mac looks really nice already, great job @simonbs! Probably going to use it instead of CodeEditor in Shaper and Enlighter. https://github.com/simonbs/Runestone
@binarytango @kotaro Also maybe run things in Docker, I use Hypriot on Raspi's and love it. Keys and such can be configured via cloud config before flashing an image. #LunchBreakFOSS https://blog.hypriot.com/getting-started-with-docker-on-your-arm-device/
#LunchBreakFOSS Today’s thing isn’t really a FOSS project per se, more like a standard: “Mustache”. A very simple templating language with implementation for literally any language.
It just has like `{{var}}`, `{{^var}}` and `{{>sub template}}`, but can model loops, conditions and even sub-templates using that. It’s my go-to for quick and simple things.
A small #SwiftLang implementation that supports attributed strings and dynamicCallable: https://github.com/AlwaysRightInstitute/mustache
http://mustache.github.io
#LunchBreakFOSS OK, another lazy one “Apache”, the No 1 WebServer. Used the 1.x line from the start and the current 2.x line brought great advancements. Considered a “fat” server once, it is actually smaller than your typical server lib today 🤓
Apache is highly capable and extremely solid. Use it when you actually serve things, for proxies nginx is the better choice. (nginx is a NIO server, it's more complicated, but Apache is technically a thread per connection setup).
https://httpd.apache.org
#LunchBreakFOSS One can just install #PostgreSQL from the sources or using Homebrew, but another very easy and convenient way is the “Postgres.app”. Which I’ve been using for years, and it is in fact open source!
It bundles up the server as a #macOS app, including the necessary login/menubar items. Recommended, very quick way to get started!
It is *not* a database browser/frontend though, it manages the server.
https://postgresapp.com/de/
#lunchbreakfoss #postgresql #macos
#LunchBreakFOSS A lazy one today: “PostgreSQL”. #PostgreSQL is a relational database (an RDBMS) with tons of extra features, from JSON to full text search to PL/Swift.
We started to support it in OpenGroupware around version 6.5 - at that time it was really bad. I think only w/ the 8.x versions (maybe late 7.x revs) it started to be the plain awesomeness it is today.
Funny side note: The server binary of that “big db server” is just about 7MB!
https://www.postgresql.org
#LunchBreakFOSS So how can a #SwiftLang dev access/work-with #SQLite? The raw API IMO goes a long way and is often sufficient (and reasonably convenient). If a little more is needed, I have my own “Lighter” project, but today is about another one: “GRBD”.
I use it in the SPMCatalog app’s backend. It has great documentation and many of the design decisions align w/ me. From the regular Swift DB libs it is also the fastest I tried (though not as fast as Lighter 😜).
https://github.com/groue/GRDB.swift/blob/master/Documentation/GoodPracticesForDesigningRecordTypes.md
#lunchbreakfoss #swiftlang #sqlite
#LunchBreakFOSS Not sure I should mention “the obvious” big FOSS projects, but since it IMO is still way underused by #SwiftLang developers: SQLite. The embedded SQL database. Even just the plain API is easy to use!
If you don’t want SQL, just store JSON snippets in it, still a useful container for data with proper locking and all kinds of other safeguards you probably do wrong otherwise.
I’d like to especially point out “SQLite as an application file format”: https://www.sqlite.org/appfileformat.html
#LunchBreakFOSS Something a little different today: “Graphite”. This project has a set of tools built around a (Python) time series database (called “Carbon”). Including some old-school looking but powerful graphing tools.
I use it to store sensor data in my home automation system (#HomeMatic). It was really easy to setup and runs for years w/ very little maintenance, though things like Grafana/TimescaleDB might be better options today. I like it though.
https://graphiteapp.org
#LunchBreakFOSS “Runestone” isn't a project I actually use just yet, but which I find really interesting in the context of yesterdays Highlight.js (and for my apps as a potential replacement for my “CodeEditor” project based on HJS).
Runestone is an editor w/ syntax highlighting based on that “tree sitter” stuff, written in #SwiftLang. One of the biggest drawbacks for me is that it only supports #UIKit, not #AppKit.
https://github.com/simonbs/runestone
#lunchbreakfoss #swiftlang #uikit #appkit
#LunchBreakFOSS “Highlighter.js” is another project that might be useful for Mastodon client coders. It is a JavaScript library for highlighting source code. There seem to be better #SwiftLang technologies for this (RuneStone, etc), but a major advantage of Highlighter.js is that it supports a huge array of languages.
I use it in Shrugs.app to highlight source snippets using sth similar to Highlightr. Overhead for hosting the JS is ~5MB RAM.
https://github.com/raspu/Highlightr
https://highlightjs.org
#LunchBreakFOSS The new year is about emotions? I hope not, but if so, there is “emoji-data”, another great project. It contains all kinds of metadata for #Emoji as JSON (e.g. short names, Unicode code points and more).
Using it in Shrugs.app to parse and complete Emoji in messages and in the Emoji picker as well. I bet this might be useful for all the Mastodon client builders.
Funny side-note: Project is by a Slack co-founder!
https://github.com/iamcal/emoji-data
#LunchBreakFOSS Another nice tool that fits into the line (and was mentioned already) is “xmlstarlet”, a set of tools to query and edit #XML files.
“xmlstarlet” is somewhat similar to “jq”, but for XML instead of JSON. Handy if you have to read and modify XML files from within shell scripts in a reliable way (i.e. w/o a regex mess 🙃).
I use it in mod_swift (to patch the Xcode scheme XML) and also in the scraper backing the SwiftPM Catalog application.
https://xmlstar.sourceforge.net/doc/UG/
#LunchBreakFOSS This week ended up being more like a #C libs for the web 🕸 thing. So one more of those: “libcurl” and its companion tool “curl”. Must haves for every developer. It is one of those software projects that have an extremely high overall quality. It used to be used for the URLSession implementation of the #ServerSideSwift #SwiftLang Linux Foundation lib, but I suppose that might go away 🥲
https://curl.se/libcurl/
#lunchbreakfoss #c #serversideswift #swiftlang
#LunchBreakFOSS Using libxml2 from yesterdays edition one can actually parse #HTML, which is quite cool. The parser however is not very tolerant, i.e. doesn’t deal well with what real world HTML programmers tend to create. And how do you fixup b0rked HTML? With the “HTML Tidy” tool of course! One of those things which just do one thing, but that very well.
But the best thing is that this tool also comes as a #C library: “libtidy”.
http://www.html-tidy.org/developer/
#LunchBreakFOSS Yesterday was Expat day, today is “libxml2” (/libxslt) day. This is also a #C #XML parsing library, but with way more features, e.g. XPath and XSLT. It also has a SAX API, but I’d go Expat for that, use “libxml2” when you need a “DOM” and operate on that. A cool thing is that libxml2 can also parse reasonably valid HTML, which can often be handy! Included on iOS/macOS.
SOPE comes w/ #ObjC wrappers/drivers for libxml2: http://sope.opengroupware.org/en/sope_xml/index.html
libxml docs: https://gitlab.gnome.org/GNOME/libxml2/-/wikis/home
#LunchBreakFOSS Let’s make an in-between week w/ old school #C #FOSS projects that rock ☣️ Something I’ve been using for 20+? years is libexpat. It is a very compact SAX based #XML parser written in C. It just does SAX, but is very good at that and carries no bloat. Can be a good choice for your daily XML parsing needs 👴 Looks like I once did a small Swift wrapper: https://github.com/helje5/SwiftyExpat
https://libexpat.github.io
#LunchBreakFOSS A late one today, but a very useful one: „SOTO“. It provides Swift APIs for all the various #AWS services. I played with it for a while when trying to build a small macOS frontend for AWS. Looked really good!
https://github.com/soto-project/soto
#LunchBreakFOSS Today’s project is an Electron app, I’m very sorry. I want to rewrite that in #SwiftUI for a very long time - well, I started multiple times - and eventually will finish that. In the meantime that non-native app is really useful for people running a #HomeMatic home automation setup.
https://github.com/hobbyquaker/homematic-manager
#lunchbreakfoss #swiftui #homematic
#LunchBreakFOSS In one app (never released) I wanted to show a network of devices interconnected by lines w/ various information about the connections. TBH I had/have no idea how to distribute objects in a view in a useful manner 🤷♀️
But I found a nice looking JS library for just that, and the coolness of that starts with the name: “Graph Dracula” 🧛♂️
Very nice lib, actually started to port the parts I need to #SwiftLang.
https://www.graphdracula.net
https://github.com/helje5/Dracula