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.

Useful shell scripts

Placing little scripts in your ~/bin directory makes it abundantly clear why some people love shell scripting, and some jobs require shelll scripting as a skill. It seriously improves the speed and ease of life. Here are a few that I enjoy: Crashplan Because I sometimes need to micromanage my backup software and the software doesn’t function if I try linking it to another folder this simplifies things. #!/bin/bash # file: /~/bin/crash CRASHPLAN_DIR=/usr/local/crashplan/bin cd $CRASHPLAN_DIR; sudo .

Find Gateway on Linux

For quick reference: how do I find my gateway on linux? (Needed to access your router’s web interface) $ netstat -nr Kernel IP routing table Destination Gateway Genmask Flags MSS Window irtt Iface 0.0.0.0 192.168.1.1 0.0.0.0 UG 0 0 0 wlan0 172.17.0.0 0.0.0.0 255.255.0.0 U 0 0 0 docker0 192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 wlan0

Saving Window configs in Emacs (in-session)

Sometimes I end up with complex window configs while working in emacs, as you see in the title image. Using Winner mode you can easily track linearly backward through your screens, “undo” style; but sometimes I have a set up–as when developing a system–that I want to return to frequently. It turns out you have Window Registers for this purpose, and they work well. window-configuration-to-register: C-x r w <key> This saves it for easy reloading with C-x r j <key> and you’re back where you want to be!