Posts

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!

Easy cross-site slide-show

I recently implemented a small slide-show banner for showcasing products, in this case books, that works across sites. I did it with a nice JQuery slideshow plugin and iframes. I happened to be inserting it into Wordpress pages. The Problem My client has three separate websites he uses for distinct blogs, but as an author he wants to showcase the books he’s published on each of them. It will be a major problem to implement three distinct solutions, even if they are identical, for each blog, and update each one whenever something changes (such as a new book coming out).

Book Review: Clojure Cookbook: Recipes for Functional Programming

Clojure Cookbook: Recipes for Functional Programming by Luke VanderHart My rating: 4 of 5 stars An excellent book, not only as a reference but as a learning resource. It is by no means written as a general entry point to Clojure, but provides terse, practical, fast-paced insight with just enough explanation to be as instructive as it is useful. The quality of the “discussion” portions means this is good for more than just copy-paste reading, while the emphasis on projects and practicality make it a pre-eminent go-to as you refine your Clojure skills.