Power Button management

https://www.reddit.com/r/i3wm/comments/58j1ui/how_to_intercept_the_power_button_to_avoid_brutal/ Note that you might want suspend instead of hibernate, if you want rapid resume. The power button isn’t handled by the window manager, it’s handled by systemd For example this is in my /etc/systemd/logind.conf [Login] HandlePowerKey=hibernate HandleLidSwitch=ignore IdleAction=suspend IdleActionSec=20min

Emacs multi-inbox Email Setup

I use the Emacs package Gnus (included in Emacs) to manage my email, and have used it this way for years. There are many reasons for managing your email locally, and even more for managing them in Emacs, but it took me years to make it through the obstacle course of actually figuring out how to do it. It requireed learning many new concepts that our day of webmail and Exchange-programs generally glosses over.

Extending HoneySQL with Array Intersection

Turns out that Postgres has beautiful support for “array” field types. In one database of mine, I use this to keep track of the recipients of emails: DROP TABLE IF EXISTS "email_log" CASCADE; CREATE TABLE "email_log" ( id SERIAL PRIMARY KEY, sender TEXT NOT NULL, recipients TEXT[] NOT NULL, message TEXT, sent_date TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, info JSONB); -- Note the recipients TEXT[] definition: that's an array of texts. Now for the use-case: a user might have multiple email addresses, and the email_log tracks recipient ADDRESSES not user-ids.

Extending HoneySQL with JSON operators

HoneySQL is a wonderful Clojure library that lets use the full power of Clojure collections to generate your SQL statements. Postgres supports json operators and data types, which is one of the main features for which I use it; however, since this is a non-SQL-standard feature, HoneySQL doesn’t support it directly, and I didn’t see that support in HoneySQL-Postgres yet. Fortunately, HoneySQL makes it easy to extend this way. (ns myapp.

Auto-mounting USB drives with EXWM

Use udiskie to auto-mount devices plugged in to your machine, such as flash drives. I found that trying to install it from my OpenSUSE packagemanager didn’t work, alhtough it was listed, but I already had pip installed and that led to simple process. After installation, the following worked beautifully: ~/.local/bin/udiskie --no-notify --tray & notifications did not play nice with exwm, but the tray works great. Then I just put the above into my .

Display PDF pages with Telephone Line

EDIT: updated 2018.06.01 to be done properly Upon switching over to the excellent Telephone Line modeline theme from my previous Smart Mode Line, I was generally pleased by the exceptional look and feel of it. That is, until I fired up a PDF a while later and found I’d lost my page-numbers that had always been there. Eventually I was able to solve this problem by adding two items to my use-package statements, one for pdf-tools and a subsequent one for telephone-line.

Gnus remove group

After years of using Gnus for my mail I had some anomolous groups like “mail.sent” (later I had reworked this to archive.sent, but couldn’t get rid of mail.sent); I had tried deleting the folder on my hard drive, but this only resulted in errors with trying to enter the group from the group list, but still the group was shown (even with a number of unread messages). Turns out the answer is easy:

Deliberate Scope in Web Applications

Web applications can be divided into two general categories, depending upon the scope to be implemented in their design and development. Global scope means that the program will draw upon and update an overall state, which can be referenced from anywhere within the program. Examples may include applications that remember the identity of the user, or generally remember notifications. Lexical scope (or block scope) indicates more modularity in the program; functions in the program wuill generally be self-contained and will operate upon data they are provided, not upon external data.

Functional Design in Web Applications

Programming drew the idea of functions from math. Consistent with that heritage, pure functions operate purely in terms of the values they receive and the value(s) they produce. While every programming language relies upon functions to some degree, one of the trademarks of languages called “functional” is that they model program-flow as the passage and transformation of data from beginning to end. Though style-neutral, Javascript allows designers to implement functional design if they so choose.

Command-line solutions to laptop functions

Trying to make the jump to exwm, which is a similar experience (though considerably less documented) than switching to i3wm, there are a number of core laptop functionalities that the heavier-weight window managers take care of for you. I’m using this on a laptop that is often used that way – traveling, connecting to multiple different WiFi networks daily, connecting to docking stations and extra monitors and devices, toggling touch pad, etc.