RSSAmplifier

Blog

Listful Andrew

`(emacs lisp bash ,@functional-programming)

flandrew.srht.siteRSS feed ↗97 posts

Latest posts

Bad Matrix Reloaded

A bit more random, but rest assured: it's nearly as bad as the previous.

Mars Rovers X: The Grid Viz Solutions — Bash

Really, now: Bash? How am I going to update hash tables and all that — there aren't any! On the other hand, the output is a string. And boy, can Bash do strings.

Mars Rovers IX: The Grid Viz Solutions — Emacs Lisp

After finishing my first implementation of The Grid Viz Problem, in Clojure, I went ahead and translated it to Emacs Lisp.

Mars Rovers VIII: The Grid Viz Solutions — Clojure

Having now introduced The Grid Viz Problem and outlined my solution, let's see the Clojure code.

Mars Rovers VII: The Grid Viz Design

How can we represent and modify such rover-populated grid?

Mars Rovers VI: The Grid Viz Problem

Wouldn't you like to see those rovers' tracks instead of just "2 3 W" strings and the like? Well, I would. So I formulated an extension to the problem.

Mars Rovers V: The Solutions — Bash

The problem starts with a string and ends with a string. Bash can certainly do strings.

Mars Rovers IV: The Solutions — Emacs Lisp

Having solved it in Clojure, I couldn't resist inviting Emacs Lisp to the party.

Mars Rovers III: The Solutions — Clojure

Having now introduced and analyzed the problem, let's see the Clojure code.

Mars Rovers II: The Design

Interpreting the Mars Rovers problem and designing a solution.

Mars Rovers I: The Problem

When I read "The Problem Statement" in Aditya Athalye's "A Clojure view of 'Mars Rovers'", I had the impulse to drop whatever I was doing and write my own solutions before being exposed to any spoilers from his own answer. Though that grid was not infinite, I was still nerd-sniped.

Stop half-POSIXing your shell scripts

I have already argued in this general direction, but thought that I might as well put it more clearly and bluntly.

Phones-to-Words Challenge V: Clojure-inspired Emacs Lisp

Having solved it in Clojure, I decided to translate that code into a new Emacs Lisp solution. I suspected that I'd like it much more than my Elisp one from years ago — and that turned out to be true.

Phones-to-Words Challenge IV: Clojure as an alternative to Java

There's an old programming challenge where the digits in a list of phone numbers are converted to letters according to rules and a given dictionary file. The results of the original challenge suggested that Lisp would be a potentially superior alternative to Java, since Lisper participants were able to produce solutions in, on average, fewer lines of code and less time than Java programmers. Some…

Counting Words VI: Clojure

Clojure solutions to Ben Hoyt's word-counting exercise, with comparisons to Emacs Lisp.

Counting Words V: More solutions in Emacs Lisp

Still more Emacs Lisp solutions to Ben Hoyt's word-counting exercise.

ISO week dates in Emacs Lisp and Bash

Match and convert from and to ISO week dates in Emacs Lisp and Bash.

HyCal — Hybrid ISO week–Gregorian calendar with color themes (Bash package)

Slice your year in weeks and quickly see where today is. Customizable with color themes, HyCal has the layout of an ISO week calendar, yet the first day of each Gregorian calendar month is shown with a distinct color. Weekdays can be shown in your own language — just pick a locale.

All codes lead to Home

In which flandrew obsesses over literally hundreds of different ways to produce the exact same result using Emacs Lisp.

Restful #03

Emacs, the longest · Ordinal dates in Elisp and Bash · Colors and effects in the terminal

Ecos — Echo with millions of colors (Bash package)

Tired of typing awkward ANSI escape codes to get eight-ish colors? With some sugared syntax and the whole RGB color space at your disposal, your terminal can look much more pleasantly colorful. Features include: lookup and Bash completion of X11 color names, effects (bold, italic, etc.), and a regex color filter mode to selectively colorize piped text.

Christmas trees from factored integers

Triangles for your terminals.

When is Christmas on a Saturday?

Emacs Lisp and Bash will be happy to tell you that.

Relative dates, to your taste

Flexible formats to know how much time exists between now and the event.

Awhile — Time difference from now in different formats (Emacs package)

Customize how you want to display a time difference: long or short, exact or fuzzy, how many and which units to use, etc.

FromNow — Time difference from now in different formats (Bash package)

Customize how you want to display a time difference: long or short, exact or fuzzy, how many and which units to use, etc.

Restful #02

The wonderful Org Show Branches · A dozen ways from vector to list · Send emoji cat to file cat and cat it

Restful #01

Org table of HTTP return codes · Faster, more elegant Bash FizzBuzz · Visualizing all territory flags at once

Have you ever transformed parameters?

A closer look at one of Bash's little known features.

How to append lists

It's simple, really.

Brace yourself

You can generate combinations of strings by using Bash's brace expansion.

Ultimate Bash

Astonishing conciseness meets high enjoyability.

Unconventional pipe captures

Point the flow to precisely where you want it.

A quick intro to arithmetic evaluation and expansion in Bash

Short, speedy, safe, simple syntax — seldom seen.

Underappreciated Bash idioms

I often use them. I much like them. Yet I rarely see them in the wild.

Progressively shorter and cleaner Bash conditionals

Watch as all that noise disappears, one step at a time.

Docstrings for Bash

With the support of as little as three lines of lookup code, Bash functions can have clean and simple docstrings.

Org tables in comments and docstrings: in Emacs Lisp and Bash

Thanks to orgtbl-mode, we can enhance our code's documentation with Org tables.

Every emoji in one hash table: playing with Emacs' ucs‑names

A handful of examples of searching, filtering, and mapping Unicode characters using a comprehensive hash table that a native Emacs function provides.

Creating emoji flags in Emacs Lisp and Bash

You can certainly do it with key–value lookups. But did you know you can calculate them?

Append2Org — Send your clipboard to an Org file as a subtree (Bash package)

Bash-based little brother of org-capture. Sort of. Emacs not needed: from anywhere, add to the end of an Org file of your choice a subtree with the contents of your clipboard.

Flaggify — Create flags of countries and subdivisions (Bash package)

Do you have fonts that can display emoji flags? Flaggify can convert from country code to country flag. Likewise for countries' subdivisions.

PercBar — Create a progress bar (Bash package)

To get a bar built with Unicode blocks, simply give it numerator, denominator, and bar length.

There are many ways to skin a cat, an echo, a printf

Bash offers several options to organize your strings for printing or further processing, of which I show lots of examples.

Some Bashisms are faster and more readable

There may be good reasons to stick to POSIX. But if instead you end up using Bash, and you're already sprinkling Bashisms all over your script, then you might as well make good use of it.

Democratize can now offer more than 6000 Emacs Lisp usage examples

It now supports 10 non-native libraries, plus treesit and all the native functions covered by shortdoc.

Mondo — World's scripts, languages, places in any language (Emacs package)

Mondo can translate into (almost) every language the names of the world's scripts, languages, territories (including countries), and countries' subdivisions. Translations happen locally — in your machine.

Vexil — Create flags of countries and subdivisions (Emacs package)

Do you have fonts that can display emoji flags? Vexil can convert from country code to country flag, and vice-versa. Likewise for countries' subdivisions.

llamascii art

In which flandrew deploys Peruvian camelids, nested lambdas, and ascii art to answer the question of the meaning of life, the Universe, and everything.

You using Pansymbolic: examples

Examples of what you type and what goes on in your mind as you use Pansymbolic.