xenodium.com @alvaro https://xenodium.com RSS feed for xenodium.com @alvaro en-us agent-shell 0.47 updates https://xenodium.com/agent-shell-0-47-1-updates https://xenodium.com/agent-shell-0-47-1-updates We got quite a few agent-shell additions since the last post, so let's go through the highlights as of v0.47.1.

What's agent-shell?

Agent shell is a native Emacs mode to interact with LLM agents powered by ACP (Agent Client Protocol).

Your employer can make a difference

agent-shell has been attracting quite a few users. Many of you are working in tech where employers are happily paying for IDE subscriptions and LLM tokens to improve productivity. If you are using agent-shell for work, consider getting your employer to give back by sponsoring the project.

I also know many of you work at AI companies offering paid agents like Claude Code, Copilot, Gemini, Codex, etc. all supported by agent-shell. Please nudge your employers to help fund projects like agent-shell, which are making their services available to more users.

Sponsor agent-shell

So what's new?

claude-code-acp renamed to claude-agent-acp [Action Required]

Let's get this one out of the way, as it needs actioning. Both the npm package and the CLI agent have been renamed from claude-code-acp to claude-agent-acp (to align with Anthropic's branding guidelines). If you're using Claude Code, you'll need to update:

npm remove -g @zed-industries/claude-code-acp
npm install -g @zed-industries/claude-agent-acp

If you had customized agent-shell-anthropic-claude-acp-command, update it to point to claude-agent-acp.

New agents supported

Bootstrapped sessions (experimental)

This was a biggie. How sessions are loaded is now configurable via agent-shell-session-strategy. When set to 'new, starting a new shell delivers a fully bootstrapped session before presenting you with the shell prompt. This means the ACP handshake, authentication, and session creation all happen upfront.

You can enable this flow with:

(setq agent-shell-session-strategy 'new)

What's the benefit? Bootstrapped sessions enable changing models and session modes (Planning, Don't ask, Skip permissions, etc…) before submitting your first prompt.

For the time being, the existing (deferred) behaviour is still offered via 'new-deferred. Just set as follows:

(setq agent-shell-session-strategy 'new-deferred)

Session resume (experimental)

Probably the most requested feature and also facilitated by the bootstrapping changes. agent-shell-session-strategy also unlocks session resume. Set it to 'prompt and every time either M-x agent-shell-new-shell or C-u M-x agent-shell are invoked, you'll be offered to resume previous sessions or start a new one.

(setq agent-shell-session-strategy 'prompt)

Alternatively, you can set to 'latest to always resume the most recent session in current project.

Under the hood, there are two ways to pick up from previous session: session/resume (lightweight, no message replay) and session/load (full history replay). By default, agent-shell prefers resuming (controlled by agent-shell-prefer-session-resume). Please favor resuming for the time being as loading has more edge cases to sort out still.

Note: Both resuming and loading sessions are agent-dependent. Some agents may not yet support either, especially as the features aren't yet considered stable in Agent Client Protocol (see session/list spec).

This feature was a collaboration between @farra, @travisjeffery, and myself.

Clipboard images

You can now use agent-shell-send-clipboard-image (#285 by @dangom) to send images straight from your clipboard into agent-shell. Clipboard images are saved to .agent-shell/screenshots in your project root and inserted into the shell buffer as context.

Note: You'll need either pngpaste or xclip installed on your system for the feature to automatically kick in.

In addition, we now have agent-shell-yank-dwim: if the clipboard has an image, it pastes it as context. Otherwise, it yanks text as usual. In other words, copy an image anywhere to your system's clipboard and paste/yank into the buffer as usual (typically via C-y).

Status display + tool calls

Status labels and tool call titles rendering got some improvements. Status reporting is generally more compact, redundant text is dropped from tool call titles, and tool status/kind shortening has been consolidated.

Image rendering

agent-shell now renders images inline. When agents output images (charts, diagrams, screenshots, etc.), they display directly in the shell buffer. You may need to nudge the agent to output image paths in the expected format so agent-shell can pick up.

Markdown images:

![alt text](/path/to/image.png)

Any of the following in a line of their own are supported also:

/path/to/image.png
file:///path/to/image.png
./output/chart.png
~/screenshots/demo.png

Recognized image formats depend on what your Emacs was built with (typically png, jpeg, gif, svg, webp, tiff, etc. via image-file-name-extensions).

Emacs skills

While on the topic of image rendering, this works particularly well when coupled with charting agent skills. I shared some of these over at emacs-skills, demoed in episode 13 of the Bending Emacs series.

Table rendering

Tables are now rendered using overlays (#17 by @ewilderj).

Usage tracking

Tracking usage now possible (#270 by @Lenbok):

  • A color-coded context usage indicator in the header (green -> yellow -> red as context fills up), enabled by default via agent-shell-show-context-usage-indicator.
  • M-x agent-shell-show-usage to check token counts, context window usage, and cost in the minibuffer.r- An optional end-of-turn usage summary can be enabled via (setq agent-shell-show-usage-at-turn-end t).

Git worktree shell

If keen to run multiple agents on the same repo without stepping on each other's work, M-x agent-shell-new-worktree-shell facilitates this via git worktrees (#255 by @nhojb).

Send context to…

You can now send context to a specific shell using agent-shell-send-file-to, agent-shell-send-region-to, agent-shell-send-clipboard-image-to. and agent-shell-send-screenshot-to. These prompt you to pick a target shell.

Both M-x agent-shell and agent-shell-send-dwim are now prefix-aware. C-u forces a new shell, while C-u C-u prompts you to pick a target shell.

Compose buffer improvements

Compose buffers now support file (via @) and command (via /) completions. It is now also possible to browse previous pages via C-c C-p and come back to your prompt draft.

There's also prompt history navigation/insertion when composing prompts via M-p (previous), M-n (next), and M-r (search).

Bringing context into viewport compose buffers is now more robust. For example, carrying context into a new viewport compose buffer is now supported (#383 by @liaowang11).

Viewport improvements

While viewport interaction was introduced in the previous post, it is now my preferred way of interacting with agent-shell. You can enable via (setq agent-shell-prefer-viewport-interaction t). In any case, viewport buffers got a handful of quality-of-life improvements.

Single key replies without needing to open a compose/reply buffer:

  • y sends "yes" (handy for quickly answering agent questions).
  • 1-9 sends digits (handy for quickly choosing options).
  • m sends "more" (handy for requesting more of the same kind of data).
  • a sends "again" (handy for requesting to carry out instructions again).

Customizable context sources

agent-shell-context-sources lets you configure which DWIM context sources are considered by M-x agent-shell, agent-shell-send-dwim, and compose buffers. You can control the order sources are checked and add custom functions. Defaults to files, region, error, and line.

I'm always on the lookout for some DWIM goodness. If you add your own context function, I'd love to hear about it.

Flycheck support

While on the topic of context sources, in addition to picking up flymake errors at point, flycheck errors are now automatically recognized (#219 by @Lenbok).

Diff improvements

Diff buffers got some love too, now with syntax highlighting (#198 by @Azkae). There's also a new agent-shell-diff-mode-map for customizing diff keybindings, which avoid inheriting unsupported features from the parent mode. You can also press f to open the modified file from a diff buffer.

Additionally, you can now press C-c C-c from an agent-shell-diff buffer to reject all changes (same binding as the shell itself).

Event subscriptions

You can now programmatically subscribe to agent-shell events like initialization steps, tool call updates, file writes, permission responses, permission requests, and turn completions. This opens the door for building integrations on top of agent-shell.

(agent-shell-subscribe-to
 :shell-buffer (current-buffer)
 :event 'file-write
 :on-event (lambda (event)
             (message "File written: %s"
                      (alist-get :path (alist-get :data event)))))

Permission UX improvements

Permission dialogs got a few improvements. Amongst them, automatic navigation to the next pending dialog and also making executed commands more prominent for some agents.

Permission responder function

You can now programmatically respond to permission requests via agent-shell-permission-responder-function. A built-in agent-shell-permission-allow-always handler is provided to auto-approve everything (use with caution):

(setq agent-shell-permission-responder-function #'agent-shell-permission-allow-always)

Claude Code OAuth token support

OAuth token now supported for Claude Code (#339 by @chemtov).

Transcript improvements

Markdown transcripts generation needed love. Thank you @Idorobots and @systemfreund for the improvements (#374, #325, and #326).

Session ID display

With (setq agent-shell-show-session-id t), session IDs are now displayed in header as well as session lists (#363 by @Cy6erBr4in).

Custom CWD function

agent-shell-cwd-function now enables customizing how agent-shell determines the working directory sent to agents.

Configurable dot-subdir location

agent-shell-dot-subdir-function now lets you customize where agent-shell keeps per-project files (#378 by @zackattackz).

Lambda MCP servers

agent-shell-mcp-servers now accept lambda functions too (#237 by @matthewbauer). Useful for setups like claude-code-ide using dynamic MCP details.

Buffer name format

agent-shell-buffer-name-format now makes buffer naming configurable. Choose between the default title case ("Claude Code Agent @ My Project"), kebab-case ("claude-code-agent @ my-project"), or provide your own function (#256 by @nhojb).

Inhibit minor modes during writes

agent-shell-write-inhibit-minor-modes lets you temporarily disable modes (like auto-formatting entire file) when agents write files (#224 by @ultronozm).

File autocompletion performance

File autocompletion is now more performant for larger repositories (#262 by @perfectayush).

Container modeline indicator

When running shells inside a container, a [C] indicator now shows up in the modeline (#250 by @ElleNajt).

Graphical header improvements

Graphical header rendering is more robust now (#275 by @nhojb).

Busy throbber display options

The busy/working indicator now offers multiple visual styles, customizable via agent-shell-busy-indicator-frames (#280 by @Lenbok).

New related packages

Pull requests

Thank you to all contributors for these improvements!

Bug fixes

  • #168: replace-buffer-contents timeout to prevent freeze on large diffs
  • #170: Suppress effects of find-file-noselect during agent writes
  • #175: ACP configuration JSON-RPC inserted into shell
  • #180: Terminal-friendly keybindings
  • #189: Changing the model with Claude causes hang
  • #191: user_message_chunk session updates no longer dump raw JSON
  • #220: Python comments no longer interpreted as Markdown headers
  • #265: session/request_permission with argv array commands
  • #297: Unexpected tool-call command type error
  • #300: agent-shell-send-region no longer fails silently without a region
  • #303: Context insertion for new deferred sessions
  • #319: Fix "Wrong type argument: font, unspecified" in terminal Emacs (fix by @eddof13)
  • #335: Plan not displaying from session/request_permission (fix by @Azkae)
  • #345: Out of turn notifications inserted into shell
  • #353: xclip handler blocking on X11 when clipboard has no image (fix by @chemtov)
  • #361: loadSession regression
  • #370: Permission UI not reacting on status failed/completed (fix by @xar7)
  • #376: File skip check using full path instead of filename only (fix by @zackattackz)
  • #385: Leading space in agent-shell-select-config prompt in terminal frames (fix by @bcc32)

Lots of polish

Beyond what's showcased, I've poured much love and effort into polishing the agent-shell experience. Interested in the nitty-gritty? Have a look through my regular commits.

Make the work sustainable

If agent-shell is useful to you, please consider sponsoring the project. These days, I've been working on agent-shell daily.

LLM tokens aren't free, and neither is the time dedicated to building this stuff. While I now have more time to work on agent-shell as an indie dev, I also have bills to pay ;)

Unless I can make this work sustainable, I will have to shift my focus to work on something else that is.

Sponsor agent-shell
]]>
Thu, 12 Mar 2026 00:00:00 GMT
Bending Emacs - Episode 13: agent-shell charting https://xenodium.com/bending-emacs-episode-13-agent-shell-charting https://xenodium.com/bending-emacs-episode-13-agent-shell-charting Time for a new Bending Emacs episode. This one is a follow-up to Episode 12, where we explored Claude Skills as emacs-skills.

Bending Emacs Episode 13: agent-shell + Claude Skills + Charts

This time around, we look at inline image rendering in agent-shell and how it opens the door to charting. I added a handful of new charting skills to emacs-skills: /gnuplot, /mermaid, /d2, and /plantuml.

The agent extracts or fetches data from context, generates the charting code, saves it as a PNG, and agent-shell renders it inline. Cherry on top: the generated charts match your Emacs theme colors by querying them via emacsclient --eval.

Hope you enjoyed the video!

Want more videos?

Liked the video? Please let me know. Got feedback? Leave me some comments.

Please like my video, share with others, and subscribe to my channel.

As an indie dev, I now have a lot more flexibility to build Emacs tools and share knowledge, but it comes at the cost of not focusing on other activities that help pay the bills. If you benefit or enjoy my work please consider sponsoring.

]]>
Wed, 04 Mar 2026 00:00:00 GMT
Bending Emacs - Episode 12: agent-shell + Claude Skills https://xenodium.com/bending-emacs-episode-12-agent-shell-claude-skills https://xenodium.com/bending-emacs-episode-12-agent-shell-claude-skills Time for a new Bending Emacs episode. This one is a follow-up to Episode 10, where we introduced agent-shell.

Bending Emacs Episode 12: agent-shell + Claude Skills

This time around, we explore Claude Skills and how to use them to teach agents Emacs tricks. I built a handful of skills packaged as a Claude Code plugin at github.com/xenodium/emacs-skills.

The skills use emacsclient --eval under the hood to bridge agent work to your running Emacs session:

  • /dired - Open files from the latest interaction in a dired buffer with marks.
  • /open - Open files in Emacs, jumping to a specific line when relevant.
  • /select - Open a file and select the relevant region.
  • /highlight - Highlight relevant regions across files with a temporary read-only minor mode.
  • /describe - Look up Emacs documentation and summarize findings.
  • emacsclient (auto) - Teaches the agent to always prefer emacsclient over emacs.

Hope you enjoyed the video!

Want more videos?

Liked the video? Please let me know. Got feedback? Leave me some comments.

Please go like my video, share with others, and subscribe to my channel.

As an indie dev, I now have a lot more flexibility to build Emacs tools and share knowledge, but it comes at the cost of not focusing on other activities that help pay the bills. If you benefit or enjoy my work please consider sponsoring the work.

]]>
Wed, 25 Feb 2026 00:00:00 GMT
Ready Player cover download improvements https://xenodium.com/ready-player-cover-download-improvements https://xenodium.com/ready-player-cover-download-improvements At times, even purchased music excludes album covers in track metadata. For those instances, ready-player-mode offers M-x ready-player-download-album-artwork, which does as it says on the tin. The interactive command offers a couple of fetching providers (iTunes vs Internet Archive / MusicBrainz) to grab the album cover. The thing is, I often found myself trying one or the other provider, sometimes without luck. Today, I finally decided to add a third provider (Deezer) to the list. Even then, what's the point of manually trying each provider out when I can automatically try them all and return the result from the first successful one? And so that's what I did.

In addition to offering all providers, M-x ready-player-download-album-artwork now offers "Any", to download from the first successful provider. Now, why keep the option to request from a specific provider? Well, sometimes one provider has better artwork than another. If I don't like what "Any" returns, I can always request from a specific provider.

While on the subject, I also tidied the preview experience up and now display the thumbnail in the minibuffer. In any case, best to show rather than tell.

Enjoying your unrestricted music via Emacs and ready player mode? ✨sponsor✨ the project.

]]>
Wed, 18 Feb 2026 00:00:00 GMT
Bending Emacs - Episode 11: winpulse https://xenodium.com/bending-emacs-episode-11-winpulse https://xenodium.com/bending-emacs-episode-11-winpulse I recently built a little package to flash Emacs windows as you switch through them, so I might as well showcase it in a new Bending Emacs episode, so here it goes:

Bending Emacs Episode 11: winpulse

In addition to showcasing winpulse, we showed some of the built-in window-managing commands like:

  • C-x 3 split-window-right
  • C-x 2 split-window-below
  • C-x 0 delete-window
  • C-x ^ enlarge-window
  • C-x } enlarge-window-horizontally
  • C-x { shrink-window-horizontally
  • C-x o other-window

It's worth noting the last four commands are can be optimized by repeat-mode. Check out Karthink's It Bears Repeating: Emacs 28 & Repeat Mode post.

Hope you enjoyed the video!

Want more videos?

Liked the video? Please let me know. Got feedback? Leave me some comments.

Please go like my video, share with others, and subscribe to my channel.

If there's enough interest, I'll continue making more videos!

Make it all sustainable

Enjoying this content or my projects? I am an indie dev. Help make it sustainable by ✨sponsoring

Need a blog? I can help with that. Maybe buy my iOS apps too ;)

]]>
Tue, 17 Feb 2026 00:00:00 GMT
Introducing winpulse https://xenodium.com/introducing-winpulse https://xenodium.com/introducing-winpulse Hard to say officially, but I've been primarily using Emacs for roughly a couple of decades. Maybe my eyesight isn't what it used to be, or maybe I've just been wanting a stronger visual signal as I navigate through Emacs windows. Either way, today's the day I finally did something about it…

I asked around to see if a package already existed for this purpose. Folks shared a handful of great options:

  • pulsar: Emacs package to pulse the current line after running select functions.
  • dimmer.el: Interactively highlight the active buffer by dimming the others.
  • window-dim.el: A window dimmer package for Emacs.

I wanted my windows to temporarily flash when switching between them. Of these options, pulsar came closest, though highlighting the current line only.

This is Emacs, so I should be able to get the behavior I want by throwing some elisp at the problem. With that, I give you winpulse, a package to temporarily highlight focused Emacs windows.

This package is fresh out of the oven and likely has some edge cases I haven't yet considered. If you're still keen to check it out, it's available on GitHub.

Make it sustainable

Enjoying this package or my content? I'm an indie dev. Consider sponsoring to help make it sustainable.

]]>
Tue, 10 Feb 2026 00:00:00 GMT
Film/TV bookmarks (chaos resolved) https://xenodium.com/film-tv-bookmarks-chaos-resolved https://xenodium.com/film-tv-bookmarks-chaos-resolved I've been somewhat chaotically "bookmarking" things to watch for some time. The info typically goes straight to an Emacs org file primarily via Journelly.

I'm fairly forgiving in my input form. I often link to Reddit discussions, IMDB/Letterboxd links, or at times simply write movie or director names. The only real requirement is to sprinkle some hashtags (#film or #series or #watch) for retrieval.

While this flexibility is important (makes it more likely for me to actually write), it's not super practical to browse through this mixed structure when looking for something to watch. Yesterday, I finally did something about that.

Here's what my save-to-Journelly flow may look like for a Reddit link:

All entries are saved to Journelly.org, a plain text org file (Markdown is supported too), so I first extracted all relevant entries (containing #film or #series or #watch). A matching entry looks a little something like this:

* [2026-01-29 Thu 09:52] @ Home
:PROPERTIES:
:LATITUDE: 51.5007
:LONGITUDE: -0.1246
:WEATHER_TEMPERATURE: 4.2°C
:WEATHER_CONDITION: Cloudy
:WEATHER_SYMBOL: cloud
:END:
#film #hongkong #watch

https://www.reddit.com/r/movies/comments/1j85b52/just_rewatched_kung_fu_hustle_still_felt_great

Having extracted non-personal items from Journelly.org, I created a git repo with just one file: watchlist.org including entries like the one above.

With personal/private details out of the way, I decided to let the LLM robots loose. That is, hand watchlist.org over to a Claude Code agent, via Emacs agent-sell to organize my chaos.

First I asked to normalize data by extracting all film/tv info from each entry, visiting Reddit/IMDB/Letterboxd links if needed, which yielded normalized.org:

Kung Fu Hustle
https://www.imdb.com/title/tt0373074

Next I asked to generate metadata for me (using the fields I wanted from IMDB), stored in org drawers, saved to db.org:

* Kung Fu Hustle
:PROPERTIES:
:TYPE: film
:YEAR: 2004
:IMDB: https://www.imdb.com/title/tt0373074/
:IMDB_RATING: 7.7
:COUNTRY: Hong Kong
:DIRECTOR: Stephen Chow
:GENRE: action, comedy, fantasy
:RUNTIME: 99
:ADDED: [2026-01-28]
:THUMBNAIL: file:thumbnails/tt0373074.png
:IMDB_THUMBNAIL: https://m.media-amazon.com/images/M/MV5BNGU2OWVlM2ItZGZlOC00Yzk2LWE1NzEtMDYwMzE4YTE5MzQ2XkEyXkFqcGc@._V1_FMjpg_UY1024_.jpg
:END:

Finally, I asked to generate HTML from db.org so I can render and easily browse.

<div>
  <a href="https://www.imdb.com/title/tt0373074/"><img src="https://m.media-amazon.com/images/M/MV5BNGU2OWVlM2ItZGZlOC00Yzk2LWE1NzEtMDYwMzE4YTE5MzQ2XkEyXkFqcGc@._V1_FMjpg_UY1024_.jpg" alt="Kung Fu Hustle" width="150" height="225"></a>
  <p><strong>Kung Fu Hustle (2004)</strong></p>
  <p>action · comedy · fantasy</p>
  <p>Hong Kong · Stephen Chow</p>
</div>

For each transformation, Claude Code generated a python script. I've yet to decide what to do with all the resulting source code. Do I clean it up? Rewrite it?

For now, I'm happy with the results of the experiment. I managed to organize some of my chaos! In some ways, this isn't too different from me writing a quick/hacky/ugly script, when it's acceptable to do so.

At the center of it all, is my beloved org syntax. Thanks to plain text formats, we can easily peek at them, query them, poke at them, tweak them, and bend til our heart's content. It's just so versatile, and now we can throw them at LLMs too.

Oh, and if you're curious about that watch list, here you go. Do you have some movie/show suggestions for me?

12 Monkeys

12 Monkeys (2015)

tv · adventure · drama · mystery

United States

2149: The Aftermath

2149: The Aftermath (2021)

sci-fi

Canada · Benjamin Duffield

3 Body Problem

3 Body Problem (2024)

tv · adventure · drama · fantasy

United Kingdom

964 Pinocchio

964 Pinocchio (1991)

horror · sci-fi

Japan · Shozin Fukui

A Scanner Darkly

A Scanner Darkly (2006)

animation · comedy · crime

United States · Richard Linklater

A Separation

A Separation (2011)

drama

Iran · Asghar Farhadi

A Small Light

A Small Light (2023)

tv · biography · drama · history

United States

A Taxing Woman

A Taxing Woman (1987)

comedy · crime

Japan · Jûzô Itami

Absentia

Absentia (2017)

tv · crime · drama · mystery

Israel

Across the Furious Sea

Across the Furious Sea (2023)

crime · drama · mystery

China · Baoping Cao

Akira

Akira (1988)

animation · action · drama

Japan · Katsuhiro Ôtomo

Alita: Battle Angel

Alita: Battle Angel (2019)

action · adventure · sci-fi

United States · Robert Rodriguez

All About My Mother

All About My Mother (1999)

comedy · drama · romance

Spain · Pedro Almodóvar

Altered Carbon

Altered Carbon (2018)

tv · action · adventure · drama

United States

Altered Hours

Altered Hours (2016)

sci-fi · thriller

United States · Bruce Wemple

Amelie

Amelie (2001)

comedy · romance

France · Jean-Pierre Jeunet

Amores Perros

Amores Perros (2000)

drama · thriller

Mexico · Alejandro G. Iñárritu

An Elephant Sitting Still

An Elephant Sitting Still (2018)

crime · drama

China · Bo Hu

Anatomy of a Fall

Anatomy of a Fall (2023)

crime · drama · mystery

France · Justine Triet

Arcane

Arcane (2021)

tv · animation · action · adventure

United States

Archive 81

Archive 81 (2022)

tv · drama · horror · mystery

United States

As Tears Go By

As Tears Go By (1988)

crime · drama · romance

Hong Kong · Wong Kar-Wai

Asakusa Kid

Asakusa Kid (2021)

biography · drama

Japan · Gekidan Hitori

Ash Is Purest White

Ash Is Purest White (2018)

crime · drama · romance

China · Jia Zhang-ke

Asura

Asura (2023)

tv · comedy · drama

Indonesia

Band of Brothers

Band of Brothers (2001)

tv · action · drama · history

United Kingdom

Banshee

Banshee (2013)

tv · action · crime · drama

United States

Barry

Barry (2018)

tv · action · comedy · crime

United States

Battlestar Galactica

Battlestar Galactica (2004)

tv · action · adventure · drama

United States

Being Human (UK)

Being Human (UK) (2008)

tv · comedy · drama · fantasy

United Kingdom

Big Man Japan

Big Man Japan (2007)

action · comedy · sci-fi

Japan · Hitoshi Matsumoto

Black Coal, Thin Ice

Black Coal, Thin Ice (2014)

crime · drama · mystery

China · Yi'nan Diao

Black Sails

Black Sails (2014)

tv · action · adventure · drama

South Africa

Blackadder

Blackadder (1983)

tv · comedy

United Kingdom

BlackBerry

BlackBerry (2023)

biography · comedy · drama

Canada · Matt Johnson

Blade Runner

Blade Runner (1982)

action · drama · sci-fi

United States · Ridley Scott

Blade Runner 2049

Blade Runner 2049 (2017)

action · drama · mystery

United States · Denis Villeneuve

Blade Runner: Black Lotus

Blade Runner: Black Lotus (2021)

tv · animation · action · drama

United States

Bloody Hell

Bloody Hell (2020)

comedy · horror · mystery

Australia · Alister Grierson

Boardwalk Empire

Boardwalk Empire (2010)

tv · crime · drama

United States

Bojack Horseman

Bojack Horseman (2014)

tv · animation · comedy · drama

United States

Brand New Cherry Flavor

Brand New Cherry Flavor (2021)

tv · drama · horror · mystery

United States

Brazil

Brazil (1985)

drama · sci-fi · thriller

United Kingdom · Terry Gilliam

Broadchurch

Broadchurch (2013)

tv · crime · drama · mystery

United Kingdom

Burn Notice

Burn Notice (2007)

tv · action · crime · drama

United States

Burning

Burning (2018)

drama · mystery · thriller

South Korea · Lee Chang-dong

Carnivale

Carnivale (2003)

tv · drama · fantasy · mystery

United States

Castlevania

Castlevania (2017)

tv · animation · action · adventure

United States

Chungking Express

Chungking Express (1994)

comedy · crime · drama

Hong Kong · Wong Kar-Wai

City Hunter

City Hunter (2024)

action · comedy · crime

Japan · Yûichi Satô

City of God

City of God (2002)

crime · drama

Brazil · Kátia Lund

Cloud

Cloud (2024)

action · crime · drama

Japan · Kiyoshi Kurosawa

Cold Fish

Cold Fish (2010)

crime · drama · horror

Japan · Sion Sono

Colony

Colony (2016)

tv · action · adventure · drama

United States

Counterpart

Counterpart (2017)

tv · drama · sci-fi · thriller

United States

Crouching Tiger Hidden Dragon

Crouching Tiger Hidden Dragon (2000)

action · adventure · drama

Taiwan · Ang Lee

Cure

Cure (1997)

crime · horror · mystery

Japan · Kiyoshi Kurosawa

Cyberpunk: Edgerunners

Cyberpunk: Edgerunners (2022)

tv · animation · action · adventure

Japan

DaVinci's Demons

DaVinci's Demons (2013)

tv · adventure · biography · drama

United States

Days of Being Wild

Days of Being Wild (1990)

crime · drama · romance

Hong Kong · Wong Kar-Wai

Deadwind

Deadwind (2018)

tv · crime · drama · mystery

Finland

Deadwood

Deadwood (2004)

tv · crime · drama · history

United States

Dear Child

Dear Child (2023)

tv · crime · drama · mystery

Germany

Decision to Leave

Decision to Leave (2022)

crime · drama · mystery

South Korea · Park Chan-wook

Demon City

Demon City (2024)

action · adventure · crime

Japan · Seiji Tanaka

Derry Girls

Derry Girls (2018)

tv · comedy

United Kingdom

Destroyer

Destroyer (2018)

action · crime · drama

United States · Karyn Kusama

Devs

Devs (2020)

tv · drama · mystery · sci-fi

United Kingdom

Dirk Gently's Holistic Detective Agency

Dirk Gently's Holistic Detective Agency (2016)

tv · action · adventure · comedy

United States

District 9

District 9 (2009)

action · sci-fi · thriller

South Africa · Neill Blomkamp

Doom Patrol

Doom Patrol (2019)

tv · action · adventure · comedy

United States

Downton Abbey

Downton Abbey (2010)

tv · drama · romance

United Kingdom

Dredd

Dredd (2012)

action · crime · sci-fi

United Kingdom · Pete Travis

Drops of God

Drops of God (2023)

tv · drama

France

Dune

Dune (2021)

action · adventure · drama

United States · Denis Villeneuve

Dust of Angels

Dust of Angels (1992)

action · crime · drama

Taiwan · Hsiao-Ming Hsu

Edge of Tomorrow

Edge of Tomorrow (2014)

action · adventure · sci-fi

United States · Doug Liman

Edie

Edie (2017)

adventure · drama

United Kingdom · Simon Hunter

Elysium

Elysium (2013)

action · drama · sci-fi

United States · Neill Blomkamp

Encanto

Encanto (2021)

animation · comedy · family

United States · Jared Bush

Endeavour

Endeavour (2012)

tv · crime · drama · mystery

United Kingdom

Equilibrium

Equilibrium (2002)

action · drama · sci-fi

United States · Kurt Wimmer

Euphoria

Euphoria (2019)

tv · drama

United States

Extreme Job

Extreme Job (2019)

action · comedy · crime

South Korea · Lee Byeong-heon

Fair Play

Fair Play (2023)

drama · thriller

United States · Chloe Domont

Fallen Leaves

Fallen Leaves (2023)

comedy · drama · romance

Finland · Aki Kaurismäki

Fallout

Fallout (2024)

tv · action · adventure · drama

United States

Fargo

Fargo (2014)

tv · crime · drama · thriller

United States

Firefly

Firefly (2002)

tv · adventure · drama · sci-fi

United States

Foundation

Foundation (2021)

tv · drama · sci-fi

Ireland

Foyle's War

Foyle's War (2002)

tv · crime · drama · mystery

United Kingdom

Fringe

Fringe (2008)

tv · drama · mystery · sci-fi

United States

From

From (2022)

tv · drama · horror · mystery

United States

Funky Forest

Funky Forest (2005)

comedy · fantasy

Japan · Katsuhito Ishii

Future Man

Future Man (2017)

tv · action · adventure · comedy

United States

Gen V

Gen V (2023)

tv · action · adventure · comedy

United States

Ghost in the Shell

Ghost in the Shell (1995)

animation · action · crime

Japan · Mamoru Oshii

Ghostbusters Afterlife

Ghostbusters Afterlife (2021)

adventure · comedy · fantasy

United States · Jason Reitman

Godzilla Minus One

Godzilla Minus One (2023)

action · adventure · drama

Japan · Takashi Yamazaki

Going By The Book

Going By The Book (2007)

action · comedy

South Korea · Hee-chan Ra

Gomorrah

Gomorrah (2014)

tv · crime · drama · thriller

Italy

Guns & Talks

Guns & Talks (2001)

action · drama · comedy

South Korea · Jang Jin

Halt and Catch Fire

Halt and Catch Fire (2014)

tv · drama

United States

Handmaid's Tale

Handmaid's Tale (2017)

tv · drama · sci-fi · thriller

United States

Hanna

Hanna (2019)

tv · action · crime · drama

United States

Hannibal

Hannibal (2013)

tv · crime · drama · horror

United States

Hausen

Hausen (2020)

tv · drama · horror · mystery

Germany

Heavy Water War (Kampen om tungtvannet)

Heavy Water War (Kampen om tungtvannet) (2015)

tv · drama · history · war

Norway

Heroes

Heroes (2006)

tv · crime · drama · fantasy

United States

Hotel Del Luna

Hotel Del Luna (2019)

tv · action · comedy · drama

South Korea

Infernal Affairs

Infernal Affairs (2002)

crime · drama · mystery

Hong Kong · Wai Keung Lau

Inside the Yellow Cocoon Shell

Inside the Yellow Cocoon Shell (2023)

drama

Vietnam · Thien An Pham

Inspector Morse

Inspector Morse (1987)

tv · crime · drama · mystery

United Kingdom

Ip Man

Ip Man (2008)

action · biography · drama

Hong Kong · Wilson Yip

Johnny Mnemonic

Johnny Mnemonic (1995)

action · drama · sci-fi

Canada · Robert Longo

JSA: Joint Security Area

JSA: Joint Security Area (2000)

action · drama · thriller

South Korea · Park Chan-wook

Jury Duty

Jury Duty (2023)

tv · comedy

United States

Justified

Justified (2010)

tv · action · crime · drama

United States

Kaili Blues

Kaili Blues (2015)

drama · mystery

China · Bi Gan

Kalifat

Kalifat (2020)

tv · crime · drama · thriller

Sweden

Katla

Katla (2021)

tv · drama · fantasy · mystery

Iceland

Killers of the Flower Moon

Killers of the Flower Moon (2023)

crime · drama · history

United States · Martin Scorsese

Killzone (SPL)

Killzone (SPL) (2005)

action · crime · thriller

Hong Kong · Wilson Yip

Kingdom

Kingdom (2019)

tv · action · drama · horror

South Korea

Kung Fu Dunk

Kung Fu Dunk (2008)

action · comedy · sport

China · Yen-Ping Chu

Kung Fu Hustle

Kung Fu Hustle (2004)

action · comedy · fantasy

Hong Kong · Stephen Chow

La Haine

La Haine (1995)

crime · drama

France · Mathieu Kassovitz

Le Bureau des Legendes

Le Bureau des Legendes (2015)

tv · drama · thriller

France

Left Handed Girl

Left Handed Girl (2024)

drama

Taiwan · Shih-Ching Tsou

Legion

Legion (2017)

tv · action · sci-fi · thriller

United States

Les Revenants

Les Revenants (2012)

tv · drama · fantasy · horror

France

Little Fires Everywhere

Little Fires Everywhere (2020)

tv · drama · mystery · thriller

United States

Locked In

Locked In (2023)

mystery · thriller

United States · David C. Snyder

Lodge 49

Lodge 49 (2018)

tv · comedy · drama · mystery

United States

Logan Lucky

Logan Lucky (2017)

action · comedy · crime

United States · Steven Soderbergh

Loki

Loki (2021)

tv · action · adventure · fantasy

United States

Long Day's Journey Into Night

Long Day's Journey Into Night (2018)

drama · mystery · romance

China · Bi Gan

Looper

Looper (2012)

action · drama · sci-fi

United States · Rian Johnson

Lupin

Lupin (2021)

tv · action · crime · drama

France

Lust, Caution

Lust, Caution (2007)

drama · history · romance

Taiwan · Ang Lee

Man in the High Castle

Man in the High Castle (2015)

tv · drama · sci-fi · thriller

United States

Man Standing Next

Man Standing Next (2020)

thriller

South Korea · Min-ho Woo

Manhunt

Manhunt (2019)

tv · biography · crime · drama

United Kingdom

Manifest

Manifest (2018)

tv · drama · mystery · sci-fi

United States

Marco Polo

Marco Polo (2014)

tv · action · adventure · drama

United States

Marvelous Mrs Maisel

Marvelous Mrs Maisel (2017)

tv · comedy · drama

United States

Max Headroom

Max Headroom (1987)

tv · comedy · sci-fi

United States

May December

May December (2023)

comedy · drama

United States · Todd Haynes

Metropolis

Metropolis (1927)

drama · sci-fi

Germany · Fritz Lang

Midnight Mass

Midnight Mass (2021)

tv · drama · fantasy · horror

United States

Midsommar

Midsommar (2019)

drama · horror · mystery

United States · Ari Aster

Minority Report

Minority Report (2002)

action · crime · mystery

United States · Steven Spielberg

Misfits

Misfits (2009)

tv · comedy · drama · fantasy

United Kingdom

Miss King

Miss King (2024)

tv · drama · thriller

Japan

Mobland

Mobland (2024)

tv · crime · drama

United Kingdom

Mogura

Mogura (2024)

tv

Monk

Monk (2002)

tv · comedy · crime · drama

United States

Moving

Moving (2023)

tv · action · adventure · drama

South Korea

Mr Inbetween

Mr Inbetween (2018)

tv · comedy · crime · drama

Australia

Mr. Robot

Mr. Robot (2015)

tv · crime · drama · thriller

United States

Sympathy for Mr. Vengeance

Sympathy for Mr. Vengeance (2002)

crime · drama · thriller

South Korea · Park Chan-wook

Mrs. Davis

Mrs. Davis (2023)

tv · comedy · drama · sci-fi

United States

My Name

My Name (2021)

tv · action · crime · drama

South Korea

Narcos

Narcos (2015)

tv · biography · crime · drama

United States

Nine Days

Nine Days (2020)

drama · fantasy

United States · Edson Oda

No Other Choice

No Other Choice (2025)

comedy · crime · drama

South Korea · Park Chan-wook

Nobel

Nobel (2016)

tv · drama · thriller · war

Norway

Northern Exposure

Northern Exposure (1990)

tv · adventure · comedy · drama

United States

Occupied (Okkupert)

Occupied (Okkupert) (2015)

tv · drama · thriller

Norway

Oldboy

Oldboy (2003)

action · drama · mystery

South Korea · Park Chan-wook

Once Upon a Time in China

Once Upon a Time in China (1991)

action

Hong Kong · Hark Tsui

One False Move

One False Move (1992)

crime · drama · thriller

United States · Carl Franklin

Ong Bak

Ong Bak (2003)

action · crime · thriller

Thailand · Prachya Pinkaew

Oppenheimer

Oppenheimer (2023)

biography · drama · history

United States · Christopher Nolan

Orphan Black

Orphan Black (2013)

tv · drama · sci-fi · thriller

Canada

Ozark

Ozark (2017)

tv · crime · drama · thriller

United States

Pacifiction

Pacifiction (2022)

drama · thriller

France · Albert Serra

Pan's Labyrinth

Pan's Labyrinth (2006)

drama · fantasy · war

Mexico · Guillermo del Toro

Panchayat

Panchayat (2020)

tv · comedy · drama

India

Pantheon

Pantheon (2022)

tv · animation · action · adventure

United States

Past Lives

Past Lives (2023)

drama · romance

United States · Celine Song

Peacemaker

Peacemaker (2022)

tv · action · adventure · comedy

United States

Peaky Blinders

Peaky Blinders (2013)

tv · crime · drama

United Kingdom

PEN15

PEN15 (2019)

tv · comedy · drama

United States

Penny Dreadful

Penny Dreadful (2014)

tv · drama · fantasy · horror

United Kingdom

Perfect Days

Perfect Days (2023)

drama

Japan · Wim Wenders

Persepolis

Persepolis (2007)

animation · biography · drama

France · Vincent Paronnaud

Police Story

Police Story (1985)

action · comedy · crime

Hong Kong · Jackie Chan

Poor Things

Poor Things (2023)

comedy · drama · romance

Ireland · Yorgos Lanthimos

Preacher

Preacher (2016)

tv · adventure · comedy · fantasy

United States

Primo

Primo (2023)

tv · comedy

United States

Priscilla

Priscilla (2023)

biography · drama · music

Italy · Sofia Coppola

Professor T

Professor T (2015)

tv · comedy · crime · drama

Belgium

Raise the Red Lantern

Raise the Red Lantern (1991)

drama · romance

China · Yimou Zhang

Reservation Dogs

Reservation Dogs (2021)

tv · comedy · crime

United States

Riki Oh

Riki Oh (1991)

action · comedy · crime

Hong Kong · Ngai Choi Lam

Ripley

Ripley (2024)

tv · crime · drama · thriller

United States

Robocop

Robocop (1987)

action · crime · sci-fi

United States · Paul Verhoeven

Rome

Rome (2005)

tv · action · drama · romance

United Kingdom

Rurouni Kenshin

Rurouni Kenshin (2012)

action · adventure · drama

Japan · Keishi Otomo

Russian Doll

Russian Doll (2019)

tv · comedy · drama · mystery

United States

Scavengers Reign

Scavengers Reign (2023)

tv · animation · adventure · drama

United States

Scrapper

Scrapper (2023)

comedy · drama

United Kingdom · Charlotte Regan

Secret Level

Secret Level (2024)

tv · animation · action · adventure

United States

See

See (2019)

tv · action · drama · sci-fi

United States

Sex is Zero

Sex is Zero (2002)

comedy · drama · romance

South Korea · JK Youn

Shall We Dance

Shall We Dance (1996)

comedy · drama · music

Japan · Masayuki Suô

Shameless

Shameless (2011)

tv · comedy · drama

United States

Shantaram

Shantaram (2022)

tv · action · adventure · crime

United States

Shaolin Soccer

Shaolin Soccer (2001)

action · comedy · fantasy

Hong Kong · Stephen Chow

Sharp Objects

Sharp Objects (2018)

tv · crime · drama · mystery

United States

Shin Ultraman

Shin Ultraman (2022)

action · adventure · drama

Japan · Shinji Higuchi

Shinobi No Mono

Shinobi No Mono (1962)

action · drama

Japan · Satsuo Yamamoto

Shogun

Shogun (2024)

tv · action · adventure · drama

United States

Shutter Island

Shutter Island (2010)

drama · mystery · thriller

Canada · Martin Scorsese

Signal

Signal (2016)

tv · crime · drama · fantasy

South Korea

Silo

Silo (2023)

tv · drama · mystery · sci-fi

United States

Six Feet Under

Six Feet Under (2001)

tv · comedy · drama

United States

Slow Horses

Slow Horses (2022)

tv · drama · thriller

United Kingdom

Snowfall

Snowfall (2017)

tv · crime · drama

United States

Snowpiercer

Snowpiercer (2013)

action · sci-fi · thriller

South Korea · Bong Joon Ho

Somebody Somewhere

Somebody Somewhere (2022)

tv · comedy · drama

United States

Sonatine

Sonatine (1993)

action · comedy · crime

Japan · Takeshi Kitano

Spartacus

Spartacus (2010)

tv · action · adventure · biography

United States

Spiral (Engrenage)

Spiral (Engrenage) (2005)

tv · crime · drama · mystery

France

Strange Darling

Strange Darling (2023)

horror · thriller

United States · JT Mollner

Strange Days

Strange Days (1995)

crime · drama · sci-fi

United States · Kathryn Bigelow

Strike Back

Strike Back (2010)

tv · action · drama · thriller

United Kingdom

Succession

Succession (2018)

tv · comedy · drama

United States

Survive Style 5+

Survive Style 5+ (2004)

comedy · fantasy · horror

Japan · Gen Sekiguchi

Suzhou River

Suzhou River (2000)

drama · romance

Germany · Ye Lou

Taegukgi

Taegukgi (2004)

action · drama · war

South Korea · Kang Je-kyu

Talk to Her

Talk to Her (2002)

drama · mystery · romance

Spain · Pedro Almodóvar

Taxi Driver

Taxi Driver (2017)

action · drama · history

South Korea · Hun Jang

Ted Lasso

Ted Lasso (2020)

tv · comedy · drama · sport

United States

Terminal List

Terminal List (2022)

tv · action · drama · thriller

United States

Terminator

Terminator (1984)

action · adventure · sci-fi

United Kingdom · James Cameron

Tetsuo: The Iron Man

Tetsuo: The Iron Man (1989)

horror · sci-fi

Japan · Shin'ya Tsukamoto

The 8 Show

The 8 Show (2024)

tv · comedy · drama · horror

South Korea

The Americans

The Americans (2013)

tv · crime · drama · mystery

United States

The Beekeeper

The Beekeeper (2024)

action · crime · thriller

United Kingdom · David Ayer

The Boys

The Boys (2019)

tv · action · comedy · crime

United States

The Bridge (Broen/Bron)

The Bridge (Broen/Bron) (2011)

tv · crime · mystery · thriller

Sweden

The Brothers Sun

The Brothers Sun (2024)

tv · action · comedy · drama

United States

The Cabin in the Woods

The Cabin in the Woods (2011)

horror · mystery · thriller

Canada · Drew Goddard

The Detour

The Detour (2016)

tv · adventure · comedy

United States

The Electric State

The Electric State (2025)

action · adventure · comedy

United States · Anthony Russo

The Empty Man

The Empty Man (2020)

drama · horror · mystery

United States · David Prior

The End of the F***ing World

The End of the F***ing World (2017)

tv · adventure · comedy · crime

United Kingdom

The Expanse

The Expanse (2015)

tv · drama · mystery · sci-fi

United States

The Fall of the House of Usher

The Fall of the House of Usher (2023)

tv · drama · horror · mystery

United States

The Glory

The Glory (2022)

tv · drama · mystery · thriller

South Korea

The Good The Bad The Weird

The Good The Bad The Weird (2008)

action · adventure · comedy

South Korea · Kim Jee-woon

The Handmaiden

The Handmaiden (2016)

drama · romance · thriller

South Korea · Park Chan-wook

The Head

The Head (2020)

tv · drama · horror · mystery

Spain

The Holdovers

The Holdovers (2023)

comedy · drama

United States · Alexander Payne

The Host

The Host (2006)

drama · horror · sci-fi

South Korea · Bong Joon Ho

The Killer

The Killer (1989)

action · crime · drama

Hong Kong · John Woo

The Killing

The Killing (2007)

tv · crime · drama · mystery

Denmark

The Last Kingdom

The Last Kingdom (2015)

tv · action · drama · history

United Kingdom

The Last of Us

The Last of Us (2023)

tv · action · adventure · drama

Canada

The Lazarus Project

The Lazarus Project (2022)

tv · action · drama · fantasy

United Kingdom

The Leftovers

The Leftovers (2014)

tv · drama · fantasy · mystery

United States

The Legend of Vox Machina

The Legend of Vox Machina (2022)

tv · animation · action · adventure

United States

The Letdown

The Letdown (2017)

tv · comedy

Australia

The Man from Nowhere

The Man from Nowhere (2010)

action · crime · drama

South Korea · Lee Jeong-beom

The Matrix

The Matrix (1999)

action · sci-fi

United States · Lana Wachowski

The Night Comes for Us

The Night Comes for Us (2018)

action · crime · thriller

Indonesia · Timo Tjahjanto

The Other Two

The Other Two (2019)

tv · comedy

United States

The Outsider

The Outsider (2020)

tv · crime · drama · horror

United States

The Pitt

The Pitt (2025)

tv · drama

United States

The Queen's Gambit

The Queen's Gambit (2020)

tv · drama

United States

The Raid

The Raid (2011)

action · crime · thriller

Indonesia · Gareth Evans

The Raid 2

The Raid 2 (2014)

action · crime · thriller

Indonesia · Gareth Evans

The Running Man

The Running Man (1987)

action · sci-fi · thriller

United States · Paul Michael Glaser

The Shield

The Shield (2002)

tv · crime · drama · thriller

United States

The Sopranos

The Sopranos (1999)

tv · crime · drama

United States

The Taste of Things

The Taste of Things (2023)

drama · history · romance

France · Anh Hung Tran

The Tower

The Tower (2021)

tv · crime · drama · mystery

United Kingdom

The Town

The Town (2010)

crime · drama · thriller

United States · Ben Affleck

The Umbrella Academy

The Umbrella Academy (2019)

tv · action · adventure · comedy

United States

The Wire

The Wire (2002)

tv · crime · drama · thriller

United States

The Zone of Interest

The Zone of Interest (2023)

drama · history · war

United Kingdom · Jonathan Glazer

Three Colors: Blue

Three Colors: Blue (1993)

drama · music · mystery

France · Krzysztof Kieslowski

Three Colors: Red

Three Colors: Red (1994)

drama · mystery · romance

France · Krzysztof Kieslowski

Three Colors: White

Three Colors: White (1994)

comedy · drama · romance

France · Krzysztof Kieslowski

Tokyo Vice

Tokyo Vice (2022)

tv · crime · drama · thriller

Japan

Tom Yum Goong (The Protector)

Tom Yum Goong (The Protector) (2005)

action · crime · drama

Thailand · Prachya Pinkaew

Total Recall

Total Recall (1990)

action · adventure · sci-fi

United States · Paul Verhoeven

Trapped

Trapped (2015)

tv · crime · drama · mystery

Iceland

Tron

Tron (1982)

action · adventure · sci-fi

United States · Steven Lisberger

Tumbbad

Tumbbad (2018)

drama · fantasy · horror

India · Rahi Anil Barve

Upgrade

Upgrade (2018)

action · sci-fi · thriller

United States · Leigh Whannell

Us and Them

Us and Them (2018)

drama · romance

China · Rene Liu

Utopia

Utopia (2013)

tv · drama · mystery · sci-fi

United Kingdom

Violet Evergarden: The Movie

Violet Evergarden: The Movie (2020)

animation · drama · fantasy

Japan · Taichi Ishidate

Volver

Volver (2006)

comedy · drama

Spain · Pedro Almodóvar

Warped Forest

Warped Forest (2011)

comedy · fantasy

Japan · Shunichirô Miki

Warrior

Warrior (2019)

tv · action · crime · drama

United States

Wayward Pines

Wayward Pines (2015)

tv · drama · horror · mystery

United States

Weeds

Weeds (2005)

tv · comedy · crime · drama

United States

Westworld

Westworld (2016)

tv · drama · mystery · sci-fi

United States

Wild Goose Lake

Wild Goose Lake (2019)

crime · drama

China · Yi'nan Diao

Wind River

Wind River (2017)

crime · drama · mystery

United Kingdom · Taylor Sheridan

Winter's Bone

Winter's Bone (2010)

crime · drama · mystery

United States · Debra Granik

Yellowjackets

Yellowjackets (2021)

tv · drama · mystery · thriller

United States

You

You (2018)

tv · crime · drama · romance

United States

Yu Yu Hakusho

Yu Yu Hakusho (2023)

tv · action · adventure · comedy

Japan

Zero Zero Zero

Zero Zero Zero (2020)

tv · crime · drama · thriller

Italy

]]>
Thu, 29 Jan 2026 00:00:00 GMT
Introducing Kitty Cards https://xenodium.com/introducing-kitty-cards https://xenodium.com/introducing-kitty-cards Back in 2023, I toyed with the relevant iOS dev tools needed to create a custom Tesco Clubcard pkpass, and even showed how to scan a QR code from our beloved Emacs (of course).

Neither my friend Vaarnan nor I are strangers to the iOS ecosystem, yet we both agreed the above approach wasn't very practical (for neither devs nor the average iOS user). So we figured we should have a crack at it.

While there are some ready-made solutions out there, they often require downloading additional iOS apps or working through clunky web interfaces. We just wanted a simpler way to create our own Apple Wallet cards, and so Kitty Cards (kitty.cards) was born: no app download or sign-in required.

Hopefully not much to explain. From kitty.cards, customize a card, press the Add to Apple Wallet button, and Bobs your uncle.

Hope you enjoy Kitty Cards!

]]>
Fri, 23 Jan 2026 00:00:00 GMT
Bending Emacs - Episode 10: agent-shell https://xenodium.com/bending-emacs-episode-10-agent-shell https://xenodium.com/bending-emacs-episode-10-agent-shell I've just uploaded a new Bending Emacs episode:

Bending Emacs Episode 10: agent-shell

You may have seen some of my previous posts on agent-shell, a package I built offering a uniform user experience across a diverse set of agents. In this video, I showcase the main agent-shell features. I had lots to cover, so the video is on the longer side of things.

I've showcased much of the content in previous agent-shell posts, so I'll just share links to those instead:

Hope you enjoyed the video!

Want more videos?

Liked the video? Please let me know. Got feedback? Leave me some comments.

Please go like my video, share with others, and subscribe to my channel.

If there's enough interest, I'll continue making more videos!

]]>
Fri, 16 Jan 2026 00:00:00 GMT
Bending Emacs - Episode 9: World times https://xenodium.com/bending-emacs-episode-9-world-times https://xenodium.com/bending-emacs-episode-9-world-times A new year, a new Bending Emacs episode, so here it goes:

Bending Emacs Episode 9: Time around the world

Emacs comes with a built-in world clock: M-x world-clock

To customize displayed timezones, use:

(setq world-clock-list '(("America/New_York" "New York")
                         ("America/Caracas" "Caracas")
                         ("Europe/London" "London")
                         ("Asia/Tokyo" "Tokyo")))

Each entry requires a valid timezone string (as per entries in your system's /usr/share/zoneinfo) and a display label.

I wanted a slightly different experience than the built-in command (more details here), so I built the time-zones package.

time-zones is available on MELPA, so you can install with:

(use-package time-zones :ensure t)

Toggle help with the "?" key add cities with the "+" key. Shifting time is possible via the "f" / "b" keys, in addition to a other features available via the "?" help menu.

Hope you enjoyed the video!

Want more videos?

Liked the video? Please let me know. Got feedback? Leave me some comments.

Please go like my video, share with others, and subscribe to my channel.

If there's enough interest, I'll continue making more videos!

Make it all sustainable

Enjoying this content or my projects? I am an indie dev. Help make it sustainable by ✨sponsoring

Need a blog? I can help with that. Maybe buy my iOS apps too ;)

]]>
Tue, 06 Jan 2026 00:00:00 GMT
My 2025 review as an indie dev https://xenodium.com/my-2025-review-as-an-indie-dev https://xenodium.com/my-2025-review-as-an-indie-dev In 2024, I took the leap to go indie full-time. By 2025, that shift enabled me to focus exclusively on building tools I care about, from a blogging platform, iOS apps, and macOS utilities, to Emacs packages. It also gave me the space to write regularly, covering topics like Emacs tips, development tutorials for macOS and iOS, a few cooking detours, and even launching a new YouTube channel.

The rest of this post walks through some of the highlights from 2025. If you’ve found my work useful, please consider sponsoring.

Off we go…

Launched a new blogging service

For well over a decade, my blogging setup consisted of a handful of Elisp functions cobbled together over the years. While they did the job just fine, I couldn't shake the feeling that I could do better, and maybe even offer a blogging platform without the yucky bits of the modern web. At the beginning of the year, I launched LMNO.lol. Today, my xenodium.com blog proudly runs on LMNO.lol.

LMNO.lol blogs render pretty much anywhere (Emacs and terminals included, of course).

2026 is a great year to start a blog! Custom domains totally welcome.

A journaling/note-taking app that feels like tweeting

Sure, there are plenty of journaling and note-taking apps out there. For one reason or another, none of them stuck for me (including my own apps). That is, until I learned a thing or two from social media.

With that in mind, Journelly was born: like tweeting, but for your eyes only. With the right user experience, I felt compelled to write things down all the time. Saving to Markdown and Org markup was the mighty sweet cherry on the cake.

Journelly app icon
Download on App Store button link

Let's learn Japanese

As a Japanese language learning noob, what better way to procrastinate than by building yet another Kana-practicing iOS app? Turns out, it kinda did the job.

Here's mochi invaders, a fun way to practice your Kana

Mochi Invaders app icon
Download on App Store button link

A new Emacs-native AI/LLM agent (powered by ACP)

2025 brought us the likes of Claude Code, Gemini CLI, Goose, Codex, and many more AI/LLM CLI agents. While CLI utilities have their appeal, I wanted a native Emacs integration, so I simply ignored agents for quite some time.

I was initially tempted to write my own Emacs agent, but ultimately decided against it. My hope was that agent providers would somehow converge to offer editor integration, so I could focus on building an Emacs integration while leveraging the solid work from many teams producing agents. With LLM APIs historically fragmented, my hope for agent convergence seemed fairly far-fetched.

To my surprise, ACP (Agent Client Protocol) was announced by Zed and Google folks. This was the cue I had been waiting for, so I set out to build acp.el, a UX agnostic elisp library, followed by an actual client: agent-shell.

I'm fairly happy with how agent-shell's been shaping up. This is my most popular package from 2025, receiving lots of user feedback. If you're curious about the feature-set, I've written about agent-shell's progress from early on:

chatgpt-shell improvements

While agent-shell is the new kid on the block, chatgpt-shell received DeepSeek, Open Router, Kagi, and Perplexity support, in addition to a handful of other improvements and bugfixes.

A new YouTube channel

While most of what I share usually ends up as a blog post, this year I decided to try something new. I started the Bending Emacs YouTube channel and posted 8 episodes:

Enjoying the content? Leave me a comment or subscribe to my channel.

My decade with org (Emacs Carnival)

While I enthusiastically joined the Emacs Carnival, I didn't quite manage monthly posts. Having said that, when I did participate, I went all in, documenting my org experience over the last decade. Ok well… I also joined in with my elevator pitch ;)

Awesome Emacs on macOS

While migrating workflows to Emacs makes them extra portable across platforms, I've also accumulated a bunch of tweaks enhancing your Emacs experience on macOS.

EverTime for macOS

While we're talking macOS, I typically like my desktop free from distractions, which includes hiding the status bar.

Having said that, I don't want to lose track of time, and for that, I built EverTime, an ever-present floating clock (available via Homebrew).

A new time zone Emacs package

Emacs ships with a perfectly functional world clock, available via M-x world-clock, but I wanted a little more, so I built time-zones.

Also covered in:

A new WhatsApp Emacs client

For better or worse, I rely on WhatsApp Messenger. Migrating to a different client or protocol just isn't viable for me, so I did the next best thing and built wasabi, an Emacs client ;)

While not a trivial task, wuzapi and whatsmeow offered a huge leg up. I wanted tighter Emacs integration, so I upstreamed a handful of patches to add JSON-RPC support, plus easier macOS installation via Homebrew.

Details covered in a couple of posts:

Spiff that shell up

While both macOS and iOS offer APIs for generating URL previews, they also let you fetch rich page metadata. I built rinku, a tiny command-line utility, and showed how to wire it all up via eshell for a nifty shell experience.

With similar eshell magic, you can also get a neat cat experience.

At one with your code

I always liked the idea of generating some sort of art or graphics from a code base, so I built one, a utility to transform images into character art using text from your codebase. Also covered in a short blog post.

Screencast converting image to source code art

Emacs can trim your videos too

Emacs is just about the perfect porcelain for command-line utilities. With little ceremony, you can integrate almost any CLI tool. Magit remains the gold standard for CLI integration.

While trimming videos doesn't typically spring to mind as an Emacs use case, I was pleasantly surprised by the possibilities.

Landing Emacs patches upstream

While I've built my fair share of Emacs packages, I'm still fairly new at submitting Emacs features upstream. This year, I landed my send-to (aka sharing on macOS) patch. While the proposal did spark quite the discussion, I'm glad I stuck with it. Both Eli and Stefan were amazingly helpful.

This year, I also wanted to experiment with dictating into my Emacs text buffers, but unfortunately dictation had regressed in Emacs 30.

Bummer. But hey, it gave me a new opportunity to submit another patch upstream.

Ready Player improvements

Ready Player, my Emacs media-playing package received further improvements like starring media (via Emacs bookmarks), enabling further customizations, and other bug fixes. Also showcased a tour of its features.

GitHub activity

  • Commits: 1,095
  • Issues created: 37
  • PRs reviewed: 106
  • Average commits per day: ~3

New GitHub projects

  • EverTime - An ever present clock for macOS
  • acp.el - An ACP implementation in Emacs lisp
  • agent-shell - A native Emacs buffer to interact with LLM agents powered by ACP
  • diverted - Identify temporary Emacs diversions and return to original location
  • emacs-materialized-theme - An Emacs theme derived from Material
  • homebrew-evertime - EverTime formula for the Homebrew package manager
  • homebrew-one - Homebrew recipe for one
  • homebrew-rinku - Homebrew recipe for rinku
  • one - Transform images into character art using text from your codebase
  • rinku - Generate link previews from the command line (macOS)
  • time-zones - View time at any city across the world in Emacs
  • video-trimmer - A video-trimming utility for Emacs
  • wasabi - A WhatsApp Emacs client powered by wuzapi and whatsmeow

Blog posts

Hope you enjoyed my 2025 contributions. Sponsor the work.

]]>
Tue, 30 Dec 2025 00:00:00 GMT
Journelly 1.3 released: Hello Markdown! https://xenodium.com/journelly-1-3-released https://xenodium.com/journelly-1-3-released

download-on-app-store.png

Journelly 1.3 available on the App Store


What is Journelly?

Journelly feels like tweeting but for your eyes only.

A fresh take on frictionless note-taking or journaling for iOS, powered by plain text (Markdown + Org).

  • Save cooking recipes, movies, music, restaurants, coffee shops…
  • Jot down your thoughts.
  • Save your favorite quotes.
  • Use it as a journal, memo book, or notes.
  • Write your shopping lists.
  • Document your travels.
  • Lots more…

Check out journelly.com for details.

What's new?

Journelly v1.3 brings Markdown support (the most requested feature), along with Simplified Chinese localization and other enhancements.

Markdown support

Journelly first launched with Org markup support, popular among Emacs enthusiasts. Markdown support has by far been the most requested feature. Thank you to everyone who reached out, shared your interest, and helped beta test early builds.

Whether you're a fan of Markdown or Org-mode, Journelly now lets you store entries in your preferred format. Choose your favorite markup on first launch or via the app menu.

welcome.png

So you like Markdown things?

While on topic, I also run lmno.lol, a Markdown-powered blogging service. Simple and focused, without the frustrating parts of the modern web. Custom domains welcome. My xenodium.com blog runs off lmno.lol.

Simplified Chinese (简体中文)

Simplified Chinese (简体中文) is now available, joining Journelly's list of supported languages:

  • Simplified Chinese (简体中文)
  • Danish
  • Dutch
  • English
  • Finnish
  • French
  • German
  • Italian
  • Japanese
  • Norwegian
  • Spanish
  • Swedish

Home Screen Widget

A home screen widget is now available, offering quick access to three key actions right from the home screen.

widget.png

Discoverable mode

Prefer clear buttons over swipe gestures? You can now enable Discoverable Mode under “Menu > View.” This new mode makes features more visible and easier to navigate, perfect for folks favoring more explicit interaction over gestures or subtle hints.

discoverable-mode.gif

Org rendering

For Org users: Journelly now renders both quote and code blocks.

blocks.png

Tidying the list up

The entry list received a little refresh to make better use of screen space. Bottom-aligned controls also make for easier one-handed use.

Love Journelly? I need your help

Since launch, Journelly has remained a single-payment app. No subscriptions. I get it, subscriptions are no fun.

That said, sustainable development is tough without regular downloads. I'm hoping the new Markdown support helps Journelly reach a wider audience.

Help Journelly grow:

Thank you

Hope you enjoy the v1.3 update.

Thank you for using Journelly and supporting indie development 💛💙❤️

]]>
Sun, 21 Dec 2025 00:00:00 GMT
agent-shell 0.25 updates https://xenodium.com/agent-shell-0-25-updates https://xenodium.com/agent-shell-0-25-updates It's been a little while since the last agent-shell blog post detailing changes, so we're naturally due another one detailing the latest features.

What's agent-shell?

A native Emacs shell to interact with any LLM agent powered by ACP (Agent Client Protocol).

Sponsor agent-shell

So what's new?

Let's go through the latest changes…

Viewport/compose (experimental)

The biggest change is the new experimental viewport/compose mode. While agent-shell's comint shell experience has its benefits, some folks may opt for a more familiar buffer experience, that is less shell-like.

There are perhaps 3 defining characteristics in the new viewport/compose feature:

A dedicated compose buffer: You get a full, multiline buffer dedicated to crafting prompts. I personally find this mode of operation more natural (no need to watch out for accidental submissions via RET), but also opens up the possibility to enable your favourite minor modes that may not play nice with comint. You can launch compose buffers via M-x agent-shell-prompt-compose, edit your prompt, and when you're ready, submit with the familiar C-c C-c binding.

Viewport: I've experimented with shell viewports before and also added a similar experience to chatgpt-shell. This compose/viewport UX quickly became my primary way of interacting with non-agent LLMs. This is a read-only buffer typically displaying the latest agent interaction. Use n/p to navigate through current interaction items. Use f/b to switch through pages/interactions.

Auto-modal: Compose and viewport modes complement each other and offer automatic transition between read-only and editable (compose) buffers. From a viewport, you can always press r to reply to the latest interaction. When replying, you automatically go into edit/compose mode. When submitting via C-c C-c, you automatically transition into viewport (read-only) mode.

While you can use M-x agent-shell-prompt-compose at any time to compose multi-line prompts and send from the shell, to get the compose/viewport hybrid experience, you need to enable with (setq agent-shell-prefer-viewport-interaction t). From then on, M-x agent-shell will favor the compose/viewport experience. You can always jump between viewport and shell with C-c C-o.

Prompt queueing (experimental)

agent-shell buffers now offer the ability to queue additional prompts if the agent is busy. Use M-x agent-shell-queue-request and M-x agent-shell-remove-pending-request to queue and remove requests.

Session model/mode

You can now change models via M-x agent-shell-set-session-model (C-c C-v), when supported by the agent.

For Anthropic users, we now have agent-shell-anthropic-default-model-id and agent-shell-anthropic-default-session-mode-id to set default agent model and modes. You can view available values by expanding shell handshake items.

If keen on using defaults for a different agent, please file a feature request.

Set preferred agent

By default, launching via M-x agent-shell prompts users to select one of the supported agents. You can now skip this by setting your preferred agent (thank you Jonathan).

(setq agent-shell-new-shell-config (agent-shell-anthropic-make-claude-code-config))

Automatic transcripts

While shell-maker automatically prompts users to save content when killing agent-shell buffers, its integration was a little clunky with agents. Elle Najt's agent-shell-specific implementation is now enable by default, saving Markdown transcripts to project/.agent-shell/transcripts. When launching new shells, you should see a message like:

Created project/.agent-shell/transcripts/2025-12-17-22-07-38.md

You can always open the current transcript via M-x agent-shell-open-transcript.

To disable the new transcript generation use:

(setq agent-shell-transcript-file-path-function nil)

MCP servers

Jonathan Jin introduced agent-shell-mcp-servers, enabling folks to add MCP servers to their agents.

For example:

(setq agent-shell-mcp-servers
      '(((name . "notion")
         (type . "http")
         (headers . [])
         (url . "https://mcp.notion.com/mcp"))))

Buffer search

You can now search across shell nodes, including collapsed ones. When using isearch (swiper too), matching nodes are now automatically expanded.

DWIM context

When invoking M-x agent-shell, active region, flymake errors, dired and image buffers are now automatically considered and brought over to agent-shell buffers to be included while crafting prompts.

There's one more. From a viewport buffer, selecting a region and pressing "r" (for reply) brings the selection over to the compose buffer as blockquoted text.

Cursor support (migrated to Mike Moore's adapter)

We've migrated Cursor agent support to use Mike Moore's ACP Adapter.

Install with:

npm install -g @blowmage/cursor-agent-acp

New related packages

Bug fixes

  • #106: Use replace-buffer-contents instead of erase-buffer/insert
  • #127: No longer possible to select the Anthropic model used by Claude Code
  • #142: [bug] Crash during message streaming: markdown overlay receives nil positions
  • #143: gemini 0.17.1 requires authMethod to authenticate (fix by Andrea)
  • #144: Make collapsible indicator keymap customizable
  • #145: Unable to enter Plan Mode until after first message is sent
  • #150: Warning (undo): Buffer 'Codex Agent @ …' undo info was 25664948 bytes long
  • #154: Gemini CLI doesn't need authorization if already logged in

Pull requests

Thank you to all contributors for these improvements!

Lots of other work ❤️😅

Beyond what's showcased, much love and effort's been poured into polishing the agent-shell experience. Interested in the nitty-gritty? Have a look through the 122 commits since the last blog post.

Make the work sustainable

If agent-shell or acp.el are useful to you, please consider sponsoring development. LLM tokens aren't free, and neither is the time dedicated to building this stuff ;-)

]]>
Sat, 20 Dec 2025 00:00:00 GMT
Bending Emacs - Episode 8: completing-read https://xenodium.com/bending-emacs-episode-8-completing-read https://xenodium.com/bending-emacs-episode-8-completing-read Nearly a couple of weeks since the last Bending Emacs episode, so here's a new episode:

Bending Emacs Episode 8: completing-read

In this video, we take a look at the humble but mighty completing-read function. We can use it to craft our purpose-built tools, whether in pure elisp or to interact with command-line utilities.

Of interest, I also highlighted the great elisp-demos package, which extends your help buffers with sample snippets.

Here are some of the completing-read snippets we played with:

Pick a queen:

(completing-read "Pick a Queen: "
                 '("Queen of Hearts ♥"
                   "Queen of Spades ♠"
                   "Queen of Clubs ♣"
                   "Queen of Diamonds ♦")
                 ;; predicate
                 nil
                 ;; require match
                 t)

Our own hashing function with an algo picker:

(defun misc/hash-region ()
  (interactive)
  (message "Hash: %s" (secure-hash (intern (completing-read
                                            "Hash type: "
                                            '(md5 sha1 sha224 sha256 sha384 sha512)))
                                   (current-buffer)
                                   (when (use-region-p)
                                     (region-beginning))
                                   (when (use-region-p)
                                     (region-end)))))

A first look at integrating completing read with a CLI util:

(completing-read "Select file: "
                 (string-split (shell-command-to-string "ls -1 ../") "\n"))

Also got creative with BluetoothConnector on macOS and completing-read.

(completing-read "Toggle BT connection: "
                 (mapcar (lambda (device)
                           ;; Extract device name
                           (nth 1 (split-string device " - ")))
                         (seq-filter
                          (lambda (line)
                            ;; Keep lines like: af-8c-3b-b1-99-af - Device name
                            (string-match-p "^[0-9a-f]\\{2\\}" line))
                          (split-string (shell-command-to-string "BluetoothConnector") "\n"))))

Some of my completing-read uses:

Want more videos?

Liked the video? Please let me know. Got feedback? Leave me some comments.

Please go like my video, share with others, and subscribe to my channel.

If there's enough interest, I'll continue making more videos!

Make it all sustainable

Enjoying this content or my projects? I am an indie dev. Help make it sustainable by ✨sponsoring

Need a blog? I can help with that. Maybe buy my iOS apps too ;)

]]>
Sat, 13 Dec 2025 00:00:00 GMT
At one with your code https://xenodium.com/at-one-with-your-code https://xenodium.com/at-one-with-your-code While in the mood to goof around with Emacs, CLI, and image rendering, I've revised an idea to generate some sort of art from your codebase (or any text really). That is, given an image, generate a textual representation, potentially using source code as input.

With that, here's one: a utility to transform images into character art using text from your codebase.

Rather than tell you more about it, best to see it in action.

Screencast converting image to source code art

Just a bit of fun. That's all there is to it.

While I've only run it on macOS, one's written in Go, so should be fairly portable. I'd love to know if you get it running on Linux. The code's on GitHub.

If you're on macOS, I've added a Homebrew on GitHub, so you should just be able to install with:

brew install --HEAD xenodium/one/one

Make it all sustainable

Having fun with one? Enjoying this blog or my projects? I am an 👉 indie dev 👈. Help make it sustainable by ✨sponsoring

Need a blog? I can help with that. Maybe buy my iOS apps too ;)

]]>
Tue, 02 Dec 2025 00:00:00 GMT
Bending Emacs - Episode 7: Eshell built-in commands https://xenodium.com/bending-emacs-episode-7-eshell-built-in-commands https://xenodium.com/bending-emacs-episode-7-eshell-built-in-commands With my recent rinku post and Bending Emacs episode 6 both fresh in mind, I figured I may as well make another Bending Emacs episode, so here we are:

Bending Emacs Episode 7: Eshell built-in commands

Check out the rinku post for a rundown of things covered in the video.

Want more videos?

Liked the video? Please let me know. Got feedback? Leave me some comments.

Please go like my video, share with others, and subscribe to my channel.

If there's enough interest, I'll continue making more videos!

Make it all sustainable

Enjoying this content or my projects? I am an indie dev. Help make it sustainable by ✨sponsoring

Need a blog? I can help with that. Maybe buy my iOS apps too ;)

]]>
Sun, 30 Nov 2025 00:00:00 GMT
Rinku: CLI link previews https://xenodium.com/rinku-cli-link-previews https://xenodium.com/rinku-cli-link-previews In my last Bending Emacs episode, I talked about overlays and used them to render link previews in an Emacs buffer.

While the overlays merely render an image, the actual link preview image is generated by rinku, a tiny command line utility I built recently.

Rinku leverages macOS APIs to do the actual heavy lifting, rendering/capturing a view off screen, and saving to disk. Similarly, it can fetch preview metadata, also saving the related thumbnail to disk. In both cases, rinku outputs to JSON.

By default, rinku fetches metadata for you.

rinku https://soundcloud.com/shehackedyou

Returns:

{
  "title": "she hacked you",
  "url": "https://soundcloud.com/shehackedyou",
  "image": "path/to/preview.png"
}

In this instance, the image looks a little something like this:

Metadata thumbnail of SoundCloud link

On the other hand, the --render flag generates a preview, very much like the ones you see in native macOS and iOS apps.

rinku --render https://soundcloud.com/shehackedyou

Returns:

{
  "image": "path/to/preview.png"
}

Similarly, the preview renders as follows:

Rendered preview of SoundCloud link

Eshell superpowers

While overlays is one way to integrate rinku anywhere in Emacs, I had been meaning to look into what I can do for eshell in particular. Eshell is just another buffer, and while overlays could do the job, I wanted a shell-like experience. After all, I already knew we can echo images into an eshell buffer.

Before getting to rinku on eshell, there's a related hack I'd been meaning to get to for some time… While we're all likely familiar with the cat command, I remember being a little surprised to find that eshell offers an alternative cat elisp implementation. Surprised too? Go check it!

$ which cat
eshell/cat is a native-comp-function in ‘em-unix.el’.

Where am I going with this? Well, if eshell's cat command is an elisp implementation, we know its internals are up for grabs, so we can technically extend it to display images too. eshell/cat is just another function, so we can advice it to add image superpowers.

I was pleasantly surprised at how little code was needed. It basically scans for image arguments to handle within advice and otherwise delegates to eshell's original cat implementation.

(defun adviced:eshell/cat (orig-fun &rest args)
  "Like `eshell/cat' but with image support."
  (if (seq-every-p (lambda (arg)
                     (and (stringp arg)
                          (file-exists-p arg)
                          (image-supported-file-p arg)))
                   args)
      (with-temp-buffer
        (insert "\n")
        (dolist (path args)
          (let ((spec (create-image
                       (expand-file-name path)
                       (image-type-from-file-name path)
                       nil :max-width 350
                       :conversion (lambda (data) data))))
            (image-flush spec)
            (insert-image spec))
          (insert "\n"))
        (insert "\n")
        (buffer-string))
    (apply orig-fun args)))

(advice-add #'eshell/cat :around #'adviced:eshell/cat)

And with that, we can see our freshly powered-up cat command in action:

By now, you may wonder why the cat detour when the post was really about rinku? You see, this is Emacs, and everything compounds! We can now leverage our revamped cat command to give similar eshell superpowers to rinku, by merely adding an eshell/rinku function.

As we now know, rinku outputs things to JSON, so we can use json-read-from-string to parse the process output and subsequently feed the image path to eshell/cat. rinku can also output link titles, so we can show that too whenever possible.

(defun eshell/rinku (&rest args)
  "Fetch link preview with rinku and display image inline.

Usage: rinku https://soundcloud.com/shehackedyou
       rinku --render https://soundcloud.com/shehackedyou"
  (unless args
    (error "rinku: no arguments provided"))
  (let* ((output (with-temp-buffer
                   (apply #'call-process "rinku" nil t nil args)
                   (buffer-string)))
         (metadata (condition-case nil
                       (json-read-from-string output)
                     (error nil))))
    (if metadata
        (concat
         (if (map-elt metadata 'image)
             (eshell/cat (map-elt metadata 'image))
           "\n")
         (when (map-elt metadata 'title)
           (concat (map-elt metadata 'title)
                   "\n\n")))
      output)))

With that, we can see the lot in action:

While non-Emacs users are often puzzled by how frequently we bring user flows and integrations on to our beloved editor, once you learn a little elisp, you start realising how relatively easily things can integrate with one another and pretty much everything is up for grabs.

Make it all sustainable

Reckon rinku and these tips will be useful to you? Enjoying this blog or my projects? I am an 👉 indie dev 👈. Help make it sustainable by ✨sponsoring

Need a blog? I can help with that. Maybe buy my iOS apps too ;)

]]>
Sat, 29 Nov 2025 00:00:00 GMT
Bending Emacs - Episode 6: Overlays https://xenodium.com/bending-emacs-episode-6-overlays https://xenodium.com/bending-emacs-episode-6-overlays The Bending Emacs series continues with a new a new episode.

Bending Emacs Episode 6: Overlays

Today we had a quick intro to overlays. Here's the snippet I used for adding snippets:

(save-excursion
  (goto-char (point-min))
  (when (search-forward "Hello World" nil t)
    (let* ((start (match-beginning 0))
           (end (match-end 0))
           (ov (make-overlay start end)))
      (overlay-put ov 'face '(:box (:line-width 1 :color "yellow")))
      ;; (overlay-put ov 'face 'underline)
      ;; (overlay-put ov 'face 'highlight)
      ;; (overlay-put ov 'before-string "🔥 ")
      ;; (overlay-put ov 'after-string  " 🚀")
      ;; (overlay-put ov 'display  "Howdy Planet")
      ;; (overlay-put ov 'invisible t)
      ;; (overlay-put ov 'help-echo "Yay overlay!")
      ;; (overlay-put ov 'mouse-face 'success)
      (overlay-put ov 'category 'overlays)
      (overlay-put ov 'evaporate t)
      ov)))

Similarly, this is what we used for removing the overlay.

(remove-overlays (point-min) (point-max)
                 'category 'overlays)

Of the experiments, you can find:

Hope you enjoyed the video!

Want more videos?

Liked the video? Please let me know. Got feedback? Leave me some comments.

Please go like my video, share with others, and subscribe to my channel.

If there's enough interest, I'll continue making more videos!

Make it all sustainable

Enjoying this content or my projects? I am an indie dev. Help make it sustainable by ✨sponsoring

Need a blog? I can help with that. Maybe buy my iOS apps too ;)

]]>
Thu, 27 Nov 2025 00:00:00 GMT
WhatsApp from you know where https://xenodium.com/whatsapp-from-you-know-where https://xenodium.com/whatsapp-from-you-know-where While there are plenty of messaging alternatives out there, for better or worse, WhatsApp remains a necessity for some of us.

With that in mind, I looked for ways to bring WhatsApp messaging to the comfort of my beloved text editor.

As mentioned in my initial findings, WhatsApp on Emacs is totally doable with the help of wuzapi and whatsmeow, which offer a huge leg up.

Wasabi joins the chat

Today, I introduce a super early version of Wasabi, a native Emacs interface for WhatsApp messaging.

Chats view Chat view

Simple install as a feature/goal

I wanted Wasabi installation/setup to be as simple as possible. Ideally, you install a single Emacs package and off you go.

While leveraging XMPP is rather appealing in reusing existing Emacs messaging packages, I felt setting up a WhatsApp gateway or related infrastructure to be somewhat at odds with wasabi's simple installation goal. Having said that, wuzapi/whatsmeow offer a great middle ground. You install a single binary dependency, along with wasabi, and you're ready to go. This isn't too different from the git + magit combo.

As of now, wasabi's installation/setup boils down to two steps if you're on macOS:

(use-package wasabi
  :ensure t
  :vc (:url "https://github.com/xenodium/wasabi" :branch "main"))
brew install asternic/wuzapi/wuzapi

While you may try Homebrew on Linux, you're likely to prefer your native package manager. If that fails, building wuzapi from source is also an option.

Upstreaming wuzapi patches

While wuzapi runs as a RESTful API service + webhooks, I wanted to simplify the Emacs integration by using json-rpc over standard I/O, enabling us to leverage incoming json-rpc notifications in place of webhooks.

I floated the idea of adding json-rpc to wuzapi to wuzapi's author Nicolas, and to my delight, he was keen on it. He's now merged my initial proof of concept, and I followed up with a handful of additional patches (all merged now):

Early days - But give it a try!

With the latest Wasabi Emacs package and wuzapi binary, you now get the initial WhatsApp experience I've been working towards. At present, you can send/receive messages to/from 1:1 or group chats. You can also download/view images as well as videos. Viewing reactions is also supported.

Needless to say, you may find some initial rough edges in addition to missing features. Having said that, I'd love to hear your feedback and experience. As mentioned Wasabi is currently available on GitHub.

Reckon Wasabi is worth it?

I've now put in quite a bit of effort prototyping things, upstreaming changes to wuzapi, and building the first iteration of wasabi. I gotta say, it feels great to be able to quickly message and catch up with different chats from the comfort of Emacs. Having said that, it's taken a lot of work to get here and will require plenty more to get to a polished and featureful experience.

Since going full-time indie dev, I have the flexibility to work on projects of choice, but that's only to an extent. If I cannot make the project sustainable, I'll eventually move to work on something else that is.

If you're keen on Wasabi's offering, please consider sponsoring the effort, and please reach out to voice your interest (Mastodon / Twitter / Reddit / Bluesky).

Reckon a WhatsApp Emacs client would help you stay focused at work (less time on your phone)? Ask your employer to sponsor it too ;-)

]]>
Mon, 24 Nov 2025 00:00:00 GMT
Want a WhatsApp Emacs client? Will you fund it? https://xenodium.com/want-a-whatsapp-emacs-client https://xenodium.com/want-a-whatsapp-emacs-client Like it or not, WhatsApp is a necessity for some of us. I wish it weren't the case, but here we are.

Given the circumstances, I wish I could use WhatsApp a little more on my terms. And by that, I mean from an Emacs client, of course. Surely I'm not the only one who feels this way, right? Right?! Fortunately, I'm not alone.

With that in mind, I've been hard at work prototyping, exploring what's feasible. Spoiler alert: it's totally possible, though will require a fair bit of work.

Thankfully, two wonderful projects offer a huge leg up: wuzapi and whatsmeow.

wuzapi offers a REST API on top of whatsmeow, a Go library leveraging WhatsApp's multi-device web API.

Last week, I prototyped sending a WhatsApp message using wuzapi's REST API.

I got there fairly quickly by onboarding myself on to wuzapi using its web interface and wiring shell-maker to send an HTTP message request via curl. While these two were enough for a quick demo, they won't cut it for a polished Emacs experience.

While I can make REST work, I would like a simpler integration under the hood. REST is fine for outgoing messages, but then I need to integrate webhooks for incoming events. No biggie, can be done, but now I have to deal with two local services opening a couple of ports. Can we simplify a little? Yes we can.

You may have seen me talk about agent-shell, my Emacs package implementing Agent Client Protocol (ACP)… Why is this relevant, you may ask? Well, after building a native Emacs ACP implementation, I learned a bit about json-rpc over standard I/O. The simplicity here is that we can bring bidirectional communication to an Emacs-owned process. No need for multiple channels handling incoming vs outgoing messages.

So where's this all going?

I've been prototyping some patches on top of wuzapi to expose json-rpc over standard I/O (as an alternative to REST). This prototype goes far beyond my initial experiment with sending messages, and yet the Emacs integration is considerably simpler, not to mention looking very promising. Here's a demo showing incoming WhatsApp messages, received via json-rpc, all through a single Emacs-owned process. Look ma, no ports!

It's feasible (but still lots to do)

These early prototypes are encouraging, but we've only scratched the surface. Before you can send and receive messages, you need to onboard users to the WhatsApp Emacs client. That is, you need to create a wuzapi user, manage/connect to a session, authorize via a QR code, and more. You'll want this flow to be realiable and that's just onboarding.

From there, you'll need to manage contacts, chats, multiple message types, incoming notifications… the list goes on. That's just the Emacs side. As mentioned, I've also been patching wuzapi. My plan is to upstream these changes, rather than maintaining a fork.

Will you fund the work?

I've prototyped quite a few things now, including the onboarding experience with QR code scanning. At this point, I feel fairly optimistic about feasibility, which is all pretty exciting! But there's a bunch of work needed. Since going full-time indie dev, I have the time available (for now), but it's hard to justify this effort without aiming for some level of sustainability.

If you're interested in making this a reality, please consider sponsoring the effort, and please reach out to voice your interest (Mastodon / Twitter / Reddit / Bluesky).

Reckon a WhatsApp Emacs client would help you stay focused at work (less time on your phone)? Ask your employer to sponsor it too ;-)

]]>
Wed, 12 Nov 2025 00:00:00 GMT
Bending Emacs - Episode 5: Ready Player Mode https://xenodium.com/bending-emacs-episode-5-ready-player-mode https://xenodium.com/bending-emacs-episode-5-ready-player-mode I'm now a bit over a month into my Emacs video-making journey. Today I bring a new episode.

Bending Emacs Episode 5: Ready Player Mode

Having migrated to mostly playing offline music, in this episode I show how to use Ready Player Mode (a package I built) for this purpose.

This is what my Ready Player configuration mostly looks like:

(use-package ready-player
  :ensure t
  :custom
  (ready-player-my-media-collection-location "~/Music/Music/Media.localized/Music")
  :config
  (ready-player-mode +1))

Note that ready-player-mode adds a global C-c m, which is https://github.com/xenodium/ready-player?tab=readme-ov-file#global-key-bindingsh

On macOS, I have one additional bit to tweak button icons to use SF Symbols. You'll need to tweak your fonts too.

(set-fontset-font t nil "SF Pro Display" nil 'append)
(ready-player-macos-use-sf-symbols)

On a related blog post, I gave a tour of Ready Player Mode.

In the video, I also mentioned dired buffers are at the heard of Ready Player. My dired abstraction post shows how to programmatically craft a valid dired buffer. Spoiler alert, it's pretty simple:

(let ((default-directory "/absolute/path/to/Music/George Benson"))
  (dired '("*My fancy m3u list*"
           "Body Talk/01 Dance.mp3"
           "Body Talk/02 When Love Has Grown.mp3"
           "Body Talk/03 Plum.mp3"
           "Original Album Classics/1-01 So What.mp3"
           "Original Album Classics/1-02 The Gentle Rain (From the Film, _The Gentle Rain_).mp3"
           "Original Album Classics/1-03 All Clear.mp3"
           "The Shape Of Things To Come/01 Footin' It.mp3"
           "The Shape Of Things To Come/02 Face It Boy It's Over.mp3"
           "The Shape Of Things To Come/03 Shape Of Things To Come.mp3")))

Hope you enjoyed the video!

Want more videos?

Liked the video? Please let me know. Got feedback? Leave me some comments.

Please go like my video, share with others, and subscribe to my channel.

If there's enough interest, I'll continue making more videos!

Make it all sustainable

Enjoying this content or my projects? I am an indie dev. Help make it sustainable by ✨sponsoring

Need a blog? I can help with that. Maybe buy my iOS apps too ;)

]]>
Wed, 05 Nov 2025 00:00:00 GMT
agent-shell 0.17 improvements + MELPA https://xenodium.com/agent-shell-016-improvements-melpa https://xenodium.com/agent-shell-016-improvements-melpa While it's only been a few weeks since the last agent-shell post, there are plenty of new updates to share.

What's agent-shell again? A native Emacs shell to interact with any LLM agent powered by ACP (Agent Client Protocol).

Thank you sponsors

Before getting to the latest and greatest, I'd like to say thank you to new and existing sponsors backing my projects.

While the work going in remains largely unsustainable, your contributions are indeed helping me get closer to sustainability. Thank you!

If you benefit from my content and projects, please consider sponsoring to make the work sustainable.

More productive at work?

Work paying for your LLM tokens and other tools? Why not get your employer to sponsor agent-shell also?

MELPA

Now on to the very first update… Both agent-shell and acp.el are now available on MELPA. As such, agent-shell installation now boils down to:

(use-package agent-shell :ensure t)

New providers

OpenCode and Qwen Code are two of the latest agents to join agent-shell. Both accessible via M-x agent-shell and M-x agent-shell-new-shell through the agent picker, but also directly from M-x agent-shell-opencode-start-agent and M-x agent-shell-qwen-start.

Send files - Thanks to Ian Davidson

Adding files as context has seen quite a few improvements in different shapes. Thank you Ian Davidson for contributing embedded context support.

Send screenshots

Invoke M-x agent-shell-send-screenshot to take a screenshot and automatically send it over to agent-shell.

Activity Indicator

A little side-note, did you notice the activity indicator in the header bar? Yep. That's new too.

@ completion (experimental)

While @ file completion remains experimental, you can enable via:

(setq agent-shell-file-completion-enabled t)

Send files or regions

From any file you can now invoke M-x agent-shell-send-file to send the current file to agent-shell. If region is selected, region information is sent also. Fancy sending a different file other than current one? Invoke M-x agent-shell-send-file with C-u prefix, or just use M-x agent-shell-send-other-file.

Send dired files

M-x agent-shell-send-file, also operates on dired files (selection or region), DWIM style ;-)

Shorter paths in titles

You may have noticed paths in section titles are no longer displayed as absolute paths. We're shortening those relative to project roots.

Shell creation / handling

While you can invoke M-x agent-shell with C-u prefix to create new shells, M-x agent-shell-new-shell is now available (and more discoverable than C-u).

Cancelling sessions

Cancelling prompt sessions (via C-c C-c) is much more reliable now. If you experienced a shell getting stuck after cancelling a session, that's because we were missing part of the protocol implementation. This is now implemented.

Shell commands

Use the new M-x agent-shell-insert-shell-command-output to automatically insert shell (ie. bash) command output.

Markdown transcripts (experimental) - Thanks to Elle Najt

Initial work for automatically saving markdown transcripts is now in place. We're still iterating on it, but if keen to try things out, you can enable as follows:

(setq agent-shell--transcript-file-path-function #'agent-shell--default-transcript-file-path)

Configuration

Turn off ASCII welcome banners

(setq agent-shell-show-welcome-message nil)

Turn off graphical header

Text header

(setq agent-shell-header-style 'text)

No header

(setq agent-shell-header-style nil)

Inline display of historical changes - Thanks to Elle Najt

Applied changes are now displayed inline.

Session mode - Thanks to Elle Najt

The new M-x agent-shell-cycle-session-mode and M-x agent-shell-set-session-mode can now be used to change the session mode.

Agent capabilities

You can now find out what capabilities and session modes are supported by your agent. Expand either of the two sections.

Accepting/rejecting changes from diff buffer

Tired of pressing q and y to accept changes from the diff buffer? Now just press y from the diff viewer to accept all hunks.

Same goes for rejecting. No more q and n. Now just press C-c C-c from the diff buffer.

Transient menu

We get a new basic transient menu. Currently available via M-x agent-shell-help-menu.

Contributions

We got lots of awesome pull requests from wonderful folks. Thank you for your contributions!

  • Arthur Heymans: Add a Package-Requires header (PR).
  • Elle Najt: Execute commands in devcontainer (PR).
  • Elle Najt: Fix Write tool diff preview for new files (PR).
  • Elle Najt: Inline display of historical changes (PR).
  • Elle Najt: Live Markdown transcripts (PR).
  • Elle Najt: Prompt session mode cycling and modeline display (PR).
  • Fritz Grabo: Devcontainer fallback workspace (PR).
  • Guilherme Pires: Codex subscription auth (PR).
  • Hordur Freyr Yngvason: Make qwen authentication optional (PR).
  • Ian Davidson: Embedded context support (PR).
  • Julian Hirn: Fix quick-diff window restoration for full-screen (PR).
  • Ruslan Kamashev: Hide header line altogether (PR).
  • festive-onion: Show Planning mode more reliably (PR).

Lots of other work ❤️😅

Beyond what's been showcased here, much love and effort's been poured into polishing the agent-shell experience. Interested in the nitty-gritty? Have a look through the 173 commits since the last blog post.

Support this work

If agent-shell or acp.el are useful to you, please consider sponsoring its development. LLM tokens aren't free, and neither is the time dedicated to building this stuff ;-)

]]>
Tue, 04 Nov 2025 00:00:00 GMT
time-zones now on MELPA. Do I have your support? https://xenodium.com/time-zones-now-on-melpa https://xenodium.com/time-zones-now-on-melpa A little over a week ago, I introduced time-zones, an Emacs utility to easily check city times around the world. Today, I'm happy to report, the package has been accepted into MELPA.

It's been wonderful to see how well time-zones was received on Reddit.

✓ You asked for MELPA publishing and I delivered.

✓ You asked for DST display and I delivered.

✓ You asked for a UTC picker and I delivered.

✓ You asked for UTC offset display and I delivered.

✓ You asked for Windows support and I delivered.

✓ You asked for help and bug fixes and I delivered.

Will you make the work sustainable?

Bringing features and improving our beloved text editor takes time and effort. time-zones isn't my first package, I've also published a bunch of Emacs packages. Will you help make this work sustainable?

]]>
Mon, 27 Oct 2025 00:00:00 GMT
Bending Emacs - Episode 4: Batch renaming files https://xenodium.com/bending-emacs-episode-4-batch-renaming-files https://xenodium.com/bending-emacs-episode-4-batch-renaming-files I'm now a few weeks into my Bending Emacs series. Today I share a new episode.

Bending Emacs Episode 4: Batch renaming files

In this video, I show a few ways of batch renaming files.

The covered flows are:

Want more videos?

Liked the video? Please let me know. Got feedback? Leave me some comments.

Please go like my video, share with others, and subscribe to my channel.

If there's enough interest, I'll continue making more videos!

Make it all sustainable

Enjoying this content or my projects? I am an indie dev. Help make it sustainable by ✨sponsoring

Need a blog? I can help with that. Maybe buy my iOS apps too ;)

]]>
Thu, 23 Oct 2025 00:00:00 GMT
Emacs time-zones https://xenodium.com/emacs-time-zones-mode https://xenodium.com/emacs-time-zones-mode Emacs ships with a perfectly functional world clock, available via M-x world-clock. Having said that, there are two things I wish it had:

  1. A quick way to interactively add any city (bonus points for fuzzy search).
  2. An easy way to shift the time back and forth.

As far as I can tell, these are neither available nor possible on the built-in world-clock (please correct me if otherwise), so when my friend across the world recently asked me for the best time to meet, I knew this was the last nudge I needed to get this done.

With that, I give you M-x time-zones (now on GitHub).

There isn't much to talk about other than time-zones accomplishes the above tasks very easily without resorting to writing elisp nor accessing via customize, which I seldom use.

As I mentioned, time-zones is on GitHub if you'd like to give it a spin. It's super fresh, so please report any issues. Hope you like it.

Make it all sustainable

Reckon time-zones will be useful to you? Enjoying this blog or my projects? I am an indie dev. Help make it sustainable by ✨sponsoring

Need a blog? I can help with that. Maybe buy my iOS apps too ;)

]]>
Sun, 19 Oct 2025 00:00:00 GMT
Bending Emacs - Episode 3: Git clone (the lazy way) https://xenodium.com/bending-emacs-episode-3-git-clone-the-lazy-way https://xenodium.com/bending-emacs-episode-3-git-clone-the-lazy-way Continuing on the Bending Emacs series, today I share a new episode.

Bending Emacs Episode 03: Git clone (the lazy way)

In this video, I show my latest iteration on an expedited git clone flow.

If this topic sounds familiar, I covered it back in 2020 with my clone git repo from clipboard post.

My git clone flow consists of copying a git repo URL to the clipboard and subsequently invoking M-x dwim-shell-commands-git-clone-clipboard-url. Everything else is taken care of for you.

I've revisited this git clone command and added a couple of improvements:

  • Configurability (via dwim-shell-commands-git-clone-dirs). For example:

    (setq dwim-shell-commands-git-clone-dirs
          '("~/Downloads"
            "~/Desktop"))
    
  • Optional prefixes to change function behavior

    • C-u: Pick target location dwim-shell-commands-git-clone-dirs.
    • C-u C-u: Pick any directory.
  • Automatically place point/cursor at README file.

I was going to post the snippet here, though may as well point you over to GitHub where dwim-shell-commands-git-clone-clipboard-url is more likely to remain up-to-date.

Note that dwim-shell-commands-git-clone-dirs is now optionally available as part of my dwim-shell-command package.

Want more videos?

Liked the video? Please let me know. Got feedback? Leave me some comments.

Please go like my video, share with others, and subscribe to my channel.

If there's enough interest, I'll continue making more videos!

]]>
Wed, 15 Oct 2025 00:00:00 GMT
agent-shell 0.5 improvements https://xenodium.com/agent-shell-0-5-improvements https://xenodium.com/agent-shell-0-5-improvements While it's only been a few weeks since introducing Emacs agent-shell, we've landed nearly 100 commits and enough improvements to warrant a new blog post.

More agents

agent-shell now includes support for two additional ACP-capable agents:

  • Claude Code
  • Codex via codex-acp (new)
  • Gemini CLI
  • Goose (new)

Unified entry point

In addition to starting new shells via agent-specific commands, we now have a unified M-x agent-shell entry point, enabling selection from a list of supported agents.

The agent-specific commands remain available as usual:

  • M-x agent-shell-anthropic-start-claude-code
  • M-x agent-shell-openai-start-codex
  • M-x agent-shell-google-start-gemini
  • M-x agent-shell-goose-start-agent

Toggling display

agent-shell now provides basic control to toggle display of shell buffers:

  • M-x agent-shell-toggle: Toggles display of the most recently accessed agent (per project).
  • agent-shell-display-action: Controls how agent shells are displayed when activated.

agent-shell-sidebar (new package)

While agent-shell provides basic display toggling, Calum MacRae offers a comprehensive sidebar package. Check out agent-shell-sidebar.

Experimental dev container support (thanks to Fritz Grabo)

agent-shell now has experimental support for running agents inside dev containers. See docs.

quick-diff improvements

quick-diff buffers, proposing changes, get a more polished experience. More notably, diffs get context (thanks to David J. Rosenbaum), single-key patch navigation/acceptance, and file names now displayed in header line.

Environment variables

Environment variables can now be loaded from either the Emacs environment, .env files, and/or overridden inline:

(setq agent-shell-anthropic-claude-environment
      (agent-shell-make-environment-variables
       :inherit-env t
       :load-env "~/.env"
       "CUSTOM_VAR" "custom_value"))

Authentication methods

Different authentication methods are now supported. For example:

;; Login-based auth
(setq agent-shell-anthropic-authentication
      (agent-shell-anthropic-make-authentication :login t))

;; API key auth
(setq agent-shell-anthropic-authentication
      (agent-shell-anthropic-make-authentication
       :api-key (lambda () (auth-source-pass-get "secret" "anthropic-api-key"))))

Check agent-shell-*-authentication per provider, as available options may differ.

UX polish

On the smaller side, but also contributing to overall polish:

  • Single-key permission bindings (y/n/!).
  • Improved error messages.
  • Improved task status rendering.
  • Improved TAB navigation.

Traffic inspection and debugging

While not technically part of agent-shell, acp.el's traffic inspection has been getting some love to help users diagnose issues.

Contributions

Thank you for your contributions!

  • David J. Rosenbaum: Context support in diffs (PR).
  • Fritz Grabo: Dev container support (PR).
  • Grant Surlyn: Doom Emacs installation instructions (PR).
  • Mark A. Hershberger: Goose key improvement (PR).
  • Ruslan Kamashev: Customization group fix (PR).

Sponsors

Thank you to all sponsors. While LLMs aren't everyone's cup of tea, we're seeing editors across the board evolving to accommodate these new LLM tools. In a somewhat similar vein, LSP integration wasn't for everyone, but for those who did want it, Emacs luckily catered to them. Thank you for helping make this project sustainable while also enabling Emacs to cater to all.

Support this work

If agent-shell or acp.el are useful to you, consider sponsoring its development. LLM tokens aren't free, and neither is the time dedicated to building this stuff ;-)

]]>
Sun, 12 Oct 2025 00:00:00 GMT
Bending Emacs - Episode 2: From vanilla to your flavor https://xenodium.com/bending-emacs-episode-2 https://xenodium.com/bending-emacs-episode-2 While still finding my footing making Emacs videos, today I'm sharing my second video.

Bending Emacs Episode 02: From vanilla to your flavor

The video is a little longer than I intended at 14:37, so plan accordingly.

In this video, I show some of my favorite UI customizations, with additional tips and tricks along the way. Like my first video, I'm hoping you find unexpected goodies in there despite being familiar with the general topic.

Read on for all supporting material…

Evaluating elisp

Showcased a handful of ways to evaluate elisp.

  • M-x eval-last-sexp

  • M-x eval-expression

  • M-x eval-buffer

  • M-x ielm

  • M-x org-ctrl-c-ctrl-c (Evaluate org source blocks)

    Sample snippets:

    (set-face-attribute 'default nil :background "DarkSlateGray")
    
    (set-face-attribute 'default nil :background "#212121")
    

Launching a separate Emacs instance

path/to/emacs/nextstep/Emacs.app/Contents/MacOS/Emacs -Q --init-directory /tmp/secondary/.emacs.d --load path/to/other-emacs.el

other-emacs.el (minimal, almost vanilla setup):

; -*- lexical-binding: t; -*-

(server-force-delete)
(make-directory "/tmp/secondary/" t)
(setq server-socket-dir "/tmp/secondary/")
(setq server-name "emacs-server")
(server-start)

(setq package-archives
      '(("melpa" . "https://melpa.org/packages/")))

(setq package-archive-priorities
      '(("melpa" .  4)))

(require 'package)
(package-initialize)
(mapc #'package-delete (mapcar #'cadr package-alist))

(add-to-list 'custom-theme-load-path "path/to/emacs-materialized-theme")

with-other-emacs macro (ie. evaluate elisp elsewhere)

(defmacro with-other-emacs (&rest body)
  "Evaluate BODY in the current buffer of the other Emacs instance."
  `(call-process "emacsclient" nil nil nil
                 "--socket-name=/tmp/secondary/emacs-server"
                 "--eval"
                 (prin1-to-string
                  '(with-current-buffer (window-buffer (selected-window))
                     ,@body))))

Looking up functions

  • M-x describe-function (built-in).
  • M-x helpful-callable (via third-party helpful package).

Advicing org-babel-expand-body:emacs-lisp

We want to extend source blocks to accept the :other-emacs header argument as follows:

#+begin_src emacs-lisp :other-emacs t
  (message (propertize "Hello again twin" 'face '(:height 6.0)))
#+end_src

So we advice org-babel-expand-body:emacs-lisp:

(defun adviced:org-babel-expand-body:emacs-lisp:other-emacs (orig-fn body header-args)
  (if (map-elt header-args :other-emacs)
      (format "(with-other-emacs %s)" (funcall orig-fn body header-args))
    (funcall orig-fn body header-args)))

(advice-add #'org-babel-expand-body:emacs-lisp
            :around #'adviced:org-babel-expand-body:emacs-lisp:other-emacs)

UI customizations

Font (JetBrains Mono)

(set-face-attribute 'default nil
                    :height 160 ;; 16pt
                    ;; brew tap homebrew/cask-fonts && brew install --cask font-jetbrains-mono
                    :family "JetBrains Mono")

Theme (Materialized)

(load-theme 'materialized t)

Calle 24 toolbar (macOS)

(use-package calle24 :ensure t
  :config
  (calle24-install)
  (calle24-refresh-appearance)))

Hide toolbar

(tool-bar-mode -1)

Titlebar

No text in title bar

(setq-default frame-title-format "")

Transparent titlebar (macOS)

(set-frame-parameter nil 'ns-transparent-titlebar t)
(add-to-list 'default-frame-alist '(ns-transparent-titlebar . t))

Hide scrollbars

(scroll-bar-mode -1)

Mode line

Minions

(use-package minions
  :ensure t
  :custom
  (mode-line-modes-delimiters nil)
  (minions-mode-line-lighter " …")
  :config
  (minions-mode +1)
  (force-mode-line-update t))

Moody

(use-package moody
  :ensure t
  :config
  (setq-default mode-line-format
                '(""
                  mode-line-front-space
                  mode-line-client
                  mode-line-frame-identification
                  mode-line-buffer-identification
                  " "
                  mode-line-position
                  (vc-mode vc-mode)
                  (multiple-cursors-mode mc/mode-line)
                  mode-line-modes
                  mode-line-end-spaces))
  (moody-replace-mode-line-buffer-identification)
  (moody-replace-vc-mode))

Nyan Cat (of course)

(use-package nyan-mode
  :ensure t
  :custom
  (nyan-bar-length 10)
  :config
  (nyan-mode +1)))

Welcome screen

A little static welcome screen I cooked up.

(defun ar/show-welcome-buffer ()
  "Show *Welcome* buffer."
  (with-current-buffer (get-buffer-create "*Welcome*")
    (setq truncate-lines t)
    (setq cursor-type nil)
    (read-only-mode +1)
    (ar/refresh-welcome-buffer)
    (local-set-key (kbd "q") 'kill-this-buffer)
    (add-hook 'window-size-change-functions
              (lambda (_frame)
                (ar/refresh-welcome-buffer)) nil t)
    (add-hook 'window-configuration-change-hook
              #'ar/refresh-welcome-buffer nil t)
    (switch-to-buffer (current-buffer))))

(defun ar/refresh-welcome-buffer ()
  "Refresh welcome buffer content for WINDOW."
  (when-let* ((inhibit-read-only t)
              (welcome-buffer (get-buffer "*Welcome*"))
              (window (get-buffer-window welcome-buffer))
              (image-path "~/.emacs.d/emacs.png")
              (image (create-image image-path nil nil :max-height 300))
              (image-height (cdr (image-size image)))
              (image-width (car (image-size image)))
              (top-margin (floor (/ (- (window-height window) image-height) 2)))
              (left-margin (floor (/ (- (window-width window) image-width) 2)))
              (title "Welcome to Emacs"))
    (with-current-buffer welcome-buffer
      (erase-buffer)
      (setq mode-line-format nil)
      (goto-char (point-min))
      (insert (make-string top-margin ?\n))
      (insert (make-string left-margin ?\ ))
      (insert-image image)
      (insert "\n\n\n")
      (insert (make-string (- (floor (/ (- (window-width window) (string-width title)) 2)) 1) ?\ ))
      (insert (propertize title 'face '(:height 1.2))))))

(ar/show-welcome-buffer)

Want more videos?

Liked the video? Please let me know. Got feedback? Leave me some comments.

Please go like my video, share with others, and subscribe to my channel.

If there's enough interest, I'll continue making more videos!

]]>
Wed, 08 Oct 2025 00:00:00 GMT
Bending Emacs - Episode 1: Applying CLI utils https://xenodium.com/bending-emacs-episode-1 https://xenodium.com/bending-emacs-episode-1 While most of the content I share is typically covered in blog posts, I'm trying something new.

Today, I'll share my first episode of Bending Emacs. This video focuses on how I like to apply (or batch-apply) command line utilities.

While the video focuses on applying command line utilities, here's a list of all the things I used:

  1. Org mode for the presentation itself.
  2. ffmpeg does the heavy lifting converting videos to gifs.
  3. Asked Claude for the relevant ffmpeg command via chatgpt-shell's M-x chatgpt-shell-prompt-compose.
  4. Browsed the video directory via dired mode.
  5. Previewed video thumbnails via ready-player mode.
  6. Previewed gifs via image mode's M-x image-toggle-animation.
  7. Validated the ffmpeg command via eshell.
  8. Applied a DWIM shell command via M-x dwim-shell-command.
  9. Duplicated files from dired via M-x dwim-shell-commands-duplicate.

Want more videos?

Liked the video? Please let me know. Got feedback? Leave me some comments.

Please go like my video, share with others, and subscribe to my channel.

If there's enough interest, I'll make more videos!

]]>
Tue, 30 Sep 2025 00:00:00 GMT
Introducing Emacs agent-shell (powered by ACP) https://xenodium.com/introducing-agent-shell https://xenodium.com/introducing-agent-shell Not long ago, I introduced acp.el, an Emacs lisp implementation of ACP (Agent Client Protocol), the agent protocol developed between Zed and Google folks.

While I've been happily accessing LLMs from my beloved text editor via chatgpt-shell (a multi-model package I built), I've been fairly slow on the AI agents uptake. Probably a severe case of old-man-shouts-at-cloud sorta thing, but hey I want well-integrated tools in my text editor. When I heard of ACP, I knew this was the thing I was waiting for to play around with agents.

With an early acp.el client library in place, I set out to build an Emacs-native agent integration… Today, I have an initial version of agent-shell I can share.

agent-shell is a native Emacs shell, powered by comint-mode (check out Mickey's comint article btw). As such, we don't have to dance between char and line modes to interact with things. agent-shell is just a regular Emacs buffer like any other you're used to.

Agent-agnostic

Thanks to ACP, we can now build agent-agnostic experiences by simply configuring our clients to communicate with their respective agents using a common protocol. As users, we benefit from a single, consistent experience, powered by any agent of our choice.

Configuring different agents from agent-shell boils down which agent we want running in the comms process. Here's an example of Gemini CLI vs Claude Code configuration:

(defun agent-shell-start-gemini-agent ()
  "Start an interactive Gemini CLI agent shell."
  (interactive)
  (agent-shell--start
   :new-session t
   :mode-line-name "Gemini"
   :buffer-name "Gemini"
   :shell-prompt "Gemini> "
   :shell-prompt-regexp "Gemini> "
   :needs-authentication t
   :authenticate-request-maker (lambda ()
                                 (acp-make-authenticate-request :method-id "gemini-api-key"))
   :client-maker (lambda ()
                   (acp-make-client :command "gemini"
                                    :command-params '("--experimental-acp")
                                    :environment-variables (list (format "GEMINI_API_KEY=%s" (agent-shell-google-key)))))))
(defun agent-shell-start-claude-code-agent ()
  "Start an interactive Claude Code agent shell."
  (interactive)
  (agent-shell--start
   :new-session t
   :mode-line-name "Claude Code"
   :buffer-name "Claude Code"
   :shell-prompt "Claude Code> "
   :shell-prompt-regexp "Claude Code> "
   :client-maker (lambda ()
                   (acp-make-client :command "claude-code-acp"
                                    :environment-variables (list (format "ANTHROPIC_API_KEY=%s" (agent-shell-anthropic-key)))))))

I've yet to try other agents. If you get another agent running, I'd love to hear about it. Maybe submit a pull request?

Traffic

While I've been relying on my acp.el client library, I'm still fairly new to the protocol. I often inspect traffic to see what's going on. After staring at json for far too long, I figured I may as well build some tooling around acp.el to make my life easier. I added a traffic buffer for that. From agent-shell, you can invoke it via M-x agent-shell-view-traffic.

Fake agents

Developing agent-shell against paid agents got expensive quickly. Not only expensive, but my edit-compile-run cycle also became boringly slow waiting for agents. While I knew I wanted some sort of fake agent to work against, I didn't want to craft the fake traffic myself. Remember that traffic buffer I showed ya? Well, I can now save that traffic to disk and replay it later. This enabled me to run problematic sessions once and quickly replay multiple times to fix things. While re-playing has its quirks and limitations, it's done the job for now.

You can see a Claude Code session below, followed by its replayed counterpart via fake infrastructure.

What's next

Getting here took quite a bit of work. Having said that, it's only a start. I myself need to get more familiar with agent usage and evolve the package UX however it feels most natural within its new habitat. Lately, I've been experimenting with a quick diff buffer, driven by n/p keys, shown along the permission dialog.

#+ATTR_HTML: :width 99%

While I've implemented enough parts of the Agent Client Protocol Schema to make the package useful, it's hardly complete. I've yet to fully familiarize myself with most protocol features.

Take them for a spin

Both of my new Emacs packages, agent-shell and acp.el, are now available on GitHub. As an agent user, go straight to agent-shell. If you're a package author and would like to build an ACP experience, then give acp.el a try. Both packages are brand new and may have rough edges. Be sure to file bugs or feature requests as needed.

Paying for LLM tokens? How about sponsoring your Emacs tools?

I've been heads down, working on these packages for some time. If you're using cloud LLM services, you're likely already paying for tokens. If you find my work useful, please consider routing some of those coins to help fund it. Maybe my tools make you more productive at work? Ask your employer to support the work. These packages not only take time and effort, but also cost me money. Help fund the work.

]]>
Thu, 25 Sep 2025 00:00:00 GMT
Introducing acp.el https://xenodium.com/introducing-acpel https://xenodium.com/introducing-acpel I recently shared my early Emacs experiments with ACP, the Agent Client Protocol now supported by Gemini CLI and Claude Code LLM agents.

While we can already run these agents from Emacs with the likes of vterm, I'm keen to offer an Emacs-native alternative to drive them. To do that, I'm working an a new package: agent-shell (more on this to be shared soon). While this new Emacs agent shell has an opinionated user experience, it uses ACP under the hood. Being a protocol, it's entirely UI-agnostic. For this, I now have an early version available of the acp.el library.

acp.el implements Agent Client Protocol for Emacs lisp as per agentclientprotocol.com. While this library is in its infancy, it's enabling me to carry on with my agent-shell work. acp.el lives as a separate library, is UI-agnostic, and can be used by Emacs package authors to build the their desired ACP-powered agent experience.

You can instantiate an ACP client and send a request as follows:

(setq client (acp-make-client :command "gemini"
                              :command-params '("--experimental-acp")
                              :environment-variables (when api-key
                                                       (list (format "GEMINI_API_KEY=%s" "your-api-key")))))

(acp-send-request
 :client client
 :request (acp-make-initialize-request :protocol-version 1)
 :on-success (lambda (response)
               (message "Initialize success: %s" response))
 :on-failure (lambda (error)
               (message "Initialize failed: %s" error)))
((protocolVersion . 1)
 (authMethods . [((id . oauth-personal)
                  (name . Log in with Google)
                  (description . :null))
                 ((id . gemini-api-key)
                  (name . Use Gemini API key)
                  (description . Requires setting the `GEMINI_API_KEY` environment variable))
                 ((id . vertex-ai)
                  (name . Vertex AI)
                  (description . :null))])
 (agentCapabilities (loadSession . :false)
                    (promptCapabilities (image . t)
                                        (audio . t)
                                        (embeddedContext . t))))

I'm new at using ACP myself, so I've added a special logging buffer to acp.el which enables me to inspect traffic and learn about the exchanges between clients and agents. You can enable logging with:

(setq acp-logging-enabled t)

Look out for the *acp traffic* buffer, which looks a little like this:

If you're keen to experiment with ACP in Emacs lisp and build agent-agnostic packages, take a look at acp.el (now on GitHub). As mentioned, it's early days for this library, but it's a start. Please file issues and feature requests. If you build anything on top of acp.el, lemme know. I'd love to see it in action.

Make this work possible

I'm working on two new Emacs packages: acp.el (introduced in this post) and agent-shell (I'll soon share more about that). Please help me make development of these packages sustainable. These packages take time and effort, but also cost me money as I have to pay for LLM tokens throughout testing and development. Please help fund it.

]]>
Sun, 14 Sep 2025 00:00:00 GMT
So you want ACP (Agent Client Protocol) for Emacs? https://xenodium.com/so-you-want-acp-for-emacs https://xenodium.com/so-you-want-acp-for-emacs Last week, I was delighted to see the Zed editor shipping beta support for their Claude Code integration. Being an Emacs enthusiast, you may wonder about my excitement. In their demo, the Zed team mentioned the integration is now possible thanks to Agent Client Protocol (ACP), which they developed in collaboration with Google. This is great news for Emacs users, as it opens the possibilities for deeper native agent integrations in our beloved editor. You can think of ACP as LSP but for LLM agents.

While I have a bunch of LLM models integrated into chatgpt-shell (including local ones), I've yet to make much headway into enabling the models to access smarter context (ie. filesystem or local tools), beyond my initial tool calling experiment.

Somehow, I wasn't super excited about tool calling, as it felt like these integrations would fall short when compared to more advanced agents like Anthropic's Claude Code or Google's Gemini CLI. In fact, I haven't been that enthusiastic about these agents, since they offered relatively little API surface to enable deeper Emacs integration (which is where I live!). That is, until ACP came along.

With ACP in mind, I'm much more likely to get on board with Emacs-agent integrations. I can now delegate all that complex agent logic to external tools and focus on building a great Emacs experience I'd be happy with.

And with that, I had an initial go at prototyping a bare minimum but with enough UX shell goodies to get me excited about it. I chose Gemini for this prototype. You can see it all in its minimal glory:

So how badly do you want ACP support in your beloved Emacs?

While getting the initials kinda working was relatively straightforward (with everything I already know about building chatgpt-shell), adding support for all ACP features with a delightfully polished Emacs experience will take a bunch of effort. While I'm excited about the prospects, dedicating a chunk of my time to make this happen isn't super feasible. You may have noticed more Emacs-related work/posts from me lately. This is currently possible because I've gone full indie dev. The flexibility is great, but doing Emacs things isn't exactly gonna help pay the bills unless interested folks help fund/support the effort.

My shell packages have quite a few enthusiastic users who more often than not, are using my package to talk to paid cloud services from the likes of OpenAI, Anthropic, or Google. I'm looking at you folks! I understand you're sending money to these companies who are providing you with a great service, but also remember the lovely Emacs integrations you use, which also need funding (much more than these well-funded commercial entities). While I'm a fan of chat-like Emacs shells for LLM/agents and would like to build a new agent shell, I also want to dedicate a chunk of this effort to building a UX-agnostic ACP Emacs library (acp.el). This library could be leveraged by me or any other Emacs package author.

So how badly do you want ACP support in your beloved Emacs? Enough to take your wallets out and help fund it?

]]>
Tue, 09 Sep 2025 00:00:00 GMT
Diverted mode https://xenodium.com/diverted-mode https://xenodium.com/diverted-mode James Dyer and I both ran into the same workflow snag when fixing source indentation. He explains it best:

  1. You’re working in a file with inconsistent indentation
  2. You want to fix the entire buffer’s formatting
  3. You run C-x h (select all) followed by M-x indent-region
  4. Your mark is now at the beginning of the buffer, disrupting your workflow

Naturally, this is Emacs and were both able to patch our editor to smoothen things out.

While I ran into the same indent-region snag after selecting an entire buffer (via mark-whole-buffer), I also faced it with mark-defun and er/expand-region (awesome package btw).

With three cases in mind, I wanted a somewhat generic solution, so I built diverted.el, a little minor mode to identify these momentary diversions and try to bring the point back to the original location. Mind you, this was back in 2019 and until James's post, I hadn't heard of anyone else running into a similar snag. Since then, I kept the package as part of my config. James's post gave me the nudge I needed to move diverted.el out of my config and into its own GitHub repo.

By default, diverted.el recognizes both mark-defun and mark-whole-buffer as diversions, but you can also recognize the likes of er/expand-region via diverted-events. I'm hoping configuring is fairly self-explanatory. To date, I only have mark-whole-buffer, mark-defun, and er/expand-region as recognized diversions.

(defcustom diverted-events
  (list
   (make-diverted-event :from 'mark-defun
                        :to 'indent-for-tab-command
                        :breadcrumb (lambda ()
                                      (diverted--pop-to-mark-command 2)))
   (make-diverted-event :from 'mark-whole-buffer
                        :to 'indent-for-tab-command
                        :breadcrumb (lambda ()
                                      (diverted--pop-to-mark-command 2))))
  "Diversion events to look for.

For example:

  (add-to-list 'diverted-events
    (make-diverted-event
      :from 'er/expand-region
      :to 'indent-for-tab-command
      :breadcrumb (lambda ()
                    (diverted--pop-to-mark-command 2))))"
  :type '(repeat sexp)
  :group 'diverted)

Read on for a little demo…

Without diverted-mode

Notice how point is left at the top of the screen after pressing TAB to indent region.

With diverted-mode

Notice how point is left where it was prior to selecting the function and pressing TAB to indent region.

That's it for today. If you want to give diverted.el a try, head over to GitHub.

Make it all sustainable

Reckon diverted-mode will be useful to you? Enjoying this blog or my projects? I am an 👉 indie dev 👈. Help make it sustainable by ✨sponsoring

Need a blog? I can help with that. Maybe buy my iOS apps too ;)

]]>
Tue, 02 Sep 2025 00:00:00 GMT
Who moved my text? https://xenodium.com/who-moved-my-text https://xenodium.com/who-moved-my-text I had an annoying chatgpt-shell bug where sometimes the compose buffer's svg header would disappear while text was streaming into the Emacs buffer. There are a number of things that could have gone rogue when streaming and post-processing buffer text, so I wasn't quite sure where to start narrowing things down.

I had a feeling I could maybe use something like after-change-functions hook to monitor changes, but that only tells me about the text modified. I wanted to know which of my functions triggered the change, so maybe I could print a few frames from the stack? So that's what I did…

(defun my-change-tracker (beg end len)
  (let ((stack (mapcar (lambda (frame)
                         (car (cdr frame)))
                       (backtrace-frames))))
    (message "Buffer %s changed: %d-%d | Stack: %s"
             (buffer-name) beg end
             (take 15 stack)))) ;; Adjust as needed

(add-hook 'after-change-functions 'my-change-tracker nil t)

Here's an extract from the logs:

Buffer claude llm (sonnet-4/Programming)> compose changed: 496-498 | Stack: (backtrace-frames mapcar let my-change-tracker insert save-excursion let save-current-buffer progn if #[(output) ((setq output (or output )) (if (buffer-live-p buffer) (progn (save-current-buffer (set-buffer buffer) (let ((inhibit-read-only t)) (save-excursion (if orig-region-active (progn (delete-region region-beginning region-end) (setq orig-region-active nil))) (goto-char marker) (insert output) (set-marker marker (+ (length output) (marker-position marker))))))))) ((region-end) (region-beginning) (orig-region-active) (marker . #<marker at 496 in *claude llm (sonnet-4/Programming)> compose*>) (buffer . claude llm (sonnet-4/Programming)> compose))] shell-maker–write-reply…

After increasing the number of logged frames, I started seeing bits of my code and… bingo! I found a very suspicious delete-region. After spotting this, fixing the bug was trivial.

While the bug was annoying, I had been procrastinating on fixing as it could have been a number of things. In this case, printing frames from after-change-functions turned out perfect for narrowing things down. I'll be keeping this in the toolbox. Maybe it can help you too.

Make it all sustainable

Learned something new? Enjoying this blog or my projects? I am an 👉 indie dev 👈. Help make it sustainable by ✨sponsoring

Need a blog? I can help with that. Maybe buy my iOS apps too ;)

]]>
Sun, 31 Aug 2025 00:00:00 GMT
Dired buffers with media overlays https://xenodium.com/dired-buffers-with-media-overlays https://xenodium.com/dired-buffers-with-media-overlays It's been well over a year now since I've moved most of my music consumption away from streaming. I started purchasing music again, just so I can play offline at any time (and on my terms). That's not so say I don't stream, but that's now purely reserved for discovery. Most playback happens via Ready Player Mode, a little Emacs player I built when I decided to take playback offline. This post isn't so much about Ready Player and more about a recent dired experience.

I had a directory with a handful of mp3s, which I wanted to split into separate album subdirectories. The challenge being the mp3 file names did not include album names. Sorting this out isn't a big task for a music-organization tool, but my brain quickly went hmmm… if dired displayed album metadata, I could just use that to quickly guide me through all the file management I needed. After all, I already know how to use ffprobe to extract relevant metadata, so I could just enhance dired's listing to also show me metadata as overlays. dired-git-info does just that.

With that, ready-player-dired-mode was born. After enabling with M-x ready-player-dired-mode, I can easily get on with my tiny file reorg without any procrastination whatsoever.

I've just pushed ready-player-dired-mode to Ready Player's GitHub repo. It's pretty fresh, so you may (or may not) encounter rough edges.

Make it all sustainable

Is Ready Player useful to you? Enjoying this blog or my projects? I am an 👉 indie dev 👈. Help make my work sustainable by ✨sponsoring

Need a blog? I can help with that. Maybe buy my macOS/iOS apps too ;)

]]>
Fri, 29 Aug 2025 00:00:00 GMT
Brisket recipe https://xenodium.com/brisket-recipe https://xenodium.com/brisket-recipe On a whim, after seeing a random brisket picture online, I decided today was the day to make my first brisket.

Ingredients

  • 15g Kosher salt (coarse)
  • 15g Black pepper (coarsely ground)
  • 10g Smoked paprika
  • 5g Chipotle powder
  • 5g Onion granules
  • 5g Garlic granules
  • 2g Cumin seeds, toasted and ground
  • 2g S&B hot mustard powder
  • 5g Brown sugar

Clean

Rinse and pat dry.

Sear

Salt both sides and sear.

Dry rub

Crush spices, mix, and apply the rub generously all over the surface of the brisket, pressing gently to ensure it adheres.

Wrap up

Wrap up in baking paper, place on tray, and wrap with foil.

Bake

Bake at 120°C. Roughly 2-3 hours per kilo.

]]>
Wed, 27 Aug 2025 00:00:00 GMT
A tiny upgrade to the LLM model picker https://xenodium.com/a-tiny-upgrade-to-the-llm-model-picker https://xenodium.com/a-tiny-upgrade-to-the-llm-model-picker A little while ago, I added an info header to chatgpt-shell's compose buffer. It displays the current model's icon, using the lovely Lobe Icons 🥨.

With that in place, it was only a matter of time until M-x chatgpt-shell-swap-model got a similar upgrade in my Emacs package. As of chatgpt-shell v2.30.1, you can get the upgrade too.

If you prefer to keep graphics out of model-picking, I got you covered. Set chatgpt-shell-show-model-icons to nil.

Make it all sustainable

Is chatgpt-shell useful to you? Enjoying this blog or my projects? I am an 👉 indie dev 👈. Help make my work sustainable by ✨sponsoring

Need a blog? I can help with that. Maybe buy my macOS/iOS apps too ;)

]]>
Mon, 25 Aug 2025 00:00:00 GMT
Emacs elevator pitch https://xenodium.com/emacs-elevator-pitch https://xenodium.com/emacs-elevator-pitch Me: Have you heard of Emacs?
Me: On the surface, it looks like a text editor…
Me: But really, it's more like a gateway to a world moulded to your needs.
Me: Emacs ships with an RPN calculator and even a doctor.
Me: Naturally, it doesn't do everything I want it to do nor how I want it to.
Me: Luckily, I can throw elisp at it and make it do things my way.

Stranger: Huh??

Me: Emacs didn't quite do all the things I wanted it to, so…
Me: I made it play music how I wanted it to.
Me: Control my operating system (1, 2, 3, 4).
Me: Help me learn Japanese.
Me: Trim videosor video screenshots.
Me: Talk to the LLM robots (1, 2).
Me: Preview SwiftUI layouts.
Me: Batch-apply all sorts of utils.
Me: Send notes to my Kindle.
Me: Tweak the debugger.
Me: Enhance my shell.

Stranger: ??!?

Me: Do what I mean.
Me: Tweak my email client (1, 2).
Me: Bring closer macOS integration (1, 2, 3, 4).
Me: Scan QR codes.
Me: Record Screencasts.
Me: Build iOS apps.
Me: Blog about all sorts of things.
Me: Tailor completion.
Me: Easily clone repos.
Me: Use my preferred eye candy.
Me: Evaluate Objective-C code.

Stranger: Sir…

Me: Write however I want.
Me: Stitch images.
Me: Make multiple cursors do what I want.
Me: Make searching smarter.
Me: Look up where I took photos.
Me: SQLite feel like a spreadsheet.
Me: Easily insert SF Symbols.
Me: Build an emotional zone.
Me: Tweak my file manager (1, 2, 3).
Me: Generate documentation.
Me: Gosh, I could keep going…

Stranger: Sir this is a Wendy's.

Emacs Carnival

This post is part of the Emacs Carnival, themed "Your Elevator Pitch for Emacs", hosted by Jeremy Friesen.

Make it all sustainable

Learned something new? Enjoying this blog or my projects? I am an 👉 indie dev 👈. Help make it sustainable by ✨sponsoring

Need a blog? I can help with that. Maybe buy my iOS apps too ;)

]]>
Wed, 20 Aug 2025 00:00:00 GMT
Emacs as your video-trimming tool https://xenodium.com/emacs-as-your-video-trimming-tool https://xenodium.com/emacs-as-your-video-trimming-tool Marcin ‘mbork’ Borkowski has a nice post showing us how he trims video clips from our beloved editor. Trimming clips is something I do from time to time, specially when posting a screencast of sorts. Since I don't need much, I typically resort to QuickTime Player's trimming functionality that ships with macOS. While it does the job, ever since I added a "graphical" seeker to Ready Player Mode, I had been meaning to build a simple video trimming tool of sorts. Marcin's post was just about the right nudge I needed to also give this a go, yielding video-trimmer-mode.

The solution relies on ffmpeg to do the heavy lifting and is roughly 300 lines of code. I was going to share the entire snippet in this post, though may as well point you to its repo. I'm likely to tweak it, so you may as well take a look at its latest incarnation.

Make it all sustainable

Find video-trimmer-mode useful? Want me to publish to MELPA? Enjoying this blog or my projects? I am an 👉 indie dev 👈. Help make my work sustainable by ✨sponsoring

Need a blog? I can help with that. Maybe buy my macOS/iOS apps too ;)

]]>
Tue, 19 Aug 2025 00:00:00 GMT
macOS dictation returns to Emacs (fix merged) https://xenodium.com/macos-dictation-returns-to-emacs-fix-merged https://xenodium.com/macos-dictation-returns-to-emacs-fix-merged macOS apps typically benefit from built-in voice dictation input (included as a macOS freebie), with little to no additional work required from app developers.

Emacs had supported this capability until relatively recently, when we began seeing reports that dictation was no longer available as of Emacs 30.

While I have no direct experience with macOS dictation-related APIs, I bisected Emacs 30 changes affecting macOS-related code (typically Objective-C code with .m file extensions). This led me to a seemingly harmless change introducing NSTextInputClient, intended to remove a deprecation warning. From that change onwards, dictation stopped working.

Reverting the change did indeed bring dictation back, but at the cost of re-introducing the deprecation warning. Looking closer at the current NSTextInputClient implementation, I noticed some stubbed-out methods. In particular, selectedRange stood out:

- (NSRange)selectedRange
{
  if (NS_KEYLOG)
    NSLog (@"selectedRange request");
  return NSMakeRange (NSNotFound, 0);
}

Turns out implementing selectedRange is all it took to bring dictation back:

diff --git a/src/nsterm.m b/src/nsterm.m
index 003aadb9782..2b34894f36e 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -7413,7 +7413,24 @@ - (NSRange)selectedRange
 {
   if (NS_KEYLOG)
     NSLog (@"selectedRange request");
-  return NSMakeRange (NSNotFound, 0);
+
+  struct window *w = XWINDOW (FRAME_SELECTED_WINDOW (emacsframe));
+  struct buffer *buf = XBUFFER (w->contents);
+  ptrdiff_t point = BUF_PT (buf);
+
+  if (NILP (BVAR (buf, mark_active)))
+    {
+      NSUInteger selection_location = point - BUF_BEGV (buf);
+      return NSMakeRange (selection_location, 0);
+    }
+
+  ptrdiff_t mark = marker_position (BVAR (buf, mark));
+  ptrdiff_t region_start = min (point, mark);
+  ptrdiff_t region_end = max (point, mark);
+  NSUInteger selection_location = region_start - BUF_BEGV (buf);
+  NSUInteger selection_length = region_end - region_start;
+
+  return NSMakeRange (selection_location, selection_length);
 }

Implementing selectedRange didn't just bring dictation back, but now leverages a newer macOS dictation implementation. You can see the slight differences in UI.

Before

After

Merged upstream

I've since submitted a patch upstream. I'm happy to report that as of today, the patch is now merged into master. Thank you Gerd Möllmann and Eli Zaretskii for your help! Also big thanks to Stephen Englen, Fritz Grabo, @veer66 and @dotemacs on the fediverse who quickly jumped in to help validate the fix.

While we've yet to find out when the next Emacs release will ship, we at least know the fix is coming! If like me, you'd like to get the fix backported to Emacs 30, I've shown you how to do just that on Emacs Plus (my favourite macOS build).

Make it all sustainable

Glad macOS dictation is fixed? Enjoying this blog or my projects? I am an 👉 indie dev 👈. Help make my work sustainable by ✨sponsoring

Need a blog? I can help with that. Maybe buy my macOS/iOS apps too ;)

]]>
Sat, 26 Jul 2025 00:00:00 GMT
Writing experience: My decade with Org https://xenodium.com/writing-experience-my-decade-with-org https://xenodium.com/writing-experience-my-decade-with-org While I missed Emacs Carnival's Take two, with this month's prompt being Writing Experience, I figured I may have a thing or two to share about my Org adoption.

Org mode is often regarded as one of the indispensable Emacs features. A Swiss army of sorts enabling outlining, presentations, task management, agenda, note-taking, blogging, literate programming, the list goes on… At its core, Org features are powered by a versatile markup. Kinda like Markdown but on steroids. When starting with Org, it's easy to feel lost in the overwhelming sea of features.

Luckily, we don't have to know or understand all of Org to get started nor ever need to. You get to pick and use what's useful to you at any given time.

Getting started

Want to get started with outlines? Easy. Let's say you wanted to start collecting python idioms, you can start with an entry like:

* Python idioms

- Prefer double quotes if escaping single quotes.
- Prefer string interpolation over join. Eg. "'%s'" % member_default.

...

That's precisely what I did when I started using Org nearly 12 years ago. I created a notes file and added my first entry to collect python 2 idioms. While the idioms may be outdated by now (who knows, it's been many years since I've written any significant amount of python code), but hey that's besides the point. I wanted to start a personal notes file and Org sounded awesome for that.

Over time, my notes file grew in usefulness. The more I wrote, the more I could recall with search. That is, until I was away from my computer. At that point, I figured I could just export my notes to HTML (via M-x org-export-dispatch) and post online. Over time, folks started reaching out about something read in my notes, and so by then I suppose I had accidentally become a blogger.

Blogging

In 12 years of "blogging", my approach hasn't changed much. I still write to the very same Org file (beware it's big) I started writing notes to. I found this approach fairly accessible, with little ceremony. When I want to write, I open the usual text file and just write. It wasn't until fairly recently I learned this is often referred to as "one big text file" (OBTF).

My HTML exporting evolved into hacky elisp cobbled together over time. While the code was nothing to rave about, it did the job just fine for well over a decade. Having said that, it was more of an "it works on my machine" sorta thing. Last year, I finally decided to change my blogging approach and built a blogging platform (in 2024?! I know right?!). Well, the modern web has led us to a sea of tracking, bloat, advertising, the list goes on… I wanted to offer a lightweight blogging alternative with none of the typical crummy bits, so I built LMNO.lol. Today, my xenodium.com blog runs off that.

Org and Markdown are friends

LMNO.lol is powered by Markdown. Wait, what? You may be wondering why an Org fan would build a blogging platform powered by a different markup? In a nutshell, reach. While I remain a faithful Org fan for its capabilities, if I want my blogging platform to appeal to more users, I can't ignore the fact that today Markdown is the prevalent format. Having said that, I wasn't about to give up on Org for personal use. I can actually have my cake and eat it too. You see, I continue writing to Org and convert to Markdown before uploading to LMNO.lol via pandoc, the Swiss Army tool of file converters.

Incremental Org adoption

Tables

As you know, my Org adoption started with a very simple outline intended for personal notes, but we know Org is a universe of its own. I soon learned about Org tables.

| name                 | job              | origin             |
|----------------------+------------------+--------------------|
| Fry                  | Delivery Boy     | Earth              |
| Bender               | Bending Unit     | Earth              |
| Leela                | Captain          | Mutant Underground |
| Professor Farnsworth | Scientist        | Earth              |
| Amy Wong             | Intern           | Mars               |
| Dr. Zoidberg         | Staff Doctor     | Decapod 10         |
| Hermes Conrad        | Bureaucrat       | Earth              |
| Zapp Brannigan       | 25-Star General  | Earth              |
| Mom                  | Owner of MomCorp | Earth              |
| Nibbler              | Leela's pet      | Planet Eternium    |

I'd keep finding really handy Org tips here and there. Like converting csv to Org by merely selecting the text from my beloved editor.

Tasks

We mentioned Org handling task management, amongst many other things. In a nutshell, tasks in Org are "simple TODO lists", using special keywords. I got started with Org tasks with something like this:

* DONE Call granny
* DONE Post on Reddit
* STARTED Procrastinate some more
* TODO Do your homework

I say "simple TODO lists" (in quotes) because Org task management is a another universe of its own. You can schedule tasks in all sorts of ways (like recurring), as habits, tag them, refile them, etc. and even get a nice agenda view to interact with.

I don’t have an agenda post on this myself, but Christian Tietze has a wonderful write-up showcasing an improved Org-mode agenda display.

Babel

Moving on from task management, I soon discovered babel, another Org super power enabling you to include code snippets. Not too different to Markdown, but I found the ability to evaluate/execute snippets and capture output pretty magical.

#+BEGIN_SRC python
  print("Hello python world")
#+END_SRC

#+RESULTS:
: Hello python world

Adding Objective-C Org babel support

At the time, I was writing a fair bit of Objective-C code but found babel support was missing. By looking at ob-C.el and ob-java.el, I figured how to add Objective-C support. Surprisingly, it took very little code and I could now execute Objective-C code just like python from the comfort of an Org buffer.

#+BEGIN_SRC objc
  #import <Foundation/Foundation.h>

  int main() {
    NSLog(@"Hello ObjC World");
    return 0;
  }
#+END_SRC

#+RESULTS:
: Hello ObjC World

Adding Org block completion

With Org code blocks (and babel superpowers), I soon found myself including lots of snippets in my notes. I tried different different input mechanisms and eventually settled on writing my own company completion backend.

company-org-block is available on GitHub and MELPA.

Later on, with Michael Eliachevitch's help, we got org-block-capf going.

Fitbit API, Org babel, and gnuplot

I continued having fun with Org babel. You can combine source blocks for different purposes, so I used it to fetch and plot Fitbit data via Gnuplot.

#+BEGIN_SRC sh :results table
curl -s -H "Authorization: Bearer TOKEN" https://api.fitbit.com/1/user/USER_ID/body/weight/date/2018-06-09/2018-07-11.json | jq '.[][] | "\(.dateTime) \(.value)"' | sed 's/"//g'
#+END_SRC

#+RESULTS: weight-data
| 2018-06-09 | 65.753 |
| 2018-06-10 | 65.762 |
...
| 2018-07-10 |  64.22 |
| 2018-07-11 |  63.95 |

#+BEGIN_SRC gnuplot :var data=weight-data :exports code :file images/fitbit-api-org-babel-and-gnuplot/weight.png
reset
set title "My recent weight"
set xdata time
set timefmt '%Y-%m-%d'
set format x "%d/%m/%y"
set term png
set xrange ['2018-06-09':'2018-07-11']
plot data u 1:2 with linespoints title 'Weight in Kg'
#+END_SRC

Adding SwiftUI Org babel support

Having learned that babel can generate images (like Gnuplot), I figured I could have fun with SwiftUI too and built ob-swiftui. Also on MELPA.

Adding Org links (DWIM style)

Notes aren't complete without links to references. I was already using a keyboard shortcut of sorts, but I figured I could make it much smarter. As in DWIM: Do what I mean. Like automatically fetching link title from the web and other things.

Scraping useful links

Comments in posts can be a great source of recommendations (someone asking for books, blogs, etc), so I figured I could get Emacs to extract all links from an online post and dump them to an org file.

Change your MAC address in Org of course

Cause you never know when you're gonna need it, I randomly saved a snippet to change your MAC address from the comfort of your Org notes. Execute via C-c C-c.

#+begin_src bash :dir /sudo::
  changeMAC() {
      local mac=$(openssl rand -hex 6 | sed 's/\(..\)/\1:/g; s/.$//')
      ifconfig en0 ether $mac
      ifconfig en0 down
      ifconfig en0 up
      echo "Your new physical address is $mac"
  }

  changeMAC
#+end_src

#+RESULTS:
: Your new physical address is b4:b2:f8:77:bb:87

By the way, noticed the :dir /sudo:: header? It enables executing the snippet as root.

Generating documentation for your Emacs package

Having built a handful of Emacs packages, maintaining a README.org documenting commands available (and keeping it up-to-date) was a bit of a chore. I figured you could automate things and generate a nice Org table documenting your package commands and customizable variables.

When you see this table in my GitHub project, you now know how it was generated.

A noweb detour: the lesser known Org babel glue

While Org babel's noweb support isn't super widely known, I learned it's great for glueing org babel blocks. I love how Org knowledge (and Emacs benefits really) just keep compounding. I started by just writing a simple Org outline. Remember?

LLMs join the babel chat

In 2023, I started experimenting with LLMs and Emacs integrations. Naturally, I had to add babel support too, so ob-chatgpt-shell (MELPA) and ob-dall-e-shell (MELPA) were added to the mix.

Smarter Org capture templates

Your knowledge base is only as useful as its wealth. The more you write, the better. And of course, the less friction, the more likely you are to write more.

Org capture is super useful to save your thoughts quickly into an Org file. You can come up with all sorts of templates to expedite the process. In addition to the base structure, I figured I could automatically capture my current location, date, time, and weather as part of a note.

Presenting in style

There are no shortages of Emacs packages leveraging Org mode to give presentations (org-present is one of many). I often enjoy David Wilson's videos. In this one, he shares his presentation setup. I figured it'd be fun to experiment with org-present to spiff things up. I wanted a sort of smart navigation where items are automatically expanded and collapsed as I <tab> my way through a presentation.

Org as lingua franca

With my Org usage growing, I felt like I was missing Org support outside of Emacs. Web access to my blog wasn't enough. I wanted to quickly capture things while on the go, so I started building iOS apps revolving around my Emacs and Org usage.

Journelly (iOS)

Journelly is my latest iOS app, centered around note-taking and journaling. The app feels like tweeting, but for your eyes only of course. It's powered by Org markup, which can be synced with Emacs via iCloud.

Flat Habits (iOS)

Org habits are handy for tracking daily habits. However, it wasn't super practical for me as I often wanted to check things off while on the go (away from Emacs). That led me to build Flat Habits.

Scratch (iOS)

While these days I'm using Journelly to jot down just about anything, before that, I built and used Scratch as scratch pad of sorts. No iCloud syncing, but needless to say, it's also powered by Org markup.

Plain Org (iOS)

For more involved writing, nothing beats Emacs Org mode. But what if I want quick access to my Org files while on the go? Plain Org is my iOS solution for that.

LMNO.lol

While I already mentioned LMNO.lol, it's been heavily inspired by my Org workflow. You write your notes or blog posts to a single plain text file, sprinkling Markdown this time around, and just drag and drop it to the web. LMNO.lol takes care of the rest.

Org bookmarks

While there is newer content out there, I did capture a handful of Org bookmarks at some point. This one took me down memory lane. Sacha Chua used make these really fun videos interviewing Emacs folks, often discussing their Emacs configs. I learned a ton from these videos. That time, Sacha interviewed Howard Abrams. Gosh, that was over 10 years ago.

Off the top of my head, Karl Voit also comes to mind, for championing Org for years. I know I'm not doing it justice. There are far too many folks I've learned from, who kindly share their knowledge. I've bookmarked some of them in the past.

Naturally, my Org journey wouldn't be possible without Org mode itself and the incredible work from the authors and maintainers. I've personally donated to their cause and even got my ex-employer to donate multiple times.

I could keep showing more things…

You could argue my Org usage is fairly random. Maybe it is. I'd say it's more organic than anything. I more or less started writing outlines and TODO lists, incrementally adopting whatever needed over time. It's up to you how much or little Org you adopt. Whatever you pick is the right answer for you. The Org feature set is just so vast. Some of the things I've tried didn't stick for me like plotting ledger reports or combating spam through Org, but by trying things I got to discover other things that probably did stick.

I could keep going, showing you more examples of the things I discovered, but in such a vast universe what's useful to me may not be useful to you. With such a diverse toolbox, it's highly likely you'll find just the right tool for your needs.

Ok, we get it. The feature set is rich. But most importantly, your data is saved in plain, transparent text, easily accessible to other tools. Heck, I even wrote my own iOS apps to view and edit Org files on the go. In over ten years of using Org, I've never lost access to my data, and I never will. That alone is the non-negotiable cherry on the cake.

Make it all sustainable

Learned something new? Enjoying this blog or my projects? I am an 👉 indie dev 👈. Help make it sustainable by ✨sponsoring

Need a blog? I can help with that. Maybe buy my iOS apps too ;)

]]>
Fri, 25 Jul 2025 00:00:00 GMT
Interactive ordering of dired items https://xenodium.com/interactive-ordering-of-dired-items https://xenodium.com/interactive-ordering-of-dired-items Redditor sauntcartas offers a nice solution for getting Emacs dired filenames in an arbitrary order. I have to say, while relatively rare, this is something I need from time to time. You see, I like to apply batch file operations from the comfort of dired buffers (via dwim-shell-command).

Take, for example, M-x dwim-shell-commands-join-images-horizontally. It does what it says on the tin. I can mark a handful of image files via dired and easily join them into a single file. The problem is that the file listing isn't always in the desired order, so this is where custom ordering comes in handy.

I wanted an interactive way of reordering dired items. While bouncing ideas with arthurno1, it led us to a drag-stuff experience, which I'm already a fan of. While drag-stuff works in most editable buffers, it breaks on dired. For now, I figured I could just write a couple of dired-specific interactive commands to provide a similar dragging experience, and so I did.

We can likely improve the commands a bit, but hey they do the job as is…

(defun ar/dired-drag-item-up ()
  "Drag dired item down in buffer."
  (interactive)
  (unless (dired-get-filename nil t)
    (error "Not a dired draggable item"))
  (when (= (line-number-at-pos) 2)
    (error "Already at top"))
  (let* ((inhibit-read-only t)
         (col (current-column))
         (item-start (line-beginning-position))
         (item-end (1+ (line-end-position)))
         (item (buffer-substring item-start item-end)))
    (delete-region item-start item-end)
    (forward-line -1)
    (beginning-of-line)
    (insert item)
    (forward-line -1)
    (move-to-column col)))

(defun ar/dired-drag-item-down ()
  "Drag dired item down in buffer."
  (interactive)
  (unless (dired-get-filename nil t)
    (error "Not a dired draggable item"))
  (when (save-excursion
          (forward-line 1)
          (eobp))
    (error "Already at bottom"))
  (let* ((inhibit-read-only t)
         (col (current-column))
         (item-start (line-beginning-position))
         (item-end (1+ (line-end-position)))
         (item (buffer-substring item-start item-end)))
    (delete-region item-start item-end)
    (forward-line 1)
    (beginning-of-line)
    (insert item)
    (forward-line -1)
    (move-to-column col)))

I gotta say, these dired dragging commands work great with M-x dwim-shell-commands-join-images-horizontally. I bind them to M-<up> and M-<down> same as drag-stuff elsewhere (already in my config).

(use-package dired
  :bind (:map dired-mode-map
              ("M-<up>" . ar/dired-drag-item-up)
              ("M-<down>" . ar/dired-drag-item-down)))

You can see the new dired commands in action.

Bonus

While bouncing ideas with arthurno1, we also came up with another helper to create new dired buffers populated from marked items, maybe needed for those times you want a more focused experience.

(defun ar/dired-from-marked-items ()
  "Create a new dired buffer containing only the marked files.

Also allow dragging items up and down via M-<up> and M-x<down>."
  (interactive)
  (let ((marked-files (dired-get-marked-files))
        (buffer-name (generate-new-buffer-name
                      (format "*%s (selection)*"
                              (file-name-nondirectory
                               (directory-file-name default-directory))))))
    (unless marked-files
      (error "No dired marked files"))
    (dired (cons buffer-name
                 (mapcar (lambda (path)
                           (file-relative-name path default-directory))
                         marked-files)))))

Make it all sustainable

Learned something new? Enjoying this blog or my projects? Help make it sustainable by ✨sponsoring

Need a blog? I can help with that. Maybe buy my iOS apps too ;)

]]>
Thu, 24 Jul 2025 00:00:00 GMT
Patching your Homebrew's Emacs Plus (macOS) https://xenodium.com/patching-your-homebrews-emacs-plus-macos https://xenodium.com/patching-your-homebrews-emacs-plus-macos Patching and building Emacs from source on macOS is fairly straightforward, but what if I'd like to patch my Emacs Plus Homebrew builds?

Let's cover both ways of patching our favourite editor…

Patching Emacs upstream sources

If you'd like to build from the master branch, you can check its sources out like so:

git clone git://git.sv.gnu.org/emacs.git
cd emacs

Next, we'll patch Emacs source as needed. For example, I recently wanted to patch src/nsterm.m to see if I could fix a macOS dictation regression introduced on Emacs 30.

diff --git a/src/nsterm.m b/src/nsterm.m
index 003aadb9782..2b34894f36e 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -7413,7 +7413,24 @@ - (NSRange)selectedRange
 {
   if (NS_KEYLOG)
     NSLog (@"selectedRange request");
-  return NSMakeRange (NSNotFound, 0);
+
+  struct window *w = XWINDOW (FRAME_SELECTED_WINDOW (emacsframe));
+  struct buffer *buf = XBUFFER (w->contents);
+  ptrdiff_t point = BUF_PT (buf);
+
+  if (NILP (BVAR (buf, mark_active)))
+    {
+      NSUInteger selection_location = point - BUF_BEGV (buf);
+      return NSMakeRange (selection_location, 0);
+    }
+
+  ptrdiff_t mark = marker_position (BVAR (buf, mark));
+  ptrdiff_t region_start = min (point, mark);
+  ptrdiff_t region_end = max (point, mark);
+  NSUInteger selection_location = region_start - BUF_BEGV (buf);
+  NSUInteger selection_length = region_end - region_start;
+
+  return NSMakeRange (selection_location, selection_length);
 }

 #if defined (NS_IMPL_COCOA) || GNUSTEP_GUI_MAJOR_VERSION > 0 || \

Now we're ready to configure and build.

./autogen.sh
./configure --with-ns --prefix="$PWD/nextstep/Emacs.app/Contents/MacOS" --enable-locallisppath="${PWD}/nextstep/Emacs.app/Contents/MacOS"
make install

We've used nextstep/Emacs.app/Contents/MacOS as our target directory, so we can test our builds from exactly there… and there you have it, your newly built Emacs.app, ready for opening.

open nextstep/Emacs.app

Patching Emacs Plus

While patching and building upstream Emacs sources as above is fairly common, patching Emacs Plus may not be as well known.

I'm a big fan of Boris Buliga's excellent Homebrew recipe and use it daily, so it makes sense for me to get acquainted with its patching capabilities.

First we check out the Emacs Plus Homebrew repo:

git clone https://github.com/d12frosted/homebrew-emacs-plus.git
cd homebrew-emacs-plus

At this point, it's worth noting Emacs Plus enables building different Emacs versions (29, 30, and even master). It extends Emacs by applying its own patches at build time. For example, if we'd like to patch Emacs 30, we'll customise the 30 build to apply our own changes.

Remember our src/nsterm.m patch above? We'll rebased it against the Emacs 30 tarball and save in the Emacs Plus patches directory:

./patches/emacs-30/dictation.patch

Next we'll need to generate a hash to complete our Emacs 30 patch details:

sha256sum ./patches/emacs-30/dictation.patch

Now we add our patch details to ./Formula/[email protected]:

local_patch "dictation", sha: "cb102525bba7385d7d85c52d31101af3d2cbbf076468dacbf505039082ec521c"

With that, we're ready to build Emacs Plus, which comes with a handy build script. I'm a fan of Valeriy Savchenko's macOS icons, so I'll throw in the optional icon flag. I should also mention Emacs Plus offers a rich catalog of app icons. Now back to building…

HOMEBREW_DEVELOPER=1 ./build 30 --with-savchenkovaleriy-big-sur-curvy-3d-icon

The build output should look a little something like the following (look out for our applied patch)

./Formula/emacs-plus-local.rb --with-savchenkovaleriy-big-sur-curvy-3d-icon
==> Fetching downloads for: emacs-plus-local
==> Fetching emacs-plus-local
==> Downloading https://ftp.gnu.org/gnu/emacs/emacs-30.1.tar.xz
Already downloaded: /Users/alvaro/Library/Caches/Homebrew/downloads/b2b29daf5d872710063495e32b8b5234c2fbfffccec82222b65e7f2b4e7fb4da--emacs-30.1.tar.xz
==> Patching
==> Applying fix-window-role.patch
==> Applying system-appearance.patch
==> Applying round-undecorated-frame.patch
==> Applying dictation.patch     <---- Our patch 🎉
==> ./autogen.sh
==> ./configure --disable-silent-rules --enable-locallisppath=/opt/homebrew/share/emacs/site-lisp --infodir=/opt/homebrew/Cellar/emacs-plus-local/30.1/share/info/emacs --with-native-compilation=aot --with-xml2 --
==> gmake
==> gmake install
==> Injecting PATH value to Emacs.app/Contents/Info.plist
Patching plist at /opt/homebrew/Cellar/emacs-plus-local/30.1/Emacs.app/Contents/Info.plist with following PATH value:


...


==> Caveats
Emacs.app was installed to:
  /opt/homebrew/opt/emacs-plus-local

To link the application to default Homebrew App location:
  osascript -e 'tell application "Finder" to make alias file to posix file "/opt/homebrew/opt/emacs-plus-local/Emacs.app" at posix file "/Applications" with properties {name:"Emacs.app"}'

Your PATH value was injected into Emacs.app/Contents/Info.plist

Report any issues to https://github.com/d12frosted/homebrew-emacs-plus

To start emacs-plus-local now and restart at login:
  brew services start emacs-plus-local
Or, if you don't want/need a background service you can just run:
  /opt/homebrew/opt/emacs-plus-local/bin/emacs --fg-daemon
==> Summary
🍺  /opt/homebrew/Cellar/emacs-plus-local/30.1: 7,470 files, 585.0MB, built in 8 minutes 59 seconds
==> Running `brew cleanup emacs-plus-local`...
Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP.
Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).
alvaro@MacBookPro homebrew-emacs-plus %  osascript -e 'tell application "Finder" to make alias file to posix file "/opt/homebrew/opt/emacs-plus-local/Emacs.app" at posix file "/Applications" with properties {name:"Emacs.app"}'

alias file Emacs.app of folder Applications of startup disk

At this point, your brand new patched Emacs Plus is ready for opening:

open /opt/homebrew/opt/emacs-plus-local/Emacs.app

Notice how Emacs.app is saved under emacs-plus-local, which is different from the default location: emacs-plus. In other words, your patched and regular builds can coexist.

I've pushed the changes to my Emacs Plus fork. If keen to take a closer look, check out the git commit. Should this change be sent to Emacs Plus in a pull request? Maybe not just yet. We'll try to get it admitted upstream first.

Now you know at least two ways of building and patching Emacs on macOS. There are more, but these are my favourite two.

Make it all sustainable

Learned something new? Enjoying this blog or my projects? Help make it sustainable by ✨sponsoring

Need a blog? I can help with that. Maybe buy my iOS apps too ;)

]]>
Wed, 23 Jul 2025 00:00:00 GMT
Emacs send-to (aka macOS sharing) merged upstream https://xenodium.com/emacs-send-to-aka-macos-sharing-merged-upstream https://xenodium.com/emacs-send-to-aka-macos-sharing-merged-upstream Back in February, I asked folks on the Fediverse if I should try to contribute native macOS sharing to Emacs upstream. While folks were keen on the sharing feature, there were reservations about whether or not a macOS-only patch would be welcome upstream.

While my chances of success sounded fairly low, I figured I had to at least try before giving up… and I have to say, I'm glad I gave it a chance. Yesterday, my patch was finally merged upstream.

That's not to say the patch did not face its challenges. The proposal sparked quite the discussion (you may need an extra large coffee to get through all messages). Frankly, my hopes of landing the patch after initial feedback quickly shrank to almost non-existent. Having said that, I really have to give huge credit and thanks to both Eli Zaretskii and Stefan Kangas for their help here. Without their steering, navigating the more turbulent parts of the discussion, I really would have had no chance of getting anywhere and simply would have just given up.

If you're wondering what was controversial about the patch, GNU guidelines discourage adding features targeting non-free operating systems before it can be made available for GNU/Linux. While the patch could be easily reworked to expose the native capabilities available for each platform, there's plenty of room for interpretation as to whether a rework is considered enough to satisfy the guideline. Most of the discussion was centered around this topic. Once the thread was refocused around shaping the patch, I received super constructive feedback and the patch was indeed reworked to cater for different platforms. We also agreed to rename the feature from "share" to "send". To my surprise, even RMS also chimed in on the patch discussion. Achievement unlocked?!

While one may or may not agree with GNU's guideline, I'm particularly grateful to the Free Software Foundation, the GNU project, and the wider open source community for building honest software that respects freedom and privacy, especially in this day and age.

I'm a huge Emacs fan. I frequently write about it, share tips/tricks, and even build/publish my own packages. In a perfect world, I would also run GNU/Linux exclusively (I did for many years), but nuance requires that I live in a mixed environment (open source + proprietary software), running macOS. I'm thankful for the parts I can control/modify (including Emacs).

When proposing my patch upstream, my intention was to offer the best possible Emacs experience for this particular feature (via native macOS APIs). In most Emacs patches, native changes aren't necessary. But for the rare instances where I'm unable to carry out all the necessary work for different platforms, I'm hoping I can work with other Emacs enthusiasts with complementary skills and strive to find common ground where my contribution raises the tide in a way that helps lift all boats (even if just a little), so to speak. That is, if I'm allowed to ;)

Emacs send-to is now accessible on the master branch via M-x context-menu-mode (right click and select "Send to…"), directly via M-x send-to, and can be applied to dired files, current buffer (with associated file), and selected text region.

File handling is configurable per platform via send-to-handlers.

(defvar-local send-to-handlers '(((:supported . send-to--ns-supported-p)
                                  (:collect . send-to--collect-items)
                                  (:send . send-to--ns-send-items))
                                 ((:supported . send-to--open-externally-supported-p)
                                  (:collect . send-to--collect-items)
                                  (:send . send-to--open-externally)))
  "A list of handlers that may be able to send files to applications or services.

Sending is handled by the first supported handler from `send-to-handlers' whose
`:supported' function returns non-nil.

Handlers are of the form:

((:supported . `is-supported-p')
 (:collect . `collect-items')
 (:send . `send-items'))

(defun is-supported-p ()
  \"Return non-nil for platform supporting send capability.\"
  ...)

(defun collect-items ()
  \"Return a list of items to be sent.

Items are strings and will be sent as text unless they are local file
paths known to exist. In these instances, files will be sent instead.\"
  ...)

(defun send-to--send-items (items)
  \"Send ITEMS.\"
  ...)")

The merged patch currently ships with two handlers. A native macOS handler, powered by NSSharingServicePicker, and a more generic one driven by the new shell-command-do-open.

With send-to-handlers now configurable, it opens up the possibility to expose all sorts of neat integrations like Android intents, KDE Connect, GSConnect, and so on… If you write a send-to-handler, I'd love to hear about it.

If you're on macOS and happen to find the new send-to's native sharing useful, you now know that exposing that little dialog took a non-trivial amount of effort, a turbulent discussion, and 5 months to land in your beloved Emacs. I'll just leave this here ;)

]]>
Sun, 20 Jul 2025 00:00:00 GMT
Mochi Invaders now on the App Store https://xenodium.com/mochi-invaders-now-on-the-app-store https://xenodium.com/mochi-invaders-now-on-the-app-store As a beginner learner of Japanese, I still need regular practice reading Kana (Hiragana and Katakana). Rather than using one of the countless existing resources, I decided to build my own little Space-Invaders-style game. No doubt I was procrastinating, but learning SpriteKit and building the app involved a fair bit of app testing, so I ended up learning while erm procrastinating. That's a win, right? Right?

As of today Mochi Invaders is available on the App Store.

Mochi Invaders app icon
Download on App Store button link

]]>
Mon, 30 Jun 2025 00:00:00 GMT
Markdown is coming to Journelly https://xenodium.com/markdown-is-coming-to-journelly https://xenodium.com/markdown-is-coming-to-journelly ✨UPDATE✨ Journelly v1.3 launched with Markdown support.

When Journelly launched, I asked users to get in touch if they were interested in Markdown support.

Since then, Markdown has by far been the most requested feature.

Today, I’m excited to share that Journelly beta builds now include initial Markdown support! If you’ve been in touch, you likely already have access. If not, let me know you’re interested.

Journelly still defaults to Org as its preferred markup, but you can now switch to Markdown from the welcome screen or the menu.

While Org is my own markup of choice, it remains fairly niche. As I work to build a sustainable iOS app as a full-time indie developer, I need to reach a wider audience, without resorting to subscriptions. Luckily, I think we can have our cake and eat it too.

Here's how I see Journelly's audience breaking down:

For anyone who just wants to write (regardless of markup)

This has always been Journelly’s main goal. I've worked hard to keep the serialization format in the background, focusing instead on delivering a smooth, friction-free experience. The primary goal: just write.

I think this is working well. Ellane's post sums it up: Journelly is the iOS Org App You’ll Love (Even if You Don’t Do Org).

If you just want a quick way to take notes or journal privately, Journelly already offers that. Adding quick notes, ideas, recipes, checklists, music, links, etc. is really easy and fast even if you don't do org (Brandon says so too).

Org mode enthusiasts

I got this one pretty well-covered also. I'm an Emacs org mode enthusiast myself and regularly share my Journelly entries between my iPhone and Mac. You don't need to take my word for it though. jcs is a seasoned Emacs enthusiast. From Irreal, he's covered Journelly pretty well. While journelly.com quotes and links to posts from happy users, I've been collecting posts from different users. I should share a post with all of them too!

Markdown enthusiasts

Which brings me back to this post: there are a lot of Markdown users out there. While Journelly’s UX has caught the interest of some Markdown fans, many prefer to stick with their favorite format. Your interest was heard! I did say, the more requests I get, the sooner I'll get Markdown support out the door, and so here we are.

You can now try Markdown support via TestFlight. I look forward to your feedback.

New to Journelly and want to join the Markdown beta? Get in touch.

]]>
Wed, 18 Jun 2025 00:00:00 GMT
EverTime available via Homebrew https://xenodium.com/evertime-available-via-homebrew https://xenodium.com/evertime-available-via-homebrew I typically like my macOS desktop free from distractions, which includes hiding the status bar.

Having said that, I don't want to lose track of time, and for that, I built a tiny ever-present floating clock.

While it's been a while since I built this clock, it's only now that I decided to make it available via Homebrew.

EverTime lives in its own GitHub repository and can be installed with:

brew install --HEAD xenodium/evertime/evertime

In addition to using EverTime, I also like enabling "Announce the time" under macOS System Settings, which announces the time every hour.

Like EverTime? Consider ✨sponsoring me✨ or buying ✨my apps✨.

]]>
Sun, 15 Jun 2025 00:00:00 GMT
Journelly 1.2 released https://xenodium.com/journelly-1-2-released https://xenodium.com/journelly-1-2-released What's new?

Journelly v1.2 focuses exclusively on improving app accessibility.

In particular:

  • Improved VoiceOver navigation and general app experience.
  • Improved edit layout when "Settings > Accessibility > Display & Text Size > Button Shapes" is enabled.

Huge thanks to Yvonne Thompson for all her help shaping this release. VoiceOver support is in way better shape as a result.

Journelly app icon
Download on App Store button link

Journelly 1.2 available on the App Store

What is Journelly?

Journelly feels like tweeting but for your eyes only.

A fresh take on frictionless note-taking for iOS, powered by Org plain text.

  • Save cooking recipes, movies, music, restaurants, coffee shops…
  • Jot down your thoughts.
  • Save your favorite quotes.
  • Use it as a journal, memo book, or notes.
  • Write your shopping lists.
  • Document your travels.
  • Lots more…

Check out journelly.com for details.

]]>
Thu, 12 Jun 2025 00:00:00 GMT
Ranking Officer now on the App Store https://xenodium.com/ranking-officer-now-on-the-app-store https://xenodium.com/ranking-officer-now-on-the-app-store With a handful of apps on the App Store, I like to keep an eye on their rankings and user reviews from around the world. I don't need much. Just a quick glance.

A few of weeks ago, it just dawned on me that my Mac's status bar is likely the perfect place to keep this glanceable information handy. And with that, I built Ranking Officer. A little utility to do just that.

I wasn't too sure if this app would make it to the App Store. To my delight, Apple reviewed and accepted on its first submission.

As of today, you can install Ranking Officer from the App Store.

download-on-app-store.png

Ranking Officer


download-on-app-store.png

You can now stay up to date on your app’s rankings and user reviews from around the world, right from your Mac's status bar.

  • Get the latest ranking and review data, updated every hour.
  • Monitor as many apps as you like (there’s no limit).
  • No login or personal details required.
  • No subscription necessary.

Just add your apps using their App Store URLs and get tracking.


Good luck with your apps!


🍀🤞⭐🎋🧧🏮🪙🐞🎰🐘

]]>
Mon, 02 Jun 2025 00:00:00 GMT
Awesome Emacs on macOS https://xenodium.com/awesome-emacs-on-macos https://xenodium.com/awesome-emacs-on-macos Update: Added macOS Trash integration.

While GNU/Linux had been my operating system of choice for many years, these days I'm primarily on macOS. Lucky for me, I spend most of my time in Emacs itself (or a web browser), making the switch between operating systems a relatively painless task.

I build iOS and macOS apps for a living, so naturally I've accumulated a handful of macOS-Emacs integrations and tweaks over time. Below are some of my favorites.

Emacs Plus

For starters, I should mention I run Emacs on macOS via the excellent Emacs Plus homebrew recipe. These are the options I use:

brew install emacs-plus@30 --with-no-frame-refocus --with-native-comp --with-savchenkovaleriy-big-sur-curvy-3d-icon

Valeriy Savchenko's icons

Valeriy Savchenko has created some wonderful macOS Emacs icons. These days, I use his curvy 3D rendered icon, which I get via Emacs Plus's --with-savchenkovaleriy-big-sur-curvy-3d-icon option.

Modifiers

It's been a long while since I've settled on using macOS's Command (⌘) as my Emacs Meta key. For that, you need:

(setq mac-command-modifier 'meta)

At the same time, I've disabled the ⌥ key to avoid inadvertent surprises.

(setq mac-option-modifier 'none)

Enabling Control-Meta(⌘)-D

After setting ⌘ as Meta key, I discovered C-M-d is not available to Emacs for binding keys. There's a little workaround:

defaults write com.apple.symbolichotkeys AppleSymbolicHotKeys -dict-add 70 '<dict><key>enabled</key><false/></dict>'

Frames

You may have noticed the --with-no-frame-refocus Emacs Plus option. I didn't like Emacs refocusing other frames when closing one, so I sent a tiny patch over to Emacs Plus, which gave us that option.

I also prefer reusing existing frames whenever possible.

(setq ns-pop-up-frames nil)

Visual tweaks

Most of my visual tweaks have been documented in my Emacs eye candy post. For macOS-specific things, read on…

It's been a while since I've added this, though vaguely remember needing it to fix mode line rendering artifacts.

(setq ns-use-srgb-colorspace nil)

I like using a transparent title bar and these two settings gave me just that:

(add-to-list 'default-frame-alist '(ns-transparent-titlebar . t))
(add-to-list 'default-frame-alist '(ns-appearance . dark))

I want a menu bar like other macOS apps, so I enable with:

(use-package menu-bar
  :config
  (menu-bar-mode +1))

Emoji picker (a freebie!)

If you got a more recent Apple keyboard, you can press the 🌐 key to insert emojis from anywhere, including Emacs. If you haven't got this key, you can always M-x ns-do-show-character-palette, which launches the very same dialog.

Also check out Charles Choi's macOS Native Emoji Picking in Emacs from the Edit Menu.

Longing long press for accents?

If you prefer Apple's long-press approach to inserting accents or other special characters, I got an Emacs version of that.

Rotate macOS display

I wanted to rotate my monitor from the comfort of M-x, so I made Emacs do it.

Open with

While there are different flavors of "open with default macOS app" commands out there (ie. crux-open-with as part of Bozhidar Batsov's crux), I wanted one that let me choose a specific macOS app.

Open in Xcode (at line number)

Shifting from Emacs to Xcode via "Open with" is simple enough, but don't you want to also visit the very same line?

SF Symbols (for work)

Apple offers SF Symbols on all their platforms, so why not enable Emacs to insert and render them?

This is particulary handy if you do any sort of iOS/macOS development, enabling you to insert SF Symbols using your favorite completion framework. I happen to remain a faithful ivy user.

SF Symbols (for fun)

Speaking of enabling SF Symbol rendering, you can also use them to spiff your Emacs up. Check out Charles Choi's Calle 24 for a great-looking Emacs toolbar. Also, Christian Tietze shows how to use SF Symbols as Emacs tab numbers.

Quick kill

While macOS's Activity Monitor does a fine job killing processes, I wanted something a little speedier, so I went with a killing solution leveraging Emacs completions.

SwiftUI a la org babel

Having learned how simple it was to enable Objective-C babel support, I figured I could do something a little more creative with SwiftUI, so I published ob-swiftui on MELPA.

Changing macOS default apps

I found the nifty duti command-line tool to change default macOS applications super handy, but could never remember its name when I needed it. And so I decided to bring it into dwim-shell-command as part of my toolbox.

I got a bunch of handy helpers in dwim-shell-commands.el (specially all the image/video helpers via ffmpeg and imagemagick). Go check dwim-shell-commands.el. There's loads in there, but here are my macOS-specific commands:

  • dwim-shell-commands-macos-add-to-photos
  • dwim-shell-commands-macos-bin-plist-to-xml
  • dwim-shell-commands-macos-caffeinate
  • dwim-shell-commands-macos-convert-to-mp4
  • dwim-shell-commands-macos-empty-trash
  • dwim-shell-commands-macos-install-iphone-device-ipa
  • dwim-shell-commands-macos-make-finder-alias
  • dwim-shell-commands-macos-ocr-text-from-desktop-region
  • dwim-shell-commands-macos-ocr-text-from-image
  • dwim-shell-commands-macos-open-with
  • dwim-shell-commands-macos-open-with-firefox
  • dwim-shell-commands-macos-open-with-safari
  • dwim-shell-commands-macos-reveal-in-finder
  • dwim-shell-commands-macos-screenshot-window
  • dwim-shell-commands-macos-set-default-app
  • dwim-shell-commands-macos-share
  • dwim-shell-commands-macos-start-recording-window
  • dwim-shell-commands-macos-abort-recording-window
  • dwim-shell-commands-macos-end-recording-window
  • dwim-shell-commands-macos-toggle-bluetooth-device-connection
  • dwim-shell-commands-macos-toggle-dark-mode
  • dwim-shell-commands-macos-toggle-display-rotation
  • dwim-shell-commands-macos-toggle-menu-bar-autohide
  • dwim-shell-commands-macos-version-and-hardware-overview-info

Toggle dark mode

Continuing on the dwim-shell-commands family, I should also mention dwim-shell-commands-macos-toggle-dark-mode.

While I hardly ever change my Emacs theme, I do toggle macOS dark mode from time to time to test macOS or web development.

Menu bar auto hide

One last dwim-shell-command… One that showcases toggling the macOS menu bar (autohide).

Connect to your Bluetooth speaker

While this didn't quite stick for me, it was a fun experiment to add Emacs into the mix.

Eshell

This is just a little fun banner I see whenever I launch eshell.

This is all you need:

(use-package em-banner
  :custom
  (eshell-banner-message "
\x1b[32m                             'c.                    \x1b[0m
\x1b[32m                          ,xNMM.                    \x1b[0m
\x1b[32m                        .OMMMMo                     \x1b[0m
\x1b[32m                        OMMM0,                      \x1b[0m
\x1b[32m              .;loddo:' loolloddol;.                \x1b[0m
\x1b[32m            cKMMMMMMMMMMNWMMMMMMMMMM0:              \x1b[0m
\x1b[33m          .KMMMMMMMMMMMMMMMMMMMMMMMWd.              \x1b[0m
\x1b[33m          XMMMMMMMMMMMMMMMMMMMMMMMX.                \x1b[0m
\x1b[31m        ;MMMMMMMMMMMMMMMMMMMMMMMM:                  \x1b[0m
\x1b[31m        :MMMMMMMMMMMMMMMMMMMMMMMM:                  \x1b[0m
\x1b[31m        .MMMMMMMMMMMMMMMMMMMMMMMMX.                 \x1b[0m
\x1b[31m         kMMMMMMMMMMMMMMMMMMMMMMMMWd.               \x1b[0m
\x1b[35m          .XMMMMMMMMMMMMMMMMMMMMMMMMMMk             \x1b[0m
\x1b[35m           .XMMMMMMMMMMMMMMMMMMMMMMMMK.             \x1b[0m
\x1b[34m             kMMMMMMMMMMMMMMMMMMMMMMd               \x1b[0m
\x1b[34m              ;KMMMMMMMWXXWMMMMMMMk.                \x1b[0m
\x1b[34m                .cooc,.    .,coo:.                  \x1b[0m

\x1b[34m                        _/                  _/  _/  \x1b[0m
\x1b[34m     _/_/      _/_/_/  _/_/_/      _/_/    _/  _/   \x1b[0m
\x1b[34m  _/_/_/_/  _/_/      _/    _/  _/_/_/_/  _/  _/    \x1b[0m
\x1b[34m _/            _/_/  _/    _/  _/        _/  _/     \x1b[0m
\x1b[34m  _/_/_/  _/_/_/    _/    _/    _/_/_/  _/  _/      \x1b[0m


"))

Screencasts

I wanted a quick way to record or take screenshots of macOS windows, so I now have my lazy way, leveraging macosrec, a recording command line utility I built. Invoked via M-x of course.

Eglot (LSP) for iOS/macOS dev

If you want any sort of code completion for your macOS projects, you'd be happy to know that eglot works out of the box.

(use-package eglot
  :ensure t
  :hook (swift-mode . eglot-ensure)
  :config
  (message "warning: `jsonrpc--log-event' is ignored.")
  (fset #'jsonrpc--log-event #'ignore)
  (add-to-list 'eglot-server-programs '(swift-mode . ("/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/sourcekit-lsp"))))

Search and play (Music app)

This is another experiment that didn't quite stick, but I played with controlling the Music app's playback.

While I still purchase music via Apple's Music app, I now play directly from Emacs via Ready Player Mode. I'm fairly happy with this setup, having scratched that itch with my own package.

By the way, those buttons also leverage SF Symbols on macOS.

Reveal -> all <- in Finder

While there are plenty of solutions out there leveraging the open command line tool to reveal files in macOS's Finder, I wanted one that revealed multiple files in one go. For that, I leveraged the awesome emacs-swift-module, also by Valeriy Savchenko.

Use the macOS Trash

The macOS trash has saved my bacon in more than one occasion. Make Emacs aware of it. Also check out M-x dwim-shell-commands-macos-empty-trash.

Build your own macOS utils

While elisp wasn't in my top languages to learn back in the day, I sure am glad I finally bit the bullet and learned a thing or two. This opened many possibilities. I now see Emacs as a platform to build utilities and tools off of. A canvas of sorts, to be leveraged in and out of the editor.

For example, you could build your own bookmark launcher and invoke from anywhere on macOS.

Emacs as default email composer

Turns out you can also make Emacs your default email composer.

Emacs key bindings everywhere

While not exactly an Emacs tweak itself, I wanted to extend Emacs bindings into other macOS apps. In particular, I wanted more reliable Ctrl-n/p usage everywhere, which I achieved via Karabiner-Elements. I also mapped C-g to Esc, which really feels just great! I can now cancel things, dismiss menus, dialogs, etc. everywhere.

Org as lingua franca

With my Emacs usage growing over time, it was a matter of time until I discovered org mode. This blog is well over 11 years old now, yet still powered by the very same org file (beware, this file is big).

With my org usage growing, I felt like I was missing org support outside of Emacs. And so I started building iOS apps revolving around my Emacs usage.

Journelly (iOS)

Journelly is my latest iOS app, centered around note-taking and journaling. The app feels like tweeting, but for your eyes only of course. It's powered by org markup, which can be synced with Emacs via iCloud.

Flat Habits (iOS)

Org habits are handy for tracking daily habits. However, it wasn't super practical for me as I often wanted to check things off while on the go (away from Emacs). That led me to build Flat Habits.

Scratch (iOS)

While these days I'm using Journelly to jot down just about anything, before that, I built and used Scratch as scratch pad of sorts. No iCloud syncing, but needless to say, it's also powered by org markup.

Plain Org (iOS)

For more involved writing, nothing beats Emacs org mode. But what if I want quick access to my org files while on the go? Plain Org is my iOS solution for that.

Found this post useful?

I'll keep looking for other macOS-related tips and update this post in the future.

In the meantime, consider ✨sponsoring✨ this content, my Emacs packages, buying my apps, or just taking care of your eyes ;)

]]>
Tue, 27 May 2025 00:00:00 GMT
Journelly 1.1 released https://xenodium.com/journelly-1-1-released https://xenodium.com/journelly-1-1-released

download-on-app-store.png

Journelly 1.1 available on the App Store

What is Journelly?

Journelly feels like tweeting but for your eyes only.

A fresh take on frictionless note-taking for iOS, powered by Org plain text.

  • Save cooking recipes, movies, music, restaurants, coffee shops…
  • Jot down your thoughts.
  • Save your favorite quotes.
  • Use it as a journal, memo book, or notes.
  • Write your shopping lists.
  • Document your travels.
  • Lots more…

Check out journelly.com for details.

What's new?

Journelly v1.1 is the first release since launching. It adds support for 10 new languages and delivers the first round of feature requests and bug fixes.

New features

  • New languages:
    • Danish
    • Dutch
    • Finnish
    • French
    • German
    • Italian
    • Japanese
    • Norwegian
    • Spanish
    • Swedish
  • Easily add hashtags using the new picker (most requested feature).
  • Hashtags are now highlighted in the editor.
  • Automatically capture selected text in Safari.
  • Paste images directly from the clipboard.
  • Tap on email addresses to compose a new message.
  • New context menu options:
    • Set location as Home.
    • Open location in Maps.
    • Copy text.
  • iPad keyboard shortcuts
    • ⌘-N Create a new Entry
    • ⌘-S Save the current Entry
    • ↑/↓ Select entry in list
    • ↵ Edit selected entry
  • Uses the full date format based on your locale.

Fixes

  • Prevents the Esc key from discarding unsaved changes.
  • Resolves incorrect link icon colors in Light Mode.
  • The About screen is now available on fresh installs.
  • Fixes issue where the navigation bar became inaccessible when viewing markup.
  • Locations are now only clickable when valid coordinates are available.

A happy Journelly user

Just as I'm getting ready to announce Journelly's 1.1 release, Ellane (from ellanew.com) shared a wonderful blog post on her experience using version 1.0:

Journelly is the Org App You’ll Love (Even if You Don’t Do Org).

I'm particulary excited to hear from Ellane given her Plain Text; Paper, Less philosophy.

"It’s the perfect mix of simplicity and low-tech plain text wizardry"

"It takes a very particular set of features for a new app to impress me enough to hit the purchase button as fast as I did with Journelly."

"Journelly is the first Org-powered app I’ve seen that lays out the welcome mat for people who don’t even know what Org is, never mind how to use it."

Ellane / ellanew.com

As an org mode enthusiast myself, I'm delighted to hear Journelly is paving a gentle road for org newcomers.

Ellane's post also has a great list of features requests. Lucky for me, I can report at least two of them are covered by today's release:

  • The new hashtag picker.
  • Pasting images from the clipboard.

Be sure to check out Ellane's post, as she covers many details I'm not mentioning here. But lemme share one last tip I learned from her post today…

Ellane's iCloud tip

Today I learned something new from Ellane’s post: you can Control-click the Journelly iCloud Drive folder on your Mac and select "Keep Downloaded" to ensure your notes are always available offline. Super handy, specially for those of us using Emacs on macOS.

Markdown enthusiast? Enquire within

Currently, Journelly stores entries in Org plain text format, but Markdown support is on the way. Interested in Markdown? Please reach out. Early support is already available on beta builds. Lemme know if you'd like to join the TestFlight group.

On the topic of Markdown: I also run lmno.lol, a Markdown-powered blogging service. Simple and focused, without the frustrating parts of the modern web. Custom domains are welcome too! My xenodium.com blog runs off lmno.lol.

]]>
Mon, 19 May 2025 00:00:00 GMT
LLM text chat is everywhere. Who’s optimizing its UX? https://xenodium.com/llm-text-chat-is-everywhere-whos-optimizing-ux https://xenodium.com/llm-text-chat-is-everywhere-whos-optimizing-ux When it comes to programming LLM tools, I've seen modes of interaction in the form of code completion, patch application, improvement suggestions, and text chat amongst others. Text chat is everywhere.

In the context of text chat UX, I haven't really come across huge differentiators across offerings. That's not to say they don't exist. The landscape moves fast and there are far too many products out there for me to check out, thus my question to you is…

Who's optimizing or innovating LLM text chat UX?

While there are plenty of new agents and model capabilities that are interesting in their own right, in the context of chat UX, I'm more interested in finding your favorite UX features. What are they? What do you love about them? Why? Do they feel like they reached or are close to reaching an optimal experience? On the other hand, what do you find that's rough about them? Tiny friction here and there? I'd love to know: Mastodon / Twitter / Reddit / Bluesky.

Chat as a shell, is it keyboard optimized?

Back in 2023, I released the first version of chatgpt-shell. To me, LLM chats felt like the perfect candidates to be implemented as shells. After all, aren't they just REPLs of sorts?

  1. Reads user input
  2. Evaluates the input
  3. Prints the result
  4. Loops back to read more input

While this mode of LLM interaction served me well for some time, I couldn't shake the feeling there were tiny improvements to be made to shed a little friction here and there.

TAB navigation

Not all LLM output is equal. I want to quickly jump to more interesting items like code blocks or links (via keyboard of course). Sure, I can search to navigate around, but don't we have better patterns already? Don't we often just TAB our way around apps and web pages?

With that, I added TAB and Shift-TAB navigation to chatgpt-shell.

Editable vs read-only (why not both?)

Most LLM text chat interfaces I've come across are made up of two components: the input text-box and the history of input requests along with their corresponding LLM outputs. While using the text-box, keyboard shortcuts are somewhat limited to modifier key shortcuts. I'd love to have a richer menu of options available or ways to quickly ask for things, without explicitly having to request a different interaction mode nor a menu of sorts. Circumstances aren't that different in a shell when you have to switch between character and line mode. In a way, the clunkiness intensifies when you'd like to input multi-line text through your shell. You better watch out for that muscle memory and avoid pressing enter prematurely while you intended to add a newline… Too late. Your incomplete request is already on its way.

With all this in mind, it's easy to dismiss shell foundations given their quirks. The thing is, we don't have to throw the baby out with the bathwater. What we need is a veneer of sorts, automatically switching between edit and view mode just when you need it.

Reducing history noise

While I want to have access to my LLM chat history (ie. the context), I'm hardly ever interested in seeing anything but the last LLM response. An always-present history feels like constant noise to me. If I want to see the history, I'd like to actively ask for it. Remember that veneer of sorts? Well, can't it act as viewport too? …showing me only the very last response. Want access to previous entries? Can it act as a pager also? One interaction per page (request + response). But if I really want to open the history floodgates, just give me access to the "raw" shell… and so I started experimenting with pagers of sorts.

One chat interface to rule them all

With my initial chatgpt-shell implementation, I envisioned multi-model chat support would be possible by isolating shell logic into a separate package (shell-maker) and let folks build whichever LLM chat they'd like (adding support for their favorite model).

While new shells started popping up here and there, I didn't foresee minor shell UX differences affecting general user experience. Learning the quirks of each new shell felt like unnecessary friction in developing muscle memory. I also became dependent on chatgpt-shell features, which I often missed when using some of the other shells. In the end, I bit the bullet and made chatgpt-shell go multi-model.

Tying it all together

TAB navigation, a smart veneer, a viewport, paging, optional access to chat history, a transient menu, a single interface driving different models, and a bunch of other tweaks currently make up chatgpt-shell's compose experience, available via Emacs's M-x chatgpt-shell-prompt-compose command or my preferred key binding: C-c C-e.

Today, I bring another tweak. Compose buffers get a brand new header presenting all relevant shell details including model and paging information.

The new compose header is now available in the latest MELPA package version. Invoke M-x chatgpt-shell-prompt-compose and off you go. It's pretty fresh, so please report issues.

Back to the original question…

What are some of the text chat UX features you love? Bonus points if they are keyboard driven. I'd love to hear: Mastodon / Twitter / Reddit / Bluesky.

]]>
Sun, 18 May 2025 00:00:00 GMT
A richer Journelly org capture template https://xenodium.com/a-richer-journelly-org-capture-template https://xenodium.com/a-richer-journelly-org-capture-template In addition to including user content, Journelly entries typically bundle a few extra details like timestamp, location, and weather information, which look a little something like this:

Behind the scenes, Journelly entries follow a fairly simple org structure:

* [2025-04-23 Wed 13:24] @ Waterside House
:PROPERTIES:
:LATITUDE: 51.518714352892665
:LONGITUDE: -0.17575820941499262
:WEATHER_TEMPERATURE: 11.4°C
:WEATHER_CONDITION: Mostly Cloudy
:WEATHER_SYMBOL: cloud
:END:
Try out Rice Guys #food #london on Wednesdays in Paddington

[[file:Journelly.org.assets/images/C5890C25-5575-4F52-80D9-CE0087E9986C.jpg]]

While out and capturing entries from my iPhone, I rely on Journelly to leverages iOS location and weather APIs to include relevant information. On the other hand, when capturing from my Macbook, I rely on a basic Emacs org capture template (very similar to Jack Baty's):

(setq org-capture-templates
      '(("j" "Journelly" entry (file "path/to/Journelly.org")
         "* %U @ Home\n%?" :prepend t)))

These templates yield straightforward entries like:

* [2025-05-16 Fri 12:42] @ Home
A simple entry from my Macbook.

I've been using this capture template for some time. It does a fine job, though you'd notice location and weather info aren't captured. No biggie, since the location of my laptop isn't typically relevant, but hey today seemed like a perfect day to get nerd snipped by @natharari.

And so, off I went, to look for a utility to capture location from the command line. I found CoreLocationCLI, which leverages the equivalent macOS location APIs. As a bonus, the project seemed active (modified only a few days ago).

Installing CoreLocationCLI via Homebrew was a breeze:

brew install corelocationcli

The first time you run corelocationcli, you'll get an message like:

"CoreLocationCLI" can't be opened because it is from an unidentified developer...

You'll need to follow CoreLocationCLI's instructions:

To approve the process and allow CoreLocationCLI to run, go to System Settings ➡️ Privacy & Security ➡️ General, and look in the bottom right corner for a button to click.

After approving the process, I ran into a snag:

$ CoreLocationCLI
CoreLocationCLI: ❌ The operation couldn’t be completed. (kCLErrorDomain error 0.)

Lucky for me, the README had the solution:

Note for Mac users: make sure Wi-Fi is turned on. Otherwise you will see kCLErrorDomain error 0.

Oddly, my WiFi was turned on, so I went ahead and toggled it. Success:

$ CoreLocationCLI
51.51871 -0.17575

We can start by wrapping this command-line utility to return coordinates along with reverse geolocation (ie. description):

(defun journelly-get-location ()
  "Get current location.

Return in the form:

`((lat . 51.51871)
  (lon . -0.17575)
  (description . \"Sunny House\"))

Signals an error if the location cannot be retrieved."
  (unless (executable-find "CoreLocationCLI")
    (error "Needs CoreLocationCLI (try brew install corelocationcli)"))
  (with-temp-buffer
    (if-let ((exit-code (call-process "CoreLocationCLI" nil t nil
                                      "--format" "%latitude\t%longitude\t%thoroughfare"))
             (success (eq exit-code 0))
             (parts (split-string (buffer-string) "\t")))
        `((lat . ,(string-to-number (nth 0 parts)))
          (lon . ,(string-to-number (nth 1 parts)))
          (description . ,(string-trim (nth 2 parts))))
      (error "No location available"))))

A quick check shows it's working as expected.

(journelly-get-location)
'((lat . 51.51871)
  (lon . -0.17575)
  (description . "Waterside House"))

Now that we're able to get the current location, we need a way to fetch weather info. I discarded using WeatherKit on macOS for its dependence on a developer account and obtaining an API key. No worries, I found the great MET Norway API which is freely available without the need for keys.

(defun journelly-fetch-weather (lat lon)
  "Fetch weather data from MET Norway API for LAT and LON.

Return the parsed JSON object."
  (let* ((url (format "https://api.met.no/weatherapi/locationforecast/2.0/compact?lat=%s&lon=%s" lat lon))
         (args (list "-s" url)))
    (with-temp-buffer
      (apply #'call-process "curl" nil t nil args)
      (goto-char (point-min))
      (json-parse-buffer :object-type 'alist))))

We can take it for a spin with:

(journelly-fetch-weather 51.51871 -0.17575)

We get a nice object with a chunky time series (cropped for readability):

((type . "Feature")
 (geometry (type . "Point") (coordinates . [-0.1758 51.5187 30]))
 (properties
  (meta (updated_at . "2025-05-16T11:17:44Z")
        (units (air_pressure_at_sea_level . "hPa")
               (air_temperature . "celsius")
               (cloud_area_fraction . "%")
               (precipitation_amount . "mm") (relative_humidity . "%")
               (wind_from_direction . "degrees") (wind_speed . "m/s")))
  (timeseries
   . [((time . "2025-05-16T12:00:00Z")
       (data
        (instant
         (details (air_pressure_at_sea_level . 1025.6)
                  (air_temperature . 18.0) (cloud_area_fraction . 4.7)
                  (relative_humidity . 44.2)
                  (wind_from_direction . 17.6) (wind_speed . 3.6)))
        (next_12_hours (summary (symbol_code . "fair_day")) (details))
        (next_1_hours (summary (symbol_code . "clearsky_day"))
                      (details (precipitation_amount . 0.0)))
        (next_6_hours (summary (symbol_code . "clearsky_day"))
                      (details (precipitation_amount . 0.0)))))

      ...


     ((time . "2025-05-26T00:00:00Z")
       (data
        (instant
         (details (air_pressure_at_sea_level . 1007.3)
                  (air_temperature . 12.6)
                  (cloud_area_fraction . 28.1)
                  (relative_humidity . 91.3)
                  (wind_from_direction . 258.7) (wind_speed . 3.5)))))])))

Journelly entries need only a tiny subset of the returned object, so let's add a helper to extract and format as preferred.

(defun journelly-fetch-weather-summary (lat lon)
  "Fetch weather data from MET Norway API for LAT and LON.

Return in the form:

 '((temperature . \"16.9°C\")
   (symbol . \"cloudy\"))."
  (let* ((data (journelly-fetch-weather lat lon))
         (now (current-time))
         (entry (seq-find
                 (lambda (entry)
                   (let-alist entry
                     (time-less-p now (date-to-time .time))))
                 (let-alist data
                   .properties.timeseries)))
         (unit (let-alist data
                 .properties.meta.units.air_temperature)))
    (unless entry
      (error "Couldn't fetch weather data"))
    (let-alist entry
      `((temperature . ,(format "%.1f%s"
                                .data.instant.details.air_temperature
                                (cond
                                 ((string= unit "celsius") "°C")
                                 ((string= unit "fahrenheit") "°F")
                                 (t (concat " " unit)))))
        (symbol . ,(alist-get 'symbol_code .data.next_1_hours.summary))))))

We can take it for a spin with:

(journelly-fetch-weather-summary 51.51871 -0.17575)

Nice! Look at that weather, it's a sign I should finish writing and go outside!

'((temperature . "19.0°C")
  (symbol . "clearsky_day"))

I really should go outside, but I'm just so close now… Or so I thought! That symbol (ie. "clearsky_day") isn't recognizable by Journelly, which relies on SF Symbols returned by WeatherKit. I need a mapping of sorts between these symbols. Gosh, I do need to go outside. Let's speed things along. This is a perfect task for a robot! Whipped chatgpt-shell out and asked the LLM robots to take on this grunt work, who gave me:

{
  "clearsky_day": "sun.max",
  "clearsky_night": "moon.stars",
  "clearsky_polartwilight": "sun.horizon",
  ...
  "snowshowers_and_thunder_day": "cloud.sun.bolt.snow",
  "snowshowers_and_thunder_night": "cloud.moon.bolt.snow",
  "thunderstorm": "cloud.bolt"
}

We're in elisp land so who wants json? Hey robot, I need an alist:

Won't the LLM make mapping errors? Most certainly! But for now, I'm just getting a rough prototype and I need to get moving if I want to go outside!

We plug our mapping into an elisp function

(defun journelly-resolve-metno-to-sf-symbol (symbol)
  "Resolve Met.no weather SYMBOL strings to a corresponding SF Symbols."
  (let ((symbols '(("clearsky_day" . "sun.max")
                   ("clearsky_night" . "moon.stars")
                   ("clearsky_polartwilight" . "sun.horizon")
                   ...
                   ("snowshowers_and_thunder_day" . "cloud.sun.bolt.snow")
                   ("snowshowers_and_thunder_night" . "cloud.moon.bolt.snow")
                   ("thunderstorm" . "cloud.bolt"))))
    (map-elt symbols symbol)))

Does it work? Kinda seems like it.

(journelly-resolve-metno-to-sf-symbol
 (map-elt (journelly-fetch-weather-summary 51.51871 -0.17575) 'symbol))
"sun.max"

We got everything we need now, let's put the bits together:

(defun journelly-generate-metadata ()
  (let* ((location (journelly-get-location))
         (weather (journelly-fetch-weather-summary
                   (map-elt location 'lat)
                   (map-elt location 'lon))))
    (format "%s
:PROPERTIES:
:LATITUDE: %s
:LONGITUDE: %s
:WEATHER_TEMPERATURE: %s
:WEATHER_SYMBOL: %s
:END:"
            (or (map-elt location 'description) "-")
            (map-elt location 'lat)
            (map-elt location 'lon)
            (alist-get 'temperature weather)
            (journelly-resolve-metno-to-sf-symbol
             (alist-get 'symbol weather)))))

Lovely, we now get the metadata we need in the expected format.

Waterside House
:PROPERTIES:
:LATITUDE: 51.51871
:LONGITUDE: -0.17575
:WEATHER_TEMPERATURE: 18.5°C
:WEATHER_SYMBOL: sun.max
:END:

Damn, the temperature is dropping. I really do need to go outside. So close now!

All we have to do is plug our journelly-generate-metadata function into our org template and… Bob's your uncle!

(setq org-capture-templates
      '(("j" "Journelly" entry (file "path/to/Journelly.org")
         "* %U @ %(journelly-generate-metadata)\n%?" :prepend t)))

We can now invoke our trusty M-x org-capture and off we go…

While the code currently lives in my Emacs config, it's available on GitHub. If you do take it for a spin, it may crash and burn. I blame the weather. In the UK, when sunny, you rush to go outside! 🌞🏃‍♂️💨

]]>
Fri, 16 May 2025 00:00:00 GMT
Journelly: like tweeting but for your eyes only (in plain text) https://xenodium.com/journelly-like-tweeting-but-for-your-eyes-only https://xenodium.com/journelly-like-tweeting-but-for-your-eyes-only On iOS, we're spoiled for choice when it comes to note-taking, journaling, or social media apps. In note-taking alone, I've flip-flopped back and forth between different note-taking and journaling apps. For one reason or another, none would stick. My initial attempt at building such an app faded just the same. That is, until I realized what I really wanted was a cocktail of sorts, combining user experiences from all three kinds. Only then, I finally gained some traction and Journelly was truly born.

I'm happy to share that, as of today, Journelly is generally available on the App Store. Check out journelly.com for all app details or just read on…

download-on-app-store.png

download-on-app-store.png

Like tweeting, but for your eyes only

While bringing social to note-taking was categorically never a goal, we got a thing or two we can draw from social media apps. They make it remarkably easy to browse and just share stuff.

All my previous mobile note-taking attempts failed to stick around almost exclusively because of friction. By bringing a social-media-like feed to my notes and making it remarkably easy to just add and search for things, app stickiness quickly took off.

Of course, these being my personal notes, privacy is non-negotiable. With Journelly being offline by default, combining elements from note-taking, journaling, and social media apps, I came to think of Journelly's experience as "tweeting but for your eyes only".

Is it a notes app? Journaling app? It's whatever you want it to be…

I like how journaling apps automatically bundle timestamps with your entries and maybe additional information like location or even weather details. At the same time, splitting my writing between two apps (quick notes vs. journaling) always felt like unnecessary friction. Even having to decide which app to launch felt like a deterrent.

While my typical Journelly use-case hops between taking notes, journaling, today's grocery shopping list, saving a few links from the web, music, movies, the list goes on… jcs from Irreal puts it best: "Journelly is a bit of a shape shifter." With just enough structure (but not too much), Journelly can serve all sorts of use-cases.

No lock-in (powered by org plain text)

While I want a smooth mobile note-taking experience, I also don't want my notes to live in a data island of sorts. I'm a fan of plain text. I've been writing my notes and blog posts at xenodium.com using Org plain text for well over a decade now, so my solution naturally had to have some plain text thrown at it.

Journelly stores entries using Org markup for now, but Markdown is coming too (UPDATE: launched). Interested in Markdown support? Please reach out. The more requests I receive, the sooner I'll get it out the door. Oh, and since we're talking Markdown, I also launched lmno.lol, a Markdown-powered blogging service (minus the yucky bits of the modern web). Custom domains are welcome too. My xenodium.com blog runs off lmno.lol.

Is it really powered by Org markup? Go ahead and fire up your beloved Emacs, Vim, Neovim, VS Code, Sublime Text, Zed… and take a peek. It's just text.

Having shown you all of that, this is all just cherry on the implementation cake. You need not know anything about markups to use Journelly. Just open the app and start writing.

iCloud syncing (optional)

While Journelly is offline by default, you may optionally sync with other devices via iCloud.

Folks have reported using Working Copy, Sushitrain, or Möbius Sync for syncing, though your mileage may vary. As of v1, I can only offer iCloud as the officially supported provider.

Searching + hashtags

There's little structure enforced on Journelly entries. Write whatever you want. If you want some categorization, sprinkle entries with your favorite hashtags. They're automatically actionable on tap, enabling quick searches in the future.

Thank you beta testers!

Nearly 300 folks signed up to Journelly's TestFlight. Thank you for testing, reporting issues, and all the great suggestions. While many of your feature requests made it to the launch, I've had to defer quite few to enable the v1 release. The good news is I now have a healthy backlog I can work on to bring features over time.

Support indie development

The App Store is a crowded place. Building ✨sustainable✨ iOS apps is quite the challenge, especially when doing right by the user. Journelly steers clear of ads, tracking, distractions, bloat, lock-in, and overreaching permissions. It embraces open formats like Org markup, safeguarding the longevity of your data.

Support independent development.

download-on-app-store.png

download-on-app-store.png

LMNO.lol Plain Org Scratch Flat Habits Fresh Eyes
]]>
Thu, 01 May 2025 00:00:00 GMT
Journelly vs Emacs: Why Not Both? https://xenodium.com/journelly-vs-emacs-why-not-both https://xenodium.com/journelly-vs-emacs-why-not-both JTR recently posted an interesting question in response to Irreal's post wondering why he feels the need to use something that is not Emacs for quick notes? While I'm in no position to speak on behalf of Irreal, I am the Ramírez building this Journelly app JTR speaks of ;-)

From my perspective as the author, I'm building this app to fill a void I have, complementing my org-mode usage. In my opinion, it's not a question of whether to use Journelly over Emacs. I freakin' love Emacs org. I don't want to give it up. If the apps speak to each other, the question I'd rather ask is: why not use both?

When I’m on my computer, nearly all my writing goes through org-mode. I’ve been an org fan for well over a decade. My blog is powered by a single org file (be warned, it's a chunky file).

It's no secret I'm also an Emacs fan. I love how this platform moulds to my needs. But when I’m on the go and on my iPhone, I want a different experience — quick mobile access, minimal ceremony, optimized for smaller touch screens. I want to capture quick notes on the go, with as little friction as possible. Optionally, I want to include photos, lists, checklists, location, weather, timestamps… I also want this experience to feel like other well-integrated iOS apps. The way I like to put it is: Journelly sorta feels like tweeting, but for your eyes only.

At the same time, I don’t want my mobile note-taking experience to live in a data island. After all, I'm still an org fan. So… why not use both apps? My goal for Journelly is to provide a mobile-optimized experience that happens to speak org and thus complement my existing org usage.

While Journelly is offline by default, you may choose a different location for your data, enabling you to access it from your beloved editor.

Back to the original question: why use another tool for quick notes other than Emacs? Journelly isn't meant to replace Emacs, but rather complement it. In a way, Journelly isn't that different from Beorg, which was mentioned in JTR's post. Both apps speak org on iOS. It just so happens the apps offer slightly different targeted experiences. While Beorg is perhaps more geared toward task lists and calendars, Journelly focuses on short and quick notes.

Journelly is still in beta, though lucky for me, Mac Observer showcased a thorough review. If keen to join the beta group, reach out at journelly/./invite/@/xenodium.com or Mastodon / Twitter / Reddit / Bluesky.

P.S. Emacs org continues to be, and likely always will be, my writing epicentre. I now have three revolving org-based apps on the App Store, with Journelly soon to become the fourth one. if interested, check out my org bundle.

]]>
Wed, 02 Apr 2025 00:00:00 GMT
The Mac Observer showcases Journelly https://xenodium.com/the-mac-observer-showcases-journelly https://xenodium.com/the-mac-observer-showcases-journelly The Mac Observer is showcasing Monday App Finder: Journelly, a Twitter-Like Journal for iOS.

#+ATTR_HTML: :width 70%

Bemfica de Oliva does a wonderful rundown of Journelly's features and capabilities, much better than anything else I've posted before. They even mentioned Org markup and Emacs text editor, for those who want to drop down to its plain text storage. A nice treat, as these aren't typically showcased in the space.

If you're curious about what Journelly can do, check out Bemfica's post. Alternatively, if you just want to play with it, join the TestFlight beta group.

]]>
Tue, 25 Mar 2025 00:00:00 GMT
Journelly open for beta https://xenodium.com/journelly-open-for-beta https://xenodium.com/journelly-open-for-beta UPDATE: Journelly is now on the App Store.

I've reignited Journelly, my note-taking/journaling project. The iOS app is coming along nicely.

I've been using Journelly daily. The best I can describe the experience is: "kinda like tweeting but for my eyes only".

Journelly automatically includes date and time in your entries. Optionally, it'll also include location and weather details.

For now, your entries can include text, images, checkboxes, bullets, and links.

While entering items orally isn't yet possible as per Irreal's post, you can use the standard keyboard button to dictate text.

Powered by plain text (org markup)

If you're an Emacs org mode fan, you'll be happy to know that Journelly stores data as plain text, using org to structure its entries.

If you're unfamiliar with these things, you don't need to learn any of it to use the app. It's just what's under the hood.

* [2025-02-26 Wed 13:55] @ Distillery Lane
:PROPERTIES:
:LATITUDE: 51.488644146827866
:LONGITUDE: -0.22292387343051026
:WEATHER_TEMPERATURE: 8.69°C
:WEATHER_CONDITION: Rain
:WEATHER_SYMBOL: cloud.rain
:END:
- [X] Try out Pad Thai Story in Hammersmith

[[file:Journelly.org.assets/images/4F0F3923-675A-461E-9B02-63CEDE76C765.jpg]]

Join the beta group

Want to give Journelly a try? Join the TestFlight beta group. Send me an email address (any would do) for the TestFlight invite.

You can reach out at journelly/./invite/@/xenodium.com or Mastodon / Twitter / Reddit / Bluesky.

]]>
Fri, 14 Mar 2025 00:00:00 GMT
DeepSeek, Open Router, Kagi, and Perplexity join the chat https://xenodium.com/deepseek-open-router-kagi-and-perplexity-join-the-chat https://xenodium.com/deepseek-open-router-kagi-and-perplexity-join-the-chat Back in November, I announced the chatgpt-shell Emacs package going offline. In real terms, it meant adding Ollama support after chatgpt-shell went multi-model. Since then, support for a handful of providers and models has been added.

While DeepSeek is the latest joinee, Open Router (thank you djr7C4), Kagi summarizer, and Perplexity are also a model-swap away.

chatgpt-shell is nearing 30K MELPA downloads. Are you a happy user? Consider making this project sustainable by ✨sponsoring✨.

]]>
Thu, 06 Mar 2025 00:00:00 GMT
Keychron K3 Pro: F1-F12 as default macOS keys https://xenodium.com/keychron-k3-pro-f1-f12-as-default-macos-keys https://xenodium.com/keychron-k3-pro-f1-f12-as-default-macos-keys

After resetting my Keychron K3 Pro, my F1 to F12 keys were no longer my default macOS keys. The entire row was defaulting to macOS's special keys (i.e. Mission Control, Launch Pad, Volume, etc). At first, I thought I may just need to revisit the macOS setting "Use F1, F2, etc keys as standard function keys", yet toggling the setting made no difference.

Turns out, I had remapped those keys long ago and simply forgot about it. Factory resetting my keyboard got rid of this customization. This post is a reminder for my future self, and anyone else looking to remap their F1-F12 keys.

Save your current layout

Via https://usevia.app, I saved my current keyboard layout (the out-of-box layout) and named it k3_pro_ansi_white(before).json.

Apply your changes

I made a second copy of the layout and named it k3_pro_ansi_white(after).json. In this new file, I located the two layers (first and second) and simply swapped the two row chunks using a text editor.

The diff looks a little something like this:

--- k3_pro_ansi_white(before).json    2025-02-20 09:44:03
+++ k3_pro_ansi_white(after).json 2025-02-20 09:43:59
@@ -5,18 +5,18 @@
   "layers": [
     [
       "KC_ESC",
-      "KC_BRID",
-      "KC_BRIU",
-      "CUSTOM(4)",
-      "CUSTOM(5)",
-      "BL_DEC",
-      "BL_INC",
-      "KC_MPRV",
-      "KC_MPLY",
-      "KC_MNXT",
-      "KC_MUTE",
-      "KC_VOLD",
-      "KC_VOLU",
+      "KC_F1",
+      "KC_F2",
+      "KC_F3",
+      "KC_F4",
+      "KC_F5",
+      "KC_F6",
+      "KC_F7",
+      "KC_F8",
+      "KC_F9",
+      "KC_F10",
+      "KC_F11",
+      "KC_F12",
       "CUSTOM(8)",
       "KC_DEL",
       "BL_STEP",
@@ -103,18 +103,18 @@
     ],
     [
       "KC_TRNS",
-      "KC_F1",
-      "KC_F2",
-      "KC_F3",
-      "KC_F4",
-      "KC_F5",
-      "KC_F6",
-      "KC_F7",
-      "KC_F8",
-      "KC_F9",
-      "KC_F10",
-      "KC_F11",
-      "KC_F12",
+      "KC_BRID",
+      "KC_BRIU",
+      "CUSTOM(4)",
+      "CUSTOM(5)",
+      "BL_DEC",
+      "BL_INC",
+      "KC_MPRV",
+      "KC_MPLY",
+      "KC_MNXT",
+      "KC_MUTE",
+      "KC_VOLD",
+      "KC_VOLU",
       "KC_TRNS",
       "KC_TRNS",
       "BL_TOGG",

Similarly, here's side-by-side look via Emacs ediff:

Load your modified layout

Now that we have k3_pro_ansi_white(after).json with our changes, all that's left is loading through https://usevia.app. You are now done.

While F1-F12 keys should now be available by default. To access your macOS special keys use the fn key.

Enjoy your F1-F12 default keys!

Final k3_pro_ansi_white(after).json

In case you'd like to see the entire content of k3_pro_ansi_white(after).json, here it is:

{
  "name": "Keychron K3 Pro ANSI White",
  "vendorProductId": 875823667,
  "macros": ["", "", "", "", "", "", "", "", "", "", "", "", "", "", "", ""],
  "layers": [
    [
      "KC_ESC",
      "KC_F1",
      "KC_F2",
      "KC_F3",
      "KC_F4",
      "KC_F5",
      "KC_F6",
      "KC_F7",
      "KC_F8",
      "KC_F9",
      "KC_F10",
      "KC_F11",
      "KC_F12",
      "CUSTOM(8)",
      "KC_DEL",
      "BL_STEP",
      "KC_GRV",
      "KC_1",
      "KC_2",
      "KC_3",
      "KC_4",
      "KC_5",
      "KC_6",
      "KC_7",
      "KC_8",
      "KC_9",
      "KC_0",
      "KC_MINS",
      "KC_EQL",
      "KC_BSPC",
      "KC_NO",
      "KC_PGUP",
      "KC_TAB",
      "KC_Q",
      "KC_W",
      "KC_E",
      "KC_R",
      "KC_T",
      "KC_Y",
      "KC_U",
      "KC_I",
      "KC_O",
      "KC_P",
      "KC_LBRC",
      "KC_RBRC",
      "KC_BSLS",
      "KC_NO",
      "KC_PGDN",
      "KC_CAPS",
      "KC_A",
      "KC_S",
      "KC_D",
      "KC_F",
      "KC_G",
      "KC_H",
      "KC_J",
      "KC_K",
      "KC_L",
      "KC_SCLN",
      "KC_QUOT",
      "KC_NO",
      "KC_ENT",
      "KC_NO",
      "KC_HOME",
      "KC_LSFT",
      "KC_NO",
      "KC_Z",
      "KC_X",
      "KC_C",
      "KC_V",
      "KC_B",
      "KC_N",
      "KC_M",
      "KC_COMM",
      "KC_DOT",
      "KC_SLSH",
      "KC_NO",
      "KC_RSFT",
      "KC_UP",
      "KC_END",
      "KC_LCTL",
      "CUSTOM(0)",
      "CUSTOM(2)",
      "KC_NO",
      "KC_NO",
      "KC_NO",
      "KC_SPC",
      "KC_NO",
      "KC_NO",
      "KC_NO",
      "CUSTOM(3)",
      "MO(1)",
      "KC_RCTL",
      "KC_LEFT",
      "KC_DOWN",
      "KC_RGHT"
    ],
    [
      "KC_TRNS",
      "KC_BRID",
      "KC_BRIU",
      "CUSTOM(4)",
      "CUSTOM(5)",
      "BL_DEC",
      "BL_INC",
      "KC_MPRV",
      "KC_MPLY",
      "KC_MNXT",
      "KC_MUTE",
      "KC_VOLD",
      "KC_VOLU",
      "KC_TRNS",
      "KC_TRNS",
      "BL_TOGG",
      "KC_TRNS",
      "CUSTOM(11)",
      "CUSTOM(12)",
      "CUSTOM(13)",
      "KC_TRNS",
      "KC_TRNS",
      "KC_TRNS",
      "KC_TRNS",
      "KC_TRNS",
      "KC_TRNS",
      "KC_TRNS",
      "KC_TRNS",
      "KC_TRNS",
      "KC_TRNS",
      "KC_NO",
      "KC_TRNS",
      "BL_TOGG",
      "BL_STEP",
      "BL_INC",
      "KC_TRNS",
      "KC_TRNS",
      "KC_TRNS",
      "KC_TRNS",
      "KC_TRNS",
      "KC_TRNS",
      "KC_TRNS",
      "KC_TRNS",
      "KC_TRNS",
      "KC_TRNS",
      "KC_TRNS",
      "KC_NO",
      "KC_TRNS",
      "KC_TRNS",
      "KC_TRNS",
      "BL_DEC",
      "KC_TRNS",
      "KC_TRNS",
      "KC_TRNS",
      "KC_TRNS",
      "KC_TRNS",
      "KC_TRNS",
      "KC_TRNS",
      "KC_TRNS",
      "KC_TRNS",
      "KC_NO",
      "KC_TRNS",
      "KC_NO",
      "KC_TRNS",
      "KC_TRNS",
      "KC_NO",
      "KC_TRNS",
      "KC_TRNS",
      "KC_TRNS",
      "KC_TRNS",
      "CUSTOM(14)",
      "MAGIC_TOGGLE_NKRO",
      "KC_TRNS",
      "KC_TRNS",
      "KC_TRNS",
      "KC_TRNS",
      "KC_NO",
      "KC_TRNS",
      "KC_TRNS",
      "KC_TRNS",
      "KC_TRNS",
      "KC_TRNS",
      "KC_TRNS",
      "KC_NO",
      "KC_NO",
      "KC_NO",
      "KC_TRNS",
      "KC_NO",
      "KC_NO",
      "KC_NO",
      "KC_TRNS",
      "KC_TRNS",
      "KC_TRNS",
      "KC_TRNS",
      "KC_TRNS",
      "KC_TRNS"
    ],
    [
      "KC_ESC",
      "KC_F1",
      "KC_F2",
      "KC_F3",
      "KC_F4",
      "KC_F5",
      "KC_F6",
      "KC_F7",
      "KC_F8",
      "KC_F9",
      "KC_F10",
      "KC_F11",
      "KC_F12",
      "KC_PSCR",
      "KC_DEL",
      "BL_STEP",
      "KC_GRV",
      "KC_1",
      "KC_2",
      "KC_3",
      "KC_4",
      "KC_5",
      "KC_6",
      "KC_7",
      "KC_8",
      "KC_9",
      "KC_0",
      "KC_MINS",
      "KC_EQL",
      "KC_BSPC",
      "KC_NO",
      "KC_PGUP",
      "KC_TAB",
      "KC_Q",
      "KC_W",
      "KC_E",
      "KC_R",
      "KC_T",
      "KC_Y",
      "KC_U",
      "KC_I",
      "KC_O",
      "KC_P",
      "KC_LBRC",
      "KC_RBRC",
      "KC_BSLS",
      "KC_NO",
      "KC_PGDN",
      "KC_CAPS",
      "KC_A",
      "KC_S",
      "KC_D",
      "KC_F",
      "KC_G",
      "KC_H",
      "KC_J",
      "KC_K",
      "KC_L",
      "KC_SCLN",
      "KC_QUOT",
      "KC_NO",
      "KC_ENT",
      "KC_NO",
      "KC_HOME",
      "KC_LSFT",
      "KC_NO",
      "KC_Z",
      "KC_X",
      "KC_C",
      "KC_V",
      "KC_B",
      "KC_N",
      "KC_M",
      "KC_COMM",
      "KC_DOT",
      "KC_SLSH",
      "KC_NO",
      "KC_RSFT",
      "KC_UP",
      "KC_END",
      "KC_LCTL",
      "KC_LGUI",
      "KC_LALT",
      "KC_NO",
      "KC_NO",
      "KC_NO",
      "KC_SPC",
      "KC_NO",
      "KC_NO",
      "KC_NO",
      "KC_RALT",
      "MO(3)",
      "KC_RCTL",
      "KC_LEFT",
      "KC_DOWN",
      "KC_RGHT"
    ],
    [
      "KC_TRNS",
      "KC_BRID",
      "KC_BRIU",
      "CUSTOM(6)",
      "CUSTOM(7)",
      "BL_DEC",
      "BL_INC",
      "KC_MPRV",
      "KC_MPLY",
      "KC_MNXT",
      "KC_MUTE",
      "KC_VOLD",
      "KC_VOLU",
      "KC_TRNS",
      "KC_TRNS",
      "BL_TOGG",
      "KC_TRNS",
      "CUSTOM(11)",
      "CUSTOM(12)",
      "CUSTOM(13)",
      "KC_TRNS",
      "KC_TRNS",
      "KC_TRNS",
      "KC_TRNS",
      "KC_TRNS",
      "KC_TRNS",
      "KC_TRNS",
      "KC_TRNS",
      "KC_TRNS",
      "KC_TRNS",
      "KC_NO",
      "KC_TRNS",
      "BL_TOGG",
      "BL_STEP",
      "BL_INC",
      "KC_TRNS",
      "KC_TRNS",
      "KC_TRNS",
      "KC_TRNS",
      "KC_TRNS",
      "KC_TRNS",
      "KC_TRNS",
      "KC_TRNS",
      "KC_TRNS",
      "KC_TRNS",
      "KC_TRNS",
      "KC_NO",
      "KC_TRNS",
      "KC_TRNS",
      "KC_TRNS",
      "BL_DEC",
      "KC_TRNS",
      "KC_TRNS",
      "KC_TRNS",
      "KC_TRNS",
      "KC_TRNS",
      "KC_TRNS",
      "KC_TRNS",
      "KC_TRNS",
      "KC_TRNS",
      "KC_NO",
      "KC_TRNS",
      "KC_NO",
      "KC_TRNS",
      "KC_TRNS",
      "KC_NO",
      "KC_TRNS",
      "KC_TRNS",
      "KC_TRNS",
      "KC_TRNS",
      "CUSTOM(14)",
      "MAGIC_TOGGLE_NKRO",
      "KC_TRNS",
      "KC_TRNS",
      "KC_TRNS",
      "KC_TRNS",
      "KC_NO",
      "KC_TRNS",
      "KC_TRNS",
      "KC_TRNS",
      "KC_TRNS",
      "KC_TRNS",
      "KC_TRNS",
      "KC_NO",
      "KC_NO",
      "KC_NO",
      "KC_TRNS",
      "KC_NO",
      "KC_NO",
      "KC_NO",
      "KC_TRNS",
      "KC_TRNS",
      "KC_TRNS",
      "KC_TRNS",
      "KC_TRNS",
      "KC_TRNS"
    ]
  ],
  "encoders": []
}

]]>
Thu, 20 Feb 2025 00:00:00 GMT
E-ink bookmarks https://xenodium.com/e-ink-bookmarks https://xenodium.com/e-ink-bookmarks
  • cPiArtFrame.
  • DIY E-Ink clock update with more faces, github repo & full youtube tutorial.
  • Show HN: E-Paper 7-color display showing the current weather | Hacker News.
  • ]]>
    Mon, 03 Feb 2025 00:00:00 GMT
    Sourdough bookmarks https://xenodium.com/sourdough-bookmarks https://xenodium.com/sourdough-bookmarks
  • Reading crumbs structure: fermentation.
  • Todays loaf and some advice after making 100+ loaves over 6 years.
  • ]]>
    Mon, 03 Feb 2025 00:00:00 GMT
    Cardamom Buns recipe https://xenodium.com/cardamom-buns-a-yak-shaving-story-plus-recipe https://xenodium.com/cardamom-buns-a-yak-shaving-story-plus-recipe Buns
    • 150 ml milk
    • 2 tsp instant yeast (2.25 tsp active-dry yeast, 17.5g fresh yeast)
    • 1 large egg
    • 1 egg yolk
    • 50 grams sugar
    • 1/2 tsp vanilla extract
    • 1/2 tsp ground cardamom
    • 1/2 tsp salt
    • 375 grams all-purpose or bread flour
    • 57 grams unsalted butter, softened

    Filling

    • 71 grams unsalted butter, softened
    • 65 grams brown sugar
    • 1.5 tsp ground cardamom
    • Pinch of salt
    ]]>
    Thu, 30 Jan 2025 00:00:00 GMT
    A tour of Ready Player Mode https://xenodium.com/a-tour-of-ready-player-mode https://xenodium.com/a-tour-of-ready-player-mode Ready Player Mode, which began as a tiny media-viewing experiment, has now become my daily music player.

    Along the way, I moved from regular daily streaming to buying and playing music offline, relying on the odd streaming service exclusively for discovery. This setup's been working great so far. I get unrestricted playback (for life) with the occasional discovery session whenever I see fit.

    Setup

    Ready Player Mode runs in Emacs. You install it, enable its minor mode (for media recognition), and you're ready to go.

    (use-package ready-player
      :ensure t
      :config
      (ready-player-mode +1))
    

    Ready Player Mode will try to use either mpv, vlc, ffplay, or mplayer (in that order) to play media, but mpv works best.

    Ready to go

    Post setup, you can open media files like any other text file and Emacs will just play it for you. Say, open a dired buffer, navigate to a file, and open as usual.

    Buttons vs key bindings

    If buttons are your cup of tea, use tab or backtab to navigate around.

    Alternatively, single-key bindings are available. You can find them all in the transient help menu, via the ? binding.

    Global key bindings

    Global key bindings are available, so you can interact with the player without switching buffers.

    Global bindings are under the C-c m prefix.


    C-c m SPC Toggle play/stop of media. C-c m r Cycle through repeat settings: file, directory, off. C-c m m Toggle switching between player buffer and previous buffer. C-c m s Toggle shuffle setting. C-c m a Toggle autoplay setting. C-c m n Open the next media file in the same directory. C-c m c Open my media collection. C-c m i Show playback info in the echo area. C-c m p Open the previous media file in the same directory. C-c m / Search the `dired' playlist for playback (experimental).


    If you prefer to use other bindings, disable default ones with:

    (setq ready-player-set-global-bindings nil)
    

    Open externally

    You can always open the currently played file externally, using your system default player. This is bound to the e key.

    Repeat, shuffle, and autoplay

    Repeat, shuffle, and autoplay should do what you'd expect and can be toggled via r s and a keys.

    Play current directory

    By default, Ready Player will continue playing other media found in the current directory. Use n and p bindings to move through different tracks.

    Seek

    Ready Player works best with mpv player. If you have it installed, you can seek through tracks.

    Play your collection

    Ready Player can remember your music collection, but needs a tiny addition to the existing setup via the ready-player-my-media-collection-location variable.

    (use-package ready-player
      :custom
      (ready-player-my-media-collection-location "~/path/to/your/music/collection")
      :config
      (ready-player-mode +1))
    

    Your music collection is now available via the home button.

    Index + search

    Your music collection is automatically indexed. Same for the currently played directory, so you can search for tracks.

    Bookmarking

    This is a new feature inspired by tristanC's use of Emacs bookmarks with Ready Player. Bookmarks are now displayed and toggled from the player interface.

    Bookmarks are searchable too.

    Download album cover

    Missing album cover? Download it via M-x ready-player-download-album-artwork.

    Embracing dired

    I mentioned playing media from current directory or your music collection, but Ready Player is really just playing media from a dired buffer. If you can craft a dired buffer, Ready Player should be able to play it. Think find-dired.

    Advanced features

    Ready Player should be umm… ready to play with little configuration. If you want further customizations, check out its documentation.

    Enjoy your unrestricted music offline, now and forever!

    sponsor✨ this project.

    ]]>
    Thu, 30 Jan 2025 00:00:00 GMT
    A platform that moulds to your needs https://xenodium.com/a-platform-that-moulds-to-your-needs https://xenodium.com/a-platform-that-moulds-to-your-needs Emacs users may be known for bringing in all sorts of diverse workflows into their beloved text editor. From the outside, I get how odd this may seem. We often treat our text editor as a platform of sorts to do our email, web browsing, calendars, project management, chat… the list goes on.

    Take email, as an example. Back in 2018 I thought "managing email from Emacs… surely that's crazy-talk", yet I gave it a try just in case. 7 years later and I never looked back. I still use the excellent mu4e client.

    As you become more accustomed to Emacs, you may find yourself wishing you could navigate other tasks just as efficiently. But this doesn't happen right away. The editor starts moulding to your needs, initially as you copy others's code/configurations, but this can only take you so far. Emacs truly does mould to your own needs, once you start learning a little elisp.

    When comparing elisp to modern languages, one may be tempted to dismiss it as a niche language from another era. While both of those things may be true, its moulding and glueing capabilities remain just as relevant and powerful today, even in the LLM era.

    Take a random workflow like extracting vocabulary from a Japanese class paper handout. While it may seem far-fetched for Emacs to handle this, it's actually fairly straightforward with a little elisp glue. Often, this consists of finding some crucial utilities and glueing them up.

    Take a screenshot

    I'm mostly on macOS, so I can use the built-in screencapture utility to capture the screen and save to a file.

    (call-process "/usr/sbin/screencapture" nil nil nil "-i" "path/to/screenshot.png")
    

    Get an LLM to OCR things for ya

    These days, there are no shortages of neither large language models nor Emacs clients. I built one: chatgpt-shell, so I feed the screenshot to chatgpt-shell-lookup, giving it a prompt like:

    1. Fill out an org mode table using this format as an example:
    
    |----------+----------+-------+--------+---------+------|
    | Hiragana | Katakana | Kanji | Romaji | English | Tags |
    |----------+----------+-------+--------+---------+------|
    |          |          |       |        |         |      |
    |----------+----------+-------+--------+---------+------|
    
    2. Fill out Hiragana or Katakana when appropriate. Never both.
    3. Fill out Kanji when appropriate.
    4. Show long romaji vowels (i.e. ō).
    5. DO NOT use Markdown source blocks.
    6. DO NOT add any text or explanations outside the org table.
    

    Be sure to always check LLM output ;)

    Let org do its thing

    Since I requested org markup from the LLM, I can use org-mode to navigate cells and tweak data as needed. The output I get looks a little something like this:

    | Hiragana               | Katakana   | Kanji                | Romaji               | English               | #Tags              |
    |------------------------+------------+----------------------+----------------------+-----------------------+--------------------|
    | べんきょう を します   |            | 勉強 を します       | benkyō o shimasu     | study                 | #study             |
    ...
    | かいもの を します     |            | 買い物 を します     | kaimono o shimasu    | shop                  | #shopping          |
    ...
    

    Sarasa Gothic (detour)

    More of a side-note than anything… As a beginner Japanese learner, I quickly discovered I needed a font supporting my new rendering needs. I found Sarasa Gothic Mono, a lovely font (thanks to this Reddit post).

    More elisp glue

    Now that I got my Japanese vocabulary in org format, I can continue leveraging elisp to glue other things from my target workflow, like iterating over the table and generating a tsv with my new vocabulary:

    (while (org-at-table-p)
      (let* ((front ...)
             (hiragana (org-table-get-field 1))
             (katakana (org-table-get-field 2))
             (kanji (org-table-get-field 3))
             (romaji (org-table-get-field 4))
             (meaning (org-table-get-field 5))
             (tags (org-table-get-field 6)))
        (with-current-buffer output-buffer
          (insert (format "%s\t%s\t%s\t%s\t%s\t%s\t%s\n"
                          front
                          hiragana
                          katakana
                          kanji
                          romaji
                          meaning
                          (replace-regexp-in-string "#" "" tags)))))
      (forward-line 1))
    
    べんきょう を します   べんきょう を します     勉強 を します    benkyō o shimasu    study   study
    ...
    かいもの を します    かいもの を します      買い物 を します   kaimono o shimasu   shop    shopping
    ...
    

    Anki

    So where is all this elisp glueing going? Now that I have my new vocabulary in a .tsv table, I can feed it to Anki, the popular spaced repetition app. While there are a handful of existing Anki Emacs packages, converting with an elisp loop was simple enough and gave me lots of freedom on how to structure my cards.

    iPhone

    Once I got the new vocabulary imported into Anki, I can subsequently sync it over to the iPhone. In some way, you can say that a bit of elisp glue here and there facilitated the entire workflow.

    By the way, now you know why there's a random chatgpt-shell-japanese-lookup function included in chatgpt-shell.

    Learn elisp

    While Emacs and elisp may not be the most fashionable pair, they sure fill a huge void for me. They provide a platform that can easily mould to my specific needs.

    If you're an Emacser and have been shying away from learning elisp, do yourself a favour and get your toes dipped. You'll be glad to.

    Soon enough, you'll enable workflows that mould exactly to the way you like things to work. In other words, they simply do what ✨you✨ mean ;)

    ]]>
    Tue, 21 Jan 2025 00:00:00 GMT
    Blogging minus the yucky bits of the modern web https://xenodium.com/blogging-minus-the-yucky-bits-of-modern-web https://xenodium.com/blogging-minus-the-yucky-bits-of-modern-web Happy New Year! If you follow my blog, you may have noticed that I've been hosting it on lmno.lol for a while now, a blogging service I built (invitation-only until now).

    #+ATTR_HTML: :width 90%
    

    Why build a blogging platform

    There's been a resurgence in blogging of sorts. Wonderful in itself, but the popular platforms are fairly erm unfriendly to their readers.

    These days, search results might lead you to an interesting blog post, but you're greeted with messages like:

    “The author made this story available to ^^^^^^ members only. If you’re new to ^^^^^^, create a new account to read this story on us.”

    Kinda strange for a platform to offload blame onto its users.

    In one instance, I bit the bullet. Created an account, logged in, only to find out the specific post was reserved to paying members. “Alright,” I thought, “let’s do this.” Sadly, when I finally arrived, the content was a bit of a letdown. After all those hoops…

    Meanwhile, both Privacy Badger and uBlock Origin were going haywire. Great, this thing is tracking me too. At least the site is lean… I kid, of course not.

    So that's that. Off I went to build a blogging platform to exclude the yucky bits the modern web has brought to our blogs.

    My blogging journey

    I'm what you may call an accidental blogger. Sometime ago, I started jotting notes using plain text file sprinkled with org markup. I'd use my text editor for both writing and recall. It worked well when in front of my computer, not so much when on the move or sharing things with anyone. By that point, I decided to export my notes to HTML and post online. Over time, folks started reaching out about something read in my notes, errrm blog posts, and so by then I suppose I had become a blogger.

    In 11 years of blogging, my approach hasn't changed much. I still write to the very same plain text file I used to write my notes to. I found this approach fairly accessible, with little ceremony. When I want to write, I open the usual text file and just write. HTML exporting consisted of hacky elisp cobbled together over time. While the code was nothing to rave about, it did the job just fine over the years. Having said that, it was more of a "it works on my machine" sorta thing.

    Enter lmno.lol

    lmno.lol is heavily inspired by the same workflow. You write your notes or blog posts to a single plain text file, sprinkling Markdown this time around, and just drag and drop it to the web.

    lmno.lol takes care of the rest.

    A Little blast from the past

    Remember ASCII art? Figlet? You can bring back some of that nostalgic web by adding a banner to your blog.

    lmno.lol enables that via text art banners. What would you add?

    # blog-text-art-banner
    
     /$$$$$$$                            /$$
    | $$__  $$                          | $$
    | $$  \ $$  /$$$$$$  /$$$$$$$   /$$$$$$$  /$$$$$$   /$$$$$$
    | $$$$$$$/ /$$__  $$| $$__  $$ /$$__  $$ /$$__  $$ /$$__  $$
    | $$__  $$| $$$$$$$$| $$  \ $$| $$  | $$| $$$$$$$$| $$  \__/
    | $$  \ $$| $$_____/| $$  | $$| $$  | $$| $$_____/| $$
    | $$  | $$|  $$$$$$$| $$  | $$|  $$$$$$$|  $$$$$$$| $$
    |__/  |__/ \_______/|__/  |__/ \_______/ \_______/|__/
    

    Read anywhere

    Needless to say, this platform has no tracking, ads, or paywalls. It also tries to stay away from bloat and uses JavaScript for optional features only. If you're wondering, all blogs include RSS FEEDS with full content.

    Blogs render wonderfully pretty much anywhere.

    Help sustain a better web

    We have plenty of features we’d like to add. We host blogs for a small fee ($1.50 per month). This fee helps us cover hosting expenses, maintain and develop features, and keep the platform running smoothly. That’s the entirety of our transaction—no ads, no tracking, no selling of user data.

    There are no paywalls here. You can read fully and freely. However, please consider becoming a paying customer, even if you don’t plan to blog yourself. Your support ensures the platform remains sustainable and independent.

    As a paying customer, you’ll also get to reserve your own blog handle. By doing so, you not only support the platform but also promote an inclusive internet experience that is fast, smooth, and free of constant tracking, intrusive advertising, paywalls, and data collection.

    By supporting services like lmno.lol, you prove like-minded services are not only possible but fully sustainable without deceitful tech.

    I hope you like lmno.lol. Happy blogging!

    ]]>
    Wed, 01 Jan 2025 00:00:00 GMT
    symbol-overlay-mc now on MELPA https://xenodium.com/symbol-overlay-mc-now-on-melpa https://xenodium.com/symbol-overlay-mc-now-on-melpa Some time ago, I wrote about adding multiple cursor support to symbol-overlay by gluing the two packages together. If you're keen to learn how to bend Emacs to your way, have a look at that post.

    Later on, in a "Multiple cursors - how and why?" Reddit post, I showcased the overlay usage. Peter Oliver asked if the package could be submitted to MELPA. To my delight, he also volunteered to take on the submission.

    Unfortunately, I had failed to check back on the MELPA submission until today. I'm happy to report that, thanks to Peter, symbol-overlay-mc is now on MELPA.

    Happy symbol-overlay-multiple-cursors editing! ;)

    ]]>
    Sat, 28 Dec 2024 00:00:00 GMT
    Hello emacs.tv https://xenodium.com/hello-emacstv https://xenodium.com/hello-emacstv A few days ago, Sacha Chua mentioned how cool it would be to have an Emacs video index like Ruby Video. I mentioned how I had similarly considered a low-tech solution, maybe powered by plain text (bonus points for org mode of course).

    A little later, Sacha shared a preliminary video feed dump, in org! With that, I wrote the first experiment to render the org feed and emacs.tv was born.

    emacs.tv is merely a few days old. Powered by an org feed (rendered client-side), but we can fetch and render in all sorts of ways. emacs.tv brings it to the web, though I'm sure we can come up with all sorts of Emacs integrations. A new major mode? Or maybe convert the org feed to rss and plug into elfeed?

    This is what a feed entry looks like:

    * EmacsConf.org: How we use Org Mode and TRAMP to organize and run a multi-track conference :emacsconf:emacsconf2023:org:tramp:
    :PROPERTIES:
    :DATE: 2023-12-03
    :URL: https://emacsconf.org/2023/talks/emacsconf
    :MEDIA_URL: https://media.emacsconf.org/2023/emacsconf-2023-emacsconf--emacsconforg-how-we-use-org-mode-and-tramp-to-organize-and-run-a-multitrack-conference--sacha-chua--main.webm
    :YOUTUBE_URL: https://www.youtube.com/watch?v=uTregv3rNl0
    :TOOBNIX_URL: https://toobnix.org/w/eX2dXG3xMtUHuuBz4fssGT
    :TRANSCRIPT_URL: https://media.emacsconf.org/2023/emacsconf-2023-emacsconf--emacsconforg-how-we-use-org-mode-and-tramp-to-organize-and-run-a-multitrack-conference--sacha-chua--main.vtt
    :SPEAKERS: Sacha Chua
    :SERIES: EmacsConf 2023
    :END:
    

    We need your help

    As mentioned, this is a new project. It's a good start, but it can only get better with your help.

    Submit more content

    Sacha kickstarted a wonderful video feed, a collection of 1715 videos as of today. We need more. Are your published videos missing? Reckon other videos should be listed? Please help by submitting new entries.

    Improve our tagging

    Many of the listed videos could use more tags. Please help us by tagging content in video.org and submit a pull request.

    Take it for a spin

    Or maybe just take emacs.tv for a spin and give us some feedback.

    Happy holidays! 🎄☃️

    ]]>
    Mon, 23 Dec 2024 00:00:00 GMT
    An experimental (e)shell pager https://xenodium.com/an-experimental-e-shell-pager https://xenodium.com/an-experimental-e-shell-pager These days, my LLM interactions primarily take place via chatgpt-shell's compose UX. I've grown fond of this hybrid style of interaction. On sharing the latest incarnation, jllw asked about the possibility to port to comint shells.

    With jllw's great idea in mind, I set out to prototype an eshell pager, my preferred shell.

    The initial results ain't too shabby:

    While you can easily flip through all eshell commands and outputs (via single-character n/p bindings), you can also compose and fire off new commands using a magit-style approach. That is, craft your desired command and C-c C-c to send it off.

    The prototype is currently focused on eshell, but it can be easily ported to comint and other shells by writing new shell-maker configs:

    (shell-pager--make-config
     :shell-buffer buffer
     :page-buffer (shell-pager--buffer)
     :next #'shell-pager--eshell-next
     :previous #'shell-pager--eshell-previous
     :current #'shell-pager--eshell-current-item
     :subscribe #'shell-pager--eshell-subscribe
     :unsubscribe #'shell-pager--eshell-unsubscribe
     :submit #'shell-pager--eshell-submit
     :interrupt #'shell-pager--eshell-interrupt)
    

    shell-pager's super rough/experimental code is now on GitHub.

    It's been a fun experiment so far. Time will tell, whether or not shell-pager can replace most of my eshell interactions. The good news is that this isn't an all or nothing sorta thing. shell-pager complements eshell, so I can always jump back to eshell itself and continue with the very same shell history.

    ]]>
    Mon, 09 Dec 2024 00:00:00 GMT
    LLM chat navigation https://xenodium.com/llm-chat-navigation https://xenodium.com/llm-chat-navigation LLM chats are often handy for refining answers to a question or task, part of a bigger goal. Navigating the chat transcript, copying and pasting, can be a frequent operation in the bigger goal. If we can do it more efficiently, the better.

    While chatgpt-shell offered chatgpt-shell-next-item and chatgpt-shell-previous-item commands, it had a few rough edges which prevented me from fully adopting. The default bindings C-c C-n and C-c C-p didn't exactly help either, making repeated navigation fairly clunky. repeat-mode would have helped a little, yet I was yearning for a familiar experience… more like tab and Shift-tab in web browsers.

    While shells often tab-complete commands and/or arguments, I'm not super convinced tab completion is a good candidate for an LLM Emacs shell. Having said that, searching for previous prompts a la Ctr-r is indeed a handy feature and already supported in chatgpt-shell (via M-r).

    This is all to say that the with the latest chatgpt-shell navigation changes (using <tab> and <backtab> bindings), the chatgpt-shell experience feels way more natural. You can see it in action…

    Tab navigation jumps between prompts, links, and code blocks. You may have noticed code blocks are automatically selected, in case you want to quickly copy and paste elsewhere.

    This mode of navigation is also present in the compose UX (via M-x chatgpt-shell-prompt-compose). In addition to <tab> and <backtab>, you can use n and p bindings (post prompt submission).

    Give the new navigation a try. See how it feels. Some of it is fairly fresh, so please file bugs if needed.

    ]]>
    Thu, 05 Dec 2024 00:00:00 GMT
    Awesome elisp https://xenodium.com/awesome-elisp https://xenodium.com/awesome-elisp A few days ago, redditor gollyned asked about best practices: developing on top of modern elisp packages. It reminded of my modern Emacs lisp libraries post, which I shared with them.

    While my post is roughly 4.5 years old, these days I continue to reach out to the likes of seq.el, map.el, subr-x.el and let-alist.el on a regular basis. My post also shared some great third party options. Maybe my post could use an update? Happy to take suggestions.

    A few days later, I ran into awesome-elisp, which aggregates a ton of resources to check out. Funnily enough, I had bookmarked it a long while ago and simply forgot about it. On a somewhat related note, when I reviewed my old list of bookmarks, I didn't have Yoo Box's it is not hard to read Lisp code bookmarked, which changed the way I viewed and read elisp code (spoiler alert, as a tree). I remember how well this approach also translated to languages like Objective-C, enabling me to inline more things without worrying too much.

    In any case, the reddit post was another reminder for me to go and check out some of those bookmarks I never got to read, including the awesome-elisp one.

    ]]>
    Wed, 04 Dec 2024 00:00:00 GMT
    ob-chatgpt-shell goes multi-model too https://xenodium.com/ob-chatgpt-shell-goes-multi-model-too https://xenodium.com/ob-chatgpt-shell-goes-multi-model-too A week ago, I announced chatgpt-shell going multi-model. What I failed to mention is that because ob-chatgpt-shell (its org babel Emacs cousin) relies on chatgpt-shell, this babel package has now gone multi-model also.

    ob-chatgpt-shell follows the familiar babel form. To swap models, use the existing :version param as follows.

    #+begin_src chatgpt-shell :results output :version gpt-4o
      Who built you?
    #+end_src
    
    #+RESULTS:
    : I was developed by OpenAI, a research organization focused on creating and promoting friendly AI for the benefit of all humanity.
    
    #+begin_src chatgpt-shell :results output :version claude-3-5-sonnet-20240620
      Who built you?
    #+end_src
    
    #+RESULTS:
    : I was created by Anthropic.
    
    #+begin_src chatgpt-shell :results output :version qwen2.5-coder
      Who built you?
    #+end_src
    
    #+RESULTS:
    : I was built by Alibaba Cloud. How can I assist you today?
    
    #+begin_src chatgpt-shell :results output :version gemini-1.5-pro-latest
      Who built you?
    #+end_src
    
    #+RESULTS:
    : I was built by Google.  More specifically, I'm a large language model, trained by Google.
    

    Keep in mind that :version depends on chatgpt-shell-models to resolve its models. You may need to add other models. If you add new ones, consider contributing a pull request, so we all benefit from the addition.

    Should ob-chatgpt-shell rename?

    See this.

    Please report issues

    In addition to being a fairly new feature, chatgpt-shell multi-model support required quite a few structural changes. We may still need additional polishing follow-ups. If you encounter any issues please report them.

    Make this project sustainable

    Maintaining, experimenting, implementing feature requests, and supporting open-source packages takes work. Today, chatgpt-shell has roughly 21.5K downloads on MELPA and many untracked elsewhere. If you're one of the happy users, consider sponsoring the project. If you see potential, help fuel development by sponsoring too.

    Perhaps you enjoy some of the content I write about? Find my Emacs posts/tips useful?

    Alternatively, you want a blogging platform that skips the yucky side effects of the modern web?

    Maybe you enjoy one of my other projects?

    So, umm… I'll just leave my GitHub sponsor page here.

    ]]>
    Wed, 27 Nov 2024 00:00:00 GMT
    LLM iterate and insert https://xenodium.com/llm-iterate-and-insert https://xenodium.com/llm-iterate-and-insert chatgpt-shell includes a couple of mechanisms to operate on an Emacs buffer region. That is, select a region and ask the LLM robots to modify it for us. Until now, both of these mechanisms didn't quite close the loop. They could either modify current region or iterate on a separate solution, but never both.

    M-x chatgpt-shell-quick-insert

    While chatgpt-shell's quick insert mechanism already enabled selecting a region and requesting changes, it was more of a "I'm feeling lucky" situation. If the changes didn't pan out, you'd have to discard the suggestion and start over.

    With the latest changes, in addition to accepting or discarding (y/n bindings) suggestions, we can now iterate using the i binding.

    M-x chatgpt-shell-prompt-compose

    While quick insertions rely on minibuffer input, chatgpt-shell-prompt-compose opens a dedicated buffer for a more thorough interactions. Select a region, invoke chatgpt-shell-prompt-compose (my preferred binding being C-c C-e), and a new compose buffer is created with the region text. Add your instructions and submit with C-c C-c. Post submission, the compose buffer becomes read-only and single-character key-bindings take over. For example: r replies (for further iteration) and n/p (or TAB/shift-TAB) navigation. There are more bindings.

    Until now, we could easily craft more involved queries and continue iterating from the compose buffer, but integrating suggested changes was a manual process. That is, navigate to a code block, select, copy it and then paste it elsewhere.

    With the latest changes, pressing i (insert) while on a code block will attempt to insert it wherever the initial interaction took place.

    Both of these changes show now be available on MELPA. While I demoed ChatGPT, the two mechanism should now work with any of the supported models (ChatGPT, Claude, Gemini, and Ollama).

    ]]>
    Mon, 25 Nov 2024 00:00:00 GMT
    Toggle macOS menu bar from you know where https://xenodium.com/toggle-macos-menu-bar-from-you-know-where https://xenodium.com/toggle-macos-menu-bar-from-you-know-where I'm a fan of macOS's auto-hide menu bar setting. Unless I'm reaching out to a menu item, I don't typically need to have a visible menu bar, so I set auto-hide to "Always".

    On rare occasions, I turn this setting off (say for a screen grab). While reaching out to macOS Control Center is OK, I wanted to quickly toggle it from the comfort of Emacs via M-x fuzzy search.

    We can leverage AppleScript to toggle the setting on and off. In the past, I would write shell scripts for this kinda thing and invoke from the command line. These days, I dump them into a dwim-shell-command and quickly forget about its implementation. From then on, I just M-x and fuzzy search for some magical incantation (I'm looking at you ffmpeg). I got a bunch of these things

    (defun dwim-shell-commands-macos-toggle-menu-bar-autohide ()
      "Toggle macOS menu bar auto-hide."
      (interactive)
      (dwim-shell-command-on-marked-files
       "Toggle menu bar auto-hide."
       "current_status=$(osascript -e 'tell application \"System Events\" to get autohide menu bar of dock preferences')
    
    if [ \"$current_status\" = \"true\" ]; then
        osascript -e 'tell application \"System Events\" to set autohide menu bar of dock preferences to false'
        echo \"Auto-hide disabled.\"
    else
        osascript -e 'tell application \"System Events\" to set autohide menu bar of dock preferences to true'
        echo \"Auto-hide enabled.\"
    fi"
       :utils "osascript"
       :silent-success t))
    

    …and that's all there is to it.

    ]]>
    Fri, 22 Nov 2024 00:00:00 GMT
    chatgpt-shell goes offline https://xenodium.com/chatgpt-shell-goes-offline https://xenodium.com/chatgpt-shell-goes-offline Since chatgpt-shell going multi-model, it was only a matter of time until we added support for local/offline models. As of version 2.0.6, chatgpt-shell has a basic Ollama implementation (llama3.2 for now).

    chatgpt-shell is more than a shell. Check out the demos in the previous post.

    For anyone keen on keeping all their LLM interactions offline, Ollama seems like a great option. I'm an Ollama noobie myself and already looking forward to getting acquainted. Having an offline LLM available at my Emacs fingertips will be super convenient.

    For the more familiar with Ollama, please give the chatgpt-shell integration a try (it's on MELPA).

    v2.0.6 has a basic/inital Ollama implementation. Please give it a good run and report bugs.

    You can swap models via:

    M-x chatgpt-shell-swap-model
    

    Help make this project sustainable. Sponsor the work.

    ]]>
    Thu, 21 Nov 2024 00:00:00 GMT
    chatgpt-shell goes multi-model https://xenodium.com/chatgpt-shell-goes-multi-model https://xenodium.com/chatgpt-shell-goes-multi-model Over the last few months, I've been chipping at implementing chatgpt-shell's most requested and biggest feature: multi-model support. Today, I get to unveil the first two implementations: Anthropic's Claude and Google's Gemini.

    Changing course

    In the past, I envisioned a different path for multi-model support. By isolating shell logic into a new package (shell-maker), folks could use it as a building block to create new shells (adding support for their favourite LLM).

    While each shell-maker-based shell currently shares a basic common experience, I did not foresee the minor differences affecting the general Emacs user experience. Learning the quirks of each new shell felt like unnecessary friction in developing muscle memory. I also became dependent on chatgpt-shell features, which I often missed when using other shells.

    Along with slightly different shell experiences, we currently require multiple package installations (and setups). Depending on which camp you're on (batteries included vs fine-grained control) this may or may not be a downside.

    With every new chatgpt-shell feature I showcased, I was often asked if they could be used with other LLM providers. I typically answered with "I've been meaning to work on this…" or "I heard you can do multi-model chatgpt-shell using a bridge like liteLLM". Neither of these where great answers, resulting in me just postponing the chunky work.

    Eventually, I bit the bullet, changed course, and got to work on multi-model support. With my initial plan to spin multiple shells via shell-maker, chatgpt-shell's implementation didn't exactly lend itself to support multiple clients. Long story short, chatgpt-shell multi-model support required quite a bit of work. This where I divert to ask you to help make this project sustainable by sponsoring the work.

    Make this project sustainable

    Maintaining, experimenting, implementing feature requests, and supporting open-source packages takes work. Today, chatgpt-shell has over 20.5K downloads on MELPA and many untracked others elsewhere. If you're one of the happy users, consider sponsoring the project. If you see potential, help fuel development by sponsoring too.

    Perhaps you enjoy some of the content I write about? Find my Emacs posts/tips useful?

    Alternatively, you want a blogging platform that skips the yucky side effects of the modern web?

    Maybe you enjoy one of my other projects?

    So, umm… I'll just leave my GitHub sponsor page here.

    chatgpt-shell, more than a shell

    With chatgpt-shell being a comint shell, you can bring your favourite Emacs flows along.

    As I used chatgpt-shell myself, I kept experimenting with different integrations and improvements. Read on for some of my favourites…

    A shell hybrid

    chatgpt-shell includes a compose buffer experience. This is my favourite and most frequently used mechanism to interact with LLMs.

    For example, select a region and invoke M-x chatgpt-shell-prompt-compose (C-c C-e is my preferred binding), and an editable buffer automatically copies the region and enables crafting a more thorough query. When ready, submit with the familiar C-c C-c binding. The buffer automatically becomes read-only and enables single-character bindings.

    Navigation: n/p (or TAB/shift-TAB)

    Navigate through source blocks (including previous submissions in history). Source blocks are automatically selected.

    Reply: r

    Reply with with follow-up requests using the r binding.

    Give me more: m

    Want to ask for more of the same data? Press m to request more of it. This is handy to follow up on any kind of list (suggestion, candidates, results, etc).

    Request entire snippets: e

    LLM being lazy and returning partial code? Press e to request entire snippet.

    Quick quick: q

    I'm a big fan of quickly disposing of Emacs buffers with the q binding. chatgpt-shell compose buffers are no exception.

    Confirm inline mods (via diffs)

    Request inline modifications, with explicit confirmation before accepting.

    Execute snippets (a la org babel)

    Both the shell and the compose buffers enable users to execute source blocks via C-c C-c, leveraging org babel.

    Vision experiments

    I've been experimenting with image queries (currently ChatGPT only, please sponsor to help bring support for others).

    Below is a handy integration to extract Japanese vocabulary. There's also a generic image descriptor available via M-x chatgpt-shell-describe-image that works on any Emacs image (via dired, image buffer, point on image, or selecting a desktop region).

    Supporting new models

    Your favourite model not yet supported? File a feature request. You also know how to fuel the project. Want to contribute new models? Reach out.

    Local models

    While the two new implementations rely on cloud APIs, local services are now possible. I've yet to use a local LLM, but please reach out, so we can make these happen too. Want to contribute?

    Should chatgpt-shell rename?

    With chatgpt-shell going multi-model, it's not unreasonable to ask if this package should be renamed. Maybe it should. But that's additional work we can likely postpone for the time being (and avoid pushing users to migrate). For now, I'd prefer focusing on polishing the multi-model experience and work on ironing out any issues. For that, I'll need your help.

    Take Gemini and Claude for a spin

    Multi-model support required chunky structural changes. While I've been using it myself, I'll need wider usage to uncover issues. Please take it for a spin and file bugs or give feedback. Or if you just want to ping me, I'd love to hear about your experience (Mastodon / Twitter / Reddit / Email).

    • Be sure to update to chatgpt-shell v2.0.1 and shell-maker v0.68.1 as a minimum.
    • Set chatgpt-shell-anthropic-key or chatgpt-shell-google-key.
    • Swap models with existing M-x chatgpt-shell-swap-model-version or set a default with (setq chatgpt-shell-model-version "claude-3-5-sonnet-20240620") or (setq chatgpt-shell-model-version "claude-gemini-1.5-pro-latest").
    • Everything else should just work 🤞😅

    Happy Emacsing!

    ]]>
    Wed, 20 Nov 2024 00:00:00 GMT
    chatgpt-shell splits up https://xenodium.com/chatgpt-shell-repo-splits-up https://xenodium.com/chatgpt-shell-repo-splits-up The chatgpt-shell package started as an experiment glueing the ChatGPT API to an Emacs comint buffer. Over time, it grew into several packages within the same repository: shell-maker, ob-chatgpt-shell, dall-e-shell, ob-dall-e-shell, and of course chatgpt-shell itself.

    I'm splitting the repository as a first step in reworking chatgpt-shell to enable multi-model support (i.e. Gemini, Claude, and others), a popular feature request.

    Want multi-model support?

    Go 👍 the feature request and ✨sponsor✨ the work.

    If keen on having a multi-modal chatgpt-shell at your fingertips, please consider sponsoring to make the project sustainable. Improvements like this, integrations, and keeping up with the AI space takes quite a bit of work and effort.

    New package repositories

    chatgpt-shell

    No repo location changes. Remains at https://github.com/xenodium/chatgpt-shell

    chatgpt-shell carries the ChatGPT shell itself, but also convenience integrations.

    My hope is to make this a multi-model package.

    ob-chatgpt-shell

    Moves to https://github.com/xenodium/ob-chatgpts-shell

    An extension of chatgpt-shell to execute org babel blocks as ChatGPT prompts.

    dall-e-shell

    Moves to https://github.com/xenodium/dall-e-shell

    A dedicated shell for DALL-E image generation.

    ob-dall-e-shell

    Moves to https://github.com/xenodium/ob-dall-e-shell

    An extension of dall-e-shell to execute org babel blocks as ChatGPT prompts.

    shell-maker

    Moves to https://github.com/xenodium/shell-maker

    shell-maker a convenience wrapper around comint mode to build shells. Both chatgpt-shell and dall-e-shell are built on top of shell-maker.

    Enjoying this content? Using one of my Emacs packages?

    Help make the work sustainable. Consider sponsoring. I'm also building lmno.lol. A platform to drag and drop your blog to the web.

    ]]>
    Wed, 13 Nov 2024 00:00:00 GMT
    Hide another detail https://xenodium.com/hide-another-detail https://xenodium.com/hide-another-detail It's been 5 years since I talked about showing/hiding Emacs dired details in style, a short post showcasing hide-details-mode (built-in) and diredfl (third-party).

    While my dired usage increased over the years, my dired config remained largely unchanged. Today, I'll show a new dired tweak.

    As you likely suspect by now, I'm a big fan of hide-details-mode. It gives me super clean and minimalistic view of my files.

    If I need more details, it's one toggle away using my trusty C-( binding.

    Now this is a super minor thing, but for a little while, I wished I could also hide the current directory's absolute path as part of hide-details-mode's toggling. In the same spirit as other hidden dired details, I rarely need to see the absolute path. And if I did, it'd only be a toggle away.

    With that in mind, I set out to bend dired my way. I looked at the dired-hide-details-mode built-in code (dired.el) and came across invisibility specs, which I hadn't used before. Dired uses add-to-invisibility-spec and remove-from-invisibility-spec to show and hide details using the invisible property set to dired-hide-details-information.

    Now that we know what property to set, we need to find the text to apply it to. Dired offers that via dired-subdir-regexp. All we need to do is match the regular expression and apply our invisible property to the relevant bounds.

    (defun hide-dired-details-include-all-subdir-paths ()
      (save-excursion
        (goto-char (point-min))
        (while (re-search-forward dired-subdir-regexp nil t)
          (let* ((match-bounds (cons (match-beginning 1) (match-end 1)))
                 (path (file-name-directory (buffer-substring (car match-bounds)
                                                              (cdr match-bounds))))
                 (path-start (car match-bounds))
                 (path-end (+ (car match-bounds) (length path)))
                 (inhibit-read-only t))
            (put-text-property path-start path-end
                               'invisible 'dired-hide-details-information)))))
    

    All that's left is for us to add our new function to a hook, and we're good to go.

    (use-package dired
      :hook ((dired-mode . dired-hide-details-mode)
             (dired-after-readin . hide-dired-details-include-all-subdir-paths)))
    

    My Dired window is even cleaner now. The current directory's absolute path is now hidden.

    There may be times we need to peek at the absolute path. We can now toggle hiding this detail just like the others.

    My first Emacs patch

    While this is a rather small change, I figured I could use it to get my toes dipped as a first Emacs contribution. I've since reworked the patch to fit into dired.el's code and submitted for review.

    I'm happy to report the tiny feature's now merged to master as of a couple of days ago. Yay! 🎉

    It'll be sometime until the feature makes it to a release, but if you're living on the Emacs master edge, it should be available there. While the feature is disabled by default, it can enabled with:

    (setq dired-hide-details-hide-absolute-location t)
    

    Happy hiding!

    Enjoying this content? Using one of my Emacs packages?

    Help make the work sustainable. Consider sponsoring. I'm also building lmno.lol. A platform to drag and drop your blog to the web.

    ]]>
    Mon, 21 Oct 2024 00:00:00 GMT
    How I batch apply and save one-liners https://xenodium.com/how-i-batch-apply-and-save-one-liners https://xenodium.com/how-i-batch-apply-and-save-one-liners My significant other needed to share proof of address by providing a number of bank statements for a period of time. That's easy enough to download as pdfs from the bank, but statements typically provide more personal information than the recipient requires. For a proof of address, the first page is more than enough.

    macOS's Preview app can easily delete pages from a pdf by selecting undesired pages and hitting the delete key. This is fine for one pdf but for a handful of them, I figured there's a command line incantation I could use out there, and indeed there is:

    qpdf my.pdf --pages . 1 -- my-one-page.pdf
    

    With command in mind, I resorted to my now my typical approach of:

    I could be done at this point, but since I now have the command fresh in mind…

    • Save command for future usage.

    So let's get on with it.

    Converting to dwim-shell-command

    qpdf '<<f>>' --pages . 1 -- '<<fne>>_1.<<e>>'
    

    Batch apply

    Other than show it in action, it may be worth mentioning dwim-shell-command recognizes files in region (in addition to dired's mark of course), so you can just select and apply.

    Save for future usage

    Saving these commands for future usage typically consists of merely wrapping in an Emacs command so we can invoke via M-x (and your favorite narrowing framework for that fuzzy quick magic).

    (defun dwim-shell-commands-keep-pdf-page ()
      "Keep a page from pdf."
      (interactive)
      (let ((page-num (read-number "Keep page number: " 1)))
        (dwim-shell-command-on-marked-files
         "Keep pdf page"
         (format "qpdf '<<f>>' --pages . %d -- '<<fne>>_%d.<<e>>'" page-num page-num)
         :utils "qpdf")))
    

    For this instance, there's a tiny bit of additional logic to ask the user which page they'd like to keep.

    While there's no way I'll remember qpdf my.pdf --pages . 1 -- my-one-page.pdf, I can easily find it in the future by searching with something like M-x keep page.

    My toolbox

    I've saved a bunch of these commands and use many of them regularly. You can find in the optional component of dwim-shell-command.

    Enjoying this content? Using one of my Emacs packages?

    Help make the work sustainable. Consider sponsoring. I'm also building lmno.lol. A platform to drag and drop your blog to the web.

    ]]>
    Sat, 21 Sep 2024 00:00:00 GMT
    Emacs bubble mode https://xenodium.com/emacs-bubble-mode https://xenodium.com/emacs-bubble-mode From time to time, I want to grab a source code viewport of sorts and feed to an LLM for questioning. From Emacs, I normally use chatgpt-shell's chatgpt-shell-prompt-compose, which automatically grabs the active region. This led me to explore a few options to select a region, or maybe even roll my own. I should also mention, these regions don't typically require compilable/complete structures.

    In most of these instances, I just reach out to one of my region favourites like expand-region, mark-defun, or mark-whole-buffer. Alternatively, I navigate to different points using sexp commands like backward-sexp and forward-sexp (or maybe something like sp-backward-up-sexp from smartparens), using set-mark-command in-between to activate the region.

    While these commands typically yield balanced expressions, it's often unnecessary for my LLM queries. This led me to ask folks for different ways of selecting regions, which highlighted great package suggestions like avy, meow, and easy-kill.

    While I've been intrigued by meow's modal editing for some time, I'm not ready for that fair trial jump. Will have to postpone it for a little longer.

    Easy-kill offers easy-mark, in some ways similar to the built-in mark-sexp, but with additional marking heuristics and possibly other goodies I missed. At present, I get similar benefits from the likes of expand-region and the other sexp helpers.

    Avy's avy-kill-ring-save-region could work for my purpose, though I wish it left the region active. Maybe that's already possible? I could look into extending avy, though Christian's suggestions led me to lean more on visual feedback in my own region-expanding experiments.

    The goal was to enable extending regions in both vertical directions by simultaneously adding lines at both ends. Sure, this doesn't guarantee structural completeness, but it may just be enough for my LLM-feeding purpose. Maybe this already exists in the Emacs universe, but hey, it's an excuse to throw some elisp lines together…

    Assuming there's an existing active region, expanding in both directions is pretty straightforward.

    (defun bubble-expand()
      "Expand region."
      (interactive)
      (when (> (point) (mark))
        (exchange-point-and-mark))
      (forward-line -1)
      (exchange-point-and-mark)
      (forward-line 1)
      (exchange-point-and-mark))
    
    (defun bubble-shrink ()
      "Shrink region."
      (interactive)
      (when (< (point) (mark))
        (exchange-point-and-mark))
      (forward-line -1)
      (exchange-point-and-mark)
      (forward-line 1))
    

    While I've yet to use this region-expanding approach long enough to validate its usefulness, it sure is fun to play with it.

    This got me thinking, what other funky things I could do with the region? Could I shift the region selection like a viewport of sorts? As you now expect, the answer in Emacs is almost always of course we can…

    (defun bubble-shift-up ()
      "Shift the region up by one line."
      (interactive)
      (when (> (point) (mark))
        (exchange-point-and-mark))
      (forward-line -1)
      (forward-line 0)
      (exchange-point-and-mark)
      (forward-line -1)
      (end-of-line)
      (activate-mark)
      (exchange-point-and-mark))
    
    (defun bubble-shift-down ()
      "Shift the region down by one line."
      (interactive)
      (when (> (point) (mark))
        (exchange-point-and-mark))
      (forward-line)
      (forward-line 0)
      (exchange-point-and-mark)
      (forward-line)
      (end-of-line)
      (activate-mark)
      (exchange-point-and-mark))
    

    My friend Vaarnan also suggested looking into UX around providing line count, which is possible by providing a prefix into bubble-expand-region.

    C-5 M-x bubble-expand-region
    

    These commands alone aren't as effective unless we have some key-bindings around them. I've tied things up into a minor mode, called… you guessed it: bubble-mode. Oooh, a mode, you may say it's now official ;) Well, no. It's still an experiment of sorts and currently lives in my Emacs config repo.

    The key bindings I've chosen are:

    • C-c C-w: Enter bubble-mode.
    • C-p: bubble-expand.
    • C-n: bubble-shrink.
    • S-C-p: bubble-move-up.
    • S-C-n: bubble-move-down.
    • Numbers 1-0: Expand 1 to 10 lines.
    • RET: Exit bubble-mode.

    Note: Inspired by expand-region, any other key binding/command automatically exits bubble-mode.

    C-c C-w kinda works for me as C-c w is already bound to expand-region. Let's see if that sticks, though I may have to give up the org-refile binding.

    So does it work for my original LLM intent? We shall see, but it seems to so far. You can play with it if you'd like (it's on github). Here's what that flow now looks like:

    Enjoying this content? Using one of my Emacs packages?

    Help make the work sustainable. Consider sponsoring. I'm also building lmno.lol. A platform to drag and drop your blog to the web.

    ]]>
    Thu, 19 Sep 2024 00:00:00 GMT
    Spiffing up those echo messages https://xenodium.com/spiffing-up-those-echo-messages https://xenodium.com/spiffing-up-those-echo-messages Well-ingrained into every Emacs user is the echo area, a one-stop shop to receive any kind of message from the editor, located at the bottom of the frame. Posting messages to this area from elisp couldn't be simpler:

    (message "Hello world")
    

    If we want to get a little fancier, we can propertize the text to add some styling.

    (message (propertize "hello " 'face '(:foreground "#C3E88D"))
             (propertize "world" 'face '(:foreground "#FF5370")))
    

    With this in mind, I set out to add a tiny command to ready-player.

    I wanted the ability to ask what's on without switching to another buffer. The echo area is perfect for that. It should display track title, artist, and album.

    (message (concat "Ahead " ;; title
                     (propertize "Wire " 'face '(:foreground "#C3E88D")) ;; artist
                     (propertize "The Ideal Copy" 'face '(:foreground "#FF5370")))) ;; album
    

    This kinda works, but I wasn't convinced with the styling. Maybe I need multi-line?

    (message (concat "Ahead\n" ;; title
                     (propertize "Wire\n" 'face '(:foreground "#C3E88D")) ;; artist
                     (propertize "The Ideal Copy" 'face '(:foreground "#FF5370")))) ;; album
    

    I felt something was missing. If I could just add the album artwork as a thumbnail… The ideal layout would maybe look something like:

    +-------+
    |       | Ahead
    | image | Wire
    |       | The Ideal Copy
    +-------+
    

    While the text-everywhere nature of Emacs buffers has many advantages, building more involved layouts can have its challenges. But hey, for that simple read-only message we're aiming at, we can certainly get creative without too much trouble. You see, Emacs has native svg support, so we can craft our fancy layout in elisp and tell Emacs to render it for us.

    While I'm a noob at doing anything in svg from Emacs, adding an image and three labels, really isn't that difficult.

    (message
     (let* ((image-width 90)
            (image-height 90)
            (text-height 25)
            (svg (svg-create (frame-pixel-width) image-height)))
       (svg-embed svg "path/to/thumbnail.png"
                  "image/png" nil
                  :x 0 :y 0 :width image-width :height image-height)
       (svg-text svg "Ahead"
                 :x (+ image-width 10) :y text-height
                 :fill (face-attribute 'default :foreground))
       (svg-text svg "Wire"
                 :x (+ image-width 10) :y (* 2 text-height)
                 :fill "#C3E88D")
       (svg-text svg "The Ideal Copy" :x (+ image-width 10) :y (* 3 text-height)
                 :fill "#FF5370")
       (with-temp-buffer
         (svg-insert-image svg)
         (buffer-string))))
    

    The code is fairly self-explanatory. While there may be an even simpler way (please lemme know), I used a temporary buffer to embed the svg in the propertized text prior to feeding to the handy message function.

    …and with that, we get a richer display of the current track.

    While I haven't experimented with other ways of creating multi-column layouts in Emacs (including images), I'd love to know if there's anything else available besides svg.

    Enjoying these tips? Using one of my Emacs packages?

    Help make them sustainable. Consider supporting this work.

    ]]>
    Wed, 11 Sep 2024 00:00:00 GMT
    Seek and you shall find https://xenodium.com/seek-and-you-shall-find https://xenodium.com/seek-and-you-shall-find A couple of months ago, I introduced Ready Player Mode, an Emacs major mode used to peek at media files from my beloved text editor. The goal was simple. Treat opening media files like any other file, that is, open and go.

    The initial implementation served me well while reviewing lots of tiny audio files I used to practice learning a new language. At this point, I started thinking, could I use ready-player for regular music consumption? The thing is, long ago I had stopped buying music and relied on streamed music from online services. Could I go back to offline?

    Dusting off my old media collection brought lots of memories as I rediscovered tunes. Having said that, the ready-player experience wasn't quite cutting it for an extended listening experience. I no longer wanted to occasionally peek at media to learn a language. I wanted to load a full music collection. I wanted random access to everything. I wanted Emacs to remember what I was listening to across sessions… While I did add some pluggable flows, I still needed additional changes to make the experience more pleasant.

    While plugging away at my own ready-player's pet peeves, I also collected a handful of feature requests. Let's go over the latest features.

    Seek (f/b binding) - feature request

    While not a feature I initially thought ranked highly in priority, I now find myself seeking audio files from time to time. Ready Player delegates all playback to the likes of mpv, vlc, mplayer, and so on… Up until now, interacting with these utilities merely consisted of feeding a media file path on to the respective process.

    Command line utilities like mpv offer socket communication via --input-ipc-server to enable further requests like seeking forward and back. Ready player now supports seeking via mpv. Maybe support for other utilities can be added in the future.

    If you're on a recent version of ready-player, seeking is automatically enabled if you've got mpv installed and aren't explicitly customizing ready-player-open-playback-commands. The default value takes care of things:

    (defcustom ready-player-open-playback-commands
      '(("mpv" "--audio-display=no" "--input-ipc-server=<<socket>>")
        ("vlc")
        ("ffplay")
        ("mplayer"))
      "..."
      :type '(repeat (list string))
      :group 'ready-player)
    

    Pause/resume (SPC binding) - feature request

    Until now, ready-player could only play and stop, so you always had to start playing tracks from the beginning. With mpv ipc support now in place, adding pause/resume was a breeze. Like seek, it should just work for ya if mpv is on your system and no explicit customization of ready-player-open-playback-commands.

    Repeat current file (r binding) - feature request

    While repeating current playlist (or directory) was already supported, there was a feature request to enable repeating files. Toggling repeat now cycles through available modes.

    Selective players - feature request

    With ready-player delegating to a single utility for either audio or video playback, folks may have a need to specify different utilities for either of these two. While I'm happy for mpv to handle both audio and video, we now have a couple of prepending options.

    Use a predicate function

    Prepend each utility with either the built-in ready-player-is-audio-p or ready-player-is-video-p functions, or maybe create your own predicate helper.

    (setq ready-player-open-playback-commands
          '((ready-player-is-audio-p "ffplay")
            (ready-player-is-video-p "mpv")))
    

    Use an extension list

    In this example, we delegate mp3 and ogg playback to ffplay and everything else to mpv.

    (setq ready-player-open-playback-commands
          '((("mp3" "ogg") "ffplay")
            ("mpv")))
    

    Autoplay (a binding) - feature request

    Automatically start playing once file opens. No need for user to explicitly request playback.

    Mark in dired (m binding) - feature request

    Open a dired buffer and mark the currently played file.

    M3u playlists - feature request

    While I talked about how the dired abstraction made basic m3u playlist support possible, it wasn't until recently that I included this experiment in the package itself. In addition, .m3u are now recognized by Emacs and automatically open like any other file: find-file, dired, projectile…

    Load recursive directory

    With the dired abstraction at its core, ready player can load any dired buffer. You could do something like:

    1. M-x find-dired RET.
    2. Pick a directory. RET.
    3. Type "-iname \*.mp3 -o -iname \*.ogg -o -iname \*.m4a" RET.
    4. M-x ready-player-load-dired-buffer RET.

    While uber flexible, there's no need to regularly do that, so you can now invoke M-x ready-player-load-directory and it will recursively find all media files in it.

    Toggle player view (C-c m m binding)

    While we can always get back to the player buffer via our favourite buffer-switching mechanism (I like ivy's ivy-switch-buffer), we now have M-x ready-player-view-player available for quicker toggle.

    Remember session

    Playback is now remembered across Emacs sessions. Toggling player view (C-c m m binding) or playback (C-c m SPC binding) starts the last song you were playing on your previous Emacs session.

    Index + searching (/ or C-c m /)

    We now have automatic indexing, which enables richer searching across your collection, not to mention that random access I was craving.

    Global bindings

    Last but not least, you may have noticed a handful of key bindings throughout the post. Single-character bindings all work within a ready-player buffer. Bindings prefixed C-c m are now globally available when ready-player-mode is turned on. This can be customized via ready-player-set-global-bindings.

    Please help make it all self-sustainable

    If you find this package useful or got the features you wanted, please consider sponsoring the work. I've left my tech job (maybe a post for another time) and looking to make projects like ready-player self-sustainable.

    If you're an iOS/macOS user, you can also buy my apps. Here's another freebie (macosrec) I've put out there, which I regularly use to capture Emacs demos for this blog.

    You may also enjoy this blog and all the tips I share. Blog posts take time. Consider sponsoring my blog.

    I've built other Emacs packages you may already use or would like to. Maybe I already built a feature request? Consider sponsoring:

    I'm also building lmno.lol, a new blogging platform, with drag and drop to the web. Maybe you want to try that too? Get in touch.

    Thank you!

    Álvaro

    ]]>
    Sat, 07 Sep 2024 00:00:00 GMT
    Anki bookmarks https://xenodium.com/anki-bookmarks https://xenodium.com/anki-bookmarks
  • Adding flashcards to your digital garden (with org-roam and Anki) - doubleloop.
  • Anki Decks with Orgmode.
  • anki-editor: Emacs minor mode for making Anki cards with Org.
  • emacs-od2ae: Convert org-drill entries to anki-editor.
  • GitHub - l3kn/org-fc: Spaced Repetition System for Emacs org-mode.
  • org-anki: Sync org notes to Anki via AnkiConnect.
  • org-drill.el - flashcards and spaced repetition for org-mode.
  • org-fc: Spaced Repetition System for Emacs org-mode.
  • Power up Anki with Emacs, Org mode, anki-editor and more.
  • ]]>
    Wed, 04 Sep 2024 00:00:00 GMT
    `*scratch*` v1.3 released https://xenodium.com/scratch-v1-3-released https://xenodium.com/scratch-v1-3-released It's been some time since the last release of *scratch* for iOS. If you haven't heard about *scratch*, it's a tiny app I built (part of the org bundle).

    *scratch* enables writing things on the go as quickly as possible.

    • No need to create a new note.
    • No need to bring keyboard up.
    • Just open and write.
    • Bonus: Basic Emacs org markup ;-)

    v1.3 (and yesterday's v1.2) are now available on the App Store. They are minor releases bringing:

    • A monospaced font.
    • A layout fix for "Settings > Display & Brightness > Display Zoom > Larger Text (often affecting iPhones with smaller screens).
    • A menu fix.

    Are you a fan of this app? Want to rate on the App Store? Please help me spread the word. Tell your friends.



    download-on-app-store.png
    ]]>
    Fri, 23 Aug 2024 00:00:00 GMT
    The dired abstraction https://xenodium.com/the-dired-abstraction https://xenodium.com/the-dired-abstraction I recently wrote about image-mode's next/previous item navigation, a feature I wanted to bring to ready player mode.

    I was curious to see how image-mode resolved next and previous files, so I checked the associated keybinding (n) via helpful-key (my preferred alternative to describe-key), and landed on image-next-file. While this function only takes care of high-level routing, it led me to image-mode--next-file, which is where the actual next/previous file resolution happens:

    (defun image-mode--next-file (file n)
      "Go to the next image file in the parent buffer of FILE.
    This is typically a Dired buffer, but may also be a tar/archive buffer.
    Return the next image file from that buffer.
    If N is negative, go to the previous file."
      ...)
    

    While image-mode--next-file's implementation details are worth checking out, its docstring already highlights the bit I found most interesting: dired's involvement in the mix. I'm not sure why I initially found dired usage surprising. Buffers are Emacs's backbone. They are the fundamental structures holding the content we work with, whether it’s editing text, reading logs, displaying information, and many others including file management… Dired specializes buffers for this last purpose. While dired itself is a powerhouse, at its core it's just an ordered list of files.

    Given a location within a dired buffer, we can use its helpers to find next and previous files. Like image-mode, ready-player now mirrors this approach (minus tar/archive handling). This got me thinking more about the dired abstraction… If it quacks like a duck, and walks like a duck, then it's probably errrm a dired buffer. What I actually mean is that associating a dired buffer to a ready-player buffer effectively attaches a playlist of sorts. It doesn't quite matter how this dired buffer was constructed. What's important is that it's recognized as a dired buffer, so all relevant helpers remain useful.

    With dired buffers acting as media playlists, we can easily create a directory playlist by merely pointing dired to the current directory. This is the default behaviour in ready-player. When you open a media file, we attach a dired buffer pointing to the current directory. Play next or previous item, and you're effectively moving up and down the associated dired buffer.

    Things get more interesting when we craft dired buffers in more creative ways than just supplying a path to a directory. One of my favourite commands is find-dired. It runs the find utility, crafting a dired buffer with its results.

    For kicks, I added a ready-player-load-dired-playback-buffer command to ready-player, so we can just load any dired buffer, including our newly generated one, courtesy of find-dired.

    With this generated buffer loaded and ready-player random playback enabled, we get to see our lucky jumps across find results.

    At this point I thought "this is prolly as far as I'll take things"… ready-player was born to address quick access to media, typically from dired itself. For deep playlist handling, there are many other Emacs media players.

    The thing is, with my newly found reusable dired abstraction, a rough m3u playlist experiment didn't seem that far-fetched at all. I'd need to read an m3u file and generate a dired buffer. I knew nothing about m3u's, other than being text files including media paths, along with optional metadata. I figured minimal m3u reading support shouldn't be too difficult.

    If we are to create a playlist including the first three album tracks from the artist above, it'd look something like this:

    #EXTM3U
    
    #EXTINF:-1,George Benson - Dance
    /absolute/path/to/Music/George Benson/Body Talk/01 Dance.mp3
    #EXTINF:-1,George Benson - When Love Has Grown
    /absolute/path/to/Music/George Benson/Body Talk/02 When Love Has Grown.mp3
    #EXTINF:-1,George Benson - Plum
    /absolute/path/to/Music/George Benson/Body Talk/03 Plum.mp3
    
    #EXTINF:-1,George Benson - So What
    /absolute/path/to/Music/George Benson/Original Album Classics/1-01 So What.mp3
    #EXTINF:-1,George Benson - The Gentle Rain
    /absolute/path/to/Music/George Benson/Original Album Classics/1-02 The Gentle Rain (From the Film, _The Gentle Rain_).mp3
    #EXTINF:-1,George Benson - All Clear
    /absolute/path/to/Music/George Benson/Original Album Classics/1-03 All Clear.mp3
    
    #EXTINF:-1,George Benson - Footin' It
    /absolute/path/to/Music/George Benson/The Shape Of Things To Come/01 Footin' It.mp3
    #EXTINF:-1,George Benson - Face It Boy It's Over
    /absolute/path/to/Music/George Benson/The Shape Of Things To Come/02 Face It Boy It's Over.mp3
    #EXTINF:-1,George Benson - Shape Of Things To Come
    /absolute/path/to/Music/George Benson/The Shape Of Things To Come/03 Shape Of Things To Come.mp3
    

    A crude function to extract file paths into a list would look something like the following:

    (defun ready-player--media-at-m3u-file (m3u-path)
      "Read m3u playlist at M3U-PATH and return files."
      (with-temp-buffer
        (insert-file-contents m3u-path)
        (let ((files))
          (while (re-search-forward
                  (rx bol (not (any "#" space))
                      (zero-or-more (not (any "\n")))
                      eol) nil t)
            (when (file-exists-p (match-string 0))
              (push (match-string 0) files)))
          (nreverse files))))
    

    Feeding our m3u file to our new function conveniently returns a list of found files:

    ("/absolute/path/to/Music/George Benson/Body Talk/01 Dance.mp3"
     "/absolute/path/to/Music/George Benson/Body Talk/02 When Love Has Grown.mp3"
     "/absolute/path/to/Music/George Benson/Body Talk/03 Plum.mp3"
     "/absolute/path/to/Music/George Benson/Original Album Classics/1-01 So What.mp3"
     "/absolute/path/to/Music/George Benson/Original Album Classics/1-02 The Gentle Rain (From the Film, _The Gentle Rain_).mp3"
     "/absolute/path/to/Music/George Benson/Original Album Classics/1-03 All Clear.mp3"
     "/absolute/path/to/Music/George Benson/The Shape Of Things To Come/01 Footin' It.mp3"
     "/absolute/path/to/Music/George Benson/The Shape Of Things To Come/02 Face It Boy It's Over.mp3"
     "/absolute/path/to/Music/George Benson/The Shape Of Things To Come/03 Shape Of Things To Come.mp3")
    

    Next we need to create a dired buffer from a list of files. This is where I thought things would get trickier, but I was pleasantly surprised.

    The dired docstring had the answer:

    (defun dired (dirname &optional switches)
      "...
    
    If DIRNAME is a cons, its first element is taken as the directory name
    and the rest as an explicit list of files to make directory entries for.
    In this case, SWITCHES are applied to each of the files separately, and
    therefore switches that control the order of the files in the produced
    listing have no effect.
    
    ..."
      ...)
    

    With that in mind, this is all it takes:

    (let ((default-directory "/absolute/path/to/Music/George Benson"))
      (dired '("*My fancy m3u list*"
               "Body Talk/01 Dance.mp3"
               "Body Talk/02 When Love Has Grown.mp3"
               "Body Talk/03 Plum.mp3"
               "Original Album Classics/1-01 So What.mp3"
               "Original Album Classics/1-02 The Gentle Rain (From the Film, _The Gentle Rain_).mp3"
               "Original Album Classics/1-03 All Clear.mp3"
               "The Shape Of Things To Come/01 Footin' It.mp3"
               "The Shape Of Things To Come/02 Face It Boy It's Over.mp3"
               "The Shape Of Things To Come/03 Shape Of Things To Come.mp3")))
    

    Here's the dired buffer to prove it:

    We now have all the pieces. We can wire them up in a ready-player-load-m3u-playlist function.

    From the previous snippet, you'd notice all file paths are relative to default-directory. While in the following snippet I use try-completion to find the longest common substring amongst the paths, I wonder if there's a more appropriate built-in function for this? I'd love to hear.

    (defun ready-player-load-m3u-playlist ()
      "Load an .m3u playlist."
      (interactive)
      (let* ((m3u-path (read-file-name "find m3u: " nil nil t nil
                                       (lambda (name)
                                         (or (string-match "\\.m3u\\'" name)
                                             (file-directory-p name)))))
             (media-files (if (string-match "\\.m3u\\'" m3u-path)
                              (ready-player--media-at-m3u-file m3u-path)
                            (error "Not a .m3u file")))
             (default-directory (file-name-directory
                                 (try-completion "" media-files)))
             (m3u-fname (file-name-nondirectory m3u-path))
             (dired-buffer-name (format "*%s*" m3u-fname))
             (dired-buffer (dired (append (list dired-buffer-name)
                                          (mapcar (lambda (path)
                                                    (file-relative-name path default-directory))
                                                  media-files)))))
        (ready-player-load-dired-playback-buffer dired-buffer)))
    

    We're good to go now! Invoking M-x ready-player-load-m3u-playlist enables us to load our m3u playlist, automatically opening the first media file, and also navigate each song in the list one by one.

    This was a really fun experiment. While dired is often used to manage files within a directory, its magic also extends to dired buffers crafted in more creative ways. find-dired and find-grep-dired are my two favourite built-ins. Are there other ones you like? Do tell.

    Not long ago, I added ready-player-load-dired-playback-buffer to ready-player, but ready-player-load-m3u-playlist remains a local experiment (for now anyway). Let's see ;-)

    Unrelated - Want your own blog?

    Like this blog? Want to start a blog? Run your blog off a single file. Write from the comfort of your favourite text editor and drag and drop to the web. I'm launching a blogging service at lmno.lol. Looking for early adopters. Get in touch.

    ]]>
    Fri, 16 Aug 2024 00:00:00 GMT
    Ctrl-n/p everywhere. Balance restored. https://xenodium.com/ctrl-np-everywhere-balance-restored https://xenodium.com/ctrl-np-everywhere-balance-restored For some years now, I've enjoyed macOS Ctrl-n/p movement everywhere. I sometimes forget I need Karabiner Elements to reach certain macOS corners.

    macOS supports many Emacs bindings (out of the box). Ctrl-n and Ctrl-p are some of my favourites. Not only can I use these to move the cursor up and down while editing text, but in many cases, for list selections too. Out of the box, list selection, in particular, is more miss than hit. Spotlight and web drop boxes are the biggest pet peeves. Without remapping, vertical movement can only be achieved via arrow keys.

    I had a sudden reminder recently when Spotlight's Ctrl-p/n didn't just work. I wanted to launch Firefox Developer Edition, the second result. Ctrl-n did nothing! The horror!

    Turns out, I had a tiny misconfiguration, possibly as I recently switched to using my keyboard via Bluetooth? I needed "Modify events" set for my keyboard.

    After setting "Modify events" for my external keyboard, my beloved key bindings started working again. Balance restored.

    Unrelated - Want your own blog?

    Like this blog? Want to start a blog? Run your blog off a single file. Write from the comfort of your favourite text editor and drag and drop to the web. I'm launching a blogging service at lmno.lol. Looking for early adopters. Get in touch.

    ]]>
    Thu, 01 Aug 2024 00:00:00 GMT
    Emacs macOS native emoji picker (revisited) https://xenodium.com/emacs-macos-native-emoji-picker-revisited https://xenodium.com/emacs-macos-native-emoji-picker-revisited Update: Doh! I was wrong. There's a better way.

    So, I totally missed the macOS native emoji picker is actually supported out of the box 😭. Thanks to redditor u/hrabannixlisp who pointed me in the right direction.

    ns-do-show-character-palette is bound to C-s-SPC by default, which didn't work for me as I use (setq mac-command-modifier 'meta), that is, ⌘ as meta modifier.

    While I won't be giving up (setq mac-command-modifier 'meta), I can certainly use ns-do-show-character-palette via M-x or a different binding. Thank you u/hrabannixlisp!

    Read on for how I went about it the long convoluted way 🤷‍♂️

    A couple of years ago, I was delighted to discover a macOS freebie for us Emacs users. Newer Macbook models started shipping with a globe/🌐 key, which summons the macOS native emoji picker. Pressing this key in Emacs works as you'd expect (no config required 🎉).

    While I seldom use emojis, the globe key worked great for me until I started using an external keyboard, which didn't have this magical key. The potential solutions I came across suggest either reprogramming the keyboard or using the likes of Karabiner-Elements to map other keys to an alternate shortcut: Ctrl-⌘-SPC. As far as I can tell, this is the only other available shortcut (please reach out if otherwise). Not a great option (it conflicts with Emacs's mark-sexp). Not that I'd be super keen to lose this mark command, but even unbinding doesn't seem of much help.

    While we have Emacs packages available for different emoji-picking experiences, I was keen on maintaining that native experience I enjoyed before. I nearly gave up on the matter until I remembered we have at least one more tool in the Emacs toolbox: dynamic modules. Thanks to Valeriy Savchenko's emacs-swift-module, we can leverage Swift to integrate native macOS experiences.

    With that in mind, I set out to find the relevant macOS API, which turned out to be a lovely one-liner:

    NSApp.orderFrontCharacterPalette(nil)
    

    Let's bring it into Emacs via emacs-swift-module's infrastructure:

    try env.defun(
      "macos-module--show-emoji-picker",
      with: "Show emoji picker (macOS module implementation)."
    ) { (env: Environment) in
      NSApp.orderFrontCharacterPalette(nil)
    }
    

    In theory, this is all we need. We can M-x eval-expression (macos-module--show-emoji-picker) and the picker simply pops up. I haven't worked out how define an interactive command from emacs-swift-module just yet, so for now I'll just wrap with a little elisp:

    (defun macos-show-emoji-picker ()
      "Show macOS emoji picker."
      (interactive)
      (macos-module--show-emoji-picker))
    

    And with that, we got our native macoOS emoji picker back at our fingertips:

    While the dedicated globe key just worked without configuration, it required newer hardware. This new approach works on older Macbooks too. Since it's an interactive command, you can optionally bind to your preferred keys.

    Having said all that, you may have noticed a brief lag during insertion. I haven't worked out the source, but since I rarely use emojis, this will have to do for now. If you have a better macOS alternative working on external keyboards, I'd love to hear about it!

    I've added macos-show-emoji-picker to EmacsMacOSModule, a tiny repo I've used to experiment with emacs-swift-module. You can find EmacsMacOSModule on GitHub.

    Unrelated - Want your own blog?

    Like this blog? Want to start a blog? Run your blog off a single file. Write from the comfort of your favourite text editor and drag and drop to the web. I'm launching a blogging service at lmno.lol. Looking for early adopters. Get in touch.

    ]]>
    Thu, 25 Jul 2024 00:00:00 GMT
    Fresh Eyes 1.7 released https://xenodium.com/fresh-eyes-17-released https://xenodium.com/fresh-eyes-17-released Back in April, I introduced Fresh Eyes: a tiny macOS utility helping me take care of my eyes.

    I spend a bunch of time in front of a computer screen and Fresh Eyes has been helping me stick with the often recommended 20-20-20 rule.

    Fresh Eyes 1.7 ships a handful of improvements suggested by users:

    • Postpone Fresh Eyes for 1 hour, 2 hours, 3 hours, or until the next day.
    • Revamped notification.
    • Revamped countdown screen.
    • Reorganized menu.
    • New keyboard shortcuts.
    • Fresh Eyes is now translated to German 🇩🇪🇩🇪🇩🇪.

    One-time purchase; [no]{.underline} subscriptions, [no]{.underline} additional payments, [no]{.underline} ads.

    Want to support my blogging and other open source work?

    Buy this app (or the others) ;) Tell your friends!

    There's always GitHub sponsoring if your prefer.

    Fresh eyes icon

    download-on-app-store.png

    Unrelated - Want your own blog?

    Like this blog? Want to start a blog? Run your blog off a single file. Write from the comfort of your favourite text editor and drag and drop to the web. I'm launching a blogging service at lmno.lol. Looking for early adopters. Get in touch.

    ]]>
    Wed, 24 Jul 2024 00:00:00 GMT
    Ready Player Mode now on MELPA https://xenodium.com/ready-player-mode-now-on-melpa https://xenodium.com/ready-player-mode-now-on-melpa A few weeks ago, I announced Ready Player Mode's availability on GitHub. As of today, you can find it on MELPA.

    Ready Player Mode is a lightweight major mode to open media (audio/video) files in an Emacs buffer.

    Install, enable via M-x ready-player-mode and you should be good to go.

    Open and preview media files (audio + video) like other files. If in repeat mode, ready-player attempts to play other files in the current directory. Track playback from the corresponding dired buffer.

    Playback is handled by your favourite command line utility. ready-player-mode will try to use either mpv, vlc, ffplay, or mplayer (in that order), but you can customize that. I'd love to hear of other defaults worth considering.

    Bonus rendering includes media thumbnails and metadata, if either ffmpegthumbnailer or ffmpeg are found.

    Unrelated - Want your own blog?

    Like this blog? Want to start a blog? Run your blog off a single file. Write from the comfort of your favourite text editor and drag and drop to the web. I'm launching a blogging service at lmno.lol. Looking for early adopters. Get in touch.

    ]]>
    Sun, 21 Jul 2024 00:00:00 GMT
    OCR those buffers https://xenodium.com/ocr-those-buffers https://xenodium.com/ocr-those-buffers I've written about macosrec before. A tiny macOS command line utility I built to take screenshots or videos of my macOS windows. Sure, there are a gazillion utilities out there, but I wanted my own, so I could bend and integrate with Emacs buffers as needed.

    If you've seen me post a screenshot or gif after April 2023, it was likely taken with macosrec.

    As of macosrec v0.7.3, OCR was added to the mix. I've also added a couple of dwim-shell-commands (dwim-shell-commands-macos-ocr-text-from-desktop-region and dwim-shell-commands-macos-ocr-text-from-image), so I can do things like:

    OCR region

    Use the mouse to select a region to OCR.

    *This gif area recording was captured via macOS's built-in screencapture.

    OCR dired files

    Selecting any file (or files) in dired OCRs the whole lot.

    *This gif window recording was captured via macosrec.

    Invoking dwim-shell-commands-macos-ocr-text-from-image from the current image buffer does the job also.

    What about non-macOS users?

    The same approach can be used with any other OCR command line tool. dwim-shell-command includes dwim-shell-commands-tesseract-ocr-text-from-image, which uses tesseract.

    While I've had more reliable results via macosrec (using macOS's Vision API), I'm sure there are other great alternatives on linux. If you know of one, I'd love to hear.

    Available on github

    Both macosrec and dwim-shell-command are on GitHub and installable via brew install xenodium/macosrec/macosrec and MELPA respectively.

    Unrelated - Want your own blog?

    Like this blog? Want to start a blog? Run your blog off a single file. Write from the comfort of Emacs and drag and drop to the web. I'm launching a blogging service at lmno.lol. Looking for early adopters. Get in touch.

    ]]>
    Wed, 17 Jul 2024 00:00:00 GMT
    It's all up for grabs, compound with glue https://xenodium.com/its-all-up-for-grabs-and-it-compounds https://xenodium.com/its-all-up-for-grabs-and-it-compounds I've written before, once you learn a little elisp, Emacs becomes this hyper malleable editor/platform. A live playground of sorts, where almost everything is up for grabs. You can inspect and tweak behaviour of just about anything to your liking.

    While the compounding benefits of using your favourite Emacs utilities are evident over time, learning elisp takes the compounding effect to another level. It empowers you to have those aha moments like "if I could just wire this awesome utility with that other one, it'd be perfect for me" and enable you to act on it.

    Take, for example, symbol-overlay and multiple-cursors. Two Emacs packages I've been using for years. The first one is a feature you've likely experienced on your favourite IDE or editor without thinking too much about it. Placing your editor cursor on a variable automatically highlights its usages. It's one of those lovely features with zero learning demands.

    The second utility, multiple-cursors, does demand some learning but can be so fun to use once you get the hang of it. Below is a little multiple cursor demo I used recently in a reddit comment, but you really should check out Emacs Rocks! Episode 13: multiple-cursors (stick around for the ending).

    So where am I going with this? While symbol-overlay offers a mechanism to rename symbols via symbol-overlay-rename, I prefer multiple-cursors for this kind of thing… "if I could just get symbol-overlay to tell multiple-cursors where to place my cursors, it'd be just perfect for me".

    I've been wanting this tweak for some time. Today's the day I finally act on it. I had no idea how to go about it, but opening symbol-overlay.el (via M-x find-library symbol-overlay) and browsing through all functions (via imenu) yields the first piece I needed: symbol-overlay-get-list.

    (defun symbol-overlay-get-list (dir &optional symbol exclude)
      "Get all highlighted overlays in the buffer.
    If SYMBOL is non-nil, get the overlays that belong to it.
    DIR is an integer.
    If EXCLUDE is non-nil, get all overlays excluding those belong to SYMBOL."
      ...)
    

    Let's take symbol-overlay-get-list for a spin, courtesy of M-x eval-expression, and see what we get out of it:

    With a list of overlays, we now know where to tell multiple-cursors to do its thing. For the second piece, we needed to peek at any of the multiple-cursors commands I already use. I happen to pick mc/mark-all-like-this to examine what's under the hood.

    (defun mc/mark-all-like-this ()
      "Find and mark all the parts of the buffer matching the currently active region"
      (interactive)
      (unless (region-active-p)
        (error "Mark a region to match first."))
      (mc/remove-fake-cursors)
      (let ((master (point))
            (case-fold-search nil)
            (point-first (< (point) (mark)))
            (re (regexp-opt (mc/region-strings) mc/enclose-search-term)))
        (mc/save-excursion
         (goto-char 0)
         (while (search-forward-regexp re nil t)
           (push-mark (match-beginning 0))
           (when point-first (exchange-point-and-mark))
           (unless (= master (point))
             (mc/create-fake-cursor-at-point))
           (when point-first (exchange-point-and-mark)))))
      (if (> (mc/num-cursors) 1)
          (multiple-cursors-mode 1)
        (mc/disable-multiple-cursors-mode)))
    

    The star of the mc/mark-all-like-this attraction is mc/create-fake-cursor-at-point, used to create each cursor. If we can just iterate over the overlays, we'd be able to create a fake cursor per overlay. There's some additional logic needed to ensure all fake cursors are placed in the same relative position within symbol (using an offset). Finally, we need to enable multiple-cursors-mode.

    We put it all together in ar/mc-mark-all-symbol-overlays:

    (defun ar/mc-mark-all-symbol-overlays ()
      "Mark all symbol overlays using multiple cursors."
      (interactive)
      (mc/remove-fake-cursors)
      (when-let* ((overlays (symbol-overlay-get-list 0))
                  (point (point))
                  (point-overlay (seq-find
                                  (lambda (overlay)
                                    (and (<= (overlay-start overlay) point)
                                         (<= point (overlay-end overlay))))
                                  overlays))
                  (offset (- point (overlay-start point-overlay))))
        (setq deactivate-mark t)
        (mapc (lambda (overlay)
                (unless (eq overlay point-overlay)
                  (mc/save-excursion
                   (goto-char (+ (overlay-start overlay) offset))
                   (mc/create-fake-cursor-at-point))))
              overlays)
        (mc/maybe-multiple-cursors-mode)))
    

    and with that, you finally get to see it all in action…

    Unrelated - Want your own blog?

    Like this blog? Want to start a blog? Run your blog off a single file. Write from the comfort of Emacs (or your favourite text editor) and drag and drop to the web. I'm launching a blogging service at lmno.lol. Looking for early adopters. Get in touch.

    ]]>
    Sun, 14 Jul 2024 00:00:00 GMT
    Ready Player Mode https://xenodium.com/ready-player-mode https://xenodium.com/ready-player-mode

    As an Emacs user, I eventually made the leap over to dired as my file manager of choice. Dired has magical things like wdired. But this post isn't so much about dired and more about the occasional need to peek at media files (images, audio, and video) from Emacs (including dired).

    To view images in Emacs, there's image mode, a fantastic major mode for taking a quick look without leaving your editor. Image mode strikes a great balance. You can get in quickly and out. The q keyboard binding is fabulous for bailing out. While viewing an image, you may quickly open the previous/next one by using n and p keyboard binding. For me, this is just about all I need within my text editor. For anything else, I resort to my favorite image viewing app (macOS's Preview).

    For audio and video, we aren't as lucky with Emacs built-in features (even for a quick peek). While Emacs faithfully opens the files, it's not realistically practical for my typical needs.

    There's a convenient package aptly named openwith, which automatically opens specific files in an external app. This isn't just for media files, but anything really. It works well with office docs, for example. While I've used it for quite some time, I found always bouncing to an external app for peeking at audio/video somewhat suboptimal.

    While a reddit post yielded some handy options, none were in the same spirit as image mode. Having said that, I did come across mediainfo-mode on my search, which is pretty neat for viewing media metadata quickly. Bonus points for q keyboard binding to exit and mediainfo-mode-open command to open with an external app. There may be other packages out there (I'd love to hear about them), though most seemed to focus on listening to music (and playlist management), which is a different flow from what I'm after.

    Ready player mode enters the chat

    With all that, I had no choice (I kid of course) but to go and throw some lines of elisp together and see if I could get to my ideal media experience, and so ready player mode was born…

    As core features, ready-player-mode has two buttons: one to play from within Emacs and one to open media in the preferred external app. You can TAB your way to the buttons. RET or click actions the buttons, in addition to the SPC keyboard binding to toggle playback.

    Like image mode, ready-player-mode offers n/p navigation to open the next/previous media file in the current directory.

    ready-player-mode attempts to display basic metadata if possible, courtesy of ffprobe and ffmpeg. You'll need these installed on your system if you want the optional metadata.

    Playback is handled by your favourite command line utility. ready-player-mode will try to use either mpv, vlc, ffplay, or mplayer (in that order), but you can customize that.

    ready-player-mode is available on GitHub if you're keen to check it out. Keep in mind this is a brand new package (a day old!), so it may need some improvements. If you do give it a try, I'd love to hear how you got on. I've only tested on macOS so far.

    Unrelated - Want your own blog?

    Like this blog? Want to start a blog? Run your blog off a single file. Write from the comfort of Emacs and drag and drop to the web. I'm launching a blogging service at lmno.lol. Looking for early adopters. Get in touch.

    ]]>
    Wed, 03 Jul 2024 00:00:00 GMT
    Hey mouse, don't mess with my Emacs font size https://xenodium.com/hey-mouse-dont-mess-with-my-emacs-font-size https://xenodium.com/hey-mouse-dont-mess-with-my-emacs-font-size While most of my Emacs workflows are typically keyboard-driven, I'm fairly pragmatic about mouse usage. My MacBook's trackpad is great for just kicking back to read and scroll through text.

    There are brief times, however, when that keyboard-driven muscle memory overlaps my mouse usage, resulting in a buffer catastrophe. I joke of course. What I'm actually referring to is nothing more than a slight annoyance. There are times when I inadvertently trigger <C-wheel-up> or <C-wheel-down> events (because I happen to hold Ctrl down while triggering scrolling events). This results in buffer font size quickly changing to either really large or super small, depending on whether I was scrolling up or down at the time. The snafu is further exacerbated by inertial scrolling on trackpads. Go ahead and press the Ctrl key while your buffer is carrying some of that inertia. The font size is affected just the same, even though there was no explicit physical/touching activity on the trackpad at the time.

    While this behaviour was a little annoying, I would typically just reopen the file via C-x C-v RET (aka find-alternate-file), which would reset the font size as a convenient side-effect. Now, you may wonder if reopening the file would also forget the point/cursor position, but that's not an issue if you've got the handy built-in save-place-mode turned on (highly recommended).

    Ok and all, but this is a second-class workaround at best. What I really wanted is for the mouse/trackpad to stop messing with my font size.

    Lucky for me, I bumped into a simple solution shared by Shane Celis and Thanga Ayyanar. It worked a treat, and it's only a few lines of elisp.

    (global-set-key (kbd "<pinch>") 'ignore)
    (global-set-key (kbd "<C-wheel-up>") 'ignore)
    (global-set-key (kbd "<C-wheel-down>") 'ignore)
    

    Thank you folks. Balance restored.

    Update

    While I was using C-x C-v RET (aka find-alternate-file) to reset font size, Luke T. Shumaker and Matthew G. shared a better reset alternative:

    C-u 0 M-x text-scale-adjust
    
    ]]>
    Fri, 07 Jun 2024 00:00:00 GMT
    Emacs: git rename, courtesy of dired https://xenodium.com/emacs-git-rename-courtesy-of-dired https://xenodium.com/emacs-git-rename-courtesy-of-dired Emacs wdired is a beautiful thing. You turn a directory representation into an editable buffer and you can do some magic. By magic, I mean you can apply your favourite text-editing commands to a directory and do some file management.

    Take, for example, batch-renaming. Turn wdired on via dired-toggle-read-only, use something like Magnar's multiple-cursors (or built-in keyboard macros) and commit via wdired-finish-edit (using the often-familar C-c C-c binding). You've now renamed multiple files as it if were any other text buffer. Pretty magical.

    One downside (or so I thought) is that wdired didn't automagically also take care of git renames for me, you know DWIM-style.

    Every time I renamed anything via wdired and subsequently pulled up my trusty magit, I was a little sad it wasn't all just handled… The renamed files were seen as deleted, along with all the untracked counterparts.

    So, I set out to change this unacceptable state of affairs 😀. I started off by setting a breakpoint on wdired-finish-edit via edebug (see why this util is awesome).

    I wanted to see what wdired-finish-edit did under the hood, which led me to dired-rename-file. As I stepped through the code, I spotted the dired-vc-rename-file variable, which does exactly what you think it does 🤦.

    One setq later…

    (setq dired-vc-rename-file t)
    

    …and boom! From now on, renaming from dired does exactly what you would expect. Here's magit to prove it:

    lol. I was so fixated on "adding git rename support", that I forgot to first search the documentation.

    While you can search for variables via the built-in describe-variable, I'm a fan of Wilfred's helpful equivalent: helpful-variable. Coupled with with your favourite completion framework (Abo Abo's ivy for me), it's as easy a fuzzy searching for anything you're after:

    This post is also at lmno.lol.

    ]]>
    Thu, 16 May 2024 00:00:00 GMT
    Fresh Eyes now on the App Store https://xenodium.com/fresh-eyes-now-on-the-app-store https://xenodium.com/fresh-eyes-now-on-the-app-store A couple of days ago, I introduced Fresh Eyes, a little macOS utility to help me practice the 20-20-20 rule and take better care of my vision while on the computer.

    Today, Fresh Eyes was approved and is now available on the macOS App Store.

    Fresh eyes icon

    download-on-app-store.png
    ]]>
    Fri, 05 Apr 2024 00:00:00 GMT
    Fresh Eyes: 20-20-20 for macOS https://xenodium.com/fresh-eyes-20-20-20-for-macos https://xenodium.com/fresh-eyes-20-20-20-for-macos I've been lucky to have enjoyed healthy vision throughout my life. That is, until recently. Nothing major, I'll need glasses for some activities. I also learned from the optometrist I should follow the 20-20-20 rule to reduce eye strain.

    The 20-20-20 rule is simple:

    Take a break from looking at your computer screen every 20 minutes and look away at something roughly 20 feet away (6 metres) for 20 seconds.

    While there are no shortages of macOS timer apps available, I figured it'd be fun to build a 20-20-20 one anyway.

    Meet Fresh Eyes. I've been using it in the last few days. If you'd like to give it a try, send me an email at [email protected] and I'll reply with a TestFlight invite.

    If looking for alternatives, Samuel W. Flint offers a couple of great options:

    Update

    Fresh Eyes has now been approved and is available on the macOS App Store.

    Fresh eyes icon

    download-on-app-store.png
    ]]>
    Wed, 03 Apr 2024 00:00:00 GMT
    Emacs 29.3 emergency release https://xenodium.com/emacs-293-emergency-release https://xenodium.com/emacs-293-emergency-release It was only last week when I upgraded to Emacs 29.2. Yup, I was late to the party. This week, we have a new release.

    Emacs 29.3 is an emergency bugfix release, so this time I've upgraded promptly. I'm on macOS using the great Emacs Plus so upgraded via Homebrew using:

    brew reinstall emacs-plus@29 --with-imagemagick --with-no-frame-refocus --with-native-comp --with-savchenkovaleriy-big-sur-3d-icon --with-poll
    

    ps. Like this splash screen? Check out the Emacs eye candy post.

    ]]>
    Mon, 25 Mar 2024 00:00:00 GMT
    Emacs: Toggling the continuation indicator https://xenodium.com/toggling-emacs-continuation-fringe-indicator https://xenodium.com/toggling-emacs-continuation-fringe-indicator By default, Emacs typically displays curly arrows when wrapping lines. While likely a handy feature to some, I didn't really find much use for it. At the same time, I never looked into their removal until now.

    Turns out, there's a continuation entry in fringe-indicator-alist variable that handles this. Removing this entry also removes the curly arrows.

    (setq-default fringe-indicator-alist
                  (delq (assq 'continuation fringe-indicator-alist) fringe-indicator-alist))
    

    Alternatively, one could write a simple function to toggle displaying the continuation indicator.

    (defun toggle-continuation-fringe-indicator ()
      (interactive)
      (setq-default
       fringe-indicator-alist
       (if (assq 'continuation fringe-indicator-alist)
           (delq (assq 'continuation fringe-indicator-alist) fringe-indicator-alist)
         (cons '(continuation right-curly-arrow left-curly-arrow) fringe-indicator-alist))))
    

    That's it for this post. A tiny tip. Perhaps there's a better way to handle it. If you know, I'd love to know too (Mastodon / Twitter / Reddit / Email).

    ]]>
    Sun, 24 Mar 2024 00:00:00 GMT
    The Org bundle https://xenodium.com/the-org-bundle https://xenodium.com/the-org-bundle I have three apps on the App Store: Plain Org, Flat Habits, and scratch.

    Plain Org / plainorg.com

    My more generic solution to access org files on the go and away from Emacs.

    Flat Habits / flathabits.com

    My take on frictionless habit tracking truly respecting user privacy and their time (absolutely no distractions).

    *scratch* / App Store

    Sure, we have tons of note-taking apps but most require more steps than desirable to write something down ASAP. Launch the app and you're good to write. No new note creation, bring keyboard up, etc.

    Common denominator

    In addition to being offline-first, no cloud, no login, no ads, no tracking, no social… each app targets a specific purpose, sharing an important common denominator: they all use org markup as the underlying storage.

    The Org bundle / App Store

    While you can still get each of my apps individually, you now have the option to get them all as a single bundle: The Org bundle.

    Journelly joining the bundle soon…

    Continuing on the org storage theme, I got another app in the works. Also joining The Org bundle, maintaining its privacy-first approach: offline, no cloud, no login, no ads, no tracking, no social… this time in the journaling space.

    Journelly is currently in beta, want to join?

    ]]>
    Fri, 22 Mar 2024 00:00:00 GMT
    sqlite-mode-extras on MELPA https://xenodium.com/sqlite-mode-extras-on-melpa https://xenodium.com/sqlite-mode-extras-on-melpa

    Emacs 29 introduced the handy sqlite-mode. Soon after, I tried a couple of experiments here and there to bring additional functionality.

    Folks reached out. The additions seemed useful to them and were keen on upstreaming or pushing to MELPA. While I can't commit to upstreaming at this moment, I can happily meet halfway on MELPA.

    As of a couple of days, you can find sqlite-mode-extras on MELPA and GitHub. Contributions totally welcome.

    While I haven't heard of issues, please continue treating the package as experimental and exercise safety with your data. Please back up.

    ]]>
    Tue, 19 Mar 2024 00:00:00 GMT
    Som tam salad dressing recipe (improvised) https://xenodium.com/som-tam-salad-dressing-recipe-improvised https://xenodium.com/som-tam-salad-dressing-recipe-improvised Lately, I've been slightly obsessed with Som Tam, a magnificent salad packing both crunch and flavour.

    I didn't have all the right ingredients for the full-blown salad at home, so I set out to experiment with the dressing's punchy flavours. While I've gone a little rogue here, I mean no disrespect to the faithful recipe and all its glory. Luckily, I did have fish sauce at home, which I considered the core ingredient, and made do with everything else I could find.

    This is where I landed:

    • 2 cloves of garlic
    • Thai chillies to taste (improvised with chilli flakes)
    • 2 tablespoons of fish sauce
    • 1 tablespoons of palm sugar (improvised with honey)
    • 2 limes squeezed (improvised with lemon)
    • 1 tablespoon of dried shrimp (didn't have any)
    • 1 small plum tomato (I used 2 of those bite-size ones)

    Using my trusty mortar and pestle, I ground and crushed the garlic, chilli flakes, and tomato, forming a paste of sorts. Then added the remaining liquids (fish sauce, honey and lemon) diluting the paste.

    • 2 tablespoons of roasted peanuts (roasted some cashews)

    Most recipes seem to suggest using peanuts, though my local Thai restaurant uses cashews. Luckily I had cashews at home, so I'm copied my local. Roasted them on pan for a few minutes.

    As you can imagine, I didn't just have a green papaya laying around at home, so I experimented with other crunchy veggies. While I won't reveal what the other veggies were (oh man, I've gone way off script), both my other half and I were happy with the results.

    Som Tam dressing packs an awesome punch. If your salads were feeling a little boring, give this a try!

    ]]>
    Tue, 19 Mar 2024 00:00:00 GMT
    My first bread (pane dei Castelli recipe) https://xenodium.com/my-first-bread-pane-dei-castelli-recipe https://xenodium.com/my-first-bread-pane-dei-castelli-recipe

    I followed The easiest no knead bread recipe (video).

    No-knead method

    Dough

    • 1 1/4 cups (300g) lukewarm water
    • 2 teaspoons (8g) salt
    • 1 teaspoon (3.5g) yeast
    • 3 cups (420g) all purpose flour

    Mix thoroughly (I like to use Ciro's spoon mixing method from this video), cover and rest for 6 hours. Stretch and fold if the dough collapsed on itself to rescue.

    Bake

    • Preheat oven (and dutch oven) at 230°C.
    • Flour.

    I didn't have a dutch oven, but my oven-proof saucepans (with lid) did just fine. Carefully take the pan out of the oven, sprinkle the bottom with some flour, and place the dough inside. Cover with lid (careful, also hot) and bake for 30-35 minutes.

    Crust

    • Reduce heat to 200°C.

    Remove the lid and bake for another 10 minutes or until you get the crust darkness of your choice.

    Rest

    Let the bread cool on a cooling rack for 45 mins before cutting. If no rack available, set upsidedown.

    Stretch and fold method

    Dough

    • 1 1/4 cups (300g) lukewarm water
    • 2 1/2 teaspoons (10g) salt
    • 2 teaspoon (7g) yeast
    • 3 cups (420g) all purpose flour

    Mix thoroughly (I like to use Ciro's spoon mixing method from this video), cover and rest for 6 hours. Stretch and fold if the dough collapsed on itself to rescue.

    Stretch and fold

    See Emma Fontanella's stretch and fold technique and apply 4-5 times every 30 mins.

    Follow no-knead method

    Remaining steps are the same as the no-knead method.

    ]]>
    Thu, 14 Mar 2024 00:00:00 GMT
    Seafood stew recipe https://xenodium.com/seafood-stew-recipe https://xenodium.com/seafood-stew-recipe I've made this seafood stew a handful of times and it's always delivered.

    Garlic almond paste

    • 1/8 cup of olive oil.
    • 8 cloves of garlic chopped.
    • 1/4 cup almond meal (flour).

    Cook garlic in low-medium heat until softened. Add almond meal and cook 3-4 mins or until golden. Set aside to cool.

    • 1 large handful of parsley.

    Blend the almond mixture to make a paste. Set aside.

    Spices

    • 1 large onion halved and sliced.

    In a large pan, cook onion until softened.

    • 1/8 cup of olive oil.
    • 1 large red chilli finely chopped (on occasions, I use chilli flakes).
    • 1 teaspoon of smoked paprika.
    • 2 bay leaves.

    Add chilli, paprika, and bay leaves and cook for 30 seconds (or fragrant).

    Liquids

    • 1/3 cup dry white wine (I've used cooking sake on occasion).
    • 1000g of passata (typically comes in 500g packs).
    • 400g plum tomatoes tin (undrained).
    • 1 teaspoon of saffron threads (soaked in 2 tablespoons of water).
    • 1 tablespoon of tomato paste.
    • 2 cups of fish stock (I've used 2 stock cubes + same amount of water).

    Add the wine, passata, plum tomatoes, saffron, tomato pate, and fish stock. Simmer for 10 minutes.

    Fish

    • 700g of firm white fish (cut into 5 cm chunks).
    • 12 mussels.

    Add the almond paste, fish, and mussels. Cook for 3-4 minutes.

    • 12 prawns (shelled).

    Add the prawns. Cook for 3 minutes (or pink).

    Finishing touches

    Season with salt and pepper to taste. I've added roughly a teaspoon of salt.

    Garnish generously with parsley and you're good to go.

    ]]>
    Mon, 11 Mar 2024 00:00:00 GMT
    A Cloudflare Workers primer: hello world https://xenodium.com/a-cloudflare-workers-primer-hello-world https://xenodium.com/a-cloudflare-workers-primer-hello-world o______________o | Hello world! | o--------------o \ ^__^ \ (oo)_______ (__)\ )\/\ ||----w | || ||

    Keen to get started with your Hello World Cloudflare Worker? Skip to the setup section.

    A little background

    The vast majority of my software development experience has been centered around client-side software. The few times I've needed a server-side component for a hobby project, I've historically provisioned a linux virtual machine somewhere and ran whatever services I needed. I have to admit though, I don't enjoy the provisioning process, configuration, maintenance, upgrades, database admin, etc. which take time away from the part I enjoy more: building and experimenting with features.

    While containers have made things somewhat simpler, much of the maintenance tradeoffs remain.

    These days, the server-managing overhead has been greatly reduced by "serverless" solutions. Odd terminology for a server offering, but I digress. It more or less refers to removing most of that additional responsibility that comes with managing your own servers and enabling you to focus on building your business logic. Having said that, I've typically shied away from these services, with the possibly irrational fear of vendor lock-in.

    The thing is, if most of my potential server-side needs merely require an entry point (where I could route/handle incoming requests) and possibly some persistence (maybe a database), I should be able to abstract these things away and build server-side logic against portable abstractions. With that in place, maybe there's little vendor lock-in to worry about? Who knows, the devil's in the detail. If I keep shying away from these services, I'll never know, so maybe I should try some and see.

    Let's try Cloudflare Workers

    There are no shortages of serverless options offering functions as a service. Google Cloud, AWS Lambda, Azure Functions, Vercel Functions, Netlify Functions, Fastly, Cloudflare workers, I could go on…

    While I haven't researched the different offerings, I had made a mental note to check out Cloudflare Workers as they had announced D1, their database backed by SQLite …and who doesn't love SQLite? ;) OK, I'm no expert here, but I have had a pleasant experience whenever I've used it. These days, even Emacs 29 got some SQLite love, which prompted me to add cell navigation/navigation and try other experiments.

    D1 / SQLite in beta

    Keep in mind that D1 is in public beta and not yet recommended for large production workloads. From the Cloudflare site:

    "While the D1 team expects breaking changes and issues to be minimal, they may still occur. The D1 team generally does not recommend running large production workloads on beta products."

    Workers cost

    In terms of pricing (as of 2024-01-13), the free tier enables workers to handle up 100,000 requests per day. Plenty for trying things out.

    In any case, we're only checking out Cloudflare's offering, so let's move on…

    Settings up a new Cloudflare Worker (via web dash) {#settings-up-a-new-cloudflare-worker-via-web-dash id="cloudflare-worker-hello-world-setup"}

    Cloudflare has a tiny snippet on their Workers landing page that sets things up rather quickly, but [I won't be using it]{.underline}.

    ~/ $ npm create cloudflare -- my-app
    ~/ $ cd my-app
    ~/ $ npx wrangler deploy
    Published https://my-app.world.workers.dev
    

    ⚠️ Note: before you get copying and pasting, read on.

    Cloudflare's snippet is helpful, but it does quite a bit under the hood. I'm somewhat of a node and serverless noob, so I wanted to understand things a little more and figure out the bare minimum needed to start a minimal Cloudflare Worker project.

    Instead, we'll first click here and there over at https://dash.cloudflare.com to spin off our new worker from the web and later continue from the command line.

    Give the worker a name. We'll call it "todos" to give ya a little sneak peek at what the next post is possibly about… But you can call it whatever you'd like. Keep in mind you'll need to use this name to refer to your new worker.

    Congrats, you've now deployed a new worker. You can access it via the URL that looks something like https://todos.somewhere.workers.dev

    This is great and all, but we want to build something with this new worker, so let's set up our local development environment…

    Prerequisites

    You'll need node.js installed on your machine.

    I happen to be on macOS, so I installed node via Homebrew.

    brew install node
    

    Create a new node project

    We want to start with a bare bones node project, so let's do just that.

    mkdir HelloCloudflareWorker
    cd HelloCloudflareWorker
    npm init -y
    

    Install TypeScript (compiler)

    I like some guardrails when targetting Javascript, so I'll use the TypeScript compiler in this project. Let's install it.

    npm install --save-dev typescript
    npx tsc --init
    

    Install Cloudflare Typescript types

    To have Cloudflare types information accessible to the TypeScript compiler, we'll need to install that too.

    npm install --save-dev @cloudflare/workers-types
    

    Install Wrangler (Cloudflare tooling)

    To manage your worker from the command-line, you'll need Cloudflare's wrangler tool. Let's install it.

    npm install --save-dev wrangler
    

    Point Wrangler to our worker

    We're done installing things now. Let's point wrangler to our new worker by creating its config file.

    wrangler.toml

    name = "todos"
    main = "worker/worker.ts"
    

    Worker entry point

    By default, the worker we created using Cloudflare's dash has the following entry point:

    export default {
      async fetch(request, env, ctx) {
        return new Response( 'Hello World!'):
      }
    }
    

    However, this isn't yet included in our development environment. We need to write our first bit of code. You may have noticed our wrangler.toml is pointing to the main entry point (worker/worker.ts) and this file doesn't exist yet. Let's create it, though be sure to also create its owning directory:

    mkdir worker
    

    Now we can create our very own worker/worker.ts. Let's make the first change that shapes worker to our liking. Rather than just printing "Hello World", let's style things up using our cow friend. We'll create worker/worker.ts and include the spiffed up message.

    worker/worker.ts

    import { Env, ExecutionContext } from '@cloudflare/workers-types';
    
    export default {
      async fetch(request: Request, env: Env, ctx: ExecutionContext): Promise<Response> {
        let defaultResponse = `
       o______________o
       | Hello World! |
       o--------------o
               \\   ^__^
                \\  (oo)\_______
                   (__)\\       )\\/\\
                       ||----w |
                       ||     ||`
        return new Response(defaultResponse);
      }
    };
    

    It's worth mentioning the import statement, since it brings Cloudflare's type information for both Env and ExecutionContext.

    Running worker locally

    Okay, we now have our worker/worker.ts code ready to go. Let's run it locally. For that we use the wrangler utility.

    npx wrangler dev
    

    With that, you'll notice the worker is now running locally and waiting to be visited at http://localhost:8787.

    Deploying worker

    When we first created the worker via https://dash.cloudflare.com, it automatically deployed to https://todos.somewhere.workers.dev. But our mods only ran locally. Let's deploy, again with the wrangler utility.

    npx wrangler deploy
    

    We're good to go. Let's point our browser to the worker's public location.

    …and with that, we have a functional Cloudflare Worker and a local development environment to shape things up however we'd like. What would you use the Worker for?

    Gave this primer a try? I'd love to hear from ya (Mastodon / Twitter / Reddit / Email).

    Enjoying this content? Find it useful?

    Consider ✨sponsoring me✨ or buy ✨my iOS apps✨.

    ]]>
    Sat, 13 Jan 2024 00:00:00 GMT
    A chatgpt-shell compose ux experiment https://xenodium.com/a-chatgpt-shell-compose-ux-experiment https://xenodium.com/a-chatgpt-shell-compose-ux-experiment It's been roughly 9 months since I experimented with wiring the ChatGPT API to an Emacs comint buffer in chatgpt-shell. ChatGPT's request-response nature maps fairly well to a shell's mode of interaction.

    In the past, I've also talked about blurring the lines between shell and editor. That is, using Emacs as your shell (eshell being my favourite) enables compounding goodies from both shell and editor when both are used from the same app.

    Keeping interactions within the same app also cuts down on some of that friction that comes with context switching between your text editor and the browser for llm things.

    Today, my interactions with llms typically consists of copying and pasting details from other Emacs buffers, crafting a query, and finally submitting by pressing enter (RET) from a shell like chatgpt-shell.

    With the entire interaction happening from Emacs, we're already cutting a fair amount of friction… But we can do better, specially when copying, pasting, and crafting those multi-line queries (you don't want to prematurely submit those shell queries by inadvertently pressing RET when you want a newline).

    chatgpt-shell-prompt-compose

    This is where chatgpt-shell-prompt-compose comes in, an opinionated experiment bringing some of my favourite "compose" features over from the likes of magit commit buffers, org capture, mu4e compose, and so on…

    You can bring a compose buffer up by invoking M-x chatgpt-shell-prompt-compose. From there, you can both craft and send your queries. If you're a magit fan, the process should feel fairly familiar with crafting a git commit message by editing away and quickly committing (via C-c C-c binding). Similarly, you can also abort with the familiar C-c C-k binding.

    I use this compose utility often enough that I bound it to C-c C-e, though this may not be your cup of tea (needs overriding other mode maps).

    (use-package chatgpt-shell
      :commands
      (chatgpt-shell
       chatgpt-shell-prompt-compose)
      :bind (("C-c C-e" . chatgpt-shell-prompt-compose)
             :map org-mode-map
             ("C-c C-e" . chatgpt-shell-prompt-compose)
             :map eshell-mode-map
             ("C-c C-e" . chatgpt-shell-prompt-compose)
             :map mu4e-compose-mode-map
             ("C-c C-e" . chatgpt-shell-prompt-compose)
             :map emacs-lisp-mode-map
             ("C-c C-e" . chatgpt-shell-prompt-compose)))
    

    While the compose buffer displays a single query/response at a time, it also follows on from previous requests. You can press r to reply and continue the conversation.

    The compose buffer is fairly stateless and mostly serves as viewport over the last query in the shell itself. If you invoke chatgpt-shell-prompt-compose with a prefix (ie. C-u), it wipes the shell history. You can do it from the compose buffer itself, if you forgot to prior to launching.

    You can also use the o binding to jump to the "other buffer" (the shell carrying the conversation history).

    If using the r and o bindings in a compose buffer sounds a little strange, fear not. The compose buffer is writeable while crafting queries, thus you can safely insert any character. Once a query is submitted (via C-c C-c), the buffer automatically becomes read-only, and thus unlocking single-character bindings.

    Another magit commit favorite of mine is using the M-p or M-n bindings to insert previous messages via git-commit-prev-message or git-commit-next-message.

    With that in mind, I also brought M-p and M-n over to the editable compose buffer.

    If cycling isn't efficient enough, you can also use the typical M-r binding to search and insert from history.

    Now, getting back to removing some of that copy-pasting friction… Selecting text in any buffer and invoking M-x chatgpt-shell-prompt-compose (or C-c C-e in my case) automatically pastes the region into the compose buffer. You get to tweak your query before submitting (via that familiar C-c C-c), in a more flexible buffer (compared to a shell).

    Note: You can also invoke the compose command with a region as many times as you'd like. Each region is sent to the compose buffer, so you can craft more involved queries before submission.

    While I typically prefer short query responses (using diffs like the example above), I sometimes want full snippets as follow-ups. I found myself typing "show entire snippet" often enough, that I now use one of those single-character bindings (e) for this purpose.

    Compose bindings

    I've showcased most of the compose key bindings, here's the whole lot (so far anyway), which you can also view from chatgpt-shell-prompt-compose's documentation.

    Editing

    • C-c C-c to send the buffer query.
    • C-c C-k to cancel compose buffer.
    • M-r search through history.
    • M-p cycle through previous item in history.
    • M-n cycle through next item in history.

    Read-only

    • C-c C-c After sending offers to abort query in-progress.
    • q Exits the read-only buffer.
    • g Refresh (re-send the query). Useful to retry on disconnects.
    • n Jump to next source block.
    • p Jump to next previous block.
    • r Reply to follow-up with additional questions.
    • e Send "Show entire snippet" query.
    • o Jump to other buffer (ie. the shell itself).
    • C-M-h Mark block at point.

    Buyer beware: it's all pretty experimental

    When I started playing with the compose buffer idea, I wasn't too sure whether or not its usage would stick, so I basically hacked chatgpt-shell-prompt-compose to pieces. A cheap prototype of sorts to validate the idea before fully committing to a more involved solution.

    I'll eventually rewrite chatgpt-shell-prompt-compose as either a major or minor mode if there's enough interest.

    For now, I'll continue using as is to validate its usefulness.

    If you give chatgpt-shell-prompt-compose a try, I'd love to hear your feedback (Mastodon / Twitter / Reddit / Email).

    Enjoying this content? Find it useful? Consider sponsoring.

    ]]>
    Mon, 01 Jan 2024 00:00:00 GMT
    A Murder at the End of the World: Are you Vi or Emacs? https://xenodium.com/are-you-vi-or-emacs https://xenodium.com/are-you-vi-or-emacs I've enjoyed watching A Murder at the End of the World. The show may resonate with folks following the tech world. Won't say much more than that…

    What I can maybe say is, the shows features Reddit, Brave browser, terminal usage (ifconfig, nmap, hydra, responder), and a reference to the good 'ol Vi vs Emacs rivalry, which I hope folks these days don't take further than friendly teasing between dear cousins.

    In any case, being an Emacs nut, the scene gave me a good tickle. It's a great show, with a lovely Emacs cherry on top! While the show title and description didn't immediately draw me in, I'm glad I gave it a chance.

    ]]>
    Fri, 22 Dec 2023 00:00:00 GMT
    An basic Mullvad WireGuard setup for macOS https://xenodium.com/a-quick-mullvad-macos-setup https://xenodium.com/a-quick-mullvad-macos-setup Needed a VPN to test an API from a different location. Gave Mullvad a try.

    Pretty neat, you can generate an account number without providing an email address. You can also pre-pay with a ton of options, including cash, crypto, credit cards, PayPal, wire transfers…

    After seeing your account credited, one can download a generated WireGuard configuration. Also a WireGuard noob, so took this opportunity to give it a try.

    The WireGuard macOS app has an "Import Tunnel(s) from File…" option where you can import the .conf file downloaded from Mullvad's generated config. After that, all I had to do was click the "Activate" button and Bob's your uncle.

    You can test your connection via:

    curl https://am.i.mullvad.net/connected
    

    I had a brief stint at using the command-line alternative via homebrew brew install wireguard-go wireguard-tools, but that seems to fail silently:

    wg-quick up xxxxx
    [#] wireguard-go utun
    [+] Interface for xxxxx is utun7
    [#] wg setconf utun7 /dev/fd/63
    [#] ifconfig utun7 inet xxx.xxx.xxx.xxx/xx xxx.xxx.xxx.xxx alias
    [#] ifconfig utun7 inet6 xxxx:xxxx:xxxx:xxxx::x:xxxx/xxx alias
    [#] ifconfig utun7 up
    [#] route -q -n add -inet6 ::/1 -interface utun7
    [#] route -q -n add -inet6 8000::/1 -interface utun7
    [#] route -q -n add -inet xxx.xxx.xxx.xxx/x -interface utun7
    [#] route -q -n add -inet xxx.xxx.xxx.xxx/x -interface utun7
    [#] route -q -n add -inet xxx.xxx.xxx.xxx -gateway xxx.xxx.xxx.xxx
    [#] networksetup -getdnsservers Wi-Fi
    [#] networksetup -getsearchdomains Wi-Fi
    [#] networksetup -getdnsservers iPhone USB
    [#] networksetup -getsearchdomains iPhone USB
    [#] networksetup -getdnsservers Thunderbolt Bridge
    [#] networksetup -getsearchdomains Thunderbolt Bridge
    [#] networksetup -getdnsservers xxxxx
    [#] networksetup -getsearchdomains xxxxx
    [#] networksetup -setdnsservers iPhone USB xxx.xxx.xxx.xxx
    [#] networksetup -setsearchdomains iPhone USB Empty
    [#] networksetup -setdnsservers xxxxx xxx.xxx.xxx.xxx
    [#] networksetup -setsearchdomains xxxxx Empty
    [#] networksetup -setdnsservers Wi-Fi xxx.xxx.xxx.xxx
    [#] networksetup -setsearchdomains Wi-Fi Empty
    [#] networksetup -setdnsservers Thunderbolt Bridge xxx.xxx.xxx.xxx
    [#] networksetup -setsearchdomains Thunderbolt Bridge Empty
    [+] Backgrounding route monitor
    
    curl https://am.i.mullvad.net/connected
    

    I'm on a Macbook M1 Pro, running macOS Sonoma. If you got wg-quick working on Sonoma, I'd love to hear from ya (Mastodon / Twitter / Reddit / Email).

    ]]>
    Sun, 17 Dec 2023 00:00:00 GMT
    An iOS journaling app powered by org plain text https://xenodium.com/an-ios-journaling-app-powered-by-org-plain-text https://xenodium.com/an-ios-journaling-app-powered-by-org-plain-text I've been experimenting with building a rich text editing component for iOS, powered by org markup. The idea is to offer a mobile-friendly editing experience, backed by our beloved plain text format.

    To make things a little more interesting, I'm introducing a new org-based app to help anyone with regular journaling.

    👉 Meet ✨Journelly✨

    Plain text is the serialization format. No conversion/import/export needed.

    Though it's early days, it's fairly functional. Been using it daily for some time. You can opt in to use an external org file and sync with your beloved Emacs.

    Want to give it a try? Want a TestFlight invite? Send me an email address (any would do) at either of these: Mastodon / Twitter / Reddit / Email.

    The topic of org being fairly Emacs-oriented, though a strength for someone far down the rabbit hole, it is understandable to call it out for someone in a different position. Lucky for us, org markup is plain text and can be implemented by apps other than Emacs, like Journelly itself for iOS and even more experimentally on macOS:

    And like Journelly for iOS, I got other org things available on iOS:

    As an Org mode fan, so I wrote Plain Org for iOS. It's on the App Store.
    Inspired by Atomic Habits, I wrote Flat Habits for iOS. Also on the App Store.
    I needed an Emacs-inspired scratch buffer on iOS (who doesn't?), so I built one.

    Just like the stuff I do or write about? Sponsor me.

    ]]>
    Wed, 06 Dec 2023 00:00:00 GMT
    Building your own bookmark launcher https://xenodium.com/building-your-own-bookmark-launcher https://xenodium.com/building-your-own-bookmark-launcher sponsor✨ this content

    I've been toying with the idea of managing browser bookmarks from you know where. Maybe dump a bunch of links into an org file and use that as a quick and dirty bookmark manager. We'll start with a flat list plus fuzzy searching and see how far that gets us.

    The org file would look a little something like this:

    ::: captioned-content ::: caption bookmarks.org :::

    My bookmarks
    - [[https://lobste.rs/t/emacs][Emacs editor (Lobsters)]]
    - [[https://emacs.stackexchange.com][Emacs Stack Exchange]]
    - [[https://www.reddit.com/r/emacs][Emacs subreddit]]
    - [[https://emacs.ch][Emacs.ch (Mastodon)]]
    - [[https://www.emacswiki.org][EmacsWiki]]
    - [[https://planet.emacslife.com/][Planet Emacslife]]
    

    :::

    Next we need fuzzy searching, but first let's write a little elisp to extract all links from the org file:

    (require 'org-element)
    (require 'seq)
    
    (defun browser-bookmarks (org-file)
      "Return all links from ORG-FILE."
      (with-temp-buffer
        (let (links)
          (insert-file-contents org-file)
          (org-mode)
          (org-element-map (org-element-parse-buffer) 'link
            (lambda (link)
              (let* ((raw-link (org-element-property :raw-link link))
                     (content (org-element-contents link))
                     (title (substring-no-properties (or (seq-first content) raw-link))))
                (push (concat title
                              "\n"
                              (propertize raw-link 'face 'whitespace-space)
                              "\n")
                      links)))
            nil nil 'link)
          (seq-sort 'string-greaterp links))))
    

    The snippet uses org-element to iterate over links to collect/return them in a list. We join both the title and url, so searching can match either of these values. We also add a little formatting (new lines/face) to spiff things up.

    (browser-bookmarks "/private/tmp/bookmarks.org")
    

    We can now feed our list to our preferred narrowing framework (ivy, helm, ido, vertico) and use it to quickly select a bookmark. In the past, I've used the likes of ivy-read directly, though have since adopted the humble but mighty completing-read which hooks up to any of the above frameworks.

    With that in mind, let's use completing-read to make a selection and split the text to extract the corresponding URL. Feed it to browse-url, and you got your preferred browser opening your bookmark.

    (defun open-bookmark ()
      (interactive)
      (browse-url (seq-elt (split-string (completing-read "Open: " (browser-bookmarks "/private/tmp/bookmarks.org")) "\n") 1)))
    

    I remain a happy ivy user, so we can see its fuzzy searching in action.

    At this point, we now have our bookmark-launching Emacs utility. It's only an M-x open-bookmark command away, but we want to make it accessible from anywhere in our operating system, in my case macOS.

    Let's enable launching from the command line, though before we do that, let's craft a dedicated frame for this purpose.

    (defmacro present (&rest body)
      "Create a buffer with BUFFER-NAME and eval BODY in a basic frame."
      (declare (indent 1) (debug t))
      `(let* ((buffer (get-buffer-create (generate-new-buffer-name "*present*")))
              (frame (make-frame '((auto-raise . t)
                                   (font . "Menlo 15")
                                   (top . 200)
                                   (height . 20)
                                   (width . 110)
                                   (internal-border-width . 20)
                                   (left . 0.33)
                                   (left-fringe . 0)
                                   (line-spacing . 3)
                                   (menu-bar-lines . 0)
                                   (minibuffer . only)
                                   (right-fringe . 0)
                                   (tool-bar-lines . 0)
                                   (undecorated . t)
                                   (unsplittable . t)
                                   (vertical-scroll-bars . nil)))))
         (set-face-attribute 'ivy-current-match frame
                             :background "#2a2a2a"
                             :foreground 'unspecified)
         (select-frame frame)
         (select-frame-set-input-focus frame)
         (with-current-buffer buffer
           (condition-case nil
               (unwind-protect
                   ,@body
                 (delete-frame frame)
                 (kill-buffer buffer))
             (quit (delete-frame frame)
                   (kill-buffer buffer))))))
    

    Most of the snippet styles our new frame and invokes the body parameter. While I don't typically resort to macros, we get a little syntatic sugar here, so we can invoke like so:

    (defun present-open-bookmark-frame ()
      (present (browse-url (seq-elt (split-string (completing-read "Open: " (browser-bookmarks "/private/tmp/bookmarks.org")) "\n") 1))))
    

    Wrapping our one-liner with the present-open-bookmark-frame function enables us to easily invoke from the command line, with something like

    emacsclient -ne "(present-open-bookmark-frame)"
    

    Now that we can easily invoke from the command line, we have the flexibility to summon from anywhere. We can even bind to a key shortcut, available anywhere (not just Emacs). I typically do this via Hammerspoon, with some helpers, though there are likely simpler options out there.

    function emacsExecute(activate, elisp)
       if activate then
          activateFirstOf({
                {
                   bundleID="org.gnu.Emacs",
                   name="Emacs"
                }
          })
       end
    
       local socket, found = emacsSocketPath()
       if not found then
          hs.alert.show("Could not get emacs socket path")
          return "", false
       end
    
       local output,success = hs.execute("/opt/homebrew/bin/emacsclient -ne \""..elisp.."\" -s "..socket)
       if not success then
          hs.alert.show("Emacs did not execute: "..elisp)
          return "", false
       end
    
       return output, success
    end
    
    function openBookmark()
       appRequestingEmacs = hs.application.frontmostApplication()
       emacsExecute(false, "(present-open-bookmark-frame)")
       activateFirstOf({
             {
                bundleID="org.gnu.Emacs",
                name="Emacs"
             }
       })
    end
    
    hs.hotkey.bind({"alt"}, "W", openBookmark)
    

    With that, we have our Emacs-powered bookmark launcher, available from anywhere.

    While we used our Emacs frame presenter to summon our universal bookmark launcher, we can likely the same mechanism for other purposes. Maybe a clipboard (kill ring) manager?

    What would you use it for? Get in touch (Mastodon / Twitter / Reddit / Email).

    Enjoying this content? Find it useful? Consider ✨sponsoring✨.

    ]]>
    Wed, 29 Nov 2023 00:00:00 GMT
    Native Emacs/macOS UX integrations via Swift modules https://xenodium.com/native-emacsmacos-ux-integrations-via-swift-modules https://xenodium.com/native-emacsmacos-ux-integrations-via-swift-modules Once you learn a little elisp, Emacs becomes this hyper malleable editor/platform. A live playground of sorts, where almost everything is up for grabs at runtime. Throw some elisp at it, and you can customize or extend almost anything to your heart's content. I say almost, as there's a comparatively small native core, that would typically require recompiling if you wanted to make further (native) mods. But that isn't entirely true. Emacs 25 enabled us to further extend things by loading native dynamic modules, back in 2016.

    Most of my Emacs-bending adventures have been powered by elisp, primarily on macOS. I also happen to have an iOS dev background, so when Valeriy Savchenko announced his project bringing Emacs dynamic modules powered by Swift, I added it to my never-ending list of things to try out.

    Fast-forward to a year later, and Roife's introduction to emt finally gave me that much-needed nudge to give emacs-swift-module a try. While I wish I had done it earlier, I also wish emacs-swift-module had gotten more visibility. Native extensions written in Swift can open up some some neat integrations using native macOS UX/APIs.

    While I'm new to Savchenko's emacs-swift-module, the project has wonderful documentation. It quickly got me on my way to build an experimental dynamic module introducing a native context menu for sharing files from my beloved editor.

    Most of the elisp/native bridging magic happens with fairly little Swift code:

    try env.defun(
      "macos-module--share",
      with: """
        Share files in ARG1.
    
        ARG1 must be a vector (not a list) of file paths.
        """
    ) { (env: Environment, files: [String]) in
      let urls = files.map { URL(fileURLWithPath: $0) }
    
      let picker = NSSharingServicePicker(items: urls)
      guard let view = NSApp.mainWindow?.contentView else {
        return
      }
    
      let x = try env.funcall("macos--emacs-point-x") as Int
      let y = try env.funcall("macos--emacs-point-y") as Int
    
      let rect = NSRect(
        x: x + 15, y: Int(view.bounds.height) - y + 15, width: 1, height: 1
      )
      picker.show(relativeTo: rect, of: view, preferredEdge: .maxY)
    }
    

    This produced an elisp macos-module--share function I could easily access from elisp like so:

    (defun macos-share ()
      "Share file(s) with other macOS apps.
    
    If visiting a buffer with associated file, share it.
    
    While in `dired', any selected files, share those.  If region is
    active, share files in region.  Otherwise share file at point."
      (interactive)
      (macos-module--share (vconcat (macos--files-dwim))))
    

    On a side note, (macos--files-dwim) chooses files depending on context. That is, do what I mean (DWIM) style. If there's a file associated with current buffer, share it. When in dired (the directory editor, aka file manager), look at region, selected files, or default to file at point.

    (defun macos--files-dwim ()
      "Return buffer file (if available) or marked/region files for a `dired' buffer."
      (if (buffer-file-name)
          (list (buffer-file-name))
        (or
         (macos--dired-paths-in-region)
         (dired-get-marked-files))))
    
    (defun macos--dired-paths-in-region ()
      "If `dired' buffer, return region files.  nil otherwise."
      (when (and (equal major-mode 'dired-mode)
                 (use-region-p))
        (let ((start (region-beginning))
              (end (region-end))
              (paths))
          (save-excursion
            (save-restriction
              (goto-char start)
              (while (< (point) end)
                ;; Skip non-file lines.
                (while (and (< (point) end) (dired-between-files))
                  (forward-line 1))
                (when (dired-get-filename nil t)
                  (setq paths (append paths (list (dired-get-filename nil t)))))
                (forward-line 1))))
          paths)))
    

    I got one more example of a native macOS integration I added. Being an even simpler one, and in hindsight, I prolly should have introduced it first. In any case, this one reveals dired files in macOS's Finder app (including the selection itself).

    try env.defun(
      "macos-module--reveal-in-finder",
      with: """
        Reveal (and select) files in ARG1 in macOS Finder.
    
        ARG1 mus be a vector (not a list) of file paths.
        """
    ) { (env: Environment, files: [String]) in
      NSWorkspace.shared.activateFileViewerSelecting(files.map { URL(fileURLWithPath: $0) })
    }
    

    The corresponding elisp is nearly identical to its macos-share sibling:

    (defun macos-reveal-in-finder ()
      "Reveal file(s) in macOS Finder.
    
    If visiting a buffer with associated file, reveal it.
    
    While in `dired', any selected files, reveal those.  If region is
    active, reveal files in region.  Otherwise reveal file at point."
      (interactive)
      (macos-module--reveal-in-finder (vconcat (macos--files-dwim))))
    

    My Swift module experiment introduces two native macOS UX integrations, now available via M-x macos-share and M-x macos-reveal-in-finder. I've pushed all code to it's own repo.

    I hope this post brings visibility to the wonderful emacs-swift-module project and sparks new, native, and innovative integrations for those on macOS. Can't wait to see what others can do with it.

    Enjoying this content? Find it useful? Consider ✨sponsoring✨.

    ]]>
    Sat, 25 Nov 2023 00:00:00 GMT
    Migrating/re-encrypting pass's password store https://xenodium.com/migratingre-encrypting-passs-password-store https://xenodium.com/migratingre-encrypting-passs-password-store Note to self, I needed to migrate/re-encrypt someone's password store (aka pass). Straightforward:

    Get the new key, probably already in gpg key chain. Try listing it:

    gpg --list-keys
    

    To re-encrypt, pass init with new key is enough. It'll prompt for old pass key.

    cd path/to/.password-store
    pass init NEW-GPG-KEY
    
    ]]>
    Thu, 16 Nov 2023 00:00:00 GMT
    How I smash burgers https://xenodium.com/how-i-smash-burgers https://xenodium.com/how-i-smash-burgers I'm neither a burger expert nor a connoisseur of any kind, yet I sure have a lot of fun smashing burgers at home. Needless to say, I shamelessly enjoy gobbling them too!

    my smash burger

    I'll share details on how I smash my burgers, but here's a quick ingredient list, if that's all you need.

    • Mince beef (20%-30% fat).
    • Streaky bacon.
    • Brioche burger buns.
    • American cheese slices (cheddar individual slices work too).
    • Lettuce.
    • Tomatoes.
    • Onions.
    • Pickles.
    • Jalapeños.
    • Garlic.
    • Chipotle powder.
    • Mayonnaise.
    • Salt.
    • Pepper.
    • Oil.
    • Greaseproof paper.
    • Butter.

    The calling

    My quest to smash burgers at home didn't start until earlier this year, while watching the The Menu. I just could't stop craving the burger from that scene, so I set out to start smashing my own.

    The gear

    Don't rush to buy anything fancy. Your existing gear will likely do the job just fine. I'd say try a few things out and only upgrade when needed. I'll share the gear I use and where I felt I needed tweaking.

    Skillet

    While I didn't have a griddle at home, I did have a couple of trusty Lodge skillets (cast iron and carbon steel). Both work great for burgers, though I have a slight preference for the carbon steel one, as it's the bigger of the two and gives a little more room for manoeuvring, specially when smashing two burgers at a time.

    Heat the skillet up and add a little oil. If the oil starts smoking, be quick to drop the patties and start smashing.

    Grill Spatula (too big/stiff for skillet)

    Somewhat inspired by the film, I got myself a wide spatula so I could firmly press those patties against the skillet, and to flip of course.

    While this kind of spatula may work well on a spacious griddle, I felt constrained on a relatively small cast iron. Specially when flipping. I went looking for an alternative.

    Spatula + smasher (my winning combo)

    Over at the r/castiron subreddit, I discovered fish spatulas. They are fairly agile on cast irons but also work great for loosening burger patties before flipping.

    While effective for flipping, fish spatulas are obviously no good for smashing. So I got myself a burger smasher. This combo worked well for me.

    When smashing, use greaseproof paper to prevent the patties from sticking to the smasher.

    Ingredients

    While I've drawn inspiration from others, I've landed on my own preferred ingredients. I'm sure that will continue changing over time. Pick and choose as your heart desires.

    Minced/ground beef

    Minced beef with higher fat content (around 20-30%) is often recommended for a couple of reasons:

    • Flavour: Fat equals flavour in cooking. The higher fat content will melt during cooking and become 'self-basting', resulting in a juicier and more flavourful burger.

    • Texture: The fat in the beef melts under heat, helping the burger achieve a crispy, caramelized exterior known as the Maillard reaction, which contrasts nicely against the soft, juicy interior.

    In the UK, I can typically find minced beef with 15%-20% fat content at the main supermarkets.

    Be sure to salt and pepper to taste (as in picture) on one side. Once flipped on pan, salt and pepper the other side.

    Bacon

    I tend to prefer smoked streaky bacon, but hey these will be your burgers. Your burgers, your rules.

    Buns (brioche)

    I hear potato buns are great for burgers. I've yet to try them. So far, I've settled for brioche. I happen to find these near me, so I've gone with them.

    Butter the buns and brown on the skillet for a minute. Check the buns often. Brioche buns can burn quickly.

    American cheese

    American cheese is often the burger cheese of choice.

    While American cheese isn't widely available in the UK, the individually wrapped orange-looking cheddar cheese slices work just fine.

    Toppings

    I like my burgers with lettuce, tomatoes, onions, pickles, and occasionally jalapeños. For pickles, I typically just take cornichons and slice them up.

    Burger sauce (chipotle/garlic/mayo)

    While classic burger sauce is often made with mayo, ketchup, pickles, and mustard, I've gone fairly rogue here.

    You see, I love chipotle mayo. I'm also a fan of garlic mayo, so I figured why not both? Turns out these three ingredients work great together.

    I like to draw out the flavours by first mixing the garlic and chipotle with a little hot water.

    • 1 garlic clove.
    • 2 teaspoons of chipotle powder.
    • 1 tablespoon of hot water.
    • Pinch of salt.

    …and then thicken with mayo.

    • 1/4 cup of mayo.

    These are very rough measurements, tweak to your preference. Make more garlicky, spicier, or soften things by adding garlic, chipotle, or mayo.

    Assembling

    I like to assemble in the following order from the bottom bun up.

    1. Sauce on bottom bun.
    2. Lettuce.
    3. Tomatoes.
    4. Onions.
    5. 2 patties (melted cheese on both).
    6. Bacon.
    7. Pickles.
    8. Jalapeños.
    9. Sauce on top bun (oops, I forgot in the picture).

    …and here's the final product.

    If you gave smashing burgers a go, I'd love to hear about it. Also any tips are very much welcome. Get in touch (Mastodon / Twitter / Reddit / Email).

    ]]>
    Mon, 30 Oct 2023 00:00:00 GMT
    Open in Xcode at line number https://xenodium.com/open-in-xcode-at-line-number https://xenodium.com/open-in-xcode-at-line-number I live mostly in Emacs. I say mostly 'cause well, I'm fairly pragmatic about it. If there's a workflow elsewhere that's more appropriate for my needs, I'll happily use that instead. While I'd love to do my web browsing from my beloved editor, Firefox ticks the right boxes for me.

    I do most of my iOS coding in Emacs. It's a hybrid of sorts between Emacs and Xcode. If I need to use the debugger, Xcode is a clear winner for me. If I happen to be visiting a Swift file in an Emacs buffer, I typically used the handy crux-open-with from crux to open in Xcode, and continue from there. This worked OK, but I always wished opening in Xcode would also jump to the same line number as the Emacs point (cursor) location. This is particularly useful if I had just spotted where I'd like to set a breakpoint in an Emacs buffer and need to transition over to Xcode.

    It turns out, there's a nifty command line utility for that. xed, the Xcode text editor invocation tool. It enables telling Xcode what file to open and at what line number:

    xed -line 141 path/to/some/file.swift
    

    With that in mind, I've added my own version of crux-open-with, using dwim-shell-command.

    When running on macOS, the function checks whether or not I'm visiting a buffer for a programming language, and opens the file in Xcode at the same line number.

    (defun dwim-shell-commands-open-externally ()
      "Open file(s) externally."
      (interactive)
      (dwim-shell-command-on-marked-files
       "Open externally"
       (if (eq system-type 'darwin)
           (if (derived-mode-p 'prog-mode)
               (format "xed --line %d '<<f>>'"
                       (line-number-at-pos (point)))
             "open '<<f>>'")
         "xdg-open '<<f>>'")
       :shell-args '("-x" "-c")
       :silent-success t
       :utils (if (eq system-type 'darwin)
                  "open"
                "xdg-open")))
    

    dwim-shell-commands-open-externally is now added to dwim-shell-commands.el.

    ps. If you find opening the same file in a different context handy, you may also like the package browse-at-remote that opens the visited file at its corresponding remote location (for example, GitHub). I can never remember the name of the function (browse-at-remote), so I aliased it to something I'd remember and moved on…

    (defalias 'ar/open-at-github #'browse-at-remote))
    
    ]]>
    Tue, 24 Oct 2023 00:00:00 GMT
    Trimming video screenshots https://xenodium.com/trimming-video-screenshots https://xenodium.com/trimming-video-screenshots A quick one… I recently wanted to trim the black borders around a video screenshot. While I could use an image editor to manually select and trim, I wondered if there was an imagemagick trick somewhere out there for such a thing… and of course there was:

    magick convert -fuzz 3% -define trim:percent-background=0% -trim +repage path/to/input.png path/to/output.png
    

    Pretty neat. It does the job, but I won't remember it next time. May as well make another dwim-shell-command function out of it and conveniently invoke from Emacs via a memorable name plus fuzzy search.

    (defun dwim-shell-commands-image-trim-borders ()
      "Trim image(s) border (useful for video screenshots)."
      (interactive)
      (dwim-shell-command-on-marked-files
       "Trim image border"
       "magick convert -fuzz 3% -define trim:percent-background=0% -trim +repage '<<f>>' '<<fne>>_trimmed.<<e>>'"
       :utils "magick"))
    

    While the screenshot I've just used was a little blurry, it's from the movie Tron Legacy, and it features Emacs eshell. This is old news, though well covered.

    dwim-shell-commands-image-trim-borders is now added to dwim-shell-commands.el

    ]]>
    Fri, 06 Oct 2023 00:00:00 GMT
    Displaying image details in mode line https://xenodium.com/displaying-image-details-in-mode-line https://xenodium.com/displaying-image-details-in-mode-line A benefit of running Emacs as a GUI app, is that you can view images from your beloved editor. This is super handy to take a quick peek at any image.

    Sometimes, I'd like a little more than just viewing the image. I'd like to see basic image details like type, dimensions, and file size. The imagemagick identify utility is pretty handy for that.

    identify -format "%m %wx%h %b" path/to/image.png
    

    I could easily invoke shell-command for this or even create a dwim-shell-command function (maybe I will), but if this info was proactively displayed in the mode line, I wouldn't have to fetch it myself.

    Since I know I can use the identify command for this, I may as well see if I can plug it into the mode line.

    Turns out this wasn't too bad by setting setting mode-line-format. I added a little logic to only include image details while in image-mode and rely on process-lines to fetch the details. This function returns a list, which is a happy coincidence since mode-line-format also expects a list.

    (setq-default mode-line-format
                  '(" "
                    mode-line-front-space
                    mode-line-client
                    mode-line-frame-identification
                    mode-line-buffer-identification
                    (:eval
                     (when (eq major-mode 'image-mode)
                       ;; Needs imagemagick installed.
                       (process-lines "identify" "-format" "[%m %wx%h %b]" (buffer-file-name))))
                    " "
                    mode-line-position
                    (vc-mode vc-mode)
                    (multiple-cursors-mode mc/mode-line)
                    " " mode-line-modes
                    mode-line-end-spaces))
    

    I'd love to hear if there's a pure elisp alternative (mastodon/twitter). I gave (image-size (image-get-display-property) :pixels) a try, but that seemed to return the display size in buffer rather than actual file size.

    ]]>
    Fri, 06 Oct 2023 00:00:00 GMT
    Creating an iCloud account (via tart VM) https://xenodium.com/creating-icloud-test-accounts https://xenodium.com/creating-icloud-test-accounts UPDATE: This method no longer works for creating iCloud accounts. I'd love to know if you find an alternative. Please let me know.

    I wanted an additional @icloud.com account for myself. My first thought was to head over to https://developer.apple.com and create a new account, but that requires an existing email address. I wanted an actual @icloud.com email address.

    My next thought was to create a new account using the iOS simulator, but that complained about creating too many accounts already. Strange, as I hadn't created any.

    I could create an account from macOS settings itself, though that would require logging out my current account (and the syncing implications). To get around that, I could maybe create a temporary macOS user. Instead, I somewhat revisited the simulator route and looked for a VM option to run macOS. This gave me an excuse to play with VM options on macOS.

    I had been meaning to check out lima as per Hacker News's Lima: A nice way to run Linux VMs on Mac. The Hacker News's thread has a handful of great recommendations. Amongst them, tart (macOS and Linux VMs on Apple Silicon) stood out, as it also gave me the Mac on Mac option.

    Installing tart via Homebrew followed the typical brew command… a breeze via my trusty Emacs eshell:

    brew install cirruslabs/cli/tart
    

    Cloning a VM image, while straightforward, it did take a little while for the chunky download:

    tart clone ghcr.io/cirruslabs/macos-sonoma-base:latest sonoma-base
    

    Running the macOS Sonoma VM was a breeze:

    tart run sonoma-base
    

    …and with that, I got a full (and disposable) macOS VM I can use to create another @icloud.com account:

    While there may be simpler options out there to create an @icloud.com account (please do let me know mastodon/twitter), the VM did the job. I'd been meaning to find a low friction mechanism to run VMs for a different reason, but that's a post for another time.

    ]]>
    Fri, 06 Oct 2023 00:00:00 GMT
    Virtual machine (VM) bookmarks https://xenodium.com/virtual-machine-vm-bookmarks https://xenodium.com/virtual-machine-vm-bookmarks
  • colima: Container runtimes on macOS (and Linux) with minima….
  • finch: The Finch CLI an open source client for container development.
  • lima VM - Linux Virtual Machines On macOS - Earthly Blog.
  • lima: A nice way to run Linux VMs on Mac | Hacker News.
  • lima: Linux virtual machines.
  • macpine: Lightweight Linux VMs on MacOS.
  • OrbStack · Fast, light, simple Docker & Linux on macOS.
  • tart: macOS and Linux VMs on Apple Silicon to use in CI a….
  • Virtualisation on Apple silicon – The Eclectic Light Company.
  • ]]>
    Wed, 04 Oct 2023 00:00:00 GMT
    Emacs hangs saving .authinfo.gpg (workaround) https://xenodium.com/emacs-hangs-saving-authinfogpg-workaround https://xenodium.com/emacs-hangs-saving-authinfogpg-workaround My Emacs (v29.1) was hanging when saving changes to .authinfo.gpg. Turns out, I ran into a known issue with a workaround. Downgrading gnupgp to a version older than 2.4.1 sorts things out.

    I'm on macOS. Downgraded by downloading the 2.4.0 Homebrew formula at https://raw.githubusercontent.com/Homebrew/homebrew-core/59edfe598541186430d49cc34f42671e849e2fc9/Formula/gnupg.rb and installing with:

    brew unlink gnupg
    brew install ~/Downloads/gnupg.rb
    
    ]]>
    Sat, 16 Sep 2023 00:00:00 GMT
    Redact that buffer https://xenodium.com/redact-that-buffer https://xenodium.com/redact-that-buffer As I was getting ready to take an Emacs screenshot in the previous post, I figured I may want to redact email addresses before moving forward. I had a quick look for existing options and found redacted.el, built-in toggle-rot13-mode, and unpackaged/lorem-ipsum-overlay. All great options. I wanted a solution I could feed a single regular expression to obscure matches. I also wanted toggling capabilities, so I had a quick go at it…

    I also wanted the ability to redact the entire buffer content, so feeding a space to the regexp query also translates to [[:graph:]], effectively redacting all visible characters.

    The solution is overlay-based, ensuring the buffer content remains unchanged. The function may have its own rough edges, yet it certainly scratched the itch for the current need. I'll leave ya with the snippet.

    (defun ar/toggle-redact-buffer ()
      "Redact buffer content matching regexp. A space redacts all."
      (interactive)
      (let* ((redacted)
             (regexp (string-trim (read-regexp "Redact regexp" 'regexp-history-last)))
             (matches (let ((results '()))
                        (when (string-empty-p regexp)
                          (setq regexp "[[:graph:]]")
                          (setq regexp-history-last regexp)
                          (add-to-history 'regexp-history regexp))
                        (save-excursion
                          (goto-char (point-min))
                          (while (re-search-forward regexp nil t)
                            (push (cons (match-beginning 0) (match-end 0)) results)))
                        (nreverse results))))
        (mapc (lambda (match)
                (dolist (overlay (overlays-in (car match) (cdr match)))
                  (setq redacted t)
                  (delete-overlay overlay))
                (unless redacted
                  (overlay-put (make-overlay (car match) (cdr match))
                               'display (make-string (- (cdr match) (car match)) ?x))))
              matches)))
    
    ]]>
    Fri, 15 Sep 2023 00:00:00 GMT
    Send note to Kindle https://xenodium.com/emacs-send-to-kindle https://xenodium.com/emacs-send-to-kindle While on Mastodon, I spotted @summeremacs looking into sending Emacs text selections to a Kindle via email. This sparked my interest as I previously looked into sending pdfs to my Kindle via mu4e.

    Kindle offers a neat service where you can email a file to your @kindle.com address and it automatically shows up in your Kindle library.

    I already do email from my beloved editor, and like most Emacs things, it's powered by elisp. In other words, it's basically up for grabs if you'd like to glue it to anything else, so I did…

    I can now select a region and invoke M-x send-to-kindle-as-txt to send it over to my Kindle.

    Soon enough, the note shows up on my Kindle.

    Opening the note reveals the same content we had previously selected and sent from our malleable editor.

    While it looks kinda magical, it's fairly simple under the hood. It takes the region content, writes it to a txt file, creates an email message buffer attaching the file, and finally sends via message-send-and-exit.

    If M-x send-to-kindle-as-txt is invoked with a C-u prefix, you get to inspect the message buffer right before sending via C-c C-c.

    Here's the full snippet.

    (defcustom send-to-kindle-from-email
      nil
      "Your own email address to send from via mu4e."
      :type 'string
      :group 'send-to-kindle)
    
    (defcustom send-to-kindle-to-email
      nil
      "Your Kindle email address to send pdf to."
      :type 'string
      :group 'send-to-kindle)
    
    (defun send-to-kindle-as-txt (review)
      (interactive "P")
      (unless send-to-kindle-from-email
        (setq send-to-kindle-from-email
              (read-string "From email address: ")))
      (unless send-to-kindle-to-email
        (setq send-to-kindle-to-email
              (read-string "To email address: ")))
      (let* ((content (string-trim (if (region-active-p)
                                       (buffer-substring (region-beginning) (region-end))
                                     (buffer-string))))
             (note-name (let ((name (string-trim (read-string "Note name: "))))
                          (if (string-empty-p name)
                              (nth
                               0 (string-split
                                  (substring content 0 (min 40 (length content))) "\n"))
                            name)))
             (path (concat (temporary-file-directory) note-name))
             (txt (concat path ".txt"))
             (buffer (get-buffer-create (generate-new-buffer-name "*Email txt*"))))
        (with-temp-buffer
          (insert content)
          (write-file txt))
        (with-current-buffer buffer
          (erase-buffer)
          ;; Disable hooks
          (let ((message-mode-hook nil))
            (message-mode))
          (insert
           (format
            "From: %s
    To: %s
    Subject: %s
    --text follows this line--
    <#multipart type=mixed>
    <#part type=\"text/plain\" filename=\"%s\" disposition=attachment>
    <#/part>
    <#/multipart>"
            send-to-kindle-from-email
            send-to-kindle-to-email
            note-name txt))
          (unless review
            (message-send-and-exit)))
        (when review
          (switch-to-buffer buffer))))
    

    By the way, and I only just learned this today… To take a screenshot on a Kindle Paperwhite, tap on these opposite corners.

    ]]>
    Fri, 15 Sep 2023 00:00:00 GMT
    SHA-256 hash from URL, the easy way https://xenodium.com/sha-256-hash-from-url-the-easy-way https://xenodium.com/sha-256-hash-from-url-the-easy-way From time to time, I need to generate a SHA-256 hash from a file hosted on some server. For me, this flow typically goes something along the lines of:

    • Copy the file URL from browser.
    • Drop to Emacs eshell.
    • Change current directory.
    • Type "curl -o file"
    • Paste the file URL.
    • Run curl command.
    • Type "shasum -a 256 file".
    • Run shasum command.
    • Copy the generated hash.
    • Maybe delete the downloaded file?

    We can maybe shave some steps off by downloading directly from the browser, though that may also bring additional clicks and navigating to a download location.

    Amongst the steps, shasum is the star player, and its output can be seen below.

    shasum -a 256 path/to/downloaded/file
    

    Not a huge deal. One can copy the hash from the output, but why go through multiple small manual steps when I know I can get Emacs to simplify the lot? I've expedited a similar flow in the past when cloning git repos. Let's simplify again so hashing a hosted file boils down to:

    • Copy the file URL from browser.
    • Run an Emacs interactive command.

    This is where I pull out dwim-shell-command (a little package I wrote) and glue the lot to get an expedited experience.

    There isn't much to the function other than glueing a little elisp and a shell script via dwim-shell-command for some buffer/error handling.

    (defun dwim-shell-commands-sha-256-hash-file-at-clipboard-url ()
      "Download file at clipboard URL and generate SHA-256 hash."
      (interactive)
      (let ((url (current-kill 0)))
        (unless (string-match-p "^http[s]?://" url)
          (user-error "No URL in clipboard"))
        (dwim-shell-command-on-marked-files
         "Generate SHA-256 hash from clipboard URL."
         (format
          "temp_file=$(mktemp)
           function cleanup {
             rm -f $temp_file
           }
           trap cleanup EXIT
           curl --no-progress-meter --location --fail --output $temp_file %s || exit 1
           shasum -a 256 $temp_file | awk '{print $1}'"
          (shell-quote-argument url))
         :utils '("curl" "shasum")
         :on-completion
         (lambda (buffer process)
           (if-let ((success (= (process-exit-status process) 0))
                    (hash (with-current-buffer buffer
                            (string-trim (buffer-string)))))
               (progn
                 (kill-buffer buffer)
                 (kill-new hash)
                 (message "Copied %s to clipboard"
                          (propertize hash 'face 'font-lock-string-face)))
             (switch-to-buffer buffer))))))
    

    dwim-shell-commands-sha-256-hash-file-at-clipboard-url is now in dwim-shell-commands.el, the optional counterpart in dwim-shell-command.

    UPDATE

    There's better way. Thanks to Philip Kaludercic for suggesting curl -s example.com | sha256sum - | cut -d " " -f1 and Sacha Chua who pinged me about it.

    Also note I'm now relying on the <<cb>> template, since dwim-shell-command replaces it with the clipboard/kill ring.

    (defun dwim-shell-commands-sha-256-hash-file-at-clipboard-url ()
      "Download file at clipboard URL and generate SHA-256 hash."
      (interactive)
      (unless (string-match-p "^http[s]?://" (current-kill 0))
        (user-error "No URL in clipboard"))
      (dwim-shell-command-on-marked-files
       "Generate SHA-256 hash from clipboard URL."
       "curl -s '<<cb>>' | sha256sum - | cut -d ' ' -f1"
       :utils '("curl" "sha256sum")
       :on-completion
       (lambda (buffer process)
         (if-let ((success (= (process-exit-status process) 0))
                  (hash (with-current-buffer buffer
                          (string-trim (buffer-string)))))
             (progn
               (kill-buffer buffer)
               (kill-new hash)
               (message "Copied %s to clipboard"
                        (propertize hash 'face 'font-lock-string-face)))
           (switch-to-buffer buffer)))))
    
    ]]>
    Sun, 10 Sep 2023 00:00:00 GMT
    Inline previous result and why you should edebug https://xenodium.com/inline-previous-result-and-why-you-should-edebug https://xenodium.com/inline-previous-result-and-why-you-should-edebug Artur Malabarba's Debugging Elisp Part 1: Earn your independence is nearly a decade old, yet it rings just as true today.

    Learning to Edebug really "is the right decision for anyone who doesn't know how to Edebug." Why, you may ask? He best puts it as "running into errors is not only a consequence of tinkering with your editor, it is the only road to graduating in Emacs."

    For me personally, it earned me that independence to bend Emacs my way. Don't like how something works? Pull up the debugger to help me understand how a package or function works. I've done this countless of times to bend things my way.

    Speaking of edebug, I had been meaning to tweak edebug's result display behaviour for quite some time. As you step through code, edbug prints the result of previous expressions to the minibuffer. This works well, but I couldn't help but feel like my eyes were constantly jumping between the code and the minibuffer at the bottom of the window.

    I wanted to minimize the eye jumping experience, so I figured I could likely bend things my way and print the result at point. How did I go about it? The same way I often do. Figure out what function is called for a given key binding via describe-key or my favourite replacement helpful-key from helpful.el. This led me to edebug-next-mode in edebug.el. At that point, I could have set a breakpoint in edebug-next-mode and eventually step into the relevant code, but hey we had a better clue. We knew that all output started with "Result:", so we could just search for that string in edebug.el instead. Jackpot! edebug-compute-previous-result and its adjacent edebug-previous-result are just the right functions:

    (defun edebug-compute-previous-result (previous-value)
      (if edebug-unwrap-results
          (setq previous-value
                (edebug-unwrap* previous-value)))
      (setq edebug-previous-result
            (concat "Result: "
                    (edebug-safe-prin1-to-string previous-value)
                    (eval-expression-print-format previous-value))))
    
    (defun edebug-previous-result ()
      "Print the previous result."
      (interactive)
      (message "%s" edebug-previous-result))
    

    We can see that edebug-previous-result invokes message which is responsible for displaying the debugged expression's result in the minibuffer. Modifying this functions behaviour would be enough to achieve inline display, but I also want to remove "Result:" from the displayed message. Neither of these functions offer configurability, so we'll resort to advising both functions. That is, monkey patch them (errm I know… lovely).

    (defun adviced:edebug-compute-previous-result (_ &rest r)
      "Adviced `edebug-compute-previous-result'."
      (let ((previous-value (nth 0 r)))
        (if edebug-unwrap-results
            (setq previous-value
                  (edebug-unwrap* previous-value)))
        (setq edebug-previous-result
              (edebug-safe-prin1-to-string previous-value))))
    
    (advice-add #'edebug-compute-previous-result
                :around
                #'adviced:edebug-compute-previous-result)
    

    adviced:edebug-compute-previous-result removes "Result:" in addition to dropping (eval-expression-print-format previous-value), which I don't typically rely on.

    (require 'eros)
    
    (defun adviced:edebug-previous-result (_ &rest r)
      "Adviced `edebug-previous-result'."
      (eros--make-result-overlay edebug-previous-result
        :where (point)
        :duration eros-eval-result-duration))
    
    (advice-add #'edebug-previous-result
                :around
                #'adviced:edebug-previous-result)
    

    adviced:edebug-previous-result is in charge of display via message, so all we need is some replacement. I initially played with popup-tip and that did the job just fine, but Colin led me to a better path while pointing to Clojure and Common Lisp. This reminded me of eros: Evaluation Result OverlayS for Emacs Lisp, which I already used. Swapping message for eros--make-result-overlay did the trick. Yes, this is a private function, but I can live with that. This code is only an advice-remove away from disabling, but hey look at those inline results!

    ]]>
    Tue, 05 Sep 2023 00:00:00 GMT
    Further sqlite-mode extensions https://xenodium.com/further-sqlite-mode-extensions https://xenodium.com/further-sqlite-mode-extensions I've continued poking at Emacs 29's sqlite-mode. Since my last post on extensions, I've experimented a little with adding a handful of interactive functions:

    • sqlite-mode-extras-compose-and-execute: Compose and execute a query.

    • sqlite-mode-extras-execute: Execute a query.

    • sqlite-mode-extras-add-row: Add row to table at point.

    • sqlite-mode-extras-delete-row-dwim: Similar to sqlite-mode-delete but also enables deleting range in region.

    • sqlite-mode-extras-refresh: Refreshes the buffer re-querying the database.
    • sqlite-mode-extras-ret-dwim: If on table, toggle expansion. If on row, edit it.
    • sqlite-mode-extras-execute-and-display-select-query: Executes a query and displays results.

    I've been playing with the following key bindings:

    (use-package sqlite-mode-extras
      :bind (:map
             sqlite-mode-map
             ("n" . next-line)
             ("p" . previous-line)
             ("b" . sqlite-mode-extras-backtab-dwim)
             ("f" . sqlite-mode-extras-tab-dwim)
             ("+" . sqlite-mode-extras-add-row)
             ("D" . sqlite-mode-extras-delete-row-dwim)
             ("C" . sqlite-mode-extras-compose-and-execute)
             ("E" . sqlite-mode-extras-execute)
             ("S" . sqlite-mode-extras-execute-and-display-select-query)
             ("DEL" . sqlite-mode-extras-delete-row-dwim)
             ("g" . sqlite-mode-extras-refresh)
             ("<backtab>" . sqlite-mode-extras-backtab-dwim)
             ("<tab>" . sqlite-mode-extras-tab-dwim)
             ("RET" . sqlite-mode-extras-ret-dwim)))
    

    The code lives in sqlite-mode-extras.el under my Emacs config repo. Beware, it's fairly experimental and hasn't been tested thoroughly.

    ]]>
    Sun, 27 Aug 2023 00:00:00 GMT
    My custom Tesco Clubcard pkpass https://xenodium.com/my-custom-tesco-clubcard-pkpass https://xenodium.com/my-custom-tesco-clubcard-pkpass My significant other and I had two plastic Tesco Clubcards. I lost mine, so I took a picture of hers. I was fairly certain a barcode photo would scan just as well at self-checkout, and it did.

    This got me thinking about Apple's Wallet pkpasses. I don't really know much about them. Could I potentially create my own .pkpass? If I could just include the same barcode as in the photo, it should do the job just fine.

    Now I should mention, Tesco does have an app on the App Store. If you just want the official Wallet pass on your iPhone, use that. But I was curious about whether or not I could create my own pass.

    Turns out I can. I followed Apple's building your first pass which runs you through creating Wallet identifiers/certificates, editing pass.json, and downloading/building signpass (the utility used to sign .pass bundles).

    The signpass utility is included in WalletCompanionFiles.zip, which comes with a handful of sample passes.

    WalletCompanionFiles
    │
    ├── SamplePasses
    │   │
    │   ├── BoardingPass.pass
    │   ├── Coupon.pass
    │   ├── Event.pass
    │   ├── Event.pkpass
    │   ├── Generic.pass
    │   └── StoreCard.pass
    │       │
    │       ├── pass.json
    │       └── ...
    └── signpass
    

    Being a rewards card, I opted to look into StoreCard.pass, but like all other passes, the barcode itself is what makes each pass scannable. The barcode details are specified in the bundles's pass.json file. I needed to figure out the relevant values describing the Tesco barcode.

    "barcode": {
      "format": "???",
      "message": "???",
      "messageEncoding": "???"
    }
    

    I had no clue what values I should use for a Tesco Clubcard. I did, however, have a photo of the barcode I needed. This is in fact what prompted looking into scanning barcodes from Emacs, which worked just great. It gave me all the crucial bits for the Clubcard.

    "barcode": {
      "format": "PKBarcodeFormatCode128",
      "message": "1234567890123456",  // not my actual Clubcard number of course.
      "messageEncoding": "iso-8859-1"
    }
    

    That's all that's needed for the barcode section, the most useful part of the pass. We're not done though. We also need our registered Wallet identifiers, so the signpass utility can sign.

    "passTypeIdentifier": "my.com.identifier.passmaker", // also not my actual one.
    "teamIdentifier": "AAABBBCCCD", // nor this one.
    

    We should be able to sign the pass with the following:

    signpass -p StoreCard.pass
    

    We're technically done. We now have a working card, but it looks just like the sample store card included in WalletCompanionFiles.

    What's the fun in that? Now that I can make my own Clubcard, let's customize it!

    For imagery, I replaced a couple of images in the .pass bundle:

    StoreCard.pass
    │
    ├── pass.json
    ├── icon.png
    ├── logo.png // replaced
    └── strip.png // replaced
    

    I replaced logo.png using a Tesco logo I found on Wikipedia. I had initially removed strip.png, but that made the card feel a little empty. I was thinking of using a Tesco carrier bag to bulk the space up. While I didn't find a suitable bag image, I did land on "Very Little Helps, 2008". Using my limited GIMP skills, I cropped one of the images and also replaced strip.png.

    The remaining customizations took place in pass.json and should be fairly self-explanatory. There's the text shown in all labels as well as three customizable colours (background, label, and foreground).

    {
      "formatVersion": 1,
      "passTypeIdentifier": "my.com.identifier.passmaker", // also not my actual one.
      "teamIdentifier": "AAABBBCCCD", // nor this one.
      "serialNumber": "AnySerialNumberYouWant",
      "barcode": {
        "format": "PKBarcodeFormatCode128",
        "message": "1234567890123456",
        "messageEncoding": "iso-8859-1"
      },
      "organizationName": "Not Tesco of course",
      "description": "Not a Tesco reqards card",
      "logoText": "Clubcard",
      "foregroundColor": "rgb(255, 255, 255)",
      "labelColor": "rgb(255, 255, 255)",
      "backgroundColor": "rgb(2, 81, 158)", // Blue for that Tesco look
      "storeCard": {
        "auxiliaryFields": [
          {
            "key": "membership",
            "label": "Member since 2023",
            "value": ""
          },
          {
            "key": "membership2",
            "label": "Expires sometime",
            "value": ""
          }
        ]
      }
    }
    

    …and with all that, here's what my very own custom Tesco Clubcard pkpass looks like. As you can appreciate, my image-editing skills aren't all that great, but hey this will do for now.

    Update

    Redditor u/stupergenius suggested using the image's original background color. Nice suggestion. Tweaked via pass.json:

    "foregroundColor": "rgb(2, 81, 158)",
    "labelColor": "rgb(15, 58, 105)",
    "backgroundColor": "rgb(166, 202, 214)",
    

    ]]>
    Tue, 22 Aug 2023 00:00:00 GMT
    Extending sqlite-mode (cell navigation + edits) https://xenodium.com/sqlite-mode-goodies https://xenodium.com/sqlite-mode-goodies I recently wrote about Emacs 29's new sqlite-mode, which enables you to browse sqlite databases from your beloved editor.

    Out of the box, it supports the following browsing features:

    • sqlite-mode-list-data: List the data from the table under point.
    • sqlite-mode-list-column: List the columns of the table under point.
    • sqlite-mode-list-tables: Re-list the tables from the currently selected database.

    On the editing side of things it supports row deletion:

    • sqlite-mode-delete: Delete the row under point.

    While fairly spartan, it lays foundations for additional tools and features.

    Two features I would like to have:

    1. TAB navigation across table rows and columns.
    2. Updating the row's field at point.

    This would give me the familiar behaviour I'm used to in my org tables as well as other common spreadsheet tools.

    Luckily, this is Emacs, so we can bend it our way… and I sure did!

    Here's tab navigating forward:

    Here's tab navigating backward:

    And updating row fields:

    Most of the navigation is achieved by querying the current buffer to figure out column positions. Editing was in some ways easier, as I looked at sqlite-mode-delete to figure out how it handled the query.

    To get the more familiar navigation behaviour, I've adjusted my key bindings as follows:

    (use-package sqlite-mode-extras
      :bind (:map
             sqlite-mode-map
             ("n" . next-line)
             ("p" . previous-line)
             ("<backtab>" . sqlite-mode-extras-backtab-dwim)
             ("<tab>" . sqlite-mode-extras-tab-dwim)
             ("RET" . sqlite-mode-extras-ret-dwim)))
    

    The code for sqlite-mode-extras-tab-dwim, sqlite-mode-extras-backtab-dwim, and sqlite-mode-extras-ret-dwim is little rough still (hacky even), but hey still fun.

    For now, the code lives in sqlite-mode-extras.el under my Emacs config repo. Improvements/fixes totally welcome!

    ]]>
    Mon, 07 Aug 2023 00:00:00 GMT
    Emacs 29's sqlite-mode https://xenodium.com/emacs-29s-sqlite-mode https://xenodium.com/emacs-29s-sqlite-mode I've jumped on the Emacs 29 bandwagon! Mickey Petersen has a great rundown of What's New in Emacs 29.1.

    Now every so often, I need to take a quick peek at an sqlite3 table. Emacs 29.1 ships sqlite-mode, which can help with that. Use sqlite-mode-open-file to open a database.

    Pressing RET on a table shows its content via sqlite-mode-list-data. DEL does as you'd expect and delete a row via sqlite-mode-delete.

    ]]>
    Sun, 06 Aug 2023 00:00:00 GMT
    Emacs: scan this QR/bar code https://xenodium.com/emacs-scan-this-qrcode https://xenodium.com/emacs-scan-this-qrcode Another day, another tool brought to my Emacs fingertips. A while ago, I wrote about easily copying text from desktop to mobile via QR codes. Later on, I brought it under dwim-shell-command as dwim-shell-commands-clipboard-to-qr.

    This time around, I needed the opposite: to scan a code from an image file. This is where zbar's zbarimg comes in. These days, I'm mostly on macOS, so I installed via Homebrew:

    $ brew install zbar
    

    There's really nothing to the command. You feed it an image, and it outputs the scanned details. Perfect.

    $ zbarimg path/to/code-128.png
    CODE-128:hello world
    scanned 1 barcode symbols from 1 images in 0.02 seconds
    

    The only challenge is my brain. I probably won't remember the name of this wonderful tool next time I need it, so I'll just add it to my dwim-shell-commands.el arsenal with a memorable name:

    (defun dwim-shell-commands-image-scan-code ()
      "Scan any code from image(s)."
      (interactive)
      (dwim-shell-command-on-marked-files
       "Scan code"
       "zbarimg '<<f>>'"
       :utils "zbarimg"))
    

    In the future, rather than reaching out to zbarimg directly, I'll use my trusty fuzzy search and… voilà!

    Because dwim-shell-command operates on either dired files or current file, we can also apply our new function when viewing the QR code itself.

    dwim-shell-commands-image-scan-code is now pushed to dwim-shell-commands.el, the optional package in dwim-shell-command.

    ]]>
    Sun, 30 Jul 2023 00:00:00 GMT
    A cure for JavaScript fatigue? https://xenodium.com/a-cure-for-javascript-fatigue https://xenodium.com/a-cure-for-javascript-fatigue It's been roughly a decade since I wrote any significant amount of JavaScript. Back then, I primarily relied on the Google Closure Compiler, now maybe an archaeological artefact? These days, it's hard not to bump into any JavaScript project that doesn't rely on npm, along with many other tools like the Typescript compiler, ESLint, Prettier… There are a ton of available frameworks too. I was somewhat put off (or maybe just lazy?) by the initial ramp-up to reenter the JavaScript world. I guess that's what some refer to as Javascript Fatigue.

    I'm giving JavaScript another try, but this time with an Emacs chatgpt-shell standing by. Reentering the JavaScript world as a noob, I often know what I want to enable, but I'm unfamiliar with which project knobs to turn to set things up.

    While I may want to dig deeper into things in the future, at present I just want to dabble with JavaScript. I want a local project set up as quickly as possible. ChatGPT has been pretty handy at that. The Emacs ChatGPT shell and its minibuffer prompts work fairly well for my needs, yet I often found myself wishing it could behave more like a magit commit buffer. That is, launch a dedicated buffer (not the shell itself), ask the question, maybe paste some snippets, and send it on its way with that oh so familiar and satisfying C-c C-c binding (sending mail also says hello).

    This is where M-x chatgpt-shell-prompt-compose comes in. It's a mash between the ChatGPT shell and a magit commit buffer:

    In the background, the buffer is still powered by the shell itself, so you can reuse it to ask clarifying questions.

    A couple of additional features worth mentioning… Invoking chatgpt-shell-prompt-compose with an active region automatically copies the region content over to the compose buffer. This is handy if you'd like to create more elaborate prompts with further editing. So far, this feels more natural than editing text from the shell or the minibuffer, where RET doesn't insert new lines.

    The compose buffer is powered by a background shell (storing history for us). Typing clear followed by C-c C-c clears the background shell history.

    chatgpt-shell-prompt-compose is available in chatgpt-shell v0.72.1. I've so far bound it to C-c C-e, though I've already found some unfortunate clashes.

    ]]>
    Tue, 25 Jul 2023 00:00:00 GMT
    ChatGPT visits the Emacs doctor https://xenodium.com/chatgpt-visits-the-emacs-doctor https://xenodium.com/chatgpt-visits-the-emacs-doctor Emacs is a part-time job. A multi-language development environment. A lisp machine. An email client. A web browser. A zettelkasten. A spreadsheet. A mastodon client. A shell. A ledger. A super agenda. An operating system. Some say it sends ripples into the atmosphere or plays tetris for you. It may even warm your place up during the winter. Can meme with you. It's an ultra-malleable editor with endless possibilities, powered by your life-long customizations. Oh man, no wonder we need to chat to someone from time to time. You know what I mean? Sir, this is a Wendy's.

    Luckily, we also have the built-in Emacs psychotherapist we can chat to, courtesy of M-x doctor. It's powered by elisp, and like all Emacs things, it's basically up for grabs. What I mean is, elisp implements many of these features, but also glues the lot for you. Once you learn a little elisp, you can build new Emacs features but also glue others for that magical compound effect.

    The Emacs doctor

    A little while ago, I wanted to give ChatGPT a try, preferably from Emacs (of course). I figured a shell interface would be a great fit for the interaction. Emacs already shipped with a general command interpreter (comint), so I cobbled together a ChatGPT Emacs shell.

    chatgpt-shell

    So where am I going with all this? The fine netizens r/emaphis and salgernon both planted a great seed:

    I haven't forgotten about you. Let's take chatgpt-shell, M-x doctor, our versatile elisp glue, and let's make them talk:

    courtesy of thriveth and dr.dk.

    There isn't too much to the code, but beware:

    1. If you want to run it, you'll need chatgpt-shell installed and set up.
    2. This was a quick fun hack. No code judging ;)

    The snippet is further down… Start with chatgpt-shell-visit-doctor as the entry point, setting things up for us. It creates both the *chatgpt* and *doctor* buffers and arranges the windows next to each other.

    We also set a ChatGPT system prompt to guide things a little:

    "Pretend to be an overwhelmed Emacs user who is obsessed with configuring their init.el file. You are in a session talking to a psychotherapist. Limit your output to no more than 20 words. In the course of 5 exchanges between you and the therapist, show improvements. On the 8th exchange after therapist speaks, declare you are cured and only output 'Thank you doc, I think I'm cured!'"

    ChatGPT and Emacs doctor can go on and on, so we limit ChatGPT responses to 20 words per response and 8 exchanges. We don't want the session to abruptly end without a resolution, so we'll use Thank you doc, I think I'm cured! as our key phrase to end the session.

    We register chatgpt-shell--on-chatgpt-patient-response as a hook to receive ChatGPT output, which we feed to the *doctor* buffer. We subsequently get a doctor response that's fed back to ChatGPT via chatgpt-shell--insert-doc-response.

    We add some additional freebies like binding Ctrl-c Ctrl-c to chatgpt-shell-leave-doctor, so we can bail out of the exchange from the *chatgpt* buffer.

    We also introduced chatgpt-shell--insert-delayed-text as a replacement for insert to slow things down a little. For visual effects, really.

    (require 'chatgpt-shell)
    
    (defun chatgpt-shell-visit-doctor ()
      (interactive)
      (setq chatgpt-shell--doctor-in-session t)
      (when (get-buffer "*doctor*")
        (kill-buffer "*doctor*"))
      (delete-other-windows)
      (split-window-horizontally)
      (other-window 1)
      (doctor)
      (visual-line-mode 1)
      (when (fboundp 'accent-menu-mode)
        (accent-menu-mode -1))
      (mapc
       (lambda (shell-buffer)
         (kill-buffer shell-buffer))
       (chatgpt-shell--shell-buffers))
      (other-window 1)
      (setq chatgpt-shell-system-prompts
            '(("Doc" . "Pretend to be an overwhelmed Emacs user who is obsessed with configuring their init.el file. You are in a session talking to a psychotherapist. Limit your output to no more than 20 words. In the course of 5 exchanges between you and the therapist, show improvements. On the 8th exchange after therapist speaks, declare you are cured and only output \"Thank you doc, I think I'm cured!\".")))
      (setq chatgpt-shell-system-prompts nil)
      (setq chatgpt-shell-system-prompt nil)
      (with-current-buffer (chatgpt-shell)
        (define-key chatgpt-shell-mode-map (kbd "C-c C-c")
          'chatgpt-shell-leave-doctor)
        (shell-maker-set-buffer-name (current-buffer)
                                     "*chatgpt*"))
      (chatgpt-shell--insert-doc-response))
    
    (defun chatgpt-shell--doc-conversation ()
      (let ((convo (with-current-buffer "*doctor*"
                     (split-string (buffer-string) "\n\n"))))
        (seq-remove
         (lambda (item)
           (string-empty-p (string-trim item)))
         (append
          ;; Replace first doc line, so it drops "Each time you are finished talking, type RET twice."
          (list "I am the psychotherapist.  Please, describe your problems.")
          (mapcar
           (lambda (item)
             (replace-regexp-in-string "\n" " " item))
           (cdr convo))))))
    
    (defun chatgpt-shell--doc-response ()
      (let* ((conversation (chatgpt-shell--doc-conversation))
             (length (seq-length conversation))
             (doc-response (nth (1- length) conversation)))
        doc-response))
    
    (defun chatgpt-shell--insert-doc-response ()
      (with-current-buffer "*chatgpt*"
        (goto-char (point-max))
        (chatgpt-shell--insert-delayed-text (chatgpt-shell--doc-response))
        (call-interactively 'shell-maker-submit)))
    
    (defun chatgpt-shell--insert-delayed-text (text)
      "Insert TEXT into the current buffer, with a delay between each character."
      (dolist (char (string-to-list text))
        (insert char)
        (sit-for 0.009)))
    
    (defun chatgpt-shell--on-chatgpt-patient-response (command output)
      (if (and chatgpt-shell--doctor-in-session
               (not (string-match-p (regexp-quote "I'm cured") output)))
          (progn
            (with-current-buffer "*chatgpt*"
              (goto-char (point-max)))
            (with-selected-window (get-buffer-window "*doctor*")
              (goto-char (point-max))
              (chatgpt-shell--insert-delayed-text output)
              (call-interactively 'doctor-ret-or-read)
              (chatgpt-shell--insert-doc-response)))
        (message "Bye Bye")))
    
    (defun chatgpt-shell-leave-doctor ()
      (interactive)
      (setq chatgpt-shell--doctor-in-session nil)
      (call-interactively 'chatgpt-shell-ctrl-c-ctrl-c))
    
    (add-hook 'chatgpt-shell-after-command-functions
              #'chatgpt-shell--on-chatgpt-patient-response)
    
    (global-set-key (kbd "M-q") #'chatgpt-shell-visit-doctor)
    

    Ok, enough already. Let's see it in action.

    If you'd like to take a closer look for analysis, here's the official transcript of this fruitful session:

    I am the psychotherapist. Please, describe your problems. Each time you are finished talking, type RET twice.

    I spend hours tweaking my Emacs config, but it's never perfect. I'm overwhelmed and obsessed with customization.

    Is it because it's not ever perfect you are overwhelmed and obsessed with customization that you came to me?

    Yes, I can't stop myself from constantly trying to tweak and improve my Emacs configuration. It's consuming me.

    Emacs? Hah! I would appreciate it if you would continue.

    Sorry about that. Yes, I came to you because I'm overwhelmed by my obsession with customizing my Emacs configuration.

    Does it bother you that you are overwhelmed by your obsession with customizing your emacs configuration?

    Absolutely! I feel trapped in an endless cycle of tweaking and configuring, unable to achieve satisfaction.

    Why do you say that?

    I constantly seek perfection in my Emacs config, but it's an unattainable goal that leaves me exhausted and frustrated.

    When did you first know that it's an unattainable goal that leaves you exhausted and frustrated?

    I've realized it recently after spending countless hours trying to perfect my Emacs configuration without any lasting satisfaction.

    Are you sure?

    Thanks you doc, I think I'm cured.

    While we can work exclusively with the *doctor* buffer making requests directly to the ChatGPT API, where's the fun in that? Getting the buffers to talk to each other enables us to marvel at both the beauty and absurdity of being able to glue anything together in our lovely Emacs world.

    Happy Emacsing!

    ]]>
    Wed, 12 Jul 2023 00:00:00 GMT
    chatgpt-shell v0.60.1 updates https://xenodium.com/chatgpt-shell-v0601-updates https://xenodium.com/chatgpt-shell-v0601-updates Back in April, I shared chatgpt-shell updates, showcasing chatgpt-shell features. It's been a little while, so here's an update with the latest additions.

    Like this project? Consider ✨sponsoring✨.

    Multi-session support

    You can run multiple shell instances independently configured to use different versions or system prompts.

    This was biggest recent change. Please report issues.

    Display system prompt and version

    The current shell's version and system prompt are now displayed more prominently in both the shell prompt and buffer name.

    With multi-session support, displaying shell details in the buffer name becomes more important as it makes it easier to find shells across your buffer list.

    Rename shell buffers

    While buffer names are now automatically derived, one can also use chatgpt-shell-rename-buffer to use custom buffer names.

    ob-chatgpt-shell improvements

    Use :temperature to specify the temperature.

    Use :context CONTEXT-NAME to pick and choose which source blocks to aggregate as context. Thank you Thomas Moulia.

    Use :preflight t to debug ob-chatgpt-shell execution.

    chatgpt-shell-write-git-commit

    Adds chatgpt-shell-write-git-commit, so you can generate commit messages using the current region. Thank you Simon Judd.

    Approximate context length

    chatgpt-shell now uses chatgpt-shell--approximate-context-length to approximate the context size and discard history if necessary. This is pretty experimental but seems to work well enough. It's enabled by default to get some feedback. Please file bugs if needed or send PRs to improve.

    S-<return> for multiline input

    In addition to C-J to insert multi-line input, S-<return> is also supported. Thank you shouya for the submission.

    Welcome message

    A welcome message now makes the help much more discoverable for new or sporadic users. Thank you shouya for the suggestion.

    Help me

    While the README documents the shells and Emacs is self-documenting, we now have a help command to make things a little more discoverable.

    Hello chatgpt-shell-mode and dall-e-shell-mode

    Both chatgpt-shell and dall-e-shell are both based on shell-maker and until recently both shared shell-maker-mode as their major mode. This didn't play well with yasnippet. Both shells now enable independent major modes: chatgpt-shell-mode and dall-e-shell-mode. Thank you Daniel Liden for the proposal.

    Saving transcript customizations

    Make transcript saving more customizable via shell-maker-transcript-default-path and shell-maker-transcript-default-filename. Thank you gnusupport.

    New ChatGPT model versions

    New OpenAI model versions were recently released and added to chatgpt-shell: gpt-3.5-turbo-0613 and gpt-4-0613. Thanks you Norio Suzuki.

    Load awesome prompts

    M-x chatgpt-shell-load-awesome-prompts to download and import curated prompts from awesome-chatgpt-prompts. Thank you Daniel Gomez.

    ob-async

    We had reports that ob-chatgpt-shell didn't play nice with ob-async. Thank you William Medrano for the solution.

    Configurable prompts

    Functions like chatgpt-shell-describe-code ask ChatGPT to describe the code in region. These functions used hardcoded English prompts. These are now configurable, so users can tweak or translate if preferred. Thank you Norio Suzuki.

    • chatgpt-shell-prompt-header-describe-code
    • chatgpt-shell-prompt-header-refactor-code
    • chatgpt-shell-prompt-header-generate-unit-test
    • chatgpt-shell-prompt-header-proofread-region
    • chatgpt-shell-prompt-header-whats-wrong-with-last-command
    • chatgpt-shell-prompt-header-eshell-summarize-last-command-output
    ]]>
    Sun, 09 Jul 2023 00:00:00 GMT
    Duplicate this! https://xenodium.com/duplicate-this https://xenodium.com/duplicate-this James Dyer has a nice post sharing his frequent dired need to duplicate files. He offers a solution using a custom interactive command. His use-case resonated with me.

    Similarly, James' recommendation to bind his file-duplicating command to C-c d [^1] sent a signal to my brain triggering Bozhidar Batsov's crux-duplicate-current-line-or-region.

    crux-duplicate-current-line-or-region is part of a "collection of Ridiculously useful extensions for Emacs" (yeah that's crux). The command itself does what it says on the tin.

    Let's duplicate the current line.

    Now let's duplicate the current region.

    Since I already have a well-internalized key-binding duplicating lines/regions in text buffers, I could extend a similar behaviour to dired files with almost zero adoption effort.

    In case you haven't noticed, I've made it a part-time job to make command line utilities easily accessible from Emacs (1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21) via dwim-shell-command. Partly because it's fairly quick and partly 'cause it's fun.

    Jame's post gave me yet another opportunity to exercise my errrm part-time job. This time, duplicating files. All I need is the cp utility and a template:

    cp -R '<<f>>' '<<f(u)>>'
    

    I seldom type these template's myself when I want to execute a command (via M-x dwim-shell-command). I typically wrap these templates in interactive commands, making them easily accessible via M-x and your favorite completion framework. I happen to use ivy.

    (require 'dwim-shell-command)
    
    (defun dwim-shell-commands-duplicate ()
      "Duplicate file(s)."
      (interactive)
      (dwim-shell-command-on-marked-files
       "Duplicate file(s)."
       "cp -R '<<f>>' '<<f(u)>>'"
       :utils "cp"))
    

    There's nothing much to the command. Most logic is handled by the template, replacing <<f>> with the current file and <<f(u)>> with a uniquified version of it. Having said this, there's a bunch of free DWIM love that kicks in, courtesy of the dwim-shell-command package by yours truly. Let's give our new dwim-shell-commands-duplicate command a spin.

    Like crux-duplicate-current-line-or-region duplicates the current line, our new command duplicates the current dired file.

    Got multiple files to duplicate? Like crux-duplicate-current-line-or-region, we can use the region for a similar purpose.

    While we have been using the region to duplicate adjacent files, we can also mark specific files.

    Our cp -R '<<f>>' '<<f(u)>>' template uses the -R (recursive) flag, so we get another freebie. In addition to files, we can also duplicate directories.

    Lastly, because we're on a DWIM train, if your current buffer happens to be visiting a file, you can M-x dwim-shell-commands-duplicate the current file to duplicate it. You're automatically dropped to a dired buffer, with point on the new file (à la dired-jump).

    While duplicating files using a template was a mere cp -R '<<f>>' '<<f(u)>>' away, we get a bunch of free DWIM magic applied to a handful of use-cases and contexts. What made the file-duplicating use-case extra special is that it maps almost exactly to an equivalent text command. Keep the same key bindings and we almost get a "free feature".

    (use-package crux
      :ensure t
      :commands crux-open-with
      :bind
      (("C-c d" . crux-duplicate-current-line-or-region)))
    
    (use-package dwim-shell-command
      :ensure t
      :bind (:map dired-mode-map
                  ("C-c d" . dwim-shell-commands-duplicate))
      :config
      ;; Loads all my own dwim shell commands
      ;; (including `dwim-shell-commands-duplicate')
      (require 'dwim-shell-commands))
    

    You can find my ever-growing list of similar commands over at dwim-shell-commands.el (the optional part of the package). Got some nifty usages? Would love to check 'em out. Get in touch.

    Like this or other content? ✨Sponsor✨ via GitHub Sponsors.

    Update

    If you're keen on a regex-based approach, u/arthurno1 offers a great built-in alternative: dired-do-copy-regexp (bound to % C).

    ]]>
    Wed, 05 Jul 2023 00:00:00 GMT
    Stitching images from the comfort of dired https://xenodium.com/joining-images-from-the-comfort-of-dired https://xenodium.com/joining-images-from-the-comfort-of-dired I recently wanted a few images stitched together. A perfect job for ImageMagick. A quick search yielded the magical incantation:

    convert image1.jpg image2.jpg image3.jpg +append joined.jpg
    

    Great, now I know, but I'll rarely use it and will soon forget it. I may as well add it to my repository of DWIM command line utilities, wrapped in a convenient Emacs function, applicable from different contexts… know what I mean? 🙃

    I built dwim-shell-command for this purpose. You can take the above command and easily turn it into an interactive Emacs command with something like the following:

    (require 'dwim-shell-command)
    
    (defun dwim-shell-commands-join-images-horizontally ()
      "Join all marked images horizontally as a single image."
      (interactive)
      (dwim-shell-command-on-marked-files
       "Join images horizontally"
       "convert -verbose '<<*>>' +append 'joined.jpg'"
       :utils "convert"))
    

    You can select as many images as you'd like from the comfort of your dired and make the ImageMagick happen.

    The snippet does the job just fine, but we can make it smarter. For starters, let's not hardcode the output filename. We'll ask the user instead. While we're asking, let's offer a default filename, but let's not assume the output extension is .jpg. Let's guess based on the image selection. While we're at it, let's not override the output file if already exists. Uniquify it.

    Most of the above can be achieved by either using dwim-shell-command helpers or its templating language. For example, <<joined.png(u)>> ensures that if joined.png already exists, it automatically generates joined(1).png instead.

    (require 'dwim-shell-command)
    
    (defun dwim-shell-commands-join-images-horizontally ()
      "Join all marked images horizontally as a single image."
      (interactive)
      (let ((filename (format "joined.%s"
                              (or (seq-first (dwim-shell-command--file-extensions)) "png"))))
        (dwim-shell-command-on-marked-files
         "Join images horizontally"
         (format "convert -verbose '<<*>>' +append '<<%s(u)>>'"
                 (dwim-shell-command-read-file-name
                  (format "Join as image named (default \"%s\"): " filename)
                  :default filename))
         :utils "convert")))
    

    Here's the new horizontal command in action…

    Notice how this time we didn't mark the images using dired-mark, typically bound to m. Instead, we made our selection using the region. Also, if you haven't gotten your junk food fix yet, here's the fries equivalent ;)

    We'll rinse all and repeat to get the vertical command equivalent. I know, I know, there's fair amount of duplication but c'est la vie.

    (require 'dwim-shell-command)
    
    (defun dwim-shell-commands-join-images-vertically ()
      "Join all marked images vertically as a single image."
      (interactive)
      (let ((filename (format "joined.%s"
                              (or (seq-first (dwim-shell-command--file-extensions)) "png"))))
        (dwim-shell-command-on-marked-files
         "Join images vertically"
         (format "convert -verbose '<<*>>' -append '<<%s(u)>>'"
                 (dwim-shell-command-read-file-name
                  (format "Join as image named (default \"%s\"): " filename)
                  :default filename))
         :utils "convert")))
    

    …and for our grand finale, we'll vertically join our burgers and fries. Behold!

    These commands are now part of dwim-shell-command. To get them, load the optional commands via (require 'dwim-shell-commands).

    ]]>
    Thu, 29 Jun 2023 00:00:00 GMT
    noweb: the lesser known org babel glue https://xenodium.com/noweb-more-glue-for-your-org-toolbox https://xenodium.com/noweb-more-glue-for-your-org-toolbox While Org babel's noweb isn't something I've frequently used for literate programming, its simplicity makes it rather versatile to glue all sorts of babel things I hadn't previously considered.

    The idea is simple. Add a placeholder like <<other-block>> to an org babel source block, and it will be automatically replaced (verbatim) with the content (or result) of referred block before execution. You'll also need the :noweb yes header argument.

    #+NAME: other-block
    #+begin_src swift
      print("Hello 0")
    #+end_src
    
    #+RESULTS: other-block
    : Hello 0
    
    #+BEGIN_SRC swift :noweb yes
      <<other-block>>
      print("Hello 1")
    #+END_SRC
    
    #+RESULTS:
    : Hello 0
    : Hello 1
    

    Since <<other-block>> is replaced with the content of said block, at execution time, the block is effectively equivalent to executing:

    print("Hello 0")
    print("Hello 1")
    

    Why is this so versatile? Org babel can include/execute all sorts of languages, so you can mix and match the result from one language and massage it to appear as the body of another block using the same (or different) language.

    I was recently asked how to include the result from one babel block in another using ob-chatgpt-shell. While the initial question was looking for a solution involving variables, we can use noweb to achieve a similar goal.

    Note that in this case, I'll be using <<hello()>>, with (), to refer to #+RESULTS: rather than the source block itself.

    #+NAME: hello
    #+BEGIN_SRC chatgpt-shell
    Say hello in spanish
    #+END_SRC
    
    #+RESULTS: hello
    Hola
    
    #+BEGIN_SRC chatgpt-shell :noweb yes
    <<hello()>>
    What does the previous line say verbatim?
    #+END_SRC
    

    Executing the block

    <<hello()>>
    What does the previous line say verbatim?
    

    Gives us

    #+RESULTS:
    
    The previous line says "Hola".
    

    On a similar note, I was asked if the results from a previous source block could be fed to a Swift Chart block using ob-swiftui.

    While I'm new to Swift Charts, I do love glueing things via Emacs lisp. I figured I could write a little elisp to generate random data and feed it to a SwiftUI block via <<data()>>. The result is pretty neat, based on Apple's LineMark example.

    #+NAME: data
    #+begin_src emacs-lisp :lexical no
      (concat (mapconcat (lambda (n)
                           (format "MonthlyHoursOfSunshine(city: \"Seattle\", month: %d, hoursOfSunshine: %d),"
                                   n (random 100)))
                         (number-sequence 1 20) "\n")
              "\n"
              (mapconcat (lambda (n)
                           (format "MonthlyHoursOfSunshine(city: \"Cupertino\", month: %d, hoursOfSunshine: %d),"
                                   n (random 100)))
                         (number-sequence 1 20) "\n"))
    #+end_src
    
    #+begin_src swiftui :results file :noweb yes
      import Charts
    
      struct MonthlyHoursOfSunshine: Identifiable {
        var city: String
        var date: Date
        var hoursOfSunshine: Double
        var id = UUID()
    
        init(city: String, month: Int, hoursOfSunshine: Double) {
          let calendar = Calendar.autoupdatingCurrent
          self.city = city
          self.date = calendar.date(from: DateComponents(year: 2020, month: month))!
          self.hoursOfSunshine = hoursOfSunshine
        }
      }
    
      struct ContentView: View {
        var data: [MonthlyHoursOfSunshine] = [
    <<data()>>
        ]
        var body: some View {
          Chart(data) {
            LineMark(
              x: .value("Month", $0.date),
              y: .value("Hours of Sunshine", $0.hoursOfSunshine)
            )
            .foregroundStyle(by: .value("City", $0.city))
          }
          .frame(minWidth: 800, minHeight: 300)
          .padding()
          .colorScheme(.dark)
        }
      }
    #+end_src
    

    While I've shown fairly basic usages of noweb, we can accomplish some nifty integrations. Check out the noweb reference syntax for more examples and additional header arguments like tangle, strip-tangle, and others.

    ]]>
    Sun, 18 Jun 2023 00:00:00 GMT
    Deleting from Emacs sequence vars https://xenodium.com/deleting-from-emacs-sequence-vars https://xenodium.com/deleting-from-emacs-sequence-vars Adding hooks and setting variables is core to customizing Emacs. Take a major mode like emacs-lisp-mode as an example. To customize its behaviour, one may add a hook function to emacs-lisp-mode-hook, or if you're a little lazy while experimenting, you may even use a lambda.

    (add-hook 'emacs-lisp-mode-hook
              #'my/emacs-lisp-mode-config)
    
    (add-hook 'emacs-lisp-mode-hook
              (lambda ()
                (message "I woz ere")))
    

    emacs-lisp-mode-hook's content would subsequently look as follows:

    '(my/emacs-lisp-mode-config
      (lambda nil
        (message "I woz ere"))
      ert--activate-font-lock-keywords
      easy-escape-minor-mode
      lisp-extra-font-lock-global-mode)
    

    Maybe my/emacs-lisp-mode-config didn't work out for us and we'd like to remove it. We can use remove-hook for that and evaluate something like:

    (remove-hook 'emacs-lisp-mode-hook #'my/emacs-lisp-mode-config)
    

    The lambda can be removed too, but you ought to be careful in using the same lambda body.

    (remove-hook 'emacs-lisp-mode-hook
                 (lambda ()
                   (message "I woz tere")))
    

    There are other ways to remove the lambdas, but we're digressing here… We typically have to write these throwaway snippets to undo our experiments. What if we just had a handy helper always available to remove items from sequences (edit: we do, remove-hook is already interactive, see Update 2 below)? After all, hooks are just lists (sequences).

    While the interactive command can likely be simplified further, I tried to optimize for ergonomic usage. For example, completing-read gives us a way narrow down whichever variable we'd like to modify as well as the item we'd like to remove. seqp is also handy, as we filter out noise by automatically removing any variable that's not a sequence.

    (defun ar/remove-from-list-variable ()
      (interactive)
      (let* ((var (intern
                   (completing-read "From variable: "
                                    (let (symbols)
                                      (mapatoms
                                       (lambda (sym)
                                         (when (and (boundp sym)
                                                    (seqp (symbol-value sym)))
                                           (push sym symbols))))
                                      symbols) nil t)))
             (values (mapcar (lambda (item)
                               (setq item (prin1-to-string item))
                               (concat (truncate-string-to-width
                                        (nth 0 (split-string item "\n"))
                                        (window-body-width))
                                       (propertize item 'invisible t)))
                             (symbol-value var)))
             (index (progn
                      (when (seq-empty-p values) (error "Already empty"))
                      (seq-position values (completing-read "Delete: " values nil t)))))
        (unless index (error "Eeek. Something's up."))
        (set var (append (seq-take (symbol-value var) index)
                         (seq-drop (symbol-value var) (1+ index))))
        (message "Deleted: %s" (truncate-string-to-width
                                (seq-elt values index)
                                (- (window-body-width) 9)))))
    

    Hooks are just an example of lists we can delete from. I recently used the same command on display-buffer-alist.

    While this has been a fun exercise, I can't help but think that I'm likely re-inventing the wheel here. Is there something already built-in that I'm missing?

    Update 1

    alphapapa suggested some generalizations that would provide an editing buffer of sorts. This is a neat idea, using familiar key bindigs C-c C-c to save and C-c C-k to bail.

    Beware, I haven't tested the code with a diverse set of list items, so there's a chance of corrupting the variable content. Improvements to the code are totally welcome.

    ;;; -*- lexical-binding: t; -*-
    
    (defun ar/edit-list-variable ()
      (interactive)
      (let* ((var (intern
                   (completing-read "From variable: "
                                    (let (symbols)
                                      (mapatoms
                                       (lambda (sym)
                                         (when (and (boundp sym)
                                                    (seqp (symbol-value sym)))
                                           (push sym symbols))))
                                      symbols) nil t)))
             (values (string-join
                      (mapcar #'prin1-to-string (symbol-value var))
                      "\n")))
        (with-current-buffer (get-buffer-create "*eval elisp*")
          (emacs-lisp-mode)
          (local-set-key (kbd "C-c C-c")
                         (lambda ()
                           (interactive)
                           (eval-buffer)
                           (kill-this-buffer)
                           (message "Saved: %s" var)))
          (local-set-key (kbd "C-c C-k") 'kill-this-buffer)
          (erase-buffer)
          (insert (format "(setq %s\n `(%s))" var values))
          (mark-whole-buffer)
          (indent-region (point-min) (point-max))
          (deactivate-mark)
          (switch-to-buffer (current-buffer)))))
    

    Update 2

    So hunch was right…

    "While this has been a fun exercise, I can't help but think that I'm likely re-inventing the wheel here. Is there something already built-in that I'm missing?"

    juicecelery's Reddit commit confirmed it. Thank you! remove-hook is already interactive 🤦‍♂️. TIL 😁

    juicecelery was kind enough to point out an improvement in the custom function:

    "but I see your improvements, for instance that non list items are removed from the selection."

    ]]>
    Thu, 25 May 2023 00:00:00 GMT
    Sprinkle me logs https://xenodium.com/sprinkle-me-logs https://xenodium.com/sprinkle-me-logs At times, basic prints/logs are just about the right debugging strategy. Sure, we have debuggers and REPLs which are super useful, but sometimes you just know that sprinkling your code with a handful of temporary prints/logs will get you enough info to fix an issue.

    I must confess, my temporary print statements are fairly uninspiring. Sometimes I log the name of the method/function, but I also resort to less creative options like print("Yay") or print("Got here").

    My laziness and lack of creativity knows no boundaries, so if I need multiple unique entries, I often copy, paste, and append numbers to my entries: print("Yay 2"), print("Yay 3"), print("Yay 4")… I know, are you judging yet?

    So rather than develop the creative muscle, I've decided to lean on laziness and old habits, so let's make old habit more efficient :) I no longer want to copy, paste, and increment my uncreative log statements. Instead, I'll let Emacs do it for me!

    There isn't a whole lot to the implementation. It searches the current buffer for other instances of the same logging string and captures the largest counter found. It subsequently prints the same string with the counter incremented. This can be done in a few lines of elisp, but I figure I wanted some additional features like auto indenting and changing the logging string when using a prefix.

    (defvar ar/unique-log-word "Yay")
    
    (defun ar/insert-unique-log-word (prefix)
      "Inserts `ar/unique-log-word' incrementing counter.
    
    With PREFIX, change `ar/unique-log-word'."
      (interactive "P")
      (let* ((word (cond (prefix
                          (setq ar/unique-log-word
                                (read-string "Log word: ")))
                         ((region-active-p)
                          (setq ar/unique-log-word
                                (buffer-substring (region-beginning)
                                                  (region-end))))
                         (ar/unique-log-word
                          ar/unique-log-word)
                         (t
                          "Reached")))
             (config
              (cond
               ((equal major-mode 'emacs-lisp-mode)
                (cons (format "(message \"%s: \\([0-9]+\\)\")" word)
                      (format "(message \"%s: %%s\")" word)))
               ((equal major-mode 'swift-mode)
                (cons (format "print(\"%s: \\([0-9]+\\)\")" word)
                      (format "print(\"%s: %%s\")" word)))
               ((equal major-mode 'ada-mode)
                (cons (format "Ada.Text_Io.Put_Line (\"%s: \\([0-9]+\\)\");" word)
                      (format "Ada.Text_Io.Put_Line (\"%s: %%s\");" word)))
               ((equal major-mode 'c++-mode)
                (cons (format "std::cout << \"%s: \\([0-9]+\\)\" << std::endl;" word)
                      (format "std::cout << \"%s: %%s\" << std::endl;" word)))
               (t
                (error "%s not supported" major-mode))))
             (match-regexp (car config))
             (format-string (cdr config))
             (max-num 0)
             (case-fold-search nil))
        (when ar/unique-log-word
          (save-excursion
            (goto-char (point-min))
            (while (re-search-forward match-regexp nil t)
              (when (> (string-to-number (match-string 1)) max-num)
                (setq max-num (string-to-number (match-string 1))))))
          (setq max-num (1+ max-num)))
        (unless (looking-at-p "^ *$")
          (end-of-line))
        (insert (concat
                 (if (looking-at-p "^ *$") "" "\n")
                 (format format-string
                         (if ar/unique-log-word
                             (number-to-string (1+ max-num))
                           (string-trim
                            (shell-command-to-string
                             "grep -E '^[a-z]{6}$' /usr/share/dict/words | shuf -n 1"))))))
        (call-interactively 'indent-for-tab-command)))
    

    Note: This snippet may evolve independently of this post. For the latest, chech my Emacs config's fe-prog.el.

    I want to be lazy in other languages, so the function can now be extended to support other languages. Here's the Swift counterpart.

    Since I sometimes log function names, I figured making it region-aware would help with that.

    I'm sure there's a package out there that does something similar, but I figure this would be a fun little elisp hack.

    Happy logging!

    Update 1

    Set ar/unique-log-word to nil and let it generate a random word. Maybe I get to learn new words as I debug ;)

    Update 2

    Added Ada and C++ support, thanks to James Dyer's post.

    ]]>
    Thu, 18 May 2023 00:00:00 GMT
    dwim-shell-command on Windows + upload to 0x0.st https://xenodium.com/dwim-shell-command-now-on-windows https://xenodium.com/dwim-shell-command-now-on-windows You can now use dwim-shell-command on Windows. Shoutout to Kartik Saranathan, who sent a pull request to get rid of ls usage.

    Also thanks to Bram for sharing his upload to 0x0.st implementation. I'd been wanting to do something similar for imgur, but 0x0.st is a much better alternative!

    dwim-shell-commands-upload-to-0x0 is now part of dwim-shell-commands.el (the optional part of the package). It has a couple of additional touches:

    • Open the uploaded image in eww browser.
    • Automatically copy the upload URL to kill-ring. You're likely gonna share this link, right?

    If you're unfamiliar with dwim-shell-command, it enables Emacs shell commands with DWIM behaviour:

    • Asynchronously.
    • Using noweb templates.
    • Automatically injecting files (from dired or other buffers) or kill ring.
    • Managing buffer focus with heuristics.
    • Showing progress bar.
    • Quick buffer exit.
    • More reusable history.

    In addition to replacing shell-command with dwim-shell-command, I also use it to bring all sorts of command line utilities to familiar Emacs workflows (in dired or current buffers), without having to remember complex command invocations.

    I've covered many of the use-cases before:

    ]]>
    Thu, 11 May 2023 00:00:00 GMT
    chatgpt-shell siblings now on MELPA also https://xenodium.com/chatgpt-shell-siblings-now-on-melpa-also https://xenodium.com/chatgpt-shell-siblings-now-on-melpa-also In chatgpt-shell updates, I highlighted dall-e-shell (a DALL-E Emacs shell), ob-chatgpt-shell (ChatGPT org babel support), and ob-dall-e-shell (DALL-E org babel support) were initially excluded from the chatgpt-shell MELPA submission while I worked out their split.

    That's now sorted and the packages are available on MELPA.

    Here's ob-chatgpt-shell and ob-dall-e-shell in action.

    Here's dall-e-shell.

    ]]>
    Mon, 01 May 2023 00:00:00 GMT
    Generating elisp org docs https://xenodium.com/generating-elisp-org-docs https://xenodium.com/generating-elisp-org-docs chatgpt-shell's README includes few org tables documenting the package's customizable variables as well as available commands. Don't worry, this isn't really another ChatGPT post.

    Here's an extract of the docs table:

    | Custom variable                       | Description                                                 |
    |---------------------------------------+-------------------------------------------------------------|
    | chatgpt-shell-display-function        | Function to display the shell.                              |
    | chatgpt-shell-curl-additional-options | Additional options for `curl' command.                      |
    | chatgpt-shell-system-prompt           | The system message helps set the behavior of the assistant. |
    

    While the table docs didn't take long to build manually, they quickly became out of sync with their elisp counterparts. Not ideal, as it'll require a little more careful maintenance in the future.

    Emacs being the self-documenting editor that it is, I figured I should be able to extract customizable variables, commands, along with their respective docs, and generate these very same org tables.

    I had no idea how to go about this, but apropos-variable and apropos-command surely knew where to fetch the details from. A peek into apropos.el quickly got me on my way. Turns out mapatoms is just what I needed. It iterates over obarray, Emacs's symbol table. We can use it to extract the symbols we're after.

    Since we're filtering symbols from chatgpt-shell, we can start by including only those whose symbol-name match "^chatgpt-shell". Out of all matching, we should only keep custom variables. We can use custom-variable-p to check for that. This gives us all relevant variables. We can subsequently get each variable's corresponding docs using (get symbol 'variable-documentation) and put it into a list.

    Now, if we pull our org babel rabbit out of our Emacs magic hat, we can use :results table to print the list as an org table. The source block powering this magic trick looks as follows:

    #+begin_src emacs-lisp :results table :colnames '("Custom variable" "Description")
      (let ((rows))
        (mapatoms
         (lambda (symbol)
           (when (and (string-match "^chatgpt-shell"
                                    (symbol-name symbol))
                      (custom-variable-p symbol))
             (push `(,symbol
                     ,(car
                       (split-string
                        (or (get (indirect-variable symbol)
                                 'variable-documentation)
                            (get symbol 'variable-documentation)
                            "")
                        "\n")))
                   rows))))
        rows)
    #+end_src
    

    And just like that… we effortlessly get our elisp docs in an org table, straight from Emacs's symbol table.

    It's worth noting that our snippet used indirect-variable to resolve aliases but also limited descriptions to the first line in each docstring.

    To build a similar table for interactive commands, we can use the following block (also including bindings).

    #+BEGIN_SRC emacs-lisp :results table :colnames '("Binding" "Command" "Description")
      (let ((rows))
        (mapatoms
         (lambda (symbol)
           (when (and (string-match "^chatgpt-shell"
                                    (symbol-name symbol))
                      (commandp symbol))
             (push `(,(mapconcat
                       #'help--key-description-fontified
                       (where-is-internal
                        symbol shell-maker-mode-map nil nil (command-remapping symbol)) ", ")
                     ,symbol
                     ,(car
                       (split-string
                        (or (documentation symbol t) "")
                        "\n")))
                   rows))))
        rows)
    #+END_SRC
    

    You see? This post wasn't really about ChatGPT. Aren't you glad you stuck around? 😀

    ]]>
    Fri, 28 Apr 2023 00:00:00 GMT
    LLM bookmarks https://xenodium.com/llm-bookmarks https://xenodium.com/llm-bookmarks
  • A New Age of Magic.
  • Bark – Text-prompted generative audio model | Hacker News.
  • Brex’s Prompt Engineering Guide | Hacker News.
  • GitHub - suno-ai/bark: 🔊 Text-Prompted Generative Audio Model.
  • How to run your own LLM (GPT).
  • Llama3 implemented from scratch | Hacker News.
  • PromptPerfect - Elevate Your Prompts to Perfection with AI Prompt Engineering.
  • Reddit - Dive into anythingHow Language Models work, Part 1
  • Running LLMs Locally | Y.K. Goon.
  • ShareGPT: Share your wildest ChatGPT conversations with one click..
  • Show HN: Automatic prompt optimizer for LLMs | Hacker News.
  • The Art of ChatGPT Prompting: A Guide to Crafting Clear and Effective Prompts.
  • The Art of Midjourney AI: A Guide to Creating Images from Text.
  • ]]>
    Tue, 25 Apr 2023 00:00:00 GMT
    chatgpt-shell updates https://xenodium.com/chatgpt-shell-available-on-melpa https://xenodium.com/chatgpt-shell-available-on-melpa About a month ago, I posted about an experiment to build a ChatGPT Emacs shell using comint mode. Since then, it's turned into a package of sorts, evolving with user feedback and pull requests.

    Now on MELPA

    While chatgpt-shell is a young package still, it seems useful enough to share more widely. As of today, chatgpt-shell is available on MELPA. Many thanks to Chris Rayner for his MELPA guidance to get the package added.

    I'll cover some of the goodies included in the latest chatgpt-shell.

    Delegating to Org Babel

    chatgpt-shell now evaluates Markdown source blocks by delegating to org babel. I've had success with a handful of languages. In some instances, some babel headers may need overriding in chatgpt-shell-babel-headers.

    Here's a Swift execution via babel, showing standard output.

    In addition to standard output, chatgpt-shell can now render blocks generating images. Here's a rendered SwiftUI layout via ob-swiftui.

    Can also do diagrams. Here's ditaa in action.

    Renaming blocks

    At times, ChatGPT may forget to label source blocks or maybe you just want to name it differently… You can now rename blocks at point.

    Send prompt/region

    There are a handful of commands to send prompts from other buffers, including the region. For example chatgpt-shell-explain-code.

    • chatgpt-shell-send-region
    • chatgpt-shell-generate-unit-test
    • chatgpt-shell-refactor-code
    • chatgpt-shell-proofread-doc
    • chatgpt-shell-eshell-summarize-last-command-output
    • chatgpt-shell-eshell-whats-wrong-with-last-command

    Saving/restoring transcript

    You can save your current session to a transcript and restore later.

    History improvements

    Nicolas Martyanoff has a great post on making IELM More Comfortable. A couple of improvements that stood out for me were:

    • Making the command history persistent.
    • Searching history with shell-maker-search-history / M-r via completing-read.

    shell-maker-search-history, coupled with your completion framework of choice, can be pretty handy. I happen to use Oleh Krehel's ivy.

    shell-maker (make your own AI shells)

    While ChatGPT is a popular service, there are many others sprouting. Some are cloud-based, others local, proprietary, open source… In any case, it'd be great be able to hook on to them without much overhead. shell-maker should help with that. The first shell-maker clients are chatgpt-shell and dall-e-shell.

    While I've built dall-e-shell, it'd be great to see what others can do with shell-maker. If you wire it up to anything, please get in touch (Mastodon / Twitter / Reddit / Email).

    dall-e-shell, ob-chatgpt-shell, and ob-dall-e-shell (on MELPA too)

    UPDATE: dall-e-shell, ob-chatgpt-shell, and ob-dall-e-shell are now available on MELPA also.

    You've seen dall-e-shell in the previous section. Here's what ob-chatgpt-shell and ob-dall-e-shell look like in an org mode document:

    How are you using chatgpt-shell?

    Whether you are an existing chatgpt-shell user, or would like to give things a try, installing from MELPA should generally make things easier for ya. As I mentioned, chatgpt-shell is a young package still. There are unexplored Emacs integrations out there. I'd love to hear about whatever you come up with (Mastodon / Twitter / Reddit / Email).

    ]]>
    Tue, 25 Apr 2023 00:00:00 GMT
    Recording and screenshotting windows: the lazy way https://xenodium.com/recordscreenshot-windows-the-lazy-way https://xenodium.com/recordscreenshot-windows-the-lazy-way While there's no substitution for great written documentation, a quick demo can go a long way in conveying what a tool if capable of doing or what a tip/trick can achieve.

    If you've read a handful of my posts, you would have come across either a screenshot or a short clip with some demo. Historically, I've used the macOS's built-in utility invoked via ⌘ + Shift + 5. It does a fine job for screenshots. For video captures, it's got a couple of small quirks.

    Record window

    Unlike screenshots, macOS video capture cannot record a specific window. While you can select a region, it's easy to inadvertently include a portion of your wallpaper in the recording. Not a big deal, but I felt posted screencasts could look as clean as their screenshot counterparts if we could record the window alone.

    Let's compare grabbing a region vs window alone. I know the clean look may be subjective, but see what I mean?

    Capture region (includes wallpaper/background)
    Capture window only (ahhh, so clean)

    Cancel recording

    macOS has a handy shortcut (⌘ + Ctrl + Esc) to stop recording. If you got your demo right, you're done. If not, you have one more step remaining (right click to delete the blooper).

    Also not a huge deal, but I was hoping for a single shortcut to stop recording [and]{.underline} also automatically discard. I haven't found one, but would love to hear if otherwise.

    macosrec enters the chat

    I wanted more flexibility to build my own recording/screenshotting flows. A command line utility could be quite versatile at that, so I built macosrec.

    macosrec enables taking a screenshot or recording a window video entirely from the command line.

    elisp glues the world

    Command line utilities can be invoked in all sorts of ways, but I'm an Emacs nutter so you can see where this is going… I want Emacs key bindings to control the lot.


    C-c _ Take screenshot of a window C-c ( Start recording window C-c ) Stop recording window C-c 8 Abort recording


    Integrating command line utilities into Emacs and making them quickly accessible seems to have become a full-time hobby of mine. I kid, but it's become a pretty painless process for me. I built dwim-shell-command for that. If you've never heard of DWIM, it stands for "Do what I mean". To give you an idea of the kinds of things I'm using DWIM commands for, check the following out:

    • dwim-shell-commands-audio-to-mp3
    • dwim-shell-commands-bin-plist-to-xml
    • dwim-shell-commands-clipboard-to-qr
    • dwim-shell-commands-drop-video-audio
    • dwim-shell-commands-files-combined-size
    • dwim-shell-commands-git-clone-clipboard-url
    • dwim-shell-commands-git-clone-clipboard-url-to-downloads
    • dwim-shell-commands-image-to-grayscale
    • dwim-shell-commands-image-to-icns
    • dwim-shell-commands-image-to-jpg
    • dwim-shell-commands-image-to-png
    • dwim-shell-commands-pdf-password-protect
    • dwim-shell-commands-reorient-image
    • dwim-shell-commands-resize-gif
    • dwim-shell-commands-resize-image
    • dwim-shell-commands-resize-video
    • dwim-shell-commands-speed-up-gif
    • dwim-shell-commands-speed-up-video
    • dwim-shell-commands-unzip
    • dwim-shell-commands-video-to-gif
    • dwim-shell-commands-video-to-optimized-gif
    • dwim-shell-commands-video-to-webp

    If it ever took you a little while to find the right command incantation to get things right, only to forget all about it next time you need it (I'm looking at you ffmpeg), dwim-shell-command can help you easily save things for posterity and make them easily accessible in the future.

    Since we're talking ffmpeg, here's all it takes to have gif conversion handy:

    (defun dwim-shell-commands-video-to-gif ()
      "Convert all marked videos to gif(s)."
      (interactive)
      (dwim-shell-command-on-marked-files
       "Convert to gif"
       "ffmpeg -loglevel quiet -stats -y -i '<<f>>' -pix_fmt rgb24 -r 15 '<<fne>>.gif'"
       :utils "ffmpeg"))
    

    There's no way I'll remember the ffmpeg command, but I can always fuzzy search my trusty commands with something like "to gif" and apply to either the current buffer file or any selected dired files.

    So where am I going with this? I wrote DWIM shell commands for the bindings I previously described:


    C-c _ dwim-shell-commands-macos-screenshot-window C-c ( dwim-shell-commands-macos-start-recording-window C-c ) dwim-shell-commands-macos-end-recording-window C-c 8 dwim-shell-commands-macos-abort-recording-window


    Out of all of commands, dwim-shell-commands-macos-start-recording-window is likely the most interesting one.

    (defun dwim-shell-commands-macos-start-recording-window ()
      "Select and start recording a macOS window."
      (interactive)
      (let* ((window (dwim-shell-commands--macos-select-window))
             (path (dwim-shell-commands--generate-path "~/Desktop" (car window) ".mov"))
             (buffer-file-name path) ;; override so <<f>> picks it up
             (inhibit-message t))
        (dwim-shell-command-on-marked-files
           "Start recording a macOS window."
           (format
            "# record .mov
             macosrec --record '%s' --mov --output '<<f>>'
             # speed .mov up x1.5
             ffmpeg -i '<<f>>' -an -filter:v 'setpts=1.5*PTS' '<<fne>>_x1.5.<<e>>'
             # convert to gif x1.5
             ffmpeg -loglevel quiet -stats -y -i '<<fne>>_x1.5.<<e>>' -pix_fmt rgb24 -r 15 '<<fne>>_x1.5.gif'
             # speed .mov up x2
             ffmpeg -i '<<f>>' -an -filter:v 'setpts=2*PTS' '<<fne>>_x2.<<e>>'
             # convert to gif x2
             ffmpeg -loglevel quiet -stats -y -i '<<fne>>_x2.<<e>>' -pix_fmt rgb24 -r 15 '<<fne>>_x2.gif'"
            (cdr window))
           :silent-success t
           :monitor-directory "~/Desktop"
           :no-progress t
           :utils '("ffmpeg" "macosrec"))))
    

    As you likely expect, this command invokes macosrec to start recording a window. The nifty part is that when it's done recording (and saving the .mov file), it automatically creates multiple variants. For starters, it creates x1.5 and x2 .mov videos, but it also generates their .gif counterparts.

    Let's recap here for a sec. You start recording a window video with C-c (, end with C-c ), and automagically have all these generated files waiting for you.

    You can subsequently inspect any of the video candidates and pick the most appropriate variant. Discard whatever else you don't need.

    The output bundle is tailored to my needs. Maybe you want to invoke gifsycle for more optimized versions? Or maybe you want automatic webp generation via ffmpeg? DWIM does that I mean, so you likely have other plans…

    dwim-shell-commands-macos-start-recording-window and all other DWIM commands are now included in dwim-shell-commands.el, which ships optionally as part of dwim-shell-command.

    macosrec is also on GitHub, but if you want to be on your way, you can install via:

    brew tap xenodium/macosrec
    brew install macosrec
    

    This is my way to record and screenshot windows the lazy way. How would you tweak to make it yours?

    ]]>
    Sat, 22 Apr 2023 00:00:00 GMT
    ob-swiftui updates https://xenodium.com/ob-swiftui-updates https://xenodium.com/ob-swiftui-updates While experimenting with delegating Markdown blocks to Org babel in Emacs chatgpt-shell, I resurrected ob-swiftui. A package I had written to execute and render SwiftUI blocks in org babel.

    ob-swiftui has two modes of rendering SwiftUI blocks: :results window, which runs outside of Emacs in a native window and :results file, which renders and saves to a file. The latter can be viewed directly from Emacs.

    :results file was a little clunky. That is, it hardcoded dimensions I had to manually modify if the canvas wasn't big enough. It was also a little slow.

    The clunkyness really came through with my chatgpt-shell experiments, so I took a closer look and made a few changes to remove hardcoding and speeds things up.

    The results ain't too shabby.

    Another tiny improvement is that if you'd like to compose a more complex layout made of multiple custom views, ob-swiftui now looks for a ContentView as that root view by default. Specifying another root view was already possible but it had to be explicitly requested via :view param.

    You can now omit the :view param if you name the root view ContentView:

    #+begin_src swiftui
      struct ContentView: View {
        var body: some View {
            TopView()
            BottomView()
        }
      }
    
      struct TopView: View {
        var body: some View {
          Text("Top text")
        }
      }
    
      struct BottomView: View {
        var body: some View {
          Text("Bottom text")
        }
      }
    #+end_src
    

    The improvements have been pushed to ob-swiftui and will soon be picked up on melpa.

    Edit: Added ContentView details.

    ]]>
    Thu, 20 Apr 2023 00:00:00 GMT
    My Emacs eye candy https://xenodium.com/my-emacs-eye-candy https://xenodium.com/my-emacs-eye-candy I get the occasional question about my Emacs theme, font, and other eye candy. I'm always tickled and happy to share.

    It's been a while since I've made visually significant changes to my Emacs config. May as well briefly document for posterity…

    Nyan Mode

    First things first. The adorable and colorful little fella in my mode line is a Nyan Cat (if you dare, check the meme video). Yes, I know it's sooo 2011, but it's 2023 and I still love the little guy hanging out in my Emacs mode line. I still get asked about it.

    This fabulous feature comes to us via the great Nyan Mode package. If looks haven't convinced you, Nyan also packs scrolling functionality. Click anywhere in it.

    Oh, and if you can't get enough of Nyan, there's also zone-nyan for Emacs.

    Emacs Plus (macOS)

    I should mention I'm running Emacs 28 on macOS via the excellent Emacs Plus homebrew recipe. These are all the options I enable.

    brew install  emacs-plus@28 --with-imagemagick --with-no-frame-refocus --with-native-comp --with-savchenkovaleriy-big-sur-icon
    

    Icon

    Since we're talking eye candy, let's chat about --with-savchenkovaleriy-big-sur-icon. This Emacs Plus option enables Valeriy Savchenko's wonderful icon.

    Titlebar

    I've enabled both transparent title bar as well as dark appearance, giving a minimal window decoration.

    (add-to-list 'default-frame-alist '(ns-transparent-titlebar . t))
    (add-to-list 'default-frame-alist '(ns-appearance . dark))
    

    Note: both of these variables are prefixed ns- (macOS-only settings).

    Font (JetBrains Mono)

    I've been on JetBrains Mono font for quite some time now. In the past, I've also been a fan of Mononoki and Menlo (on macOS) or Meslo (similar elsewhere).

    Theme (Materialized)

    I'm using Materialized which I derived from the great Material Theme for Emacs.

    Modeline tabs/ribbons (Moody)

    The moody package adds a nice touch displaying mode line elements as tabs and ribbons.

    Modeline menus (Minions)

    The minions package removes lots of minor mode clutter from the mode line and stashes it away in menus.

    Hiding modeline (hide mode line mode)

    Hiding the mode line isn't something I use in most major modes. However, I found it complements my shell (eshell) quite well. While I was sceptical at first, once I hid the mode line in my shell I never looked back. I just didn't miss it. I also love the uncluttered clean vibe. hide-mode-line-mode can help with that.

    Welcome screen

    Back in October 2022, I experimented with adding a minimal welcome screen. I was initially hesitant, as I was already a fan of the welcome scratch buffer. In any case, I figured I'd eventually get tired of it and remove it. Well, it's enabled in my config still ;) My initial attachment to a landing scratch quickly faded. I'm only a C-x b binding away from invoking ivy-switch-buffer to get me anywhere.

    The great Emacs logo originally shared by u/pearcidar43.

    Zones

    I've been meaning to re-enable zones in my config. They always gave me a good tickle. I've already mentioned zone-nyan, but if you're new to zones, they kick off after a period of inactivity (similar to a screensaver).

    Here's zone-pgm-rotate in all its glory. Oh and it's built-in!

    Coincidentally, I had a go at writing a basic zone a little while ago.

    Config

    Most of the items mentioned I pulled from my Emacs config's fe-ui.el. There's more there if you're interested.

    What is some of your favorite Emacs eye candy? reddit / mastodon / twitter.

    ]]>
    Sat, 15 Apr 2023 00:00:00 GMT
    shell-maker, a maker of Emacs shells https://xenodium.com/a-shell-maker https://xenodium.com/a-shell-maker A few weeks ago, I wrote about an experiment to bring ChatGPT to Emacs as a shell. I was fairly new to both ChatGPT and building anything on top of comint. It was a fun exercise, which also generated some interest.

    As mentioned in the previous post, I took inspiration in other Emacs packages (primarily ielm) to figure out what I needed from comint. Soon, I got ChatGPT working.

    As I was looking at OpenAI API docs, I learned about DALL-E: "an AI system that can create realistic images and art from a description in natural language."

    Like ChatGPT, they also offered an API to DALL-E, so I figured I may as well try to write a shell for that too… and I did.

    There was quite a bit of code duplication between the two Emacs shells I had just written. At the same time, I started hearing from folks about integrating other tools, some cloud-based, some local, proprietary, open source.. There's Cody, invoke-ai, llama.cpp, alpaca.cpp, and the list continues to grow.

    With that in mind, I set out to reduce the code duplication and consolidate into a reusable package. And so shell-maker was born, a maker of Emacs shells.

    shell-maker's internals aren't too different from the code I had before. It's still powered by comint, but instead offers a reusable convenience wrapper.

    It takes little code to implement a shell, like the sophisticated new greeter-shell ;)

    (require 'shell-maker)
    
    (defvar greeter-shell--config
      (make-shell-maker-config
       :name "Greeter"
       :execute-command
       (lambda (command _history callback error-callback)
         (funcall callback
                  (format "Hello \"%s\"" command)
                  nil))))
    
    (defun greeter-shell ()
      "Start a Greeter shell."
      (interactive)
      (shell-maker-start greeter-shell--config))
    

    shell-maker is available on GitHub and currently bundled with chatgpt-shell. If there's enough interest and usage, I may just break it out into its own package. For now, it's convenient to keep with chatgpt-shell and dall-e-shell.

    If you plug shell-maker into other tools, I'd love to hear about it.

    Happy shell making!

    ]]>
    Sat, 08 Apr 2023 00:00:00 GMT
    Flat Habits 1.1.4 released https://xenodium.com/flat-habits-114-released https://xenodium.com/flat-habits-114-released Flat Habits 1.1.4 is now available on the App Store.

    Flat Habits is a habit tracker that’s mindful of your time, data, and privacy. It's a simple but effective iOS app.

    today_no_filter.png

    download-on-app-store.png

    If you care about how your data is stored, Flat Habits is powered by org plain text markup without any cloud component. You can use your favorite editor (Emacs, Vim, VSCode, etc.) to poke at habit data, if that's your cup of tea.

    What's new?

    • Quicker toggling, now exposing Done/Skip.
      • Double tap marks Done.
    • Also display in 12 hour time format.
    • Overdue habits are now labelled "past" and coloured orange.
    • Don't dismiss creation dialog if tapping outside.
    • Set #+STARTUP: nologdrawer in new files.

    Are you a fan?

    Is Flat Habits helping you keep up with your habits? Please rate/review 😊

    ]]>
    Thu, 06 Apr 2023 00:00:00 GMT
    A ChatGPT Emacs shell https://xenodium.com/a-chatgpt-emacs-shell https://xenodium.com/a-chatgpt-emacs-shell UPDATE: chatgpt-shell has evolved a bit and is now on MELPA.

    I had been meaning to give ChatGPT a good try, preferably from Emacs. As an eshell fan, ChatGPT seemed like the perfect fit for a shell interface of sorts. With that in mind, I set out to wire ChatGPT with Emacs's general command interpreter (comint).

    I had no previous experience building anything comint-related, so I figured I could just take a peek at an existing comint-derived mode to achieve a similar purpose. inferior-emacs-lisp-mode (ielm) seemed to fit the bill just fine, so I borrowed quite a bit to assemble a basic shell experience.

    From then on, it was mostly about sending each request over to the ChatGPT API to get a response. For now, I'm relying on curl to make each request. The invocation is fairly straightforward:

    curl "https://api.openai.com/v1/chat/completions" \
         -H "Authorization: Bearer YOUR_OPENAI_KEY" \
         -H "Content-Type: application/json" \
         -d "{
         \"model\": \"gpt-3.5-turbo\",
         \"messages\": [{\"role\": \"user\", \"content\": \"YOUR PROMPT\"}]
         }"
    

    There are two bits of information needed in each request. The API key, which you must get from OpenAI, and the prompt text itself (i.e. whatever you want ChatGPT to help you with). The results are not too shabby.

    I've uploaded the code to GitHub as a tiny chatgpt-shell package. It's a little experimental and rough still, but hey, it does the job for now. Head over to github to take a look. The latest iteration handles multiline prompts (use C-j for newlines) and basic code highlighting.

    Let's see where it all goes. Pull requests for improvements totally welcome ;-)

    ]]>
    Tue, 21 Mar 2023 00:00:00 GMT
    `*scratch*` a new minimal org mode scratch area for iOS https://xenodium.com/scratch-a-minimal-scratch-area https://xenodium.com/scratch-a-minimal-scratch-area While we already have lots of note-taking apps on iOS, I wanted a minimal *scratch* area (à la Emacs), so I built one.


    *scratch* icon

    What's the use-case? You're on the go. Someone's telling you directions, or a phone number, name of a restaurant, anything really… you just need to write it down right now, quickly!

    No time to create a new contact, a note, a file, or spend time on additional taps, bring up keyboard… You just want to write it somewhere with the least amount of friction.

    Being an Emacs and org user, I had to sprinkle the app with basic markup support for headings, lists and checkboxes. Also, having a *scratch* "buffer" on my iPhone gives me that warm emacsy fuzzy feeling :)

    You can download *scratch* from the App Store.

    Find it useful? Please help me spread the word. Tell your friends.



    download-on-app-store.png
    ]]>
    Sat, 04 Mar 2023 00:00:00 GMT
    Chicken Karaage recipe https://xenodium.com/chicken-karaage-recipe https://xenodium.com/chicken-karaage-recipe Huge fan of Chicken Karaage, but never really made it at home until recently.

    Dice the chicken

    • 350 grams boneless chicken thighs

    Dice the chicken up.

    Marinade for 30 mins

    • 1 tablespoon soy sauce (Kikkoman or similar)
    • 1 tablespoon cooking Sake
    • 2 tablespoons of grated ginger (include liquids)
    • 1/2 teaspoon Mirin

    Mix all ingredients into a ziploc bag. Add the diced chicken and let it marinade for 30 minutes in the fridge.

    Pat dry

    • Paper towels

    After marinating, pat the chicken dry with paper towels and set aside.

    Breading

    • Potato starch

    Ok, not quite breading since we're using potato starch but same goal. Sprinkle the chicken pieces and make sure they are fully coated with the starch.

    Frying (1st round)

    • Vegetable oil
    • Paper towels

    Heat up (roughly at 160°C) enough oil in a pan to cover the chicken pieces. Cook for about 3 minutes. The pieces don't have to be super golden at this point. There will be another round of frying for that.

    Rest for 4 minutes

    • Paper towels

    Let the chicken rest on paper towels for about 4 minutes before frying again.

    Frying (2nd round)

    • Vegetable oil
    • Paper towels

    This time heat up the oil at roughly 200°C. This is a quick in-and-out action to make the chicken crispy. Cook for 30 seconds. Take out and set aside on some paper towels. Let it cool and it's ready to eat.

    Dipping

    • Kewpie mayo
    • Sriracha sauce

    This is totally optional, but I'm a fan of both Kewpie mayo and Sriracha sauce. You can dip your chicken in either or both!

    ]]>
    Sun, 29 Jan 2023 00:00:00 GMT
    Emacs: org-present in style https://xenodium.com/emacs-org-present-in-style https://xenodium.com/emacs-org-present-in-style I had been meaning to check out David Wilson's System Crafters post detailing his presentations style achieved with the help of org-present and his own customizations. If you're looking for ways to present from Emacs itself, David's post is well worth a look.

    org-present's spartan but effective approach resonated with me. David's touches bring the wonderfully stylish icing to the cake. I personally liked his practice of collapsing slide subheadings by default. This lead me to think about slide navigation in general…

    There were two things I wanted to achieve:

    1. Easily jump between areas of interest. Subheadings, links, and code blocks would be a good start.
    2. Collapse all but the current top-level heading within the slide, as navigation focus changes.

    A quick search for existing functions led me to org-next-visible-heading, org-next-link, and org-next-block. While these make it easy to jump through jump between headings, links, org block on their own, I wanted to jump to whichever one of these is next (similar a web browser's tab behaviour). In a way, DWIM style.

    I wrapped the existing functions to enable returning positions. This gave me ar/rg-next-visible-heading-pos, ar/rg-next-link-pos, and ar/rg-next-block-pos respectively. Now that I can find out the next location of either of these items, I can subsequently glue the navigation logic in a function like ar/org-present-next-item. To restore balance to the galaxy, I also added ar/org-present-previous-item.

    (defun ar/org-present-next-item (&optional backward)
      "Present and reveal next item."
      (interactive "P")
      ;; Beginning of slide, go to previous slide.
      (if (and backward (eq (point) (point-min)))
          (org-present-prev)
        (let* ((heading-pos (ar/org-next-visible-heading-pos backward))
               (link-pos (ar/org-next-link-pos backward))
               (block-pos (ar/org-next-block-pos backward))
               (closest-pos (when (or heading-pos link-pos block-pos)
                              (apply (if backward #'max #'min)
                                     (seq-filter #'identity
                                                 (list heading-pos
                                                       link-pos
                                                       block-pos))))))
          (if closest-pos
              (progn
                (cond ((eq heading-pos closest-pos)
                       (goto-char heading-pos))
                      ((eq link-pos closest-pos)
                       (goto-char link-pos))
                      ((eq block-pos closest-pos)
                       (goto-char block-pos)))
                ;; Reveal relevant content.
                (cond ((> (org-current-level) 1)
                       (ar/org-present-reveal-level2))
                      ((eq (org-current-level) 1)
                       ;; At level 1. Collapse children.
                       (org-overview)
                       (org-show-entry)
                       (org-show-children)
                       (run-hook-with-args 'org-cycle-hook 'children))))
            ;; End of slide, go to next slide.
            (org-present-next)))))
    
    (defun ar/org-present-previous-item ()
      (interactive)
      (ar/org-present-next-item t))
    
    (defun ar/org-next-visible-heading-pos (&optional backward)
      "Similar to `org-next-visible-heading' but for returning position.
    
    Set BACKWARD to search backwards."
      (save-excursion
        (let ((pos-before (point))
              (pos-after (progn
                           (org-next-visible-heading (if backward -1 1))
                           (point))))
          (when (and pos-after (not (equal pos-before pos-after)))
            pos-after))))
    
    (defun ar/org-next-link-pos (&optional backward)
      "Similar to `org-next-visible-heading' but for returning position.
    
    Set BACKWARD to search backwards."
      (save-excursion
        (let* ((inhibit-message t)
               (pos-before (point))
               (pos-after (progn
                            (org-next-link backward)
                            (point))))
          (when (and pos-after (or (and backward (> pos-before pos-after))
                                   (and (not backward) (> pos-after pos-before))))
            pos-after))))
    
    (defun ar/org-next-block-pos (&optional backward)
      "Similar to `org-next-block' but for returning position.
    
    Set BACKWARD to search backwards."
      (save-excursion
        (when (and backward (org-babel-where-is-src-block-head))
          (org-babel-goto-src-block-head))
        (let ((pos-before (point))
              (pos-after (ignore-errors
                           (org-next-block 1 backward)
                           (point))))
          (when (and pos-after (not (equal pos-before pos-after)))
            ;; Place point inside block body.
            (goto-char (line-beginning-position 2))
            (point)))))
    
    (defun ar/org-present-reveal-level2 ()
      (interactive)
      (let ((loc (point))
            (level (org-current-level))
            (heading))
        (ignore-errors (org-back-to-heading t))
        (while (or (not level) (> level 2))
          (setq level (org-up-heading-safe)))
        (setq heading (point))
        (goto-char (point-min))
        (org-overview)
        (org-show-entry)
        (org-show-children)
        (run-hook-with-args 'org-cycle-hook 'children)
        (goto-char heading)
        (org-show-subtree)
        (goto-char loc)))
    

    Beware, this was a minimal effort (with redundant code, duplication, etc) and should likely be considered a proof of concept of sorts, but the results look promising. You can see a demo in action.

    While this was a fun exercise, I can't help but think there must be a cleaner way of doing it or there are existing packages that already do this for you. If you do know, I'd love to know.

    Future versions of this code will likely be updated in my Emacs org config.

    Update

    Removed a bunch of duplication and now rely primarily on existing org-next-visible-heading, org-next-link, and org-next-block.

    ]]>
    Tue, 10 Jan 2023 00:00:00 GMT
    Emacs: insert and render SF symbols https://xenodium.com/emacs-insert-and-render-sf-symbols https://xenodium.com/emacs-insert-and-render-sf-symbols About a week ago, I added an Emacs function to insert SF symbol names. This is specially useful for SwiftUI. I didn't bother too much with inserting symbols themselves since I hadn't figured out a way to render them for all buffers. That's now changed.

    Christian Tietze and Alan Third both have useful posts in this space:

    I'm currently using the following to render SF symbols in all buffers (macOS only):

    ;; Enable rendering SF symbols on macOS.
    (when (memq system-type '(darwin))
      (set-fontset-font t nil "SF Pro Display" nil 'append))
    

    Now that I can render SF symbols everywhere, I may be more included to use them to spif things up.

    I've added sf-symbol-insert to sf.el, let's see if usage sticks.

    ]]>
    Sun, 08 Jan 2023 00:00:00 GMT
    Emacs: Macro me some SF Symbols https://xenodium.com/emacs-macro-me-some-sf-symbols https://xenodium.com/emacs-macro-me-some-sf-symbols For inserting SF Symbols in SwiftUI, I typically rely on Apple's SF Symbols app to browse the symbols's catalog. Once I find a symbol I'm happy with, I copy its name and paste it into my Swift source. This works fairly well.

    With Christian Tietze recently posting how he rendered SF Symbols in Emacs, I figured there may be a way to shift the above workflow to rely on Emacs completion instead. While I initially went down a rabbit hole to programmatically extract SF symbols (via something like SFSafeSymbols), I took a step back to rethink the strategy.

    From the SF Symbols app, one can select multiple symbols and copy/paste either the symbols themselves or their respective names. The catch is you can only copy disjointed data. That is, you can copy the symbols or their names, but not both in one go. Let's take a look at what the disjointed data looks like. I've pasted both under separate sections in an Emacs buffer.

    If I could rejoin these two sets, I would have a lookup table I could easily invoke from Emacs.

    There are roughly 4500 symbols, so copying, pasting, along with text manipulation isn't manually feasible. Lucky for us, an Emacs keyboard macro is the perfect hammer for this nail. You can see the macro in action below.

    This looks fairly magical (and it is), but when you break it down into its building blocks, it's nothing more than recording your keystrokes and replaying them. Starting with the cursor at the beginning of square.and.arrow.up, these are the keystrokes we'd need to record:

    C-s : iseach-forward to search for a character and jump to it

    = : insert = so we jump to == Symbols ==

    <return> : runs isearch-exit since we're done jumping.

    C-n : next-line.

    C-a : beginning-of-line.

    C-SPC : set-mark-command to activate the region.

    C-f : forward-char to select symbol.

    C-w : kill-ring-save to cut/kill the symbol.

    C-u C-<space> : set-mark-command (with prefix) to jump back to where we started before searching.

    C-y : yank to yank/paste the symbol.

    C-<space> : set-mark-command to activate the region.

    C-e : end-of-line to select the entire line.

    " : As a smartparens user, inserting quote with region places quotes around selection.

    C-n : next-line.

    C-a : beginning-of-line. We are now at a strategic location where we can replay the above commands.

    To start/end recording and executing keyboard macros, use:

    C-x ( : kmacro-start-macro

    C-x ) : kmacro-end-macro

    C-x e : kmacro-end-and-call-macro runs your macro. Press e immediately after to execute again.

    C-u 0 C-x e : kmacro-end-and-call-macro (with zero prefix) repeat until there is an error.

    Our previous example ran on a handful of SF symbols. Let's bring out the big guns and run on the entire dataset. This time, we'll run the entire flow, including macro creation and executing until there is an error (i.e. process the whole lot).

    Now that we have our data joined, we can feed it to the humble completing-read.

    It's worth highlighting that to render SF Symbols in Emacs, we must propertize our text with one of the macOS SF fonts, for example "SF Pro".

    With all the pieces in place, let's use our new function to insert SF symbol names in a SwiftUI snippet. Since we're using completing-read we can fuzzy search our lookups with our favorite completion frameworks (in my case via ivy).

    While this post is macOS-specific, it gives a taste of how powerful Emacs keyboard macros can be. Be sure to check out Emacs Rocks! Episode 05: Macros in style and Keyboard Macros are Misunderstood - Mastering Emacs. For those that dabble in elisp, you can appreciate how handy completing-read is with very little code.

    The full source to sf-symbol-insert-name is available in my Emacs config repo. The function is fairly bare bones and has had fairly little testing. Patches totally welcome.

    Update

    There is some redundancy in the snippet I had forgotten to remove. Either way, latest version at sf.el.

    ]]>
    Sat, 31 Dec 2022 00:00:00 GMT
    Emacs: ffmpeg and macOS aliasing commands https://xenodium.com/emacs-ffmpeg-and-macos-alias-commands https://xenodium.com/emacs-ffmpeg-and-macos-alias-commands On a recent mastodon post, Chris Spackman mentioned he uses Emacs to save ffmpeg commands he's figured out for later usage. Emacs is great for this kind of thing. I've tried different approaches over time and eventually landed on dwim-shell-command, a small package I wrote. Like Chris, I also wanted a way to invoke magical incantations of known shell commands without having to remember all the details.

    Chris's post reminded me of a few use-cases I'd been meaning to add DWIM shell commands for.

    ffmpeg

    1. Trimming seconds from videos
      • dwim-shell-commands-video-trim-beginning using:

        ffmpeg -i '<<f>>' -y -ss <<Seconds:5>> -c:v copy -c:a copy '<<fne>>_trimmed.<<e>>'
        
      • dwim-shell-commands-video-trim-end using:

        ffmpeg -sseof -<<Seconds:5>> -i '<<f>>' -y -c:v copy -c:a copy '<<fne>>_trimmed.<<e>>'
        

        Side-node: The <<Seconds:5>> placeholder is recognized as a query, so Emacs will prompt you for a numeric value.

    2. Extracting audio from videos
      • dwim-shell-commands-video-to-mp3 using:

        ffmpeg -i '<<f>>' -vn -ab 128k -ar 44100 -y '<<fne>>.mp3'
        

    With these new dwim shell commands added, I can easily apply them one after the other. No need to remember command details.

    macOS aliases

    After rebuilding Emacs via the wonderful emacs-plus, I recently broke my existing /Applications/Emacs.app alias. No biggie, one can easily add a new one alias from macOS Finder, but I've been wanting to do it from Emacs. Turns out there's a bit of AppleScript we can turn into a more memorale command like dwim-shell-commands-macos-make-finder-alias:

    osascript -e 'tell application \"Finder\" to make alias file to POSIX file \"<<f>>\" at POSIX file \"%s\"'
    

    It's highly unlikely I'll remember the AppleScript snippet (are there better ways?), but I'll easily find and invoke my new command with fuzzy searching:

    Included in dwim-shell-command

    All of these are now included in dwim-shell-commands.el, which you can optionally load after installing dwim-shell-command from MELPA.

    ]]>
    Sun, 18 Dec 2022 00:00:00 GMT
    Emacs: Context-aware yasnippets https://xenodium.com/emacs-generate-a-swift-initializer https://xenodium.com/emacs-generate-a-swift-initializer Back in 2020, I wrote a semi-automatic yasnippet to generate Swift initializers. I say semi-automatic because it could have been a little smarter. While it helped generate some of the code, what I really wanted was full context-aware generation. The Swift struct already had a few properties defined, so a smarter yasnippet should have been able to use this info for code generation.

    With an extra push, we could have written a smarter yasnippet, but it may require a fair bit of parsing logic. Fast forward to today, and bringing context-awareness seems like the right match for Tree-sitter. While Tree-sitter can enable faster and more reliable syntax-highlighting in our beloved text editor, it can also power smarter tools. It does so by exposing a semantic snapshot of our source code using a syntax tree.

    Let's see how we can use Tree-sitter to realise our original yasnippet vision. We'll start with the same struct snippet we used back in 2020. The goal is to generate an initializer using the existing definitions.

    struct Coordinate {
      public let x: Int
      public let y: Int
      public let z: Int
    }
    

    While Emacs will will soon ship its own Tree-sitter integration, I've opted to try out the emacs-tree-sitter package as Swift support is currently included in tree-sitter-langs.

    I have much to learn much about Tree-sitter syntax trees, but the package ships with a handy tool to dump the tree via tree-sitter-debug-mode.

    With a syntax tree in mind, one can craft a query to semantically extract parts of the code. In our case, we want property names and types. I've yet to get acquainted with Tree-sitter's query syntax, but the package also ships with another handy tool that helps view query results via tree-sitter-query-builder.

    The following query extracts all the let properties in file. You can see the builder in action above, highlighting our query results.

    (struct_declaration (constant_declaration (identifier) @name (type) @value))
    

    If we want to be more thorough, we should likely cater for classes, vars, int/string literals, etc. so the query needs to be extended as follows. I'm sure it can be written differently, but for now, it does the job.

    (struct_declaration (variable_declaration (identifier) @name (type) @type))
    (struct_declaration (variable_declaration (identifier) @name (string) @value))
    (struct_declaration (variable_declaration (identifier) @name (number) @value))
    (struct_declaration (constant_declaration (identifier) @name (type) @value))
    (struct_declaration (constant_declaration (identifier) @name (string) @value))
    (struct_declaration (constant_declaration (identifier) @name (number) @value))
    (class_declaration (variable_declaration (identifier) @name (type) @type))
    (class_declaration (variable_declaration (identifier) @name (string) @value))
    (class_declaration (variable_declaration (identifier) @name (number) @value))
    (class_declaration (constant_declaration (identifier) @name (type) @type))
    (class_declaration (constant_declaration (identifier) @name (string) @value))
    (class_declaration (constant_declaration (identifier) @name (number) @value))
    

    Now that we got our Tree-sitter query sorted, let's write a little elisp to extract the info we need from the generated tree. We'll write a swift-class-or-struct-vars-at-point function to extract the struct (or class) at point and subsequently filter its property names/types using our query. To simplify the result, we'll return a list of alists.

    (defun swift-class-or-struct-vars-at-point ()
      "Return a list of class or struct vars in the form '(((name . \"foo\") (type . \"Foo\")))."
      (cl-assert (seq-contains local-minor-modes 'tree-sitter-mode) "tree-sitter-mode not enabled")
      (let* ((node (or (tree-sitter-node-at-point 'struct_declaration)
                       (tree-sitter-node-at-point 'class_declaration)))
             (vars)
             (var))
        (unless node
          (error "Neither in class nor struct"))
        (mapc
         (lambda (item)
           (cond ((eq 'identifier
                      (tsc-node-type (cdr item)))
                  (when var
                    (setq vars (append vars (list var))))
                  (setq var (list (cons 'name (tsc-node-text
                                               (cdr item))))))
                 ((eq 'type
                      (tsc-node-type (cdr item)))
                  (setq var (map-insert var 'type (tsc-node-text
                                                   (cdr item)))))
                 ((eq 'string
                      (tsc-node-type (cdr item)))
                  (setq var (map-insert var 'type "String")))
                 ((eq 'number
                      (tsc-node-type (cdr item)))
                  (setq var (map-insert var 'type "Int")))
                 (t (message "%s" (tsc-node-type (cdr item))))))
         (tsc-query-captures
          (tsc-make-query tree-sitter-language
                          "(struct_declaration (variable_declaration (identifier) @name (type) @type))
                           (struct_declaration (variable_declaration (identifier) @name (string) @value))
                           (struct_declaration (variable_declaration (identifier) @name (number) @value))
                           (struct_declaration (constant_declaration (identifier) @name (type) @value))
                           (struct_declaration (constant_declaration (identifier) @name (string) @value))
                           (struct_declaration (constant_declaration (identifier) @name (number) @value))
                           (class_declaration (variable_declaration (identifier) @name (type) @type))
                           (class_declaration (variable_declaration (identifier) @name (string) @value))
                           (class_declaration (variable_declaration (identifier) @name (number) @value))
                           (class_declaration (constant_declaration (identifier) @name (type) @type))
                           (class_declaration (constant_declaration (identifier) @name (string) @value))
                           (class_declaration (constant_declaration (identifier) @name (number) @value))")
          node nil))
        (when var
          (setq vars (append vars (list var))))
        vars))
    

    Finally, we write a function to generate a Swift initializer from our property list.

    (defun swift-class-or-struct-initializer-text (vars)
      "Generate a Swift initializer from property VARS."
      (cl-assert (seq-contains local-minor-modes 'tree-sitter-mode) "tree-sitter-mode not enabled")
      (format
       (string-trim
        "
    init(%s) {
      %s
    }")
       (seq-reduce (lambda (reduced var)
                     (format "%s%s%s: %s"
                             reduced
                             (if (string-empty-p reduced)
                                 "" ", ")
                             (map-elt var 'name)
                             (map-elt var 'type)))
                   vars "")
       (string-join
        (mapcar (lambda (var)
                  (format "self.%s = %s"
                          (map-elt var 'name)
                          (map-elt var 'name)))
                vars)
        "\n  ")))
    

    We're so close now. All we need is a simple way invoke our code generator. We can use yasnippet for that, making init our expandable keyword.

    # -*- mode: snippet -*-
    # name: init all
    # key: init
    # --
    `(swift-class-or-struct-initializer-text (swift-class-or-struct-vars-at-point))`
    

    And with all that, we've got our yasnippet vision accomplished!

    Be sure to check out this year's relevant EmacsConf talk: Tree-sitter beyond syntax highlighting.

    All code is now pushed to my config repo. By the way, I'm not super knowledgable of neither yasnippet nor Tree-sitter. Improvements are totally welcome. Please reach out on the Fediverse if you have suggestions!

    Update

    Josh Caswell kindly pointed out a couple of interesting items:

    1. tree-sitter-langs's Swift grammar is fairly outdated/incomplete.
    2. There are more up-to-date Swift grammar implementations currently available:
    ]]>
    Mon, 12 Dec 2022 00:00:00 GMT
    Emacs: quickly killing processes https://xenodium.com/emacs-quick-kill-process https://xenodium.com/emacs-quick-kill-process Every so often, I need to kill the odd unresponsive process. While I really like proced (check out Mickey Petersen's article), I somehow find myself using macOS's Activity Monitor to this purpose. Kinda odd, considering I prefer to do these kinds of things from Emacs.

    What I'd really like is a way to quickly fuzzy search a list of active processes and choose the unresponsive culprid, using my preferred completion frontend (in my case ivy).

    The function below gives us a fuzzy-searchable process utility. While we could use ivy-read directly in our implementation, we're better of using completing-read to remain compatible with other completion frameworks. I'm a big fan of the humble completing-read. You feed it a list of candidates and it prompts users to pick one.

    To build our process list, we can lean on proced's own source: proced-process-attributes. We transform its output to an alist, formatting the visible keys to contain the process id, owner, command name, and the command line which invoked the process. Once a process is chosen, we can send a kill signal using signal-process dwim-shell-command and our job is done.

    (require 'dwim-shell-command)
    (require 'map)
    (require 'proced)
    (require 'seq)
    
    (defun dwim-shell-commands-kill-process ()
      "Select and kill process."
      (interactive)
      (let* ((pid-width 5)
             (comm-width 25)
             (user-width 10)
             (processes (proced-process-attributes))
             (candidates
              (mapcar (lambda (attributes)
                        (let* ((process (cdr attributes))
                               (pid (format (format "%%%ds" pid-width) (map-elt process 'pid)))
                               (user (format (format "%%-%ds" user-width)
                                             (truncate-string-to-width
                                              (map-elt process 'user) user-width nil nil t)))
                               (comm (format (format "%%-%ds" comm-width)
                                             (truncate-string-to-width
                                              (map-elt process 'comm) comm-width nil nil t)))
                               (args-width (- (window-width) (+ pid-width user-width comm-width 3)))
                               (args (map-elt process 'args)))
                          (cons (if args
                                    (format "%s %s %s %s" pid user comm (truncate-string-to-width args args-width nil nil t))
                                  (format "%s %s %s" pid user comm))
                                process)))
                      processes))
             (selection (map-elt candidates
                                 (completing-read "kill process: "
                                                  (seq-sort
                                                   (lambda (p1 p2)
                                                     (string-lessp (nth 2 (split-string (string-trim (car p1))))
                                                                   (nth 2 (split-string (string-trim (car p2))))))
                                                   candidates) nil t)))
             (prompt-title (format "%s %s %s"
                                   (map-elt selection 'pid)
                                   (map-elt selection 'user)
                                   (map-elt selection 'comm))))
        (when (y-or-n-p (format "Kill? %s" prompt-title))
          (dwim-shell-command-on-marked-files
           (format "Kill %s" prompt-title)
           (format "kill -9 %d" (map-elt selection 'pid))
           :utils "kill"
           :error-autofocus t
           :silent-success t))))
    

    I've pushed dwim-shell-commands-kill-process to my config dwim-shell-commands.el. Got suggestions? Alternatives? Lemme know.

    Update

    I've moved dwim-shell-commands-kill-process from my Emacs config to dwim-shell-commands.el. A few advantages:

    • Killing processes is now async.
    • Should anything go wrong, an error message is now accessible.
    • You can easily install via MELPA.

    If you prefer the previous version (without a dependency on dwim-shell-command), have a look at the initial commit.

    ]]>
    Sun, 13 Nov 2022 00:00:00 GMT
    Hey Emacs, change the default macOS app for… https://xenodium.com/hey-emacs-change-the-default-macos-app-for https://xenodium.com/hey-emacs-change-the-default-macos-app-for A few weeks ago, I added an "open with" command to dwim-shell-commands.el. It's pretty handy for opening files using an external app (ie. not Emacs) other than the default macOS one.

    dwim-shell-commands-macos-open-with and dwim-shell-commands-open-externally are typically enough for me to handle opening files outside of Emacs. But every now and then I'd like to change the default macOS app associated with specific file types. Now this isn't particularly challenging in macOS, but it does require a little navigating to get to the right place to change this default setting.

    Back in March 2020, I tweeted about duti: a command-line utility capable of setting default applications for various document types on macOS. While I liked the ability to change default apps from the command-line, the habit never quite stuck.

    Fast forward to 2022. I've been revisiting lots of my command-line usages (specially those that never stuck) and making them more accessible from Emacs via dwim-shell-command. I seldom change default apps on macOS, so my brain forgets about duti itself, let alone its arguments, order, etc. But with a dwim shell command like dwim-shell-commands-macos-set-default-app, I can easily invoke the command via swiper's counsel-M-x fuzzy terms: "dwim set".

    As an added bonus, I get to reuse dwim-shell-commands--macos-apps from "open with" to quickly pick the new default app, making the whole experience pretty snappy.

    (defun dwim-shell-commands-macos-set-default-app ()
      "Set default app for file(s)."
      (interactive)
      (let* ((apps (dwim-shell-commands-macos-apps))
             (selection (progn
                          (cl-assert apps nil "No apps found")
                          (completing-read "Set default app: " apps nil t))))
        (dwim-shell-command-on-marked-files
         "Set default app"
         (format "duti -s \"%s\" '<<e>>' all"
                 (string-trim
                  (shell-command-to-string (format "defaults read '%s/Contents/Info.plist' CFBundleIdentifier"
                                                   (map-elt apps selection)))))
         :silent-success t
         :no-progress t
         :utils "duti")))
    
    (defun dwim-shell-commands--macos-apps ()
      "Return alist of macOS apps (\"Emacs\" . \"/Applications/Emacs.app\")."
      (mapcar (lambda (path)
                (cons (file-name-base path) path))
              (seq-sort
               #'string-lessp
               (seq-mapcat (lambda (paths)
                             (directory-files-recursively
                              paths "\\.app$" t (lambda (path)
                                                 (not (string-suffix-p ".app" path)))))
                           '("/Applications" "~/Applications" "/System/Applications")))))
    

    As usual, I've added dwim-shell-commands-macos-set-default-app to dwim-shell-commands.el, which you can install via MELPA.

    Did you find this tiny integration useful? Check out Hey Emacs, where did I take that photo?

    ]]>
    Sun, 06 Nov 2022 00:00:00 GMT
    Hey Emacs, where did I take that photo? https://xenodium.com/hey-emacs-where-did-i-take-that-photo https://xenodium.com/hey-emacs-where-did-i-take-that-photo I was recently browsing through an old archive of holiday photos (from dired of course). I wanted to know where the photo was taken, which got me interested in extracting Exif metadata.

    Luckily the exiftool command line utility does the heavy lifting when it comes to extracting metadata. Since I want it quickly accessible from Emacs (in either dired or current buffer), a tiny elisp snippet would give me just that (via dwim-shell-command).

    (defun dwim-shell-commands-image-exif-metadata ()
      "View EXIF metadata in image(s)."
      (interactive)
      (dwim-shell-command-on-marked-files
       "View EXIF"
       "exiftool '<<f>>'"
       :utils "exiftool"))
    

    The above makes all Exif metadata easily accessible, including the photo's GPS coordinates. But I haven’t quite answered the original question. Where did I take the photo? I now know the coordinates, but I can’t realistically deduce neither the country nor city unless I manually feed these values to a reverse geocoding service like OpenStreetMap. Manually you say? This is Emacs, so we can throw more elisp glue at the problem, mixed in with a little shell script, and presto! We've now automated the process of extracting metadata, reverse geocoding, and displaying the photo's address in the minibuffer. Pretty nifty.

    (defun dwim-shell-commands-image-reverse-geocode-location ()
      "Reverse geocode image(s) location."
      (interactive)
      (dwim-shell-command-on-marked-files
       "Reverse geocode"
       "lat=\"$(exiftool -csv -n -gpslatitude -gpslongitude '<<f>>' | tail -n 1 | cut -s -d',' -f2-2)\"
        if [ -z \"$lat\" ]; then
          echo \"no latitude\"
          exit 1
        fi
        lon=\"$(exiftool -csv -n -gpslatitude -gpslongitude '<<f>>' | tail -n 1 | cut -s -d',' -f3-3)\"
        if [ -z \"$lon\" ]; then
          echo \"no longitude\"
          exit 1
        fi
        json=$(curl \"https://nominatim.openstreetmap.org/reverse?format=json&accept-language=en&lat=${lat}&lon=${lon}&zoom=18&addressdetails=1\")
        echo \"json_start $json json_end\""
       :utils '("exiftool" "curl")
       :silent-success t
       :error-autofocus t
       :on-completion
       (lambda (buffer)
         (with-current-buffer buffer
           (goto-char (point-min))
           (let ((matches '()))
             (while (re-search-forward "^json_start\\(.*?\\)json_end" nil t)
               (push (match-string 1) matches))
             (message "%s" (string-join (seq-map (lambda (json)
                                                   (map-elt (json-parse-string json :object-type 'alist) 'display_name))
                                                 matches)
                                        "\n")))
           (kill-buffer buffer)))))
    

    Displaying the photo's address in the minibuffer is indeed pretty nifty, but what if I’d like to drop a pin in a map for further exploration? This is actually simpler, as there's no need for reverse geocoding. Following a similar recipe, we merely construct an OpenStreetMap URL and open it in our favourite browser.

    (defun dwim-shell-commands-image-browse-location ()
      "Open image(s) location in browser."
      (interactive)
      (dwim-shell-command-on-marked-files
       "Browse location"
       "lat=\"$(exiftool -csv -n -gpslatitude -gpslongitude '<<f>>' | tail -n 1 | cut -s -d',' -f2-2)\"
        if [ -z \"$lat\" ]; then
          echo \"no latitude\"
          exit 1
        fi
        lon=\"$(exiftool -csv -n -gpslatitude -gpslongitude '<<f>>' | tail -n 1 | cut -s -d',' -f3-3)\"
        if [ -z \"$lon\" ]; then
          echo \"no longitude\"
          exit 1
        fi
        if [[ $OSTYPE == darwin* ]]; then
          open \"http://www.openstreetmap.org/?mlat=${lat}&mlon=${lon}&layers=C\"
        else
          xdg-open \"http://www.openstreetmap.org/?mlat=${lat}&mlon=${lon}&layers=C\"
        fi"
       :utils "exiftool"
       :error-autofocus t
       :silent-success t))
    

    Got suggestions? Improvements? All three functions are now included in dwim-shell-commands.el as part of dwim-shell-command. Pull requests totally welcome ;)

    ]]>
    Wed, 02 Nov 2022 00:00:00 GMT
    Emacs: A welcoming experiment https://xenodium.com/emacs-a-welcoming-experiment https://xenodium.com/emacs-a-welcoming-experiment The *scratch* buffer is the first thing I see when I launch an Emacs session. Coupled with persistent-scratch, it's served me well over the years. I gotta say though, my scratch buffer accumulates random bits and often becomes a little messy. It's not the most visually appealing landing buffer when launching Emacs. But who cares, I'm only a C-x b binding away from invoking ivy-switch-buffer to get me wherever I need to be. It's powered by ivy-use-virtual-buffers, which remembers recent files across sessions.

    Having said all of this, I recently ran into u/pearcidar43's post showcasing a wonderful Emacs banner. Lucky for us, they shared the image, so I got curious about building a minimal welcome buffer of sorts. Nothing fancy, the only requirements being to load quickly and enable me to get on with my C-x b ritual. Throw in a little bonus to exit quickly by pressing just q if I so desire.

    I didn't know a whole lot on how to go about it, so I took a peek at emacs-dashboard for inspiration. Turns out, I needed little code to get the desired effect in my early-init.el:

    (defun ar/show-welcome-buffer ()
      "Show *Welcome* buffer."
      (with-current-buffer (get-buffer-create "*Welcome*")
        (setq truncate-lines t)
        (let* ((buffer-read-only)
               (image-path "~/.emacs.d/emacs.png")
               (image (create-image image-path))
               (size (image-size image))
               (height (cdr size))
               (width (car size))
               (top-margin (floor (/ (- (window-height) height) 2)))
               (left-margin (floor (/ (- (window-width) width) 2)))
               (prompt-title "Welcome to Emacs!"))
          (erase-buffer)
          (setq mode-line-format nil)
          (goto-char (point-min))
          (insert (make-string top-margin ?\n ))
          (insert (make-string left-margin ?\ ))
          (insert-image image)
          (insert "\n\n\n")
          (insert (make-string (floor (/ (- (window-width) (string-width prompt-title)) 2)) ?\ ))
          (insert prompt-title))
        (setq cursor-type nil)
        (read-only-mode +1)
        (switch-to-buffer (current-buffer))
        (local-set-key (kbd "q") 'kill-this-buffer)))
    
    (setq initial-scratch-message nil)
    (setq inhibit-startup-screen t)
    
    (when (< (length command-line-args) 2)
      (add-hook 'emacs-startup-hook (lambda ()
                                      (when (display-graphic-p)
                                        (ar/show-welcome-buffer)))))
    

    This being Emacs, I can bend it as far as needed. In my case, I didn't need much, so I can probably stop here. It was a fun experiment. I'll even try using it for a little while and see if it sticks. I'm sure there's plenty more that could be handled (edge cases, resizes, etc.), but if you want something more established, consider something like emacs-dashboard instead. I haven't used it myself, but is pretty popular.

    ]]>
    Mon, 24 Oct 2022 00:00:00 GMT
    Emacs: Open with macOS app https://xenodium.com/emacs-open-with-macos-app https://xenodium.com/emacs-open-with-macos-app On a recent Reddit comment, tdstoff7 asked if I had considered writing an "Open with" DWIM shell command for those times one would like to open a file externally using an app other than the default. I hadn't, but nice idea.

    Take images as an example. Though Emacs can display them quickly, I also open images externally using the default app (Preview in my case). But then there are those times when I'd like to open with a different app for editing (maybe something like GIMP). It'd be nice to quickly choose which app to open with.

    There isn't much to the code. Get a list of apps, ask user to pick one (via completing-read), and launch the external app via dwim-shell-command-on-marked-files.

    There's likely a better way of getting a list of available apps (happy to take suggestions), but searching in "/Applications" "~/Applications" and "/System/Applications" does the job for now.

    (defun dwim-shell-commands-macos-open-with ()
      "Convert all marked images to jpg(s)."
      (interactive)
      (let* ((apps (seq-sort
                    #'string-lessp
                    (seq-mapcat (lambda (paths)
                                  (directory-files-recursively
                                   paths "\\.app$" t (lambda (path)
                                                      (not (string-suffix-p ".app" path)))))
                                '("/Applications" "~/Applications" "/System/Applications"))))
             (selection (progn
                          (cl-assert apps nil "No apps found")
                          (completing-read "Open with: "
                                           (mapcar (lambda (path)
                                                     (propertize (file-name-base path) 'path path))
                                                   apps)))))
        (dwim-shell-command-on-marked-files
         "Open with"
         (format "open -a '%s' '<<*>>'" (get-text-property 0 'path selection))
         :silent-success t
         :no-progress t
         :utils "open")))
    

    dwim-shell-commands-macos-open-with is now included in dwim-shell-command, available on melpa. What other uses can you find for it?

    ]]>
    Fri, 14 Oct 2022 00:00:00 GMT
    Improving on Emacs macOS sharing https://xenodium.com/emacs-macos-sharing-dwim-style-improved https://xenodium.com/emacs-macos-sharing-dwim-style-improved A quick follow-up to Emacs: macOS sharing (DWIM style)… Though functional, the implementation had a couple of drawbacks.

    Tohiko noticed fullscreen wasn't working at all while Calvin proposed enumeration for tighter Emacs integration.

    Calvin's suggestion enables using completing-read to pick the sharing service. This makes the integration feel more at home. As a bonus, it also enables sharing from fullscreen Emacs.

    As an ivy user, you can see a vertical list of sharing services.

    Here's the new snippet, now pushed to dwim-shell-commands.el:

    (defun dwim-shell-commands--macos-sharing-services ()
      "Return a list of sharing services."
      (let* ((source (format "import AppKit
                             NSSharingService.sharingServices(forItems: [
                               %s
                             ]).forEach {
                               print(\"\\($0.prompt-title)\")
                             }"
                             (string-join (mapcar (lambda (file)
                                                    (format "URL(fileURLWithPath: \"%s\")" file))
                                                  (dwim-shell-command--files))
                                          ", ")))
             (services (split-string (string-trim (shell-command-to-string (format "echo '%s' | swift -" source)))
                                     "\n")))
        (when (seq-empty-p services)
          (error "No sharing services available"))
        services))
    
    (defun dwim-shell-commands-macos-share ()
      "Share selected files from macOS."
      (interactive)
      (let* ((services (dwim-shell-commands--macos-sharing-services))
             (service-name (completing-read "Share via: " services))
             (selection (seq-position services service-name #'string-equal)))
        (dwim-shell-command-on-marked-files
         "Share"
         (format
          "import AppKit
    
           _ = NSApplication.shared
    
           NSApp.setActivationPolicy(.regular)
    
           class MyWindow: NSWindow, NSSharingServiceDelegate {
             func sharingService(
               _ sharingService: NSSharingService,
               didShareItems items: [Any]
             ) {
               NSApplication.shared.terminate(nil)
             }
    
             func sharingService(
               _ sharingService: NSSharingService, didFailToShareItems items: [Any], error: Error
             ) {
               let error = error as NSError
               if error.domain == NSCocoaErrorDomain && error.code == NSUserCancelledError {
                 NSApplication.shared.terminate(nil)
               }
               exit(1)
             }
           }
    
           let window = MyWindow(
             contentRect: NSRect(x: 0, y: 0, width: 0, height: 0),
             styleMask: [],
             backing: .buffered,
             defer: false)
    
           let services = NSSharingService.sharingServices(forItems: [\"<<*>>\"].map{URL(fileURLWithPath:$0)})
           let service = services[%s]
           service.delegate = window
           service.perform(withItems: [\"<<*>>\"].map{URL(fileURLWithPath:$0)})
    
           NSApp.run()" selection)
         :silent-success t
         :shell-pipe "swift -"
         :join-separator ", "
         :no-progress t
         :utils "swift")))
    

    dwim-shell-command is available on melpa. What other uses can you find for it?

    ]]>
    Wed, 12 Oct 2022 00:00:00 GMT
    Emacs: macOS sharing (DWIM style) https://xenodium.com/emacs-macos-share-from-dired-dwim-style https://xenodium.com/emacs-macos-share-from-dired-dwim-style UPDATE: See an improved implementation here.

    A few days ago, I wrote dwim-shell-commands-macos-reveal-in-finder. While I've written a bunch of other dwim-shell-commands, what set this case apart was the use of Swift to glue an Emacs workflow.

    (defun dwim-shell-commands-macos-reveal-in-finder ()
      "Reveal selected files in macOS Finder."
      (interactive)
      (dwim-shell-command-on-marked-files
       "Reveal in Finder"
       "import AppKit
        NSWorkspace.shared.activateFileViewerSelecting([\"<<*>>\"].map{URL(fileURLWithPath:$0)})"
       :join-separator ", "
       :silent-success t
       :shell-pipe "swift -"))
    

    There is hardly any Swift involved, yet it scratched a real itch I couldn't otherwise reach (reveal multiple dired files in macOS's Finder).

    divinedominion's reddit comment got me thinking of other use-cases, so I figured why not push this Swift-elisp beeswax a little further… Let's add macOS's sharing ability via dwim-shell-command, so I could invoke it from the comfort of my beloved dired or any 'ol Emacs buffer visiting a file.

    (defun dwim-shell-commands-macos-share ()
      "Share selected files from macOS."
      (interactive)
      (let* ((position (window-absolute-pixel-position))
             (x (car position))
             (y (- (x-display-pixel-height)
                   (cdr position))))
        (dwim-shell-command-on-marked-files
         "Share"
         (format
          "import AppKit
    
           _ = NSApplication.shared
    
           NSApp.setActivationPolicy(.regular)
    
           let window = InvisibleWindow(
             contentRect: NSRect(x: %d, y: %s, width: 0, height: 0),
             styleMask: [],
             backing: .buffered,
             defer: false)
    
           NSApp.activate(ignoringOtherApps: true)
    
           DispatchQueue.main.async {
             let picker = NSSharingServicePicker(items: [\"<<*>>\"].map{URL(fileURLWithPath:$0)})
             picker.delegate = window
             picker.show(
               relativeTo: .zero, of: window.contentView!, preferredEdge: .minY)
           }
    
           NSApp.run()
    
           class InvisibleWindow: NSWindow, NSSharingServicePickerDelegate, NSSharingServiceDelegate {
             func sharingServicePicker(
               _ sharingServicePicker: NSSharingServicePicker, didChoose service: NSSharingService?
             ) {
               if service == nil {
                 print(\"Cancelled\")
    
                 // Delay so \"More...\" menu can launch System Preferences
                 DispatchQueue.main.asyncAfter(deadline: .now() + 0.1) {
                   NSApplication.shared.terminate(nil)
                 }
               }
             }
    
             func sharingServicePicker(
               _ sharingServicePicker: NSSharingServicePicker,
               delegateFor sharingService: NSSharingService
             ) -> NSSharingServiceDelegate? {
               return self
             }
    
             func sharingService(
               _ sharingService: NSSharingService,
               didShareItems items: [Any]
             ) {
               NSApplication.shared.terminate(nil)
             }
    
             func sharingService(
               _ sharingService: NSSharingService, didFailToShareItems items: [Any], error: Error
             ) {
               let error = error as NSError
               if error.domain == NSCocoaErrorDomain && error.code == NSUserCancelledError {
                 NSApplication.shared.terminate(nil)
               }
               exit(1)
             }
           }" x y)
         :silent-success t
         :shell-pipe "swift -"
         :join-separator ", "
         :no-progress t
         :utils "swift")))
    

    Sure there is some trickery involved here (like creating an invisible macOS window to anchor the menu), but hey the results are surprisingly usable. Take a look…

    I've pushed dwim-shell-commands-macos-share to dwim-shell-commands.el in case you'd like to give it a try. It's very much an experiment of sorts, so please treat it as such. For now, I'm looking forward to AirDropping more files and seeing if the flow sticks. Oh, and I just realised I can use this to send files to iOS Simulators. Win.

    dwim-shell-command is available on melpa. What other uses can you find for it?

    ]]>
    Wed, 12 Oct 2022 00:00:00 GMT
    Emacs: Reveal in macOS Finder (DWIM style) https://xenodium.com/emacs-reveal-in-finder-dwim-style https://xenodium.com/emacs-reveal-in-finder-dwim-style Just the other day, Graham Voysey filed an escaping bug against dwim-shell-command. Once he verified the the fix, he also posted two uses of dwim-shell-command-on-marked-files. I've made some small tweaks, but here's the gist of it:

    (defun dwim-shell-commands-feh-marked-files ()
      "View all marked files with feh."
      (interactive)
      (dwim-shell-command-on-marked-files
       "View with feh"
       "feh --auto-zoom --scale-down '<<*>>'"
       :silent-success t
       :utils "feh"))
    
    (defun dwim-shell-commands-dragon-marked-files ()
      "Share all marked files with dragon."
      (interactive)
      (dwim-shell-command-on-marked-files
       "View with dragon"
       "dragon --on-top '<<*>>'"
       :silent-success t
       :utils "dragon"))
    

    I love seeing what others get up to by using dwim-shell-command. Are there new magical command-line utilities out there I don't know about? In this instance, I got to learn about feh and dragon.

    feh is a no-frills image viewer for console users while dragon is a simple drag-and-drop source/sink for X or Wayland. Both utilities are great uses of dwim-shell-command, enabling a seamless transition from Emacs to the outside world. These days I'm rarely on a linux box, so I was keen to ensure macOS had these cases covered.

    Preview is a solid macOS equivalent to feh. Preview is already macOS's default image viewer. A simple open '<<f>>' would do the job, but if we'd like to make this command more portable, we can accomodate as follows:

    (defun dwim-shell-commands-open-externally ()
      "Open file(s) externally."
      (interactive)
      (dwim-shell-command-on-marked-files
       "Open externally"
       (if (eq system-type 'darwin)
           "open '<<f>>'"
         "xdg-open '<<f>>'")
       :silent-success t
       :utils "open"))
    

    Special mention goes to Bozhidar Batsov's crux which achieves similar functionality via crux-open-with. crux provides a bunch of other useful functions. Some of my favourites being crux-duplicate-current-line-or-region, crux-transpose-windows, crux-delete-file-and-buffer, and crux-rename-buffer-and-file, but I digress.

    Moving on to a dragon equivalent on macOS, I thought I had it covered via reveal-in-osx-finder or reveal-in-folder. Turns out, neither of these reveal multiple dired-selected files within Finder. At first, I thought this could be easily achieved by passing additional flags/params to macOS's open command, but it doesn't seem to be the case. Having said that, this Stack Overflow post, has a solution in Objective-C, which is where things got a little more interesting. You see, back in July I added multi-language support to dwim-shell-command and while it highlighted language flexibility, I hadn't yet taken advantage of this feature myself. That is, until today.

    The Objective-C snippet from the Stack Overflow post can be written as a Swift one-liner. Ok I lie. It's actually two lines, counting the import, but you can see that this multi-language Emacs transition/integration is pretty easy to add.

    (defun dwim-shell-commands-macos-reveal-in-finder ()
      "Reveal selected files in macOS Finder."
      (interactive)
      (dwim-shell-command-on-marked-files
       "Reveal in Finder"
       "import AppKit
        NSWorkspace.shared.activateFileViewerSelecting([\"<<*>>\"].map{URL(fileURLWithPath:$0)})"
       :join-separator ", "
       :silent-success t
       :shell-pipe "swift -"))
    

    <<*>> is the centrepiece of the snippet above. It gets instantiated with a list of files joined using the ", " separator.

    NSWorkspace.shared.activateFileViewerSelecting(["/path/to/file1", "/path/to/file2"].map { URL(fileURLWithPath: $0) })
    

    The proof of the pudding is of course in the eating, so ummm let's show it in action:

    I should mention the webp animation above was also created using my trusty dwim-shell-commands-video-to-webp also backed by dwim-shell-command.

    (defun dwim-shell-commands-video-to-webp ()
      "Convert all marked videos to webp(s)."
      (interactive)
      (dwim-shell-command-on-marked-files
       "Convert to webp"
       "ffmpeg -i '<<f>>' -vcodec libwebp -filter:v fps=fps=10 -compression_level 3 -lossless 1 -loop 0 -preset default -an -vsync 0 '<<fne>>'.webp"
       :utils "ffmpeg"))
    

    dwim-shell-command is available on melpa. What other uses can you find for it?

    UPDATE: Most DWIM shell commands I use are available as part of dwim-shell-commands.el. See dwim-shell-command's install command line utilities.

    ]]>
    Sun, 09 Oct 2022 00:00:00 GMT
    Plain Org v1.5 released https://xenodium.com/plain-org-v15-released https://xenodium.com/plain-org-v15-released If you haven't heard of Plain Org, it gives you access to org files on iOS while away from your beloved Emacs.

    Hadn't had time to post, but v1.5 has been available on the App Store for a couple of weeks now. The update is mostly a bugfix release, primarily addressing inline editing issues that appeared on iOS 16, along with a few other changes:

    • Render form feeds at end of headings at all times.
    • Fixes new files not recognized by org-roam.
    • Fixes share sheet saving from cold launch.
    • Fixes inline editing on iOS 16.

    I love org markup, but we (iPhone + org users) are a fairly niche bunch. If you're finding Plain Org useful, please help support this effort by getting the word out. Tell your friends, tweet, or blog about it. Or just support via the App Store :)

    ]]>
    Sat, 01 Oct 2022 00:00:00 GMT
    dwim-shell-command usages: pdftotext and scp https://xenodium.com/dwim-shell-command-usages-pdftotext-and-scp https://xenodium.com/dwim-shell-command-usages-pdftotext-and-scp dwim-shell-command is a little Emacs package I wrote to enable crafting more reusable shell commands. I intended to use it as an async-shell-command alternative (and I do these days). The more surprising win was bringing lots of command-line utilities (sometimes with complicated invocations) and making them quickly accessible. I no longer need to remember their respective parameters, order, flags, etc.

    I've migrated most one-liners and scripts I had to dwim-shell-command equivalents. They are available at dwim-shell-commands.el. Having said that, it's great to discover new usages from dwim-shell-command users.

    Take u/TiMueller's Reddit comment, showcasing pdftotext. Neat utility I was unaware of. It does as it says on the tin and converts a pdf to text. Can be easily saved to your accessible repertoire with:

    (defun dwim-shell-commands-pdf-to-txt ()
      "Convert pdf to txt."
      (interactive)
      (dwim-shell-command-on-marked-files
       "pdf to txt"
       "pdftotext -layout '<<f>>' '<<fne>>.txt'"
       :utils "pdftotext"))
    

    tareefdev wanted a quick command to secure copy remote files to a local directory. Though this use-case is already covered by Tramp, I suspect a DWIM command would make it a little more convenient (async by default). However, Tramp paths aren't usable from the shell unless we massage them a little. We can use dwim-shell-command-on-marked-files's :post-process-template to drop the "/ssh:" prefix.

    (defun dwim-shell-commands-copy-remote-to-downloads ()
      (interactive)
      (dwim-shell-command-on-marked-files
       "Copy remote to local Downloads"
       "scp '<<f>>' ~/Downloads/"
       :utils "scp"
       :post-process-template
       (lambda (script file)
         ;; Tramp file path start with "/ssh:". Drop it.
         (string-replace file
                         (string-remove-prefix "/ssh:" file)
                         script))))
    

    dwim-shell-command is available on MELPA (531 downloads as of 2022-10-01).

    ]]>
    Sat, 01 Oct 2022 00:00:00 GMT
    \$ rm Important.txt (uh oh!) https://xenodium.com/rm-important-txt-oh-sht https://xenodium.com/rm-important-txt-oh-sht Setting Emacs up to use your system trash can potentially save your bacon if you mistakenly delete a file, say from dired.

    Unsurprisingly, the trash safety net also extends to other Emacs areas. For example, discarding files from Magit (via magit-discard) becomes a recoverable operation. As an eshell user, the trash can also help you recover from rm blunders.

    You can enable macOS system trash in Emacs by setting trash-directory along with defining system-move-file-to-trash:

    (setq trash-directory "~/.Trash")
    
    ;; See `trash-directory' as it requires defining `system-move-file-to-trash'.
    (defun system-move-file-to-trash (file)
      "Use \"trash\" to move FILE to the system trash."
      (cl-assert (executable-find "trash") nil "'trash' must be installed. Needs \"brew install trash\"")
      (call-process "trash" nil 0 nil "-F"  file))
    
    ]]>
    Sat, 17 Sep 2022 00:00:00 GMT
    Cycling through window layouts (revisited) https://xenodium.com/cycling-through-window-layout-revisited https://xenodium.com/cycling-through-window-layout-revisited Last year, I wrote a little script to cycle through window layouts via Hammerspoon. The cycling set I chose didn't stick, so here's another go.

    function reframeFocusedWindow()
       local win = hs.window.focusedWindow()
       local maximizedFrame = win:screen():frame()
       maximizedFrame.x = maximizedFrame.x + 15
       maximizedFrame.y = maximizedFrame.y + 15
       maximizedFrame.w = maximizedFrame.w - 30
       maximizedFrame.h = maximizedFrame.h - 30
    
       local leftFrame = win:screen():frame()
       leftFrame.x = leftFrame.x + 15
       leftFrame.y = leftFrame.y + 15
       leftFrame.w = leftFrame.w / 2 - 15
       leftFrame.h = leftFrame.h - 30
    
       local rightFrame = win:screen():frame()
       rightFrame.x = rightFrame.w / 2
       rightFrame.y = rightFrame.y + 15
       rightFrame.w = rightFrame.w / 2 - 15
       rightFrame.h = rightFrame.h - 30
    
       if win:frame() == maximizedFrame then
         win:setFrame(leftFrame)
         return
       end
    
       if win:frame() == leftFrame then
         win:setFrame(rightFrame)
         return
       end
    
       win:setFrame(maximizedFrame)
    end
    
    hs.hotkey.bind({"alt"}, "F", reframeFocusedWindow)
    

    Looping through layouts is done with a global key-binding of option f or, if familiar with a macOS keyboard, ⌥ f.

    For those unfamiliar with Hammerspoon… If you're a tinkerer and a macOS user, you'd love Hammerspoon. Like elisp gluing all things Emacs, Hammerspoon uses Lua to glue all things macOS. For example, here's a stint at writing a narrowing utility for macOS using chooser.

    ]]>
    Sun, 11 Sep 2022 00:00:00 GMT
    dwim-shell-command with template prompts https://xenodium.com/dwim-shell-command-with-template-prompts https://xenodium.com/dwim-shell-command-with-template-prompts Somewhat recently, I wanted to quickly create an empty/transparent png file. ImageMagick's convert has you covered here. Say you want a transparent 200x400 image, you can get it with:

    convert -verbose -size 200x400 xc:none empty200x400.png
    

    Great, I now know the one-liner for it. But because I'm in the mood of saving these as seamless command-line utils, I figured I should save the dwim-shell-command equivalent.

    I wanted configurable image dimensions, so I used read-number together with format to create the templated command and fed it to dwim-shell-command-on-marked-files. Job done:

    (defun dwim-shell-commands-make-transparent-png ()
      "Create a transparent png."
      (interactive)
      (let ((width (read-number "Width: " 200))
            (height (read-number "Height: " 200)))
        (dwim-shell-command-on-marked-files
         "Create transparent png"
         (format "convert -verbose -size %dx%d xc:none '<<empty%dx%d.png(u)>>'"
                 width height width height)
         :utils "convert")))
    

    The resulting dwim-shell-commands-make-transparent-png is fairly simple, but dwim-shell-command aims to remove friction so you're more inclined to save reusable commands. In this case, we can shift querying and formatting into the template.

    <<Width:200>> can be interpreted as "ask the user for a value using the suggested prompt and default value."

    With template queries in mind, dwim-shell-commands-make-transparent-png can be further reduced to essentially the interactive command boilerplate and the template itself:

    (defun dwim-shell-commands-make-transparent-png ()
      "Create a transparent png."
      (interactive)
      (dwim-shell-command-on-marked-files
       "Create transparent png"
       "convert -verbose -size <<Width:200>>x<<Height:200>> xc:none '<<empty<<Width:200>>x<<Height:200>>.png(u)>>'"
       :utils "convert"))
    

    Note: Any repeated queries (same prompt and default) are treated as equal. That is, ask the user once and replace everywhere. If you'd like to request separate values, change either prompt or the default value.

    ]]>
    Thu, 18 Aug 2022 00:00:00 GMT
    Seamless command-line utils https://xenodium.com/seamless-command-line-utils https://xenodium.com/seamless-command-line-utils Just the other day, I received a restaurant menu split into a handful of image files. I wanted to forward the menu to others but figured I should probably send it as a single file.

    ImageMagick's convert command-line utility works great for this purpose. Feed it some images and it creates a pdf for you:

    convert image1.png image2.png image3.png combined.pdf
    

    Using convert for this purpose was pretty straightforward. I'm sure I'll use it again in a similar context, but what if I can make future usage more seamless? In the past, I would just make a note of usage and revisit when needed. Though this works well enough, it often requires some amount of manual work (looking things up, tweaking command, etc) if you happen to forget the command syntax.

    I wanted common one-liners (or longer shell scripts) to be easily reusable and accessible from Emacs. Turns out, the dwim-shell-command experiment is working fairly well for this purpose. In addition to providing template expansion, it generally tries to do what I mean (focus when needed, reveal new files, rename buffers, etc).

    Here's how I saved the convert command instance for future usage:

    (defun dwim-shell-commands-join-as-pdf ()
      "Join all marked images as a single pdf."
      (interactive)
      (dwim-shell-command-on-marked-files
       "Join as pdf"
       "convert -verbose '<<*>>' '<<joined.pdf(u)>>'"
       :utils "convert"))
    

    From now on, any time I'd like to join multiple files into a pdf, I can now select them all and invoke dwim-shell-commands-join-as-pdf.

    In the saved command, '<<*>>' expands to either dired selected files or whatever file happens to be open in the current buffer. The buffer file isn't of much help for joining multiple items, but can be handy for other instances (say I want to convert current image to jpeg).

    Moving on to '<<joined.pdf(u)>>', we could have just written as joined.pdf, but wrapping it ensures the resulting file name is unique. That is, if joined.pdf already exists, write joined(1).pdf instead.

    These kinds of command-line integrations are working well for me. Take the webp animation above, it was created by invoking dwim-shell-commands-video-to-webp on a .mov file. Easy peasy. While I can easily memorize the convert command for the pdf instance, I'm hopeless in the webp scenario:

    ffmpeg -i '<<f>>' -vcodec libwebp -filter:v fps=fps=10 -compression_level 3 -lossless 1 -loop 0 -preset default -an -vsync 0 '<<fne>>'.webp
    

    While searching through command line history helps to quickly re-spin previous commands, it requires remembering the actual utility used for any particular action. On the other hand, wrapping with Emacs functions enables me to remember the action itself, using more memorable names. Also, fuzzy searching works a treat.

    It's been roughly a month since I started playing around with this idea of wrapping command-line utilities more seamlessly. Since then, I've brought in a bunch of use-cases that are now quickly accessible (all in dwim-shell-commands.el):

    • dwim-shell-commands-audio-to-mp3
    • dwim-shell-commands-clipboard-to-qr
    • dwim-shell-commands-copy-to-desktop
    • dwim-shell-commands-copy-to-downloads
    • dwim-shell-commands-docx-to-pdf
    • dwim-shell-commands-download-clipboard-stream-url
    • dwim-shell-commands-drop-video-audio
    • dwim-shell-commands-epub-to-org
    • dwim-shell-commands-external-ip
    • dwim-shell-commands-files-combined-size
    • dwim-shell-commands-git-clone-clipboard-url
    • dwim-shell-commands-git-clone-clipboard-url-to-downloads
    • dwim-shell-commands-http-serve-dir
    • dwim-shell-commands-image-browse-location
    • dwim-shell-commands-image-exif-metadata
    • dwim-shell-commands-image-reverse-geocode-location
    • dwim-shell-commands-image-to-grayscale
    • dwim-shell-commands-image-to-icns
    • dwim-shell-commands-image-to-jpg
    • dwim-shell-commands-image-to-png
    • dwim-shell-commands-install-iphone-device-ipa
    • dwim-shell-commands-join-as-pdf
    • dwim-shell-commands-kill-gpg-agent
    • dwim-shell-commands-kill-process
    • dwim-shell-commands-macos-bin-plist-to-xml
    • dwim-shell-commands-macos-caffeinate
    • dwim-shell-commands-macos-hardware-overview
    • dwim-shell-commands-macos-open-with
    • dwim-shell-commands-macos-reveal-in-finder
    • dwim-shell-commands-macos-set-default-app
    • dwim-shell-commands-macos-share
    • dwim-shell-commands-macos-toggle-dark-mode
    • dwim-shell-commands-macos-toggle-display-rotation
    • dwim-shell-commands-make-transparent-png
    • dwim-shell-commands-move-to-desktop
    • dwim-shell-commands-move-to-downloads
    • dwim-shell-commands-open-clipboard-url
    • dwim-shell-commands-open-externally
    • dwim-shell-commands-pdf-password-protect
    • dwim-shell-commands-pdf-to-txt
    • dwim-shell-commands-ping-google
    • dwim-shell-commands-rename-all
    • dwim-shell-commands-reorient-image
    • dwim-shell-commands-resize-gif
    • dwim-shell-commands-resize-image
    • dwim-shell-commands-resize-video
    • dwim-shell-commands-speed-up-gif
    • dwim-shell-commands-speed-up-video
    • dwim-shell-commands-stream-clipboard-url
    • dwim-shell-commands-svg-to-png
    • dwim-shell-commands-unzip
    • dwim-shell-commands-url-browse
    • dwim-shell-commands-video-to-gif
    • dwim-shell-commands-video-to-optimized-gif
    • dwim-shell-commands-video-to-webp

    What other use-cases would you consider? dwim-shell-command is available on melpa.

    Update

    2022-11-14 dwim-shell-commands.el list updated.

    ]]>
    Sun, 14 Aug 2022 00:00:00 GMT
    Emacs freebie: macOS emoji picker https://xenodium.com/emacs-freebie-macos-emoji-picker https://xenodium.com/emacs-freebie-macos-emoji-picker I recently ran a little experiment to bring macOS's long-press-accents-like behavior to Emacs. What I forgot to mention is that macOS's character viewer just works from our beloved editor.

    If you have a newer MacBook model, you can press the 🌐 key to summon the emoji picker (character viewer). You may need to set this key binding from macOS keyboard preferences.

    I'm happy to take this Emacs freebie, kthxbye.

    Edits:

    • Like other macOS apps, this dialog can be invoked via control-command-space (thanks mtndewforbreakfast). Note: you'd lose this ability if you (setq mac-command-modifier 'meta) in your config.
    • The 🌐 key is a feature on newer MacBook hardware and likely needs configuration (thanks Fabbi-).
    ]]>
    Wed, 03 Aug 2022 00:00:00 GMT
    dwim-shell-command video streams https://xenodium.com/dwim-shell-command-video-streams https://xenodium.com/dwim-shell-command-video-streams I continue hunting for use-cases I can migrate to dwim-shell-command… After adding clipboard support (via []

    id: cb ---) I found one more.

    1. Copy URL from browser.
    2. Invoke dwim-shell-commands-mpv-stream-clipboard-url.
    3. Enjoy picture in picture from Emacs ;)

    What's the secret sauce? Very little. Invoke the awesome mpv with a wrapping function using dwim-shell-command-on-marked-files.

    (defun dwim-shell-commands-mpv-stream-clipboard-url ()
      "Stream clipboard URL using mpv."
      (interactive)
      (dwim-shell-command-on-marked-files
       "Streaming"
       "mpv --geometry=30%x30%+100%+0% \"<<cb>>\""
       :utils "mpv"
       :no-progress t
       :error-autofocus t
       :silent-success t))
    

    The typical progress bar kinda got in the way, so I added a new option :no-progress to dwim-shell-command-on-marked-files, so it can be used for cases like this one.

    ]]>
    Mon, 01 Aug 2022 00:00:00 GMT
    An accentuated Emacs experiment (à la macOS) https://xenodium.com/an-accentuated-emacs-experiment https://xenodium.com/an-accentuated-emacs-experiment macOS has a wonderful input mechanism where you press and hold a key on your keyboard to display the accent menu. It's easy to internalize: long press "a" if you want to input "á".

    On Emacs, C-x 8 ' a would be the equivalent, but it just didn't stick for me. Fortunately, there's an alternative, using dead keys. Mickey Petersen gives a wonderful introduction. Having said all this, I still longed for macOS's input mechanism.

    Thanks to Christian Tietze's post, I discovered the accent package. While it doesn't handle press-and-hold, it does the heavy lifting of offering a menu with character options. If I could just bring that press-and-hold

    My initial attempt was to use key chords (via use-package):

    (use-package accent
      :ensure t
      :chords (("aa" . ar/spanish-accent-menu)
               ("ee" . ar/spanish-accent-menu)
               ("ii" . ar/spanish-accent-menu)
               ("oo" . ar/spanish-accent-menu)
               ("uu" . ar/spanish-accent-menu)
               ("AA" . ar/spanish-accent-menu)
               ("EE" . ar/spanish-accent-menu)
               ("II" . ar/spanish-accent-menu)
               ("OO" . ar/spanish-accent-menu)
               ("UU" . ar/spanish-accent-menu)
               ("nn" . ar/spanish-accent-menu)
               ("NN" . ar/spanish-accent-menu)
               ("??" . ar/spanish-accent-menu)
               ("!!" . ar/spanish-accent-menu))
      :config
      (defun ar/spanish-accent-menu ()
        (interactive)
        (let ((accent-diacritics
               '((a (á))
                 (e (é))
                 (i (í))
                 (o (ó))
                 (u (ú ü))
                 (A (Á))
                 (E (É))
                 (I (Í))
                 (O (Ó))
                 (U (Ú Ü))
                 (n (ñ))
                 (N (Ñ))
                 (\? (¿))
                 (! (¡)))))
          (ignore-error quit
            (accent-menu)))))
    

    While it kinda works, "nn" quickly got in the way of my n/p magit navigation. Perhaps key chords are still an option for someone who doesn't need the "nn" chord, but being a Spanish speaker, I need that "ñ" from long "n" presses!

    I'm now trying a little experiment using an after-change-functions hook to monitor text input and present the accent menu. I'm sure there's a better way (anyone with ideas?). For now, it gives me something akin to press-and-hold.

    I'm wrapping the hook with a minor mode to easily enable/disable whenever needed. I'm also overriding accent-diacritics to only include the characters I typically need.

    (use-package accent
      :ensure t
      :hook ((text-mode . accent-menu-mode)
             (org-mode . accent-menu-mode)
             (message-mode . accent-menu-mode))
      :config
      (setq accent-diacritics '((a (á))
                                (e (é))
                                (i (í))
                                (o (ó))
                                (u (ú ü))
                                (A (Á))
                                (E (É))
                                (I (Í))
                                (O (Ó))
                                (U (Ú Ü))
                                (n (ñ))
                                (N (Ñ))
                                (\? (¿))
                                (! (¡))))
      (defvar accent-menu-monitor--last-edit-time nil)
    
      (define-minor-mode accent-menu-mode
        "Toggle `accent-menu' if repeated keys are detected."
        :lighter " accent-menu mode"
        (if accent-menu-mode
            (progn
              (remove-hook 'after-change-functions #'accent-menu-monitor--text-change t)
              (add-hook 'after-change-functions #'accent-menu-monitor--text-change 0 t))
          (remove-hook 'after-change-functions #'accent-menu-monitor--text-change t)))
    
      (defun accent-menu-monitor--text-change (beginning end length)
        "Monitors text change BEGINNING, END, and LENGTH."
        (let ((last-edit-time accent-menu-monitor--last-edit-time)
              (edit-time (float-time)))
          (when (and (> end beginning)
                     (eq length 0)
                     last-edit-time
                     (not undo-in-progress)
                     ;; 0.27 seems to work for my macOS keyboard settings.
                     ;; Key Repeat: Fast | Delay Until Repeat: Short.
                     (< (- edit-time last-edit-time) 0.27)
                     (float-time (time-subtract (current-time) edit-time))
                     (accent-menu-monitor--buffer-char-string (1- beginning))
                     (seq-contains-p (mapcar (lambda (item)
                                               (symbol-name (car item)))
                                             accent-diacritics)
                                     (accent-menu-monitor--buffer-char-string beginning))
                     (string-equal (accent-menu-monitor--buffer-char-string (1- beginning))
                                   (accent-menu-monitor--buffer-char-string beginning)))
            (delete-backward-char 1)
            (ignore-error quit
              (accent-menu)))
          (setq accent-menu-monitor--last-edit-time edit-time)))
    
      (defun accent-menu-monitor--buffer-char-string (at)
        (when (and (>= at (point-min))
                   (< at (point-max)))
          (buffer-substring-no-properties at (+ at 1)))))
    

    As a bonus, it ocurred to me that I could use the same press-and-hold to handle question marks in Spanish (from my UK keyboard).

    ]]>
    Sat, 30 Jul 2022 00:00:00 GMT
    dwim-shell-command improvements https://xenodium.com/dwim-shell-command-improvements https://xenodium.com/dwim-shell-command-improvements Added a few improvements to dwim-shell-command.

    Dired region

    In DWIM style, if you happen to have a dired region selected, use region files instead. There's no need to explicitly mark them.

    Clipboard (kill-ring) replacement

    Use <<cb>> to substitute with clipboard content. This is handy for cloning git repos, using a URL copied from your browser.

    git clone <<cb>>
    

    This illustrates <<cb>> usage, but you may want to use dwim-shell-commands-git-clone-clipboard-url from dwim-shell-commands.el instead. It does the same thing internally, but makes the command more accessible.

    (defun dwim-shell-commands-git-clone-clipboard-url ()
      "Clone git URL in clipboard to `default-directory'."
      (interactive)
      (dwim-shell-command-on-marked-files
       (format "Clone %s" (file-name-base (current-kill 0)))
       "git clone <<cb>>"
       :utils "git"))
    

    Counter replacement

    Use <<n>> to substitute with a counter. You can also use <<3n>> to start the counter at 3.

    Handy if you'd like to consistently rename or copy files.

    mv '<<f>>' 'image(<<n>>).png'
    

    Can also use an alphabetic counter with <<an>>. Like the numeric version, can use any letter to start the counter with.

    mv '<<f>>' 'image(<<an>>).png'
    

    Prefix counter

    Use a prefix command argument on dwim-shell-commands to repeat the command a number of times. Combined with a counter, you can make multiple copies of a single file.

    Optional error prompt

    Set dwim-shell-command-prompt-on-error to nil to skip error prompts. Focus process buffers automatically instead.

    Configurable prompt

    By default, dwim-shell-command shows all supported placeholders. You can change that prompt to something shorter using dwim-shell-command-prompt.

    ⚠️ Use with care ⚠️

    The changes are pretty fresh. Please use with caution (specially the counter support).

    ]]>
    Thu, 28 Jul 2022 00:00:00 GMT
    dwim-shell-command on Melpa https://xenodium.com/dwim-shell-command-on-melpa https://xenodium.com/dwim-shell-command-on-melpa
    <<cb>> gets replaced by a clipboard (kill ring) URL

    My pull request to add dwim-shell-command to melpa has been merged. Soon, you'll be able to install directly from Milkypostman’s Emacs Lisp Package Archive.

    dwim-shell-command is another way to invoke shell commands from our beloved editor. Why a different way? It does lots of little things for you, removing friction you didn't realise you had. You can check out the README, but you'll appreciate it much more once you try it out.

    In addition, it's enabled me to bring lots of command-line tools into my Emacs config and make them highly accessible. You can see my usages over at dwim-shell-command-commands.el.

    What kind of command-line tools? ffmpeg, convert, gifsycle, atool, qdpf, plutil, qrencode, du, sips, iconutil, and git (so far anyway). Below is a simple example, but would love to hear how you get to use it.

    (defun dwim-shell-command-audio-to-mp3 ()
      "Convert all marked audio to mp3(s)."
      (interactive)
      (dwim-shell-command-on-marked-files
       "Convert to mp3"
       "ffmpeg -stats -n -i '<<f>>' -acodec libmp3lame '<<fne>>.mp3'"
       :utils "ffmpeg"))
    

    I've written about dwim-shell-command before:

    Irreal's also covered it:

    ]]>
    Sun, 24 Jul 2022 00:00:00 GMT
    A lifehack for your shell https://xenodium.com/a-lifehack-for-your-shell https://xenodium.com/a-lifehack-for-your-shell

    I'm a fan of the unzip command line utility that ships with macOS. I give it a .zip file and it unzips it for me. No flags or arguments to remember (for my typical usages anyway). Most importantly, I've fully internalized the unzip command into muscle memory, probably because of its perfect mnemonic.

    But then there's .tar, .tar.gz, .tar.xz, .rar, and a whole world of compression archives, often requiring different tools, flags, etc. and I need to remember those too.

    Can't remember where I got this "life hack" from, but it suggests something along the lines of…

    ::: center Once you find a lost item at home, place it in the first spot you looked. :::

    Great, I'll find things quickly. Win.

    Now, I still remember a couple of unarchiving commands from memory (looking at you tar xvzf), but I've noticed the first word that pops into mind when extracting is always unzip.

    There's the great atool wrapper out there to extract all kinds of archives (would love to hear of others), but unlucky for me, its name never comes to mind as quickly as unzip does.

    With "life hack" in mind, let's just create an unzip eshell alias to atool. Next time I need to unarchive anything, the first word that comes to mind (unzip!) will quickly get me on my way…

    alias unzip 'atool --extract --explain $1'
    

    Or if you prefer to add to your Emacs config:

    (eshell/alias "unzip" "atool --extract --explain $1")
    

    While I'm fan of Emacs eshell, it's not everyone's cup of tea. Lucky for us all, aliases are a popular feature across shells. Happy unzipping!

    Bonus

    Since I'm a keen on using "unzip" mnemonic everywhere in Emacs (not just my shell), I now have a DWIM shell-command for it:

    (defun dwim-shell-command-unzip ()
      "Unzip all marked archives (of any kind) using `atool'."
      (interactive)
      (dwim-shell-command-on-marked-files
       "Unzip" "atool --extract --explain '<<f>>'"
       :utils "atool"))
    

    UPDATE:

    Lobste.rs has great comments. Thanks all:

    Aliases missing on remote machines

    Concerns about aliases not available on remote machines. Valid. Certainly brings challenges if you can't modify the environment on the remote machine. The severity would depend on how frequently you have to do this. Fortunately for me, it's infrequent.

    Additionally, if accessing remote machine via eshell, this is a non-issue. You get to transparently bring most of your environment with you anyway.

    Unzip keyword is overloaded

    The alias is overloading the unzip command. I know. It's a little naughty. Going with it for now. I used to use "extract" (also in comments), which I still like but somehow "unzip" still wins my memory race. There's also "x" (nice option), which seems to originate from prezto. I could consider unzipp, unzip1, or some other variation.

    Not sure how I missed this, but there's also an existing alias for atool: aunpack. Could be a great alternative.

    Pause before extracting archives

    Valid point. In my case, the pause typically happens before I invoke the alias.

    Littering

    If the archive didn't have a root dir, it can litter your current directory. Indeed a pain to clean up. For this, we can atool's --subdir param to always create subdirectory when extracting.

    Alias to retrain

    Neat trick: alias unzip = “echo ‘use atool’” to help retrain yourself. Reminds me of Emacs guru-mode.

    atool alternatives

    Nice to see other options suggested dtrx (comment), archiver (comment), unar (comment), bsdtar from libarchive (comment), unp, patool, and the tangentially related zgrep (comment).

    ]]>
    Sat, 16 Jul 2022 00:00:00 GMT
    Emacs zones to lift you up https://xenodium.com/emacs-zones-to-lift-you-up https://xenodium.com/emacs-zones-to-lift-you-up

    As I prune my Emacs config off, I came across a forgotten bit of elisp I wrote about 6 years ago. While it's not going to power up your Emacs fu, it may lift your spirits, or maybe just aid discovery of new words.

    You see, I had forgotten about zone.el altogether: a fabulous package to tickle your heart. You can think of it as screensaver built into Emacs.

    If the built-in zones don't do it for ya, check out the few on melpa (nyan, sl, and rainbow).

    So, my nostalgic bit of elisp dates Jun 17 2016: a basic but functional zone (zone-words), displaying words from WordNet. Surely the package can use plenty of improvements (here's one), but hey this is Emacs and pretty much all existing code will run, no matter how old. In Emacs time, 2016 is practically yesterday!

    ]]>
    Wed, 13 Jul 2022 00:00:00 GMT
    Emacs: DWIM shell command (multi-language) https://xenodium.com/emacs-dwim-shell-command-multi-language https://xenodium.com/emacs-dwim-shell-command-multi-language UPDATE: dwim-shell-command is now available on melpa.

    I keep on goofying around with dwim-shell-command and it's sibling dwim-shell-command-on-marked-files from dwim-shell-command.el.

    In addition to defaulting to zsh, dwim-shell-command-on-marked-files now support other shells and languages. This comes in handy if you have snippets in different languages and would like to easily invoke them from Emacs. Multi-language support enables "using the best tool for the job" kinda thing. Or maybe you just happen to know how to solve a particular problem in a specific language.

    Let's assume you have an existing Python snippet to convert files from csv to json. With dwim-shell-command-on-marked-files, you can invoke the Python snippet to operate on either dired or buffer files.

    (defun dwim-shell-command-csv-to-json-via-python ()
      "Convert csv file to json (via Python)."
      (interactive)
      (dwim-shell-command-on-marked-files
       "Convert csv file to json (via Python)."
       "
    import csv
    import json
    text = json.dumps({ \"values\": list(csv.reader(open('<<f>>')))})
    fpath = '<<fne>>.json'
    with open(fpath , 'w') as f:
      f.write(text)"
       :shell-util "python"
       :shell-args "-c"))
    

    Or, maybe you prefer Swift and already had a snippet for the same thing?

    (defun dwim-shell-command-csv-to-json-via-swift ()
      "Convert csv file to json (via Swift)."
      (interactive)
      (dwim-shell-command-on-marked-files
       "Convert csv file to json (via Swift)."
       "
        import Foundation
        import TabularData
        let filePath = \"<<f>>\"
        print(\"reading \\(filePath)\")
        let content = try String(contentsOfFile: filePath).trimmingCharacters(in: .whitespacesAndNewlines)
        let parsedCSV = content.components(separatedBy: CSVWritingOptions().newline).map{
          $0.components(separatedBy: \",\")
        }
        let jsonEncoder = JSONEncoder()
        let jsonData = try jsonEncoder.encode([\"value\": parsedCSV])
        let json = String(data: jsonData, encoding: String.Encoding.utf8)
        let outURL = URL(fileURLWithPath:\"<<fne>>.json\")
        try json!.write(to: outURL, atomically: true, encoding: String.Encoding.utf8)
        print(\"wrote \\(outURL)\")"
       :shell-pipe "swift -"))
    

    You can surely solve the same problem in elisp, but hey it's nice to have options and flexibility.

    ]]>
    Sun, 10 Jul 2022 00:00:00 GMT
    png to icns (Emacs DWIM style) https://xenodium.com/png-to-icns-emacs-dwim-style https://xenodium.com/png-to-icns-emacs-dwim-style UPDATE: dwim-shell-command is now available on melpa.

    Since writing a DWIM version of the shell-command, I've been having a little fun revisiting command line utilities I sometimes invoke from my beloved editor. In this instance, converting a png file to an icns icon. What's more interesting about this case is that it's not just a one-liner, but a short script in itself. Either way, it's just as easy to invoke from Emacs using dwim-shell-command--on-marked-files.

    (defun dwim-shell-command-convert-image-to-icns ()
      "Convert png to icns icon."
      (interactive)
      (dwim-shell-command-on-marked-files
       "Convert png to icns icon"
       "
        # Based on http://stackoverflow.com/questions/12306223/how-to-manually-create-icns-files-using-iconutil
        # Note: png must be 1024x1024
        mkdir <<fne>>.iconset
        sips -z 16 16 '<<f>>' --out '<<fne>>.iconset/icon_16x16.png'
        sips -z 32 32 '<<f>>' --out '<<fne>>.iconset/[email protected]'
        sips -z 32 32 '<<f>>' --out '<<fne>>.iconset/icon_32x32.png'
        sips -z 64 64 '<<f>>' --out '<<fne>>.iconset/[email protected]'
        sips -z 128 128 '<<f>>' --out '<<fne>>.iconset/icon_128x128.png'
        sips -z 256 256 '<<f>>' --out '<<fne>>.iconset/[email protected]'
        sips -z 256 256 '<<f>>' --out '<<fne>>.iconset/[email protected]'
        sips -z 512 512 '<<f>>' --out '<<fne>>.iconset/icon_512x512.png'
        sips -z 512 512 '<<f>>' --out '<<fne>>.iconset/[email protected]'
        sips -z 1024 1024 '<<f>>' --out '<<fne>>.iconset/[email protected]'
        iconutil -c icns '<<fne>>.iconset'"
       :utils '("sips" "iconutil")
       :extensions "png"))
    
    ]]>
    Sat, 09 Jul 2022 00:00:00 GMT
    Emacs: Password-protect current pdf (revisited) https://xenodium.com/emacs-password-protect-current-pdf-revisited https://xenodium.com/emacs-password-protect-current-pdf-revisited UPDATE: dwim-shell-command is now available on melpa.

    With a recent look at writing DWIM shell commands, I've been revisiting my custom Emacs functions invoking command line utilities.

    Take this post, for example, where I invoke qpdf via a elisp. Using the new dwim-shell-command--on-marked-files in dwim-shell-command.el, the code is stripped down to a bare minimum:

    (defun dwim-shell-commands-pdf-password-protect ()
      "Password protect pdf."
      (interactive)
      (dwim-shell-command-on-marked-files
       "Password protect pdf"
       (format "qpdf --verbose --encrypt '%s' '%s' 256 -- '<<f>>' '<<fne>>_enc.<<e>>'"
               (read-passwd "user-password: ")
               (read-passwd "owner-password: "))
       :utils "qpdf"
       :extensions "pdf"))
    

    Compare the above dwim-shell-command--on-marked-files usage to my previous implementation:

    (defun pdf-password-protect ()
      "Password protect current pdf in buffer or `dired' file."
      (interactive)
      (unless (executable-find "qpdf")
        (user-error "qpdf not installed"))
      (unless (equal "pdf"
                     (or (when (buffer-file-name)
                           (downcase (file-name-extension (buffer-file-name))))
                         (when (dired-get-filename nil t)
                           (downcase (file-name-extension (dired-get-filename nil t))))))
        (user-error "no pdf to act on"))
      (let* ((user-password (read-passwd "user-password: "))
             (owner-password (read-passwd "owner-password: "))
             (input (or (buffer-file-name)
                        (dired-get-filename nil t)))
             (output (concat (file-name-sans-extension input)
                             "_enc.pdf")))
        (message
         (string-trim
          (shell-command-to-string
           (format "qpdf --verbose --encrypt '%s' '%s' 256 -- '%s' '%s'"
                   user-password owner-password input output))))))
    

    This really changes things for me. I'll be more inclined to add more of these tiny integrations to lots of great command line utilities. Take this recent Hacker News post on ocrmypdf as an example. Their cookbook has lots of examples that can be easily used via dwim-shell-command--on-marked-files.

    What command line utils would you use?

    ]]>
    Sat, 09 Jul 2022 00:00:00 GMT
    Emacs DWIM shell-command https://xenodium.com/emacs-dwim-shell-command https://xenodium.com/emacs-dwim-shell-command UPDATE: dwim-shell-command is now available on melpa.

    I've talked about DWIM before, where I bend Emacs to help me do what I mean. Emacs is also great for wrapping command-line one-liners with elisp, so I can quickly invoke commands without thinking too much about flags, arguments, etc.

    I keep thinking the shell-command is ripe for plenty of enhancements using our DWIM fairydust.

    Do what I mean how?

    Smart template instantiation

    I've drawn inspiration from dired-do-shell-command, which substitutes special characters like * and ? with marked files. I'm also drawing inspiration from org babel's noweb syntax to substitute <<f>> (file path), <<fne>> (file path without extension), and <<e>> (extension). My initial preference was to use something like $f, $fne, and $e, but felt they clashed with shell variables.

    Operate on dired marked files

    This is DWIM, so if we're visiting a dired buffer, the shell command should operate on all the marked files.

    Operate on current buffer file

    Similarly, if visiting a buffer with an associated file, operate on that file instead.

    Automatically take me to created files

    Did the command create a new file in the current directory? Take me to it, right away.

    Show me output on error

    I'm not usually interested in the command output when generating new files, unless there was an error of course. Offer to show it.

    Show me output if no new files

    Not all commands generate new files, so automatically show me the output for these instances.

    Make it easy to create utilities

    ffmpeg is awesome, but man I can never remember all the flags and arguments. I may as well wrap commands like these in a convenient elisp function and invoke via execute-extended-command, or my favorite counsel-M-x (with completion), bound to the vital M-x.

    All those gifs you see in this post were created with dwim-shell-command-convert-to-gif, powered by the same elisp magic.

    (defun dwim-shell-command-convert-to-gif ()
      "Convert all marked videos to optimized gif(s)."
      (interactive)
      (dwim-shell-command--on-marked-files
       "Convert to gif"
       "ffmpeg -loglevel quiet -stats -y -i <<f>> -pix_fmt rgb24 -r 15 <<fne>>.gif"
       :utils "ffmpeg"))
    

    This makes wrapping one-liners a breeze, so let's do some more…

    (defun dwim-shell-command-convert-audio-to-mp3 ()
      "Convert all marked audio to mp3(s)."
      (interactive)
      (dwim-shell-command-on-marked-files
       "Convert to mp3"
       "ffmpeg -stats -n -i '<<f>>' -acodec libmp3lame '<<fne>>.mp3'"
       :utils "ffmpeg"))
    
    (defun dwim-shell-command-convert-image-to-jpg ()
      "Convert all marked images to jpg(s)."
      (interactive)
      (dwim-shell-command-on-marked-files
       "Convert to jpg"
       "convert -verbose '<<f>>' '<<fne>>.jpg'"
       :utils "convert"))
    
    (defun dwim-shell-command-drop-video-audio ()
      "Drop audio from all marked videos."
      (interactive)
      (dwim-shell-command-on-marked-files
       "Drop audio" "ffmpeg -i '<<f>>' -c copy -an '<<fne>>_no_audio.<<e>>'"
       :utils "ffmpeg"))
    

    Make it spin ;)

    Ok, not quite, but use Emacs's progress-reporter just for kicks.

    Use it everywhere

    dwim-shell-command covers my needs (so far anyway), so I'm binding it to existing bindings.

    (use-package dwim-shell-command
      :bind
      ("M-!" . dwim-shell-command))
    
    (use-package dired
      :bind (:map dired-mode-map
                  ([remap dired-do-async-shell-command] . dwim-shell-command)
                  ([remap dired-do-shell-command] . dwim-shell-command)
                  ([remap dired-smart-shell-command] . dwim-shell-command)))
    

    Bring those command line utilities

    On the whole, this really changes things for me. I'll be more inclined to bring command line utilities to seamless Emacs usage. Take this recent Hacker News post on ocrmypdf as an example. Their cookbook has lots of examples that can be easily used via dwim-shell-command--on-marked-files. What command line utilities would you bring?

    Where's the code?

    UPDATE: dwim-shell-command is now available on melpa.

    The code for dwim-shell-command.el is likely a bit rough still, but you can take a peek if interested. Keep in mind this is DWIM, tailored for what ✨I✨ mean. Some of the current behavior may not be your cup of tea, but this is Emacs. You can bend it to do what ✨you✨ mean. Happy Emacsing.

    ]]>
    Thu, 07 Jul 2022 00:00:00 GMT
    Emacs: Password-protect current pdf https://xenodium.com/emacs-password-protect-current-pdf https://xenodium.com/emacs-password-protect-current-pdf UPDATE: Check out Password-protect current pdf (revisted) for a simpler version.

    Every so often, I need to password-protect a pdf. On macOS, Preview has a simple solution, but I figured there must be a command line utility to make this happen. There are options, but qdf did the job just fine.

    qpdf --verbose --encrypt USER-PASSWORD OWNER-PASSWORD KEY-LENGTH -- input.pdf output.pdf
    

    So what does qpdf have to do with Emacs? Command-line utilities are easy to invoke from Emacs via shell-command (M-!), but I don't want to remember the command nor the parameters. I may as well add a function that does what I mean and password-protect either buffers or dired files.

    (defun pdf-password-protect ()
        "Password protect current pdf in buffer or `dired' file."
        (interactive)
        (unless (executable-find "qpdf")
          (user-error "qpdf not installed"))
        (unless (equal "pdf"
                       (or (when (buffer-file-name)
                             (downcase (file-name-extension (buffer-file-name))))
                           (when (dired-get-filename nil t)
                             (downcase (file-name-extension (dired-get-filename nil t))))))
          (user-error "no pdf to act on"))
        (let* ((user-password (read-passwd "user-password: "))
               (owner-password (read-passwd "owner-password: "))
               (input (or (buffer-file-name)
                          (dired-get-filename nil t)))
               (output (concat (file-name-sans-extension input)
                               "_enc.pdf")))
          (message
           (string-trim
            (shell-command-to-string
             (format "qpdf --verbose --encrypt '%s' '%s' 256 -- '%s' '%s'"
                     user-password owner-password input output))))))
    
    ]]>
    Thu, 02 Jun 2022 00:00:00 GMT
    Plain Org v1.4 released https://xenodium.com/plain-org-v14-released https://xenodium.com/plain-org-v14-released Plain Org v1.4 is now available on the App Store.

    I was on a long flight recently 🦘, so I gave list and checkbox editing a little love. There's a couple of other minor improvements included.

    If you haven't heard of Plain Org, it gives you access to org files on iPhone while away from your beloved Emacs.

    I love org markup, but we (iPhone + org users) are a fairly niche bunch. If you're finding Plain Org useful, please help support this effort by getting the word out. Tell your friends, tweet, or blog about it.

    On to v1.4 release notes…

    Improved list/checkbox editing

    Adding list or checkbox items is traditionally cumbersome via the iPhone's keyboard. This release adds new toolbar actions and smart return to simplify things.

    Render form feed characters

    Form feed characters are now rendered within expanded headings.

    Note: There's a limitation. Form feed characters at the end of a heading aren't currently displayed.

    Other

    Increased all button tap areas in edit toolbar. This should hopefully improve interaction.

    ]]>
    Sun, 24 Apr 2022 00:00:00 GMT
    Plain Org v1.3 released https://xenodium.com/plain-org-v130-released https://xenodium.com/plain-org-v130-released Plain Org v1.3 is now available on the App Store. The update receives a few features, bug fixes, and improvements.

    If you haven't heard of Plain Org, it gives you access to org files on iPhone while away from your beloved Emacs.

    I love org markup, but we (iPhone + org users) are a fairly niche bunch. If you're finding Plain Org useful, please help support this effort by getting the word out. Tell your friends, tweet, or blog about it.

    On to v1.3 release notes…

    Toggle recurring tasks

    You can now toggle recurring tasks with either catchup <2022-04-15 Fri ++1d>, restart <2022-04-15 Fri .+1d>, or cumulate <2022-04-15 Fri +1d> repeaters.

    Log state transitions

    Fullscreen view

    The navigation bar now hides on scroll. This can be enabled/disabled via View > Full Screen menu.

    The previous screenshot text comes from Org Mode - Organize Your Life In Plain Text, a magnificent org resource.

    Deadline and scheduled date rendered

    In the past, SCHEDULED and DEADLINE were rendered (but only one of them at a time). Now both are rendered alongside each other (deadline has an orange tint).

    Roundtripping fidelity

    Many roundtripping fidelity improvements included in 1.3. Shoutout to u/Oerm who reported unnecessary formatting changes in unmodified areas and helped test all fixes.

    Other bug fixes improvements

    • Disable raw text edit menu when file is not accessible.
    • Minor improvements to inline editing layouts (vertical height and drawers).
    • ABRT and HABIT now recognized as a popular keywords.
    • Improve state transition alignment to match org mode behaviour.
    • Fixes roundtripping state transition notes (leading to data loss).
    • Log creation from share sheet.
    • Increment DEADLINE and SCHEDULED, not just first found.
    • Roundtrip more whitespace in untouched areas.
    • Fixes org syntax inadvertently parsed within begin_src blocks (leading to data loss).
    ]]>
    Fri, 15 Apr 2022 00:00:00 GMT
    Plain Org v1.2.1 released https://xenodium.com/plain-org-v121-released https://xenodium.com/plain-org-v121-released Plain Org v1.2.1 is now available on the App Store. The update receives minor features, bug fixes, and improvements.

    If you haven't heard of Plain Org, it gives you access to org files on iPhone while away from your beloved Emacs.

    I love org markup, but we (iPhone + org users) are a fairly niche userbase. If you're finding Plain Org useful, please help support this effort by getting the word out. Tell your friends, tweet, or blog about it.

    On to v1.2.1 release notes…

    Render LOGBOOK

    State transitions and LOGBOOK drawers are now recognized and rendered as such.

    Either of the following snippets are rendered as togglable LOGBOOK drawers.

    * TODO Feed the fish
    - State "DONE"       from "TODO"       [2022-03-11 Fri 12:23]
    
    * TODO Feed the cat
    :LOGBOOK:
    - State "DONE"       from "TODO"       [2022-03-11 Fri 12:23]
    :END:
    

    Add task to top/bottom

    Up until now, tasks were always appended to the bottom of things. This didn't work so well if you like seeing recent items bubbling up to the top.

    This version adds a new setting: Settings > Add new tasks to > Top/Bottom, giving you the choice.

    Note: Top is the new default value, please change this setting if you'd like to keep the previous behaviour.

    Checking for changes

    Local file changes aren't always detected via state change notifications, so additional checks are now in place to offer reloading files.

    Open inactive files

    After adding new tasks via iOS's share sheet, if the item was added to a file other than the active one, offer to open that instead.

    Other improvements

    • Color keyword red/green depending on #+TODO: position.
    • Round-trip planning order (SCHEDULED, CLOSED, DEADLINE).
    • Improve tag alignment to match org mode behaviour (best effort, sorry).
    • Improve vertical spacing prior to lists.
    • Improve share sheet reliability.
    • Fix opening local links from list items.
    • Fix indent for list items without previous content.
    • Fix race condition in adding TITLE and ID to new files.
    • Fix incorrect keyword color selection in search toolbar.
    • Fix menu inadvertently closing.
    • Fix menu tapping for iPad.
    ]]>
    Sun, 27 Mar 2022 00:00:00 GMT
    Emacs DWIM: swiper vs isearch vs phi-search https://xenodium.com/emacs-dwim-swiper-vs-isearch-vs-phi-search https://xenodium.com/emacs-dwim-swiper-vs-isearch-vs-phi-search

    I've talked about DWIM in the past, that wonderful Emacs ability to do what ✨I✨ mean.

    Emacs being hyper-configurable, we can always teach it more things, so it can do exactly what we mean.

    There are no shortages of buffer searching packages for Emacs. I'm a fan of Oleh Krehel's swiper, but before that, I often relied on the built-in isearch. Swiper is my default goto mechanism and have it bound to C-s (replacing the built-in isearch-forward).

    Swiper services most needs until I start combining with other tools. Take keyboard macros and multiple cursors. Both wonderful, but neither can rely on swiper to do their thing. Ok, swiper does, but in a different way.

    Rather than binding C-s to swiper, let's write a DWIM function that's aware of macros and multiple cursors. It must switch between swiper, isearch, and phi-search depending on what I want (search buffer, define macro, or search multiple cursors).

    Let's also tweak swiper's behavior a little further and prepopulate its search term with the active region. Oh, and I also would like swiper to wrap around (see ivy-wrap). But only swiper, not other ivy utilities. I know, I'm picky, but that's the whole point of DWIM… so here's my function to search forward that does exactly what ✨I✨ mean:

    (defun ar/swiper-isearch-dwim ()
      (interactive)
      ;; Are we using multiple cursors?
      (cond ((and (boundp 'multiple-cursors-mode)
                  multiple-cursors-mode
                  (fboundp  'phi-search))
             (call-interactively 'phi-search))
            ;; Are we defining a macro?
            (defining-kbd-macro
              (call-interactively 'isearch-forward))
            ;; Fall back to swiper.
            (t
             ;; Wrap around swiper results.
             (let ((ivy-wrap t))
               ;; If region is active, prepopulate swiper's search term.
               (if (and transient-mark-mode mark-active (not (eq (mark) (point))))
                   (let ((region (buffer-substring-no-properties (mark) (point))))
                     (deactivate-mark)
                     (swiper-isearch region))
                 (swiper-isearch))))))
    

    The above snippet searches forward, but I'm feeling a little off-balance. Let's write an equivalent to search backwards. We can then bind it to C-r, also overriding the built-in isearch-backward.

    (defun ar/swiper-isearch-backward-dwim ()
      (interactive)
      ;; Are we using multiple cursors?
      (cond ((and (boundp 'multiple-cursors-mode)
                  multiple-cursors-mode
                  (fboundp  'phi-search-backward))
             (call-interactively 'phi-search-backward))
            ;; Are we defining a macro?
            (defining-kbd-macro
              (call-interactively 'isearch-backward))
            ;; Fall back to swiper.
            (t
             ;; Wrap around swiper results.
             (let ((ivy-wrap t))
               ;; If region is active, prepopulate swiper's search term.
               (if (and transient-mark-mode mark-active (not (eq (mark) (point))))
                   (let ((region (buffer-substring-no-properties (mark) (point))))
                     (deactivate-mark)
                     (swiper-isearch-backward region))
                 (swiper-isearch-backward))))))
    

    These may be on the hacky side of things, but hey… they do the job. If there are better/supported ways of accomplishing a similar thing, I'd love to hear about it.

    ]]>
    Sat, 26 Mar 2022 00:00:00 GMT
    Grandma's vanilla pound cake https://xenodium.com/grandmas-vanilla-pound-cake https://xenodium.com/grandmas-vanilla-pound-cake

    My grandmother Hilda used to bake this for us grandkids. I don't know the origin of the recipe, but my parents, aunts, and cousins, they all bake it too. I'm a big fan, but only get to eat it when visiting. Yesterday, I changed that. Finally baked it myself ø/

    Ingredients

    • 200g salted butter
    • 2 cups (400 g) sugar
    • 4 eggs
    • 3 cups (375 g) plain flour
    • 3 teaspoons baking powder
    • 1 tablespoon (15 ml) vanilla extract
    • 1 cup (250 ml) milk
    • 2 tablespoons (30 ml) Málaga Virgen wine (port works too)

    Prep

    • Ensure all ingredients are at room temperature before you start.
    • Preheat oven at 175C.
    • Separate egg yolks and whites. Keep both.
    • Consolidate liquids into a bowl (milk + wine + vanilla).
    • Consolidate sifted powders into a bowl (flour + baking powder).

    Meringue

    • Beat egg whites into a snowy meringue. Set aside.

    Mixer

    • Beat butter in the mixer until creamy (important).
    • Add sugar and mix thoroughly ensuring creamy consistency remains (important).
    • Mix yolks in thoroughly one by one.
    • Mix in the meringue.
    • You're done with the mixer.

    Hand mixing

    • With a wooden spoon, alternate hand mixing the liquids and the powders. Start with liquids and end with powders.

    Pour into mould

    • Pour the mix into a non-stick baking mould.

    Bake

    • Bake in oven between 60 and 70 mins, but don’t be afraid to leave longer if needed. Mileage varies across ovens.
    • Use a cake tester after 60 minutes to decide how much longer to bake for (if needed).
    ]]>
    Sat, 12 Mar 2022 00:00:00 GMT
    Emacs: viewing webp images https://xenodium.com/emacs-viewing-webp-images https://xenodium.com/emacs-viewing-webp-images There's a recent reddit post asking how to view webp images in Emacs. I didn't know the answer, but it's something I had wanted for some time. This post was a nice reminder to go and check things out. Was happy to contribute an answer.

    Turns out, it's very simple. Just set image-use-external-converter and install relevant external tools.

    (setq image-use-external-converter t)
    

    I'm a use-package user, so I prefer to set with:

    (use-package image
      :custom
      ;; Enable converting external formats (ie. webp) to internal ones.
      (image-use-external-converter t))
    

    So what are the external tools needed? C-h v image-use-external-converter gives us the info we need:

    If non-nil, create-image will use external converters for exotic formats.

    Emacs handles most of the common image formats (SVG, JPEG, PNG, GIF and some others) internally, but images that don't have native support in Emacs can still be displayed if an external conversion program (like ImageMagick "convert", GraphicsMagick "gm" or "ffmpeg") is installed.

    This variable was added, or its default value changed, in Emacs 27.1.

    I happen to be a macOS user, so I install ImageMagick with:

    brew install imagemagick
    
    ]]>
    Sat, 05 Mar 2022 00:00:00 GMT
    Emacs: Fuzzy search Apple's online docs https://xenodium.com/emacs-fuzzy-search-apples-online-docs https://xenodium.com/emacs-fuzzy-search-apples-online-docs

    When building software for the Apple ecosystem, Xcode is often the editor of choice. With Emacs being my personal preference, I rarely find other iOS devs with a similar mindset.

    When I saw Mikael Konradsson's post describing his Emacs Swift development setup, I reached out to say hello. While exchanging tips and tricks, the topic of searching Apple's docs came up. It had been a while since I looked into this, so it was a great reminder to revisit the space.

    Back in June 2020, I wrote a snippet to fuzzy search hackingwithswift.com, using Emacs's ivy completion framework. With a similar online API, we could also search Apple's docs. Turns out, there is and we can we can use it to search developer.apple.com from our beloved editor.

    ;;; counsel-apple-search.el -*- lexical-binding: t; -*-
    
    (defun ar/counsel-apple-search ()
      "Ivy interface for dynamically querying apple.com docs."
      (interactive)
      (require 'request)
      (require 'json)
      (require 'url-http)
      (ivy-read "apple docs: "
                (lambda (input)
                  (let* ((url (url-encode-url (format "https://developer.apple.com/search/search_data.php?q=%s" input)))
                         (c1-width (round (* (- (window-width) 9) 0.3)))
                         (c2-width (round (* (- (window-width) 9) 0.5)))
                         (c3-width (- (window-width) 9 c1-width c2-width)))
                    (or
                     (ivy-more-chars)
                     (let ((request-curl-options (list "-H" (string-trim (url-http-user-agent-string)))))
                       (request url
                         :type "GET"
                         :parser 'json-read
                         :success (cl-function
                                   (lambda (&key data &allow-other-keys)
                                     (ivy-update-candidates
                                      (mapcar (lambda (item)
                                                (let-alist item
                                                  (propertize
                                                   (format "%s   %s   %s"
                                                           (truncate-string-to-width (propertize (or .title "")
                                                                                                 'face '(:foreground "yellow")) c1-width nil ?\s "…")
                                                           (truncate-string-to-width (or .description "") c2-width nil ?\s "…")
                                                           (truncate-string-to-width (propertize (string-join (or .api_ref_data.languages "") "/")
                                                                                                 'face '(:foreground "cyan1")) c3-width nil ?\s "…"))
                                                   'url .url)))
                                              (cdr (car data)))))))
                       0))))
                :action (lambda (selection)
                          (browse-url (concat "https://developer.apple.com"
                                              (get-text-property 0 'url selection))))
                :dynamic-collection t
                :caller 'ar/counsel-apple-search))
    
    ]]>
    Mon, 21 Feb 2022 00:00:00 GMT
    Plain Org v1.2 released https://xenodium.com/plain-org-v12-released https://xenodium.com/plain-org-v12-released Although Plain Org v1.2 has been in the App Store for a little while, the release write-up was overdue, sorry. The update receives some new features and bugfixes.

    If you haven't heard of Plain Org, it gives ya access to your org files on iOS while away from your beloved Emacs.

    If you're finding Plain Org useful, please help support this effort by getting the word out. Tell your friends, tweet, or blog about it.

    Ok, now on to what's included in the v1.2 release…

    Edit heading sections inline

    v1.0 introduced outline editing (for headings only). In v1.2, we can also edit section content. Press the return key multiple times to exit out section editing.

    Filter by keyword/priority/tag

    From the search dialog, you can now filter by keyboard, priority, and tag.

    Render drawers and properties

    Drawers are now rendered and can be expanded to view their content.

    Open files via the Files app's "Share" sheet

    From the Files app, you can now explicitly request launching files in Plain Org by using the "Share" menu.

    Render LaTeX src blocks (experimental)

    This one has its rough edges at the moment, so have to mark it [experimental]{.underline}, but… you can can now render #+begin_src latex blocks.

    Insert title/id in new files

    New files created via Plain Org automatically get #+TITLE: and :ID: inserted by default as follows:

    #+TITLE: My favorite title
    :PROPERTIES:
    :ID:       7C845D38-8D80-41B5-BEB1-94F673807355
    :END:
    

    UPDATE: Sorry, this feature currently has a bug. You may not get these values inserted into your new document. Working on a fix.

    Adding new tags quicker

    Add tags quicker via the new + button.

    Enable/disable sticky tags

    Keywords, indent, and tags are maintained when adding new headings via outline editing. If you prefer disabling sticky tags, this can now be disabled.

    Improved navigation bar

    v1.2 makes the navigation bar feel more at home on your iPhone. It uses a large title which scrolls into the navigation bar.

    Bugfixes

    • Fix table rendering for iPad width.
    • Fix image's horizontal padding.
    • Fix adding new tags on new headings.
    • Fix snapshotting bug resulting in Syncthing conflicts.
    • Fix tapping menu after presenting other dialogs.
    • Filter out parenthesis in file-local keywords like TODO(t).
    • Commit pending inline changes if search is requested.
    • Fix opening local links inside tables.
    • Roundtrip whitespace in empty headings.
    • Roundtrip trailing whitespace when raw-editing heading content.
    • Tapping on body content should not toggle expansion.

    download-on-app-store.png
    ]]>
    Sun, 13 Feb 2022 00:00:00 GMT
    Happy New Year and forming new habits https://xenodium.com/happy-new-year-and-forming-new-habits https://xenodium.com/happy-new-year-and-forming-new-habits Hacker News has a summary of Atomic Habits (the book). In my case, I really enjoyed reading the entire book. I liked its narrative, mixing [actionable]{.underline} and [concrete]{.underline} advice with personal stories and experiments.

    After reading Atomic Habits during the first lockdown, I was excited to try out its actionables, specially tracking to keep me honest.

    I tried a bunch of iOS apps, but wanted no friction, no tracking, no cloud, no social, no analytics, no account, etc. so eventually built Flat Habits (flathabits.com). Also wanted to own my habit data (as plain text), so I made sure Flat Habits stored its data locally as an org file.

    I'm an Emacs nutter and can say the strength in habit tracking lies in removing daily friction from the tracking process itself. A quickly accessible mobile app can really help with that. For me, Emacs plays a less important role here. The plain text part is cherry on top (bringing piece of mind around lock-in). In my case, it's been months since I looked at the plain text file itself from an Emacs org buffer. The iOS app, on the other hand, gets daily usage.

    As for forming lasting habits (the actual goal here)… it's been well over a year since I started running as a regular form of exercise. While reading Atomic Habits really changed how I think of habits, a tracker played a crucial part in the daily grind. I happen to have built a tracker that plays nice with Emacs.

    It's a new year. If you're looking at forming new habits, you may want some inspiration and also practical and concrete guidance. The book Atomic Habits can help with that. You can decide on which apps and how to implement the tracking process later on. Pen and paper is also a viable option and there are plenty of templates you can download.

    There's a surplus of habit-tracking apps on the app stores. I built yet another one for iOS, modeled after my needs.

    today_no_filter.png today_no_filter.png today_no_filter.png
    ]]>
    Mon, 03 Jan 2022 00:00:00 GMT
    Plain Org v1.1 released 🎄☃️ https://xenodium.com/plain-org-v11-released https://xenodium.com/plain-org-v11-released Plain Org v1.1 is now available on the App Store. The update receives new features and bugfixes.

    If you're finding Plain Org useful, please help support this effort by getting the word out. Tell your friends, tweet, or blog about it.

    What is Plain Org?

    Ok, now on to what's included in the v1.1 release…

    Compact mode

    By default, Plain Org layout uses generous padding. The new option Menu -> View -> Compact mode packs more content into your screen.

    Regroup active and inactive tasks

    Regrouping tasks now bubbles active ones up. Similarly, inactive tasks drop to the bottom of their node. Changes are persisted to the org file.

    Native table rendering

    Tables are now rendered natively but also support displaying links and other formatting within cells.

    Open local ID links

    If your file provider supports granting access to folders, local ID links (ie. id:eb155a82-92b2-4f25-a3c6-0304591af2f9) can now be resolved and opened from Plain Org. Note that for ID links to resolve, other org files must live in either the same directory or a subdirectory.

    Fill paragraphs

    If your org paragraphs contain newlines optimizing for bigger screens, you can toggle Menu -> View -> Fill paragraph to optimize rendering for your iPhone. This rendering option makes no file modifications.

    By the way, the previous screenshot text comes from Org Mode - Organize Your Life In Plain Text, a magnificent org resource.

    Show/hide basic scheduling

    Use the new Menu -> View -> Scheduling to toggle showing SCHEDULED or DEADLINE dates.

    Show/hide tags

    Similarly, the new Menu -> View -> Tags option toggles displaying tags.

    Native list rendering

    Lists are now rendered natively. With the exception of numbered cases, list items now share a common bullet icon. Description lists are also recognized and receive additional formatting when rendered.

    - First list item
    * Second list item
    + Third list item
    1. Numbered list item
    + Term :: Description for term
    

    Numbered checkboxes are now recognized and receive the same formatting and interaction as their non-numbered counterparts.

    1. [ ] First checkbox
    2. [X] Second checkbox
    3. [X] Third checkbox
    

    Reload current file

    Plain Org may not be able to automatically reload files for some syncing providers. In those instances, use Menu -> Reload to explicitly request a reload.

    Open .txt files

    Although .org files are plain text files, they aren't always recognized by other text-editing apps. This release enables opening .txt files, so you can choose to render them in Plain Org, while giving you the option to edit elsewhere.

    Bugfixes

    • Improve vertical whitespace handling.
    • Fixes rendering edge cases.
    • Fail gracefully when creating new files on unsupported cloud providers.
    • Prevent creating new files with redundant extensions.
    • File access improvements.
    • Replicates property spacing behaviour using Emacs's org-property-format default value.
    • Fixes keyword picker border rendering.
    • Improves rendering performance for large nodes.

    download-on-app-store.png
    ]]>
    Sun, 12 Dec 2021 00:00:00 GMT
    Emacs bends again https://xenodium.com/emacs-bends-again https://xenodium.com/emacs-bends-again While adding more rendering capabilities to Plain Org, it soon became apparent some sort of screenshot/snapshot testing was necessary to prevent regressing existing features. That is, we first generate a rendered snapshot from a given org snippet, followed by some visual inspection, right before we go and save the blessed snapshot (often referred to as golden) to our project. Future changes are validated against the golden snapshot to ensure rendering is still behaving as expected.

    Let's say we'd like to validate table rendering with links, we can write a test as follows:

    func testTableWithLinks() throws {
      assertSnapshot(
        matching: OrgMarkupText.make(
          """
          | URL                    | Org link    |
          |------------------------+-------------|
          | https://flathabits.com | [[https://flathabits.com][Flat Habits]] |
          | Regular text           | Here too    |
          |------------------------+-------------|
          """),
        as: .image(layout: .sizeThatFits))
    }
    

    The corresponding snapshot golden can be seen below.

    This is all done rather effortlessly thanks to Point Free's wonderful swift-snapshot-testing utilities.

    So what does any of this have to do with Emacs? You see, as I added more snapshot tests and made modifications to the rendering logic, I needed a quick way to visually inspect and override all goldens. All the main pieces were already there, I just needed some elisp glue to bend Emacs my way™.

    First, I needed to run my Xcode builds from the command line. This is already supported via xcodebuild. Next, I needed a way to parse test execution data to extract failing tests. David House's xcodebuild-to-json handles this perfectly. What's left? Glue it all up with some elisp.

    Beware, the following code snippet is packed with assumptions about my project, it's messy, surely has bugs, can be optimized, etc. But the important point here is that Emacs is such an amazing malleable power tool. Throw some elisp at it and you can to bend it to your liking. After all, it's [your]{.underline} editor.

    And so here we are, I can now run snapshot tests from Emacs using my hacked up plainorg-snapshot-test-all function and quickly override (or ignore) all newly generated snapshots by merely pressing y/n keys. Oh, and our beloved web browser was also invited to the party. Press "d" to open two browser tabs if you'd like to take a closer look (not demoed below).

    Success. Emacs bends again.

    ;;; -*- lexical-binding: t; -*-
    
    (defun plainorg-snapshot-test-all ()
      "Invoke xcodebuild, compare failed tests screenshots side-to-side,
    and offer to override them."
      (interactive)
      (let* ((project (cdr (project-current)))
             (json-tmp-file (make-temp-file "PlainOrg_Tests_" nil ".json"))
             (default-directory project))
        (unless (file-exists-p (concat project "PlainOrg.xcodeproj"))
          (user-error "Not in PlainOrg project"))
        (set-process-sentinel
         (start-process
          "xcodebuild"
          (with-current-buffer
              (get-buffer-create "*xcodebuild*")
            (let ((inhibit-read-only t))
              (erase-buffer))
            (current-buffer))
          "/usr/bin/xcodebuild"
          "-scheme" "PlainOrg" "-target" "PlainOrgTests" "-destination" "name=iPhone 13" "-quiet" "test")
         (lambda (p e)
           (with-current-buffer (get-buffer "*xcodebuild*")
             (let ((inhibit-read-only t))
               (insert (format "xcodebuild exit code: %d\n\n" (process-exit-status p)))))
           (when (not (eq 0 (process-exit-status p)))
             (set-process-sentinel
              (start-process
               "xcodebuild-to-json"
               "*xcodebuild*"
               "/opt/homebrew/bin/xcodebuild-to-json"
               "--derived-data-folder" (format "/Users/%s/Library/Developer/Xcode/DerivedData/"
                                               (user-login-name)) "--output" json-tmp-file)
              (lambda (p e)
                (with-current-buffer (get-buffer "*xcodebuild*")
                  (let ((inhibit-read-only t))
                    (insert (format "xcodebuild-to-json exit code: %d\n\n" (process-exit-status p)))))
                (when (= 0 (process-exit-status p))
                  (with-current-buffer (get-buffer "*xcodebuild*")
                    (let ((inhibit-read-only t))
                      (insert "Screenshot comparison started\n\n")))
                  (plainorg--snapshot-process-json (get-buffer "*xcodebuild*") json-tmp-file)
                  (with-current-buffer (get-buffer "*xcodebuild*")
                    (let ((inhibit-read-only t))
                      (insert "\nScreenshot comparison finished\n"))
                    (read-only-mode +1))))))))
        (switch-to-buffer-other-window "*xcodebuild*")))
    
    (defun plainorg--snapshot-process-json (result-buffer json)
      "Find all failed snapshot tests in JSON and offer to override
     screenshots, comparing them side to side."
      (let ((hashtable (with-current-buffer (get-buffer-create "*build json*")
                         (erase-buffer)
                         (insert-file-contents json)
                         (json-parse-buffer))))
        (mapc
         (lambda (item)
           (when (equal (gethash "id" item)
                        "SnapshotTests")
             (mapc
              (lambda (testCase)
                (when (and (gethash "failureMessage" testCase)
                           (string-match-p "Snapshot does not match reference"
                                           (gethash "failureMessage" testCase)))
                  (let* ((paths (plainorg--snapshot-screenshot-paths
                                 (gethash "failureMessage" testCase)))
                         (override-result (plainorg--snapshot-override-image
                                           "Expected screenshot"
                                           (nth 0 paths) ;; old
                                           "Actual screenshot"
                                           (nth 1 paths) ;; new
                                           (nth 0 paths))))
                    (when override-result
                      (with-current-buffer result-buffer
                        (let ((inhibit-read-only t))
                          (insert override-result)
                          (insert "\n")))))))
              (gethash "testCases" item))))
         (gethash "classes" (gethash "details" hashtable)))))
    
    (defun plainorg--snapshot-screenshot-paths (failure-message)
      "Extract a paths list from FAILURE-MESSAGE of the form:
    
    failed - Snapshot does not match reference.
    
    @−
    \"/path/to/expected/screenshot.1.png\"
    @+
    \"/path/to/actual/screenshot.1.png\"
    
    Newly-taken snapshot does not match reference.
    "
      (mapcar
       (lambda (line)
         (string-remove-suffix "\""
                               (string-remove-prefix "\"" line)))
       (seq-filter
        (lambda (line)
          (string-prefix-p "\"" line))
        (split-string failure-message "\n"))))
    
    (defun plainorg--snapshot-override-image (old-buffer old new-buffer new destination)
      (let ((window-configuration (current-window-configuration))
            (action)
            (result))
        (unwind-protect
            (progn
              (delete-other-windows)
              (split-window-horizontally)
              (switch-to-buffer (with-current-buffer (get-buffer-create old-buffer)
                                  (let ((inhibit-read-only t))
                                    (erase-buffer))
                                  (insert-file-contents old)
                                  (image-mode)
                                  (current-buffer)))
              (switch-to-buffer-other-window (with-current-buffer (get-buffer-create new-buffer)
                                               (let ((inhibit-read-only t))
                                                 (erase-buffer))
                                               (insert-file-contents new)
                                               (image-mode)
                                               (current-buffer)))
              (while (null result)
                (setq action (read-char-choice (format "Override %s? (y)es (n)o (d)iff in browser? "
                                                       (file-name-base old))
                                               '(?y ?n ?d ?q)))
                (cond ((eq action ?n)
                       (setq result
                             (format "Keeping old %s" (file-name-base old))))
                      ((eq action ?y)
                       (copy-file new old t)
                       (setq result
                             (format "Overriding old %s" (file-name-base old))))
                      ((eq action ?d)
                       (shell-command (format "open -a Firefox %s --args --new-tab" old))
                       (shell-command (format "open -a Firefox %s --args --new-tab" new)))
                      ((eq action ?q)
                       (set-window-configuration window-configuration)
                       (setq result (format "Quit %s" (file-name-base old)))))))
          (set-window-configuration window-configuration)
          (kill-buffer old-buffer)
          (kill-buffer new-buffer))
        result))
    
    ]]>
    Sun, 28 Nov 2021 00:00:00 GMT
    Plain Org has joined the chat (iOS) https://xenodium.com/plain-org-has-joined-the-chat https://xenodium.com/plain-org-has-joined-the-chat The App Store is a crowded space when it come to markdown apps. A quick search yields a wonderful wealth of choice. Kinda overwhelming, but a great problem to have nonetheless.

    For those of us with org as our markup of choice, the App Store is far less crowded. I wish we could fill more than a screen's worth of search results, so you know… I could show you another pretty gif scrolling through org results. For now, we'll settle on a single frame showcasing our 4 org options.

    Beorg, MobileOrg, Flat Habits, and Orgro are all great options. Each with strengths of their own. Organice, while not on the App Store, is another option for those looking for a web alternative. Of these, I had already authored one of them. More on that in a sec… You see, about a year ago I wanted to play with Swift, SPM, and lsp itself. Also, having Swift code completion in Emacs via lsp-sourcekit sounded like a fun thing to try out, so I started using it while writing a Swift org parser.

    While working on the parser, I happened to be reading Atomic Habits (awesome book btw)… It was also a great time to play around with SwiftUI, which by the way, is pretty awesome too. With Atomic Habits fresh in mind, org parser in one hand, and SwiftUI in the other, I built Flat Habits: a lightweight habit tracker powered by org.

    I love being able to save habit data to plain text and easily track on my iPhone (via Flat Habits) or laptop (via Emacs). I wanted to extend similar convenience to org tasks, so I built Plain Org.

    My previous post mentioned quickly adding new tasks and searching existing ones as Plain Org's driving goals. Of course, neither of those are as useful without automatic cloud syncing, so pluging into iOS's third party cloud support was a must-have.

    With these baseline features in place, I started an alpha/beta group via TestFlight. Early Plain Org adopters have been wonderfully supportive, given lots of great feedback, and helped shape the initial feature set you see below.

    There's plenty more that can be supported, but hey let's get v1 out the door. Gotta start somewhere.

    Plain Org v1 features

    • View and edit your org mode tasks while on the go.
    • Beautifully rendered org markup.
    • Sync your org files using your favorite cloud provider.
    • Create new files.
    • Outline-style editing with toolbar
      • Keywords
      • Indent
      • Priority
      • Tags
      • Formatting: bold, italic, underline, strikethrough, verbatim, and code.
    • Add links from Safari via share extension.
    • Add new tasks via Spotlight.
    • Reorder headings via drag/drop.
    • Checkboxes
      • Interactive toggling.
      • Quickly reset multiple checkboxes.
    • Follow local links.
    • Show inline images.
    • File-local keywords and visibility.
    • Filter open/closed tasks.
    • Show/hide stars.
    • Edit raw text.
    • Light/dark mode.

    Plain Org joins the chat

    Today Plain Org joins the likes of Beorg, MobileOrg, Flat Habits, and Orgro on the App Store.


    download-on-app-store.png
    This post was written in org mode.
    ]]>
    Wed, 10 Nov 2021 00:00:00 GMT
    Plain Org for iOS (a month later) https://xenodium.com/plain-org-for-ios-a-month-later https://xenodium.com/plain-org-for-ios-a-month-later A month ago, I posted about my desire to bring org tasks/TODOs to iOS and make them quickly available from my iPhone.

    Since then, I've received some great feedback, which I've been slowly chipping away at. My intent isn't so much to move my org workflow over to iOS, but to supplement Emacs while away from my laptop.

    As of now, this is what the inline edit experience looks like:

    If, like me, you prefer dark mode. The app's got ya covered:

    Plain Org is not yet available on the App Store, but you can get a TestFlight invite if you send me an email address. Ping me on reddit, twitter, or email me at "plainorg" + "@" + "xenodium.com".

    You can also check out progress over at the r/plainorg subreddit.

    ]]>
    Sun, 19 Sep 2021 00:00:00 GMT
    Org habits on iOS? Check! Tasks, you're next https://xenodium.com/org-habits-on-ios-check-tasks-youre-next https://xenodium.com/org-habits-on-ios-check-tasks-youre-next I'm an org mode fan. This blog is powered by org. It's more of an accidental blog that started as a single org file keeping notes. I use org babel too. Oh and org habits. My never-ending list of TODOs is also powered by org. I manage all of this from Emacs and peek at TODOs using org agenda. This all works really well while I'm sitting in front of my laptop running Emacs.

    But then I'm away from my laptop… and I need to quickly record habits on the go. I need it to be low-friction. Ssh'ing to an Emacs instance from a smartphone isn't an option. I'm an iPhone user, so whatever the solution, it should play nice with Emacs and org mode. I built Flat Habits for habit tracking and I'm fairly happy with the result. As of today, my longest-tracked habit is on a 452-day streak.

    Moving on to org tasks/TODOs… I want something fairly frictionless while on the go. With Flat Habits as a stepping stone, I can now reuse some parts to build Plain Org. This new app should give me quick access to my tasks. The two driving goals are: quickly add new tasks and search existing ones while away from my laptop. Ok, maybe basic editing helps too. Oh and it should sync over cloud, of course.

    I now have an early implementation of sorts, available on TestFlight. If you'd like to give it a try, send me an email address to receive the the invite. Ping me on reddit, twitter, or email me at "plainorg" + "@" + "xenodium.com".

    ]]>
    Thu, 19 Aug 2021 00:00:00 GMT
    Flat Habits 1.1 released https://xenodium.com/flat-habits-11-released https://xenodium.com/flat-habits-11-released Flat Habits 1.1 is now available on the App Store. Flat Habits is a habit tracker that’s mindful of your time, data, and privacy. It's powered by org plain text markup, enabling you to use your favorite editor (Emacs, Vim, VSCode, etc.) to poke at your habit data.

    What's new?

    This release implements a few of features requested by users.

    Multiday weekly habits

    This is the chunkiest addition and most requested feature. You can now select multiple days when scheduling weekly habits.

    Historical management

    Sometimes you forget to mark a habit done or make a mistake toggling one. Either way, you can now toggle any habit day from the calendar/streak view.

    Long tap

    Long tap shows you the editing option available for that day.

    Short tap

    Short tap typically toggles between "Done" and "Not done".

    Where's today?

    A few folks rightfully asked for today's date to be highlighted in the calendar view, and so we now have a red circle.

    Improved error messages

    Hopefully you don't run into issues, but if you do, I hope the app helps ya sort them out.

    Bugfixes

    • Tapping on blur now dismisses habit edit dialog.
    • Future habits now longer editable.
    • Skipped habits no longer have a default tap action.
    • Undoing from streak/calendar view now refreshes correctly.
    • Undoing habit addition on iPad removes streak/calendar view.
    ]]>
    Sun, 11 Jul 2021 00:00:00 GMT
    macOS: Show in Finder / Show in Emacs https://xenodium.com/show-in-finder--show-in-emacs https://xenodium.com/show-in-finder--show-in-emacs From Christian Tietze's Open macOS Finder Window in Emacs Dired, I learned about reveal-in-osx-finder. This is handy for the few times I want to transition from Emacs to Finder for file management. I say few times since Emacs's directory editor, dired, is just awesome. I've written about dired customizations here and here, but since dired is just another buffer, you can apply your Emacs magic like multiple cursors to batch rename files in an editable dired buffer.

    To transition from macOS Finder to Emacs, Christian offers an Emacs interactive command that fetches Finder's location and opens a dired buffer via AppleScript. On a similar note, I learned from redditor u/pndc that Finder's proxy icons can be dragged over to Emacs, which handily drops ya into a dired buffer.

    With these two solutions in mind, I looked into a third one to offer a context menu option in Finder to show the file in Emacs. This turned out to be fairly easy using Automator, which I've rarely used.

    I created a flow that runs a shell script to "Show in Emacs", revealing the selected file or folder in an dired buffer. This is similar to Christian's solution, but invoked from Finder itself. The flow also uses dired-goto-file which moves the point (cursor) to the file listed under dired.

    current_dir=$(dirname "$1")
    osascript -e 'tell application "Emacs" to activate'
    path/to/emacsclient --eval "(progn (dired \"$current_dir\") (dired-goto-file \"$1\"))"
    

    As a bonus, I added an "Open in Emacs" option, which does as it says on the tin. Rather than show the file listed in a dired buffer, it gets Emacs to open it in your favorite major mode. This option is not technically needed since Finder already provides an "Open With" context menu, but it does remove a few click here and there.

    osascript -e 'tell application "Emacs" to activate'
    /Users/alvaro/homebrew/bin/emacsclient --eval "(find-file \"$1\")"
    

    On a side note, Emacs defaults to creating new frames when opening files via "Open With" menu (or "open -a Emacs foo.txt"). I prefer to use my existing Emacs frame, which can be accomplished by setting ns-pop-up-frames to nil.

    (setq ns-pop-up-frames nil)
    
    ]]>
    Sun, 11 Jul 2021 00:00:00 GMT
    Emacs: smarter search and replace https://xenodium.com/emacs-smarter-search-and-replace https://xenodium.com/emacs-smarter-search-and-replace

    Not long ago, I made a note to go back and read Mac for Translators's Emacs regex with Emacs lisp post. The author highlights Emacs's ability to apply additional logic when replacing text during a search-and-replace session. It does so by leveraging elisp expressions.

    Coincidentally, a redditor recently asked What is the simplest way to apply a math formula to all numbers in a buffer/region? Some of the answers also point to search and replace leveraging elisp expressions.

    While I rarely need to apply additional logic when replacing matches, it's nice to know we have options available in our Emacs toolbox. This prompted me to check out replace-regexp's documentation (via M-x describe-function or my favorite M-x helpful-callable). There's lots in there. Go check its docs out. You may be pleasantly surprised by all the features packed under this humble function.

    For instance, \& expands to the current match. Similarly, \#& expands to the current match, fed through string-to-number. But what if you'd like to feed the match to another function? You can use \, to signal evaluation of an elisp expression. In other words, you could multiply by 3 using \,(* 3 \#&) or inserting whether a number is odd or even with something like \,(if (oddp \#&) "(odd)" "(even)").

    Take the following text:

    1
    2
    3
    4
    5
    6
    

    We can label each value "(odd)" or "(even)" as well as multiply by 3, by invoking replace-regexp as follows:

    M-x replace-regexp

    [PCRE] Replace regex:

    [-0-9.]+

    Replace regex [-0-9.]+:

    \& \,(if (oddp \#&) "(odd)" "(even)") x 3 = \,(* 3 \#&)

    1 (odd) x 3 = 3
    2 (even) x 3 = 6
    3 (odd) x 3 = 9
    4 (even) x 3 = 12
    5 (odd) x 3 = 15
    6 (even) x 3 = 18
    

    It's worth noting that replace-regexp's cousin query-replace-regexp also handles all this wonderful magic.

    Happy searching and replacing!

    ]]>
    Sun, 27 Jun 2021 00:00:00 GMT
    Previewing SwiftUI layouts in Emacs (revisited) https://xenodium.com/previewing-swiftui-layouts-in-emacs-revisited https://xenodium.com/previewing-swiftui-layouts-in-emacs-revisited Back in May 2020, I shared a snippet to extend ob-swift to preview SwiftUI layouts using Emacs org blocks.

    When I say extend, I didn't quite modify ob-swift itself, but rather advised org-babel-execute:swift to modify its behavior at runtime.

    Fast-forward to June 2021 and Scott Nicholes reminded me there's still interest in org babel SwiftUI support. ob-swift seems a little inactive, but no worries there. The package offers great general-purpose Swift support. On the other hand, SwiftUI previews can likely live as a single-purpose package all on its own… and so I set off to bundle the rendering functionality into a new ob-swiftui package.

    Luckily, org babel's documentation has a straightforward section to help you develop support for new babel languages. They simplified things by offering template.el, which serves as the foundation for your language implementation. For the most part, it's a matter of searching, replacing strings, and removing the bits you don't need.

    The elisp core of ob-swiftui is fairly simple. It expands the org block body, inserts the expanded body into a temporary buffer, and finally feeds the code to the Swift toolchain for execution.

    (defun org-babel-execute:swiftui (body params)
      "Execute a block of SwiftUI code in BODY with org-babel header PARAMS.
    This function is called by `org-babel-execute-src-block'"
      (message "executing SwiftUI source code block")
      (with-temp-buffer
        (insert (ob-swiftui--expand-body body params))
        (shell-command-on-region
         (point-min)
         (point-max)
         "swift -" nil 't)
        (buffer-string)))
    

    The expansion in ob-swiftui–expand-body is a little more interesting. It decorates the block's body, so it can become a fully functional and stand-alone SwiftUI macOS app. If you're familiar with Swift and SwiftUI, the code should be fairly self-explanatory.

    From an org babel's perspective, the expanded code is executed whenever we press C-c C-c (or M-x org-ctrl-c-ctrl-c) within the block itself.

    It's worthing mentioning that our new implementation supports two babel header arguments (results and view). Both extracted from params using map-elt and replaced in the expanded Swift code to enable/disable snapshotting or explicitly setting a SwiftUI root view.

    (defun ob-swiftui--expand-body (body params)
      "Expand BODY according to PARAMS and PROCESSED-PARAMS, return the expanded body."
      (let ((write-to-file (member "file" (map-elt params :result-params)))
            (root-view (when (and (map-elt params :view)
                                  (not (string-equal (map-elt params :view) "none")))
                         (map-elt params :view))))
        (format
         "
    // Swift snippet heavily based on Chris Eidhof's code at:
    // https://gist.github.com/chriseidhof/26768f0b63fa3cdf8b46821e099df5ff
    
    import Cocoa
    import SwiftUI
    import Foundation
    
    let screenshotURL = URL(fileURLWithPath: NSTemporaryDirectory(), isDirectory: true).appendingPathComponent(ProcessInfo.processInfo.globallyUniqueString + \".png\")
    let preview = %s
    
    // Body to run.
    %s
    
    extension NSApplication {
      public func run<V: View>(_ view: V) {
        let appDelegate = AppDelegate(view)
        NSApp.setActivationPolicy(.regular)
        mainMenu = customMenu
        delegate = appDelegate
        run()
      }
    
      public func run<V: View>(@ViewBuilder view: () -> V) {
        let appDelegate = AppDelegate(view())
        NSApp.setActivationPolicy(.regular)
        mainMenu = customMenu
        delegate = appDelegate
        run()
      }
    }
    
    extension NSApplication {
      var customMenu: NSMenu {
        let appMenu = NSMenuItem()
        appMenu.submenu = NSMenu()
    
        let quitItem = NSMenuItem(
          title: \"Quit \(ProcessInfo.processInfo.processName)\",
          action: #selector(NSApplication.terminate(_:)), keyEquivalent: \"q\")
        quitItem.keyEquivalentModifierMask = []
        appMenu.submenu?.addItem(quitItem)
    
        let mainMenu = NSMenu(title: \"Main Menu\")
        mainMenu.addItem(appMenu)
        return mainMenu
      }
    }
    
    class AppDelegate<V: View>: NSObject, NSApplicationDelegate, NSWindowDelegate {
      var window = NSWindow(
        contentRect: NSRect(x: 0, y: 0, width: 414 * 0.2, height: 896 * 0.2),
        styleMask: [.titled, .closable, .miniaturizable, .resizable, .fullSizeContentView],
        backing: .buffered, defer: false)
    
      var contentView: V
    
      init(_ contentView: V) {
        self.contentView = contentView
      }
    
      func applicationDidFinishLaunching(_ notification: Notification) {
        window.delegate = self
        window.center()
        window.contentView = NSHostingView(rootView: contentView)
        window.makeKeyAndOrderFront(nil)
    
        if preview {
          screenshot(view: window.contentView!, saveTo: screenshotURL)
          // Write path (without newline) so org babel can parse it.
          print(screenshotURL.path, terminator: \"\")
          NSApplication.shared.terminate(self)
          return
        }
    
        window.title = \"press q to exit\"
        window.setFrameAutosaveName(\"Main Window\")
        NSApp.activate(ignoringOtherApps: true)
      }
    }
    
    func screenshot(view: NSView, saveTo fileURL: URL) {
      let rep = view.bitmapImageRepForCachingDisplay(in: view.bounds)!
      view.cacheDisplay(in: view.bounds, to: rep)
      let pngData = rep.representation(using: .png, properties: [:])
      try! pngData?.write(to: fileURL)
    }
    
    // Additional view definitions.
    %s
    "
         (if write-to-file
             "true"
           "false")
         (if root-view
             (format "NSApplication.shared.run(%s())" root-view)
           (format "NSApplication.shared.run {%s}" body))
         (if root-view
             body
           ""))))
    

    For rendering inline SwiftUI previews in Emacs, we rely on NSView's bitmapImageRepForCachingDisplay to capture an image snapshot. We write its output to a temporary file and piggyback-ride off org babel's :results file header argument to automatically render the image inline.

    Here's ob-swiftui inline rendering in action:

    When rendering SwiftUI externally, we're effectively running and interacting with the generated macOS app itself.

    The two snippets give a general sense of what's needed to enable org babel to handle SwiftUI source blocks. Having said that, the full source and setup instructions are both available on github.

    ob-swiftui is now available on melpa.

    ]]>
    Sun, 20 Jun 2021 00:00:00 GMT
    Blurring the lines between shell and editor https://xenodium.com/yasnippet-in-emacs-eshell https://xenodium.com/yasnippet-in-emacs-eshell

    I recently tweeted that Vivek Haldar's 10-year old post rings true today just the same. He writes about the levels of Emacs proficiency. All 6 levels are insightful in their own right, but for the sake of this post, let's quote an extract from level 4. Shell inside Emacs:

    "And then, you learned about it: M-x shell.

    It was all just text. Why did you need another application for it? Why should only the shell prompt be editable? Why can’t I move my cursor up a few lines to where the last command spewed out its results? All these problems simply disappear when your shell (or shells) simply becomes another Emacs buffer, upon which all of the text manipulation power of Emacs can be brought to bear."

    In other words, we aren't merely removing shell restrictions, but opening up possibilities…

    Take Emacs eshell looping, for example. I use it so infrequently, I could never remember eshell's syntax. I would refer back to EmacsWiki's Eshell For Loop or Mastering Emacs's Mastering Eshell comments for a reminder. It finally dawned on me. I don't need to internalize this eshell syntax. I have YASnippet available like any other buffer. I could just type "for" and let YASnippet do the rest for me.

    All I need is a tiny YASnippet:

    #name : Eshell for loop
    #key : for
    # --
    for f in ${1:*} { ${2:echo} "$f"; $3} $0
    

    Want a gentle and succinct YASnippet intro? Check out Jake's YASnippet introduction video.

    If you're a shell-mode user, YASnippet would have you covered in your favorite shell. The expansion snippet can be modified to a Bash equivalent, giving us the same benefit. We type "for" and let YASnippet expand and hop over arguments. Here's a Bash equivalent emphasizing the hopping a little more:

    #name : bash for loop
    #key : for
    # --
    for f in ${1:*}; do ${2:echo} $f; done $0
    

    ps. Looks like vterm, term, or ansi-term work too. See Shane Mulligan's post: Use YASnippets in term and vterm in emacs.

    ]]>
    Sat, 19 Jun 2021 00:00:00 GMT
    xcodebuild's SPM support (Xcode 11) https://xenodium.com/xcodebuilds-spm-support-xcode-11 https://xenodium.com/xcodebuilds-spm-support-xcode-11 Had been a while since I looked into generating Xcode projects from a Swift package. On my latest use of the generate-xcodeproj subcommand, I was greeted by a nice warning surprise…

    swift package generate-xcodeproj
    

    Xcode can handle Swift packages directly. Similarly, xcodebuild can handle them too. This isn't new. It's likely been available since Xcode 11. I just totally missed it.

    Note: I've yet to dig into Xcode 13 beta, as Swift packages may already support the build/test features I was after in xcodebuild (like build/test on Catalyst).

    In any case, on to xcodebuild… but let's first create a brand new Swift package.

    Creating a Swift package library

    mkdir FooBar && cd FooBar
    swift package init --type library
    

    List package schemes

    We can use xcodebuild to list the available schemes.

    xcodebuild -list
    

    Show supported platform, architecture, etc

    Similarly, we can list destinations supported for the schemes.

    xcodebuild -showdestinations -scheme FooBar
    

    macOS builds

    Let's build for macOS, though let's first import UIKit into FooBar.swift. This ensures we get an expected failure when building for macOS.

    import UIKit
    
    struct FooBar {
      var text = "Hello, World!"
    }
    

    Now let's attempt to build it…

    xcodebuild build -quiet -scheme FooBar -destination 'platform=macOS'
    

    The failure expected as UIKit isn't available on your typical macOS builds.

    macOS Catalyst builds

    We do, however, have Catalyst available, so we can use its variant to build for macOS with UIKit support, and.. voilà!

    xcodebuild build -quiet -scheme FooBar -destination 'platform=macOS,variant=Mac Catalyst' && echo \\o/
    
    ]]>
    Wed, 16 Jun 2021 00:00:00 GMT
    Emacs org block completion on melpa https://xenodium.com/emacs-org-block-completion-on-melpa https://xenodium.com/emacs-org-block-completion-on-melpa When enabled, the character "<" triggers company completion of org blocks.

    I get the occasional ping to package the code from this post and publish it on melpa. Finally gave it a go. Moved the code here.

    This was my first time publishing on melpa. The process was very smooth. Big thanks to melpa volunteers!

    ]]>
    Sun, 06 Jun 2021 00:00:00 GMT
    Emacs DWIM: do what ✨I✨ mean https://xenodium.com/emacs-dwim-do-what-i-mean https://xenodium.com/emacs-dwim-do-what-i-mean Update: There's a DWIM follow-up for searching.

    I was a rather puzzled the first time I spotted DWIM in an Emacs interactive command name. Don't think I remember what the command itself was, but what's important here is that DWIM stands for do what I mean.

    I love DWIM interactive commands. They enable commands to be smarter and thus pack more functionality, without incurring the typical cognitive overhead associated with remembering multiple commands (or key bindings). The Emacs manual does a great job describing DWIM for the comment-dwim command:

    The word “dwim” is an acronym for “Do What I Mean”; it indicates that this command can be used for many different jobs relating to comments, depending on the situation where you use it.
    

    It's really great to find built-in DWIM-powered Emacs commands. Third-party packages often include them too. I typically gravitate towards these commands and bind them in my Emacs config. Examples being upcase-dwim, downcase-dwim, or mc/mark-all-dwim.

    But what if the DWIM command doesn't exist or the author has written a command for what they mean? This is your editor, so you can make it do what you mean.

    Take for example, org-insert-link, bound to C-c C-l by default. It's handy for inserting org mode links. I used it so frequently that I quickly internalized its key binding. Having said that, I often found myself doing some lightweight preprocessing prior to invoking org-insert-link. What if I can make org-insert-link do what I mean?

    What do I mean?

    Use URLs when in clipboard

    If the URL is already in the clipboard, don't ask me for it. Just use it.

    Use the region too

    If I have a region selected and there's a URL in the clipboard, just sort it out without user interaction.

    Automatically fetch titles

    Automatically fetch URL titles from their HTML tag, but ask me for tweaks before insertion.

    Fallback to org-insert-link

    If my DWIM rules don't apply, fall back to using good ol' org-insert-link.

    My most common use case here is when editing an existing link where I don't want neither its title nor URL automatically handled.

    The code

    This is your own DWIM command that does what you mean. Strive to write a clean implementation, but hey you can be forgiven for not handling all the cases that other folks may want or inlining more code than usual. The goal is to bend your editor a little, not write an Emacs package.

    (defun ar/org-insert-link-dwim ()
      "Like `org-insert-link' but with personal dwim preferences."
      (interactive)
      (let* ((point-in-link (org-in-regexp org-link-any-re 1))
             (clipboard-url (when (string-match-p "^http" (current-kill 0))
                              (current-kill 0)))
             (region-content (when (region-active-p)
                               (buffer-substring-no-properties (region-beginning)
                                                               (region-end)))))
        (cond ((and region-content clipboard-url (not point-in-link))
               (delete-region (region-beginning) (region-end))
               (insert (org-make-link-string clipboard-url region-content)))
              ((and clipboard-url (not point-in-link))
               (insert (org-make-link-string
                        clipboard-url
                        (read-string "title: "
                                     (with-current-buffer (url-retrieve-synchronously clipboard-url)
                                       (dom-text (car
                                                  (dom-by-tag (libxml-parse-html-region
                                                               (point-min)
                                                               (point-max))
                                                              'title))))))))
              (t
               (call-interactively 'org-insert-link)))))
    

    Org web tools package

    I showed how to write your own DWIM command, so you can make Emacs do what ✨you✨ mean. ar/org-insert-link-dwim was built for my particular needs.

    Having said all of this, alphapapa has built a great package with helpers for the org web/link space. It doesn't do what I mean (for now anyway), but it may work for you: org-web-tools: View, capture, and archive Web pages in Org-mode[^2].

    ]]>
    Tue, 01 Jun 2021 00:00:00 GMT
    Emacs link scraping (2021 edition) https://xenodium.com/emacs-link-scraping-2021-edition https://xenodium.com/emacs-link-scraping-2021-edition

    A recent Hacker News post, Ask HN: Favorite Blogs by Individuals, led me to dust off my oldie but trusty command to extract comment links. I use it to dissect these wonderful references more effectively.

    You see, I wrote this command back in 2015. We can likely revisit and improve. The enlive package continues to do a fine job fetching, parsing, and querying HTML. Let's improve my code instead… we can shed a few redundant bits and maybe use newer libraries and features.

    Most importantly, let's improve the user experience by sanitizing and filtering URLs a little better.

    We start by writing a function that looks for a URL in the clipboard and subsequently fetches, parses, and extracts all links found in the target page.

    (require 'enlive)
    (require 'seq)
    
    (defun ar/scrape-links-from-clipboard-url ()
      "Scrape links from clipboard URL and return as a list. Fails if no URL in clipboard."
      (unless (string-prefix-p "http" (current-kill 0))
        (user-error "no URL in clipboard"))
      (thread-last (enlive-query-all (enlive-fetch (current-kill 0)) [a])
        (mapcar (lambda (element)
                  (string-remove-suffix "/" (enlive-attr element 'href))))
        (seq-filter (lambda (link)
                      (string-prefix-p "http" link)))
        (seq-uniq)
        (seq-sort (lambda (l1 l2)
                    (string-lessp (replace-regexp-in-string "^http\\(s\\)*://" "" l1)
                                  (replace-regexp-in-string "^http\\(s\\)*://" "" l2))))))
    

    Let's chat (current-kill 0) for a sec. No improvement from my previous usage, but let's just say building interactive commands that work with your current clipboard (or kill ring in Emacs terminology) is super handy (see clone git repo from clipboard).

    Moving on to sanitizing and filtering URLs… Links often have trailing slashes. Let's flush them. string-remove-suffix to the rescue. This and other handy string-manipulating functions are built into Emacs since 24.4 as part of subr-x.el.

    Next, we can keep http(s) links and ditch everything else. The end-goal is to extract links posted by users, so these are typically fully qualified external URLs. seq-filter steps up to the task, included in Emacs since 25.1 as part of the seq.el family. We remove duplicate links using seq-uniq and sort them via seq-sort. All part of the same package.

    When sorting, we could straight up use seq-sort and string-lessp and nothing else, but it would separate http and https links. Let's not do that, so we drop http(s) prior to comparing strings in seq-sort's predicate. replace-regexp-in-string does the job here, but if you'd like to skip regular expressions, string-remove-prefix works just as well.

    Yay, sorting no longer cares about http vs https:

    https://andymatuschak.org
    http://antirez.com
    https://apenwarr.ca/log
    ...
    

    With all that in mind, let's flatten list processing using thread-last. This isn't strictly necessary, but since this is the 2021 edition, we'll throw in this macro added to Emacs in 2016 as part of 25.1. Arthur Malabarba has a great post on thread-last.

    Now that we've built out ar/scrape-links-from-clipboard-url function, let's make its content consumable!

    The completing frameworks way

    This is the 2021 edition, so power up your completion framework du jour and feed the output of ar/scrape-links-from-clipboard-url to our completion robots…

    I'm heavily vested in ivy, but since we're using the built-in completing-read function, any completion framework like vertico, selectrum, helm, or ido should kick right in to give you extra powers.

    (defun ar/view-completing-links-at-clipboard-url ()
      "Scrape links from clipboard URL and open all in external browser."
      (interactive)
      (browse-url (completing-read "links: "
                                   (ar/scrape-links-from-clipboard-url))))
    

    The auto-open way (use with caution)

    Sometimes you just want to open every link posted in the comments and use your browser to discard, closing tabs as needed. The recent HN news instance wasn't one of these cases, with a whopping 398 links returned by our ar/scrape-links-from-clipboard-url.

    Note: I capped the results to 5 in this gif/demo to prevent a Firefox tragedy (see seq-take).

    In a case like Hacker News's, we don't want to surprise-attack the user and bomb their browser by opening a gazillion tabs, so let's give a little heads-up using y-or-n-p.

    (defun ar/browse-links-at-clipboard-url ()
      (interactive)
      (let ((links (ar/scrape-links-from-clipboard-url)))
        (when (y-or-n-p (format "Open all %d links? " (length links)))
          (mapc (lambda (link)
                  (browse-url link))
                links))))
    

    The org way

    My 2015 solution leveraged an org mode buffer to dump the fetched links. The org way is still my favorite. You can use whatever existing Emacs super powers you already have on top of the org buffer, including searching and filtering fueled by your favourite completion framework. I'm a fan of Oleh's swiper.

    The 2021 implementation is mostly a tidy-up, removing some cruft, but also uses our new ar/scrape-links-from-clipboard-url function to filter and sort accordingly.

    (require 'org)
    
    (defun ar/view-links-at-clipboard-url ()
      "Scrape links from clipboard URL and dump to an org buffer."
      (interactive)
      (with-current-buffer (get-buffer-create "*links*")
        (org-mode)
        (erase-buffer)
        (mapc (lambda (link)
                (insert (org-make-link-string link) "\n"))
              (ar/scrape-links-from-clipboard-url))
        (goto-char (point-min))
        (switch-to-buffer (current-buffer))))
    

    Emacs + community + packages + your own glue = awesome

    To power our 2021 link scraper, we've used newer libraries included in more recent versions of Emacs, leveraged an older but solid HTML-parsing package, pulled in org mode (the epicenter of Emacs note-taking), dragged in our favorite completion framework, and tickled our handy browser all by smothering the lot with some elisp glue to make Emacs do exactly what we want. Emacs does rock.

    ]]>
    Fri, 28 May 2021 00:00:00 GMT
    OCR bookmarks https://xenodium.com/ocr-bookmarks https://xenodium.com/ocr-bookmarks
  • schappim/macOCR: Get any text on your screen into your clipboard..
  • ]]>
    Sun, 23 May 2021 00:00:00 GMT
    gpg: decryption failed: No secret key (macOS) https://xenodium.com/gpg-decryption-failed-no-secret-key-macos https://xenodium.com/gpg-decryption-failed-no-secret-key-macos gpg: decryption failed: No secret key

    OMG! Where's my secret key gone!?

    But but but, gpg –list-secret-keys says they're there. Puzzled…

    Ray Oei's Stack Overflow answer solved the mystery for me: pinentry never got invoked, so likely something's up with the agent… Killing (and thus restaring) the gpg-agent did the trick:

    gpgconf --kill gpg-agent
    

    Thank you internet stranger. Balance restored.

    ]]>
    Wed, 19 May 2021 00:00:00 GMT
    Emacs plus –with-native-comp https://xenodium.com/emacs-plus-with-native-comp https://xenodium.com/emacs-plus-with-native-comp

    I'm a big fan of Boris Buliga's Emacs Plus homebrew recipe for customizing and installing Emacs builds on macOS.

    For a little while, I took a detour and built Emacs myself, so I could enable Andrea Corallo's fantastic native compilation. I documented the steps here. Though it was fairly straightforward, I did miss Emacs Plus's convenience.

    I had been meaning to check back on Emacs Plus for native compilation support. Turns out, it was merged back in Dec 2020, and it works great!

    Enabling native compilation is simple (just use –with-native-comp). As a bonus, you get all the Emacs Plus goodies. I'm loving –with-elrumo2-icon, enabling a spiffy icon to go with macOS Big Sur. –with-no-frame-refocus is also handy to avoid refocusing other frames when another one is closed.

    In any case, here's the minimum needed to install Emacs Plus with native compilation support enabled:

    brew tap d12frosted/emacs-plus
    brew install emacs-plus@28 --with-native-comp
    

    Sit tight. Homebrew will build and install some chunky dependencies (including gcc and libgccjit).

    Note: Your init.el needs tweaking to take advantage of native compilation. See my previous post for how I set mine, or go straight to my config.

    ]]>
    Mon, 17 May 2021 00:00:00 GMT
    Cycling window layouts with hammerspoon https://xenodium.com/cycling-window-layouts-via-hammerspoon https://xenodium.com/cycling-window-layouts-via-hammerspoon Back in January, Patrik Collison tweeted about Rectangle's Todo mode. Rectangle looks great. Although I've not yet adopted it, Todo mode really resonates with me. I've been achieving similar functionality with hammerspoon.

    Here's a quick and dirty function to cycle through my window layouts:

    function reframeFocusedWindow()
       local win = hs.window.focusedWindow()
       local maximizedFrame = win:screen():frame()
       maximizedFrame.x = maximizedFrame.x + 15
       maximizedFrame.y = maximizedFrame.y + 15
       maximizedFrame.w = maximizedFrame.w - 30
       maximizedFrame.h = maximizedFrame.h - 30
    
       local leftFrame = win:screen():frame()
       leftFrame.x = leftFrame.x + 15
       leftFrame.y = leftFrame.y + 15
       leftFrame.w = leftFrame.w - 250
       leftFrame.h = leftFrame.h - 30
    
       local rightFrame = win:screen():frame()
       rightFrame.x = rightFrame.w - 250 + 15
       rightFrame.y = rightFrame.y + 15
       rightFrame.w = 250 - 15 - 15
       rightFrame.h = rightFrame.h - 30
    
       -- Make space on right
       if win:frame() == maximizedFrame then
         win:setFrame(leftFrame)
         return
       end
    
       -- Make space on left
       if win:frame() == leftFrame then
         win:setFrame(rightFrame)
         return
       end
    
       win:setFrame(maximizedFrame)
    end
    

    A here's my ⌥-F binding to reframeFocusedWindow:

    hs.hotkey.bind({"alt"}, "F", reframeFocusedWindow)
    
    ]]>
    Sun, 02 May 2021 00:00:00 GMT
    Flat Habits meets org agenda https://xenodium.com/flat-habits-meets-org-agenda https://xenodium.com/flat-habits-meets-org-agenda UPDATE: Flat Habits now has its own page at flathabits.com.

    Flat Habits v1.0.2 is out today, with habit-toggling now supported from the streak view.

    Flat Habits runs on org, making it a great complement to Emacs and org agenda ø/

    today_no_filter.png
    ]]>
    Sat, 10 Apr 2021 00:00:00 GMT
    Flat Habits v1.0.1 (org import menu) https://xenodium.com/flat-habits-v101-org-import-menu https://xenodium.com/flat-habits-v101-org-import-menu UPDATE: Flat Habits now has its own page at flathabits.com.

    Flat Habits v1.0.1 is now released and available in the App Store.

    org import (import vs in-place)

    We can now import org files from the menu. Importing gives ya the option to either import (copy into the app) or open in-place. The latter enables users to sync org files with other iOS apps or just open/edit from Emacs for the full org-mode/agenda experience.

    today_no_filter.png today_no_filter.png

    Syncing with your desktop can be achieved by either iCloud or by enabling other providers in the Files app (after installing the likes of Google Drive, Dropbox, etc).

    Please note that importing (copying into the app) is currently the recommended flow. Opening in-place and syncing is still fairly experimental, so please back up your org files regularly. If you do run into syncing issues, please get in touch.

    Good luck with your habits!

    ]]>
    Tue, 23 Mar 2021 00:00:00 GMT
    Flat Habits for iOS (powered by org) https://xenodium.com/flat-habits-for-ios-powered-by-org https://xenodium.com/flat-habits-for-ios-powered-by-org UPDATE: Flat Habits now has its own page at flathabits.com.

    No friction. No social. No analytics. No account. No cloud. No lock-in.

    So what is it?

    An iOS app to help you form and track lasting habits.

    today_no_filter.png today_no_filter.png today_no_filter.png

    Why an app?

    Tracking and accountability may help you develop positive habits. A simple habit-tracking app should make this easy. I'm not a habits expert, but got inspired by James Clear's Atomic Habits. Read that book if you're interested in the topic.

    I wanted a frictionless habit tracker that gets out of the way, so I built one to my taste.

    Sounds like a lot of work?

    You mean habit tracking? It's not. I tried to make the app simple and focused. Mark a habit done whenever you do it. It's really encouraging to see your daily streaks grow. I really don't want to break them.

    What kind of habits?

    Any recurring habit you'd like to form like exercise, water the plants, read, make your bed, recycle, call grandma, yoga, cleaning, drink water, meditate, take a nap, make your lunch, journal, laundry, push-ups, sort out the dryer filter, floz, take your vitamins, take your meds, eat salad, eat fruit, practice a language, practice an instrument, go to bed early…

    So it's like a task/todo app?

    Nope. This app focuses solely on habits. Unlike todos/tasks, habits must happen regularly. If you don't water the plants, they will die. If you don't exercise regularly, you won't get the health benefits. Keep your habits separate from that long list of todos. You know, that panic-inducing list you're too afraid to look at.

    Where is my data stored?

    On your iPhone as a plain text file (in org mode format). You can view, edit, or migrate your data at any time (use export from the menu). You may also save it to a shared location, so you can access it from multiple devices/apps. Some of us like to use our beloved text editors (Emacs, Vim, VSCode, etc.) to poke at habits.

    Got more questions?

    I may not have the answer, but I can try. Ping me at flathabits*at*xenodium.com.

    Privacy policy

    No personal data is sent to any server, as there is no server component to this app. There are neither third party integrations, accounts, analytics, nor trackers in this app. All your data is kept on your iPhone, unless you choose a cloud provider to sync or store your data. See your cloud provider's privacy policy for details on how they may handle it.

    If you choose to send feedback by email, you have the option to review and attach logs to help diagnose issues. If you'd like an email thread to be deleted, just ask.

    To join TestFlight as a beta tester, you likely gave your email address. If you'd like your email removed, just ask. Note that TestFlight has its own Terms Of Service.

    ]]>
    Wed, 17 Mar 2021 00:00:00 GMT
    Frictionless org habits on iOS https://xenodium.com/frictionless-org-habits-on-ios https://xenodium.com/frictionless-org-habits-on-ios UPDATE: Flat Habits now has its own page at flathabits.com.

    I've been wanting org to keep track of my daily habits for a little while. The catalyst: reading James Clear's wonderful Atomic Habits (along with plenty of lock-down inspiration).

    As much as I live in Emacs and org mode, it just wasn't practical enough to rely on my laptop for tracking habits. I wanted less friction, so I've been experimenting with building a toy app for my needs. Naturally, org support was a strict requirement, so I could always poke at it from my beloved editor.

    I've been using the app every day with success. The habits seem to be sticking, but equally important, it's been really fun to join the fabulous world of Emacs/Org with iOS/SwiftUI.

    This is all very experimental[^3] and as mentioned on reddit (follow-up here) and twitter, the app isn't available on the App Store. I may consider publishing if there's enough interest, but in the mean time, you can reach out and install via TestFlight.

    Send me an email address to flathabits*at*xenodium.com for a TestFlight invite.

    2021-03-12 Update: Now with iOS Files app/sync integration

    If you can sync your org file with your iPhone (ie. Drive/Dropbox/iCloud), and list it in the Files app, you should be able to open/edit[^4] with Flat Habits (that's the name now). With iOS Files integration, you should be able to sync your habits between your iPhone and your funky editor powering org mode[^5].

    ]]>
    Sun, 21 Feb 2021 00:00:00 GMT
    Symbolicating iOS crashes https://xenodium.com/symbolicating-ios-crashes https://xenodium.com/symbolicating-ios-crashes export DEVELOPER_DIR=$(xcode-select --print-path) /Applications/Xcode.app/Contents/SharedFrameworks/DVTFoundation.framework/Versions/A/Resources/symbolicatecrash crashlog.crash MyFoo.app.dSYM ]]> Sat, 20 Feb 2021 00:00:00 GMT Emacs: mu4e icons https://xenodium.com/mu4e-icons https://xenodium.com/mu4e-icons Recently spotted mu4e-marker-icons, which adds mu4e icons using all-the-icons.

    Although I'm not currently using all-the-icons, it did remind me to take a look at mu4e's built-in variables to spiff up my email. It's pretty simple. Find the icons you like and set them as follows:

    (setq mu4e-headers-unread-mark    '("u" . "📩 "))
    (setq mu4e-headers-draft-mark     '("D" . "🚧 "))
    (setq mu4e-headers-flagged-mark   '("F" . "🚩 "))
    (setq mu4e-headers-new-mark       '("N" . "✨ "))
    (setq mu4e-headers-passed-mark    '("P" . "↪ "))
    (setq mu4e-headers-replied-mark   '("R" . "↩ "))
    (setq mu4e-headers-seen-mark      '("S" . " "))
    (setq mu4e-headers-trashed-mark   '("T" . "🗑️"))
    (setq mu4e-headers-attach-mark    '("a" . "📎 "))
    (setq mu4e-headers-encrypted-mark '("x" . "🔑 "))
    (setq mu4e-headers-signed-mark    '("s" . "🖊 "))
    
    ]]>
    Sat, 23 Jan 2021 00:00:00 GMT
    Luxembourg travel bookmarks https://xenodium.com/luxembourg-travel-bookmarks https://xenodium.com/luxembourg-travel-bookmarks
  • Hiking in Luxembourg - Mullerthal Trail.
  • ]]>
    Sat, 02 Jan 2021 00:00:00 GMT
    South Africa travel bookmarks https://xenodium.com/south-africa-travel-bookmarks https://xenodium.com/south-africa-travel-bookmarks
  • Blyde River Canyon, South Africa: The Complete Guide.
  • ]]>
    Sat, 02 Jan 2021 00:00:00 GMT
    Swift package code coverage (plus Emacs overlay) https://xenodium.com/swift-package-code-coverage https://xenodium.com/swift-package-code-coverage While playing around with Swift package manager, I had a quick look into code coverage options. Luckily, coverage reporting and exporting are supported out of the box (via llvm-cov).

    Ensure tests are invoked as follows:

    swift test --enable-code-coverage
    

    A high level report can be generated with:

    xcrun llvm-cov report .build/x86_64-apple-macosx/debug/FooPackageTests.xctest/Contents/MacOS/FooPackageTests \
          -instr-profile=.build/x86_64-apple-macosx/debug/codecov/default.profdata -ignore-filename-regex=".build|Tests"
    

    llvm-cov can export as lcov format:

    xcrun llvm-cov export -format="lcov" .build/x86_64-apple-macosx/debug/FooPackageTests.xctest/Contents/MacOS/FooPackageTests -instr-profile=.build/x86_64-apple-macosx/debug/codecov/default.profdata -ignore-filename-regex=".build|Tests" > coverage.lcov
    

    With the report in lcov format, we can look for an Emacs package to visualize coverage in source files. Found coverlay.el to require minimal setup. I was interested in highlighting only untested areas, so I set tested-line-background-color to nil:

    (use-package coverlay
      :ensure t
      :config
      (setq coverlay:tested-line-background-color nil))
    

    After installing coverlay, I enabled the minor mode via M-x coverlay-minor-mode, invoked M-x coverlay-watch-file to watch coverage.lcov for changes, and voilà!

    ]]>
    Tue, 29 Dec 2020 00:00:00 GMT
    Hiking bookmarks https://xenodium.com/hiking-bookmarks https://xenodium.com/hiking-bookmarks
  • A growing list of long distance hikes around the world (Hacker News).
  • ]]>
    Tue, 29 Dec 2020 00:00:00 GMT
    Patience https://xenodium.com/patience https://xenodium.com/patience Via Orange Book, a reminder to myself:

    • In investing, patience is rewarded.
    • In growing a talent, patience is rewarded.
    • In building a business, patience is rewarded.
    • In love and friendships, patience is rewarded.
    • Patience = success

    I feel like there's an Emacs lesson somewhere in there…

    ]]>
    Mon, 28 Dec 2020 00:00:00 GMT
    Chess bookmarks https://xenodium.com/chess-bookmarks https://xenodium.com/chess-bookmarks
  • A Beginner's Garden of Chess Openings.
  • A Beginner's Garden of Chess Openings (2002) (Hacker News).
  • ]]>
    Sat, 26 Dec 2020 00:00:00 GMT
    40 Coolest neighbourhoods in the world https://xenodium.com/40-coolest-neighborhoods-in-the-world https://xenodium.com/40-coolest-neighborhoods-in-the-world Via TimeOut's 40 Coolest Neighbourhoods in the World Right Now:

    1. Esquerra de l’Eixample, Barcelona
    2. Downtown, Los Angeles
    3. Sham Shui Po, Hong Kong
    4. Bedford-Stuyvesant, New York
    5. Yarraville, Melbourne
    6. Wedding, Berlin
    7. Shaanxi Bei Lu/Kangding Lu, Shanghai
    8. Dennistoun, Glasgow
    9. Haut-Marais, Paris
    10. Marrickville, Sydney
    11. Verdun, Montreal
    12. Kalamaja, Tallinn
    13. Hannam-dong, Seoul
    14. Bonfim, Porto
    15. Ghosttown, Oakland
    16. Chula-Samyan, Bangkok
    17. Alvalade, Lisbon
    18. Noord, Amsterdam
    19. Centro, São Paulo
    20. Holešovice, Prague
    21. Lavapiés, Madrid
    22. Opebi, Lagos
    23. Narvarte, Mexico City
    24. Uptown, Chicago
    25. Little Five Points, Atlanta
    26. Wynwood, Miami
    27. Phibsboro, Dublin
    28. Nørrebro, Copenhagen
    29. Bugis, Singapore
    30. Gongguan, Taipei
    31. Soho, London
    32. Binh Thanh, Ho Chi Minh City
    33. Melville, Johannesburg
    34. Kabutocho, Tokyo
    35. Porta Venezia, Milan
    36. Taman Paramount, Kuala Lumpur
    37. Allston, Boston
    38. Bandra West, Mumbai
    39. Arnavutköy, Istanbul
    40. Banjar Nagi, Ubud
    ]]>
    Sun, 20 Dec 2020 00:00:00 GMT
    Emacs: Rotate my macOS display https://xenodium.com/emacs-rotate-my-macos-display https://xenodium.com/emacs-rotate-my-macos-display Every so often, I rotate my monitor (vertical vs horizontal) for either work or to watch a movie. macOS enables changing the display rotation via a dropdown menu (under Preferences > Displays > Rotation) where you can pick between Standard, 90°, 180°, and 270°. That's all fine, but what I'd really like is a quick way to toggle between my preferred two choices: Standard and 270°.

    Unsurprisingly, I'd also like to invoke it as an interactive command via Emacs's M-x (see Emacs: connect my Bluetooth speaker). With narrowing frameworks like ivy, helm, and ido, invoking these commands is just a breeze.

    Turns out, this was pretty simple to accomplish, thanks to Eric Nitardy's fb-rotate command line utility. All that's left to do is wrap it in a tiny elisp function hack, add the toggling logic, and voilà!

    The screen capture goes a little funky when rotating the display, but you get the idea. It works better in person :)

    …and here's the snippet:

    (defun ar/display-toggle-rotation ()
      (interactive)
      (require 'cl-lib)
      (cl-assert (executable-find "fb-rotate") nil
                 "Install fb-rotate from https://github.com/CdLbB/fb-rotate")
      ;; #  Display_ID    Resolution  ____Display_Bounds____  Rotation
      ;; 2  0x2b347692    1440x2560      0     0  1440  2560    270    [main]
      ;; From fb-rotate output, get the `current-rotation' from Column 7, row 1 zero-based.
      (let ((current-rotation (nth 7 (split-string (nth 1 (process-lines "fb-rotate" "-i"))))))
        (call-process-shell-command (format "fb-rotate -d 1 -r %s"
                                            (if (equal current-rotation "270")
                                                "0"
                                              "270")))))
    
    ]]>
    Sat, 05 Dec 2020 00:00:00 GMT
    Emacs: Clone git repo from clipboard https://xenodium.com/emacs-clone-git-repo-from-clipboard https://xenodium.com/emacs-clone-git-repo-from-clipboard Cloning git repositories is a pretty common task. For me, it typically goes something like:

    • Copy git repo URL from browser.
    • Drop to Emacs eshell.
    • Change current directory.
    • Type "git clone ".
    • Paste git repo URL.
    • Run git command.
    • Change directory to cloned repo.
    • Open dired.

    No biggie, but why go through the same steps every time? We can do better. We have a hyper malleable editor, so let's get it to grab the URL from clipboard and do its thing.

    shell-command or async-shell-command can help in this space, but require additional work: change location, re-type command, what if directory already exists… This is Emacs, so we can craft the exact experience we want. I did take inspiration from shell-command to display the process buffer correctly (git progress, control codes, etc.) and landed on the following experience:

    ;; -*- lexical-binding: t -*-
    
    (defun ar/git-clone-clipboard-url ()
      "Clone git URL in clipboard asynchronously and open in dired when finished."
      (interactive)
      (cl-assert (string-match-p "^\\(http\\|https\\|ssh\\)://" (current-kill 0)) nil "No URL in clipboard")
      (let* ((url (current-kill 0))
             (download-dir (expand-file-name "~/Downloads/"))
             (project-dir (concat (file-name-as-directory download-dir)
                                  (file-name-base url)))
             (default-directory download-dir)
             (command (format "git clone %s" url))
             (buffer (generate-new-buffer (format "*%s*" command)))
             (proc))
        (when (file-exists-p project-dir)
          (if (y-or-n-p (format "%s exists. delete?" (file-name-base url)))
              (delete-directory project-dir t)
            (user-error "Bailed")))
        (switch-to-buffer buffer)
        (setq proc (start-process-shell-command (nth 0 (split-string command)) buffer command))
        (with-current-buffer buffer
          (setq default-directory download-dir)
          (shell-command-save-pos-or-erase)
          (require 'shell)
          (shell-mode)
          (view-mode +1))
        (set-process-sentinel proc (lambda (process state)
                                     (let ((output (with-current-buffer (process-buffer process)
                                                     (buffer-string))))
                                       (kill-buffer (process-buffer process))
                                       (if (= (process-exit-status process) 0)
                                           (progn
                                             (message "finished: %s" command)
                                             (dired project-dir))
                                         (user-error (format "%s\n%s" command output))))))
        (set-process-filter proc #'comint-output-filter)))
    

    Comment on reddit or twitter.

    Updates

    • Added lexical binding.
    • Checks clipboard for ssh urls also.
    ]]>
    Sun, 29 Nov 2020 00:00:00 GMT
    Pulled pork recipe https://xenodium.com/pulled-pork-recipe https://xenodium.com/pulled-pork-recipe Made pulled pork a couple of times. Freestyled a bit. No expert here, but result was yummie.

    Grind/blend spices

    • 2 teaspoons smoked paprika
    • 2 teaspoons cumin seeds
    • 2 teaspoons whole pepper corn mix
    • 2 teaspoons chilly flakes

    If spices are whole, grind or blend them. Set aside.

    Optionally: Substitute 1 teaspoon of paprika with chipotle pepper.

    Mix into a paste

    • 2 tablespoons honey
    • 1 teaspoon of dijon mustard

    Mix the honey, mustard, and previous spices into a paste.

    Rub the mix in

    Rub mix thoroughly into the pork shoulder.

    Bake (1 hour)

    Place in a pot (lid off) and bake in the oven for 1 hour at 200 °C.

    Add liquids

    • 1/2 cup of water.
    • 4 tablespoons of apple cider vinegar.

    Add liquids to pot.

    Bake (3-5 hours)

    Bake between 3 to 5 hours 150 °C. Check every hour or two. Does the meat fall easily when spread with two forks? If so, you're done.

    Pull apart

    Use two forks to pull the meat apart.

    ]]>
    Mon, 23 Nov 2020 00:00:00 GMT
    Zettelkasten bookmarks https://xenodium.com/zettelkasten-bookmarks https://xenodium.com/zettelkasten-bookmarks
  • Introduction to the Zettelkasten Method.
  • Zettelkasten note-taking in 10 minutes · Tomas Vik.
  • ]]>
    Sun, 01 Nov 2020 00:00:00 GMT
    Battlestation bookmarks https://xenodium.com/battlestation-bookmarks https://xenodium.com/battlestation-bookmarks
  • Hacking with Swift's battlestation..
  • /r/battlestations.
  • ]]>
    Wed, 28 Oct 2020 00:00:00 GMT
    Emacs: chaining org babel blocks https://xenodium.com/emacs-chaining-org-babel-blocks https://xenodium.com/emacs-chaining-org-babel-blocks Recently wanted to chain org babel blocks. That is, aggregate separate source blocks and execute as one combined block.

    I wanted the chaining primarily driven through header arguments as follows:

    #+name: block-0
    #+begin_src swift
      print("hello 0")
    #+end_src
    
    #+name: block-1
    #+begin_src swift :include block-0
      print("hello 1")
    #+end_src
    
    #+RESULTS: block-1
    : hello 0
    : hello 1
    

    I didn't find the above syntax and behaviour supported out of the box (or didn't search hard enough?). Fortunately, this is our beloved and malleable editor, so we can always bend it our way! Wasn't quite sure how to go about it, so I looked at other babel packages for inspiration. ob-async was great for that.

    Turns out, advicing org-babel-execute-src-block did the job:

    (defun adviced:org-babel-execute-src-block (&optional orig-fun arg info params)
      (let ((body (nth 1 info))
            (include (assoc :include (nth 2 info)))
            (named-blocks (org-element-map (org-element-parse-buffer)
                              'src-block (lambda (item)
                                           (when (org-element-property :name item)
                                             (cons (org-element-property :name item)
                                                   item))))))
        (while include
          (unless (cdr include)
            (user-error ":include without value" (cdr include)))
          (unless (assoc (cdr include) named-blocks)
            (user-error "source block \"%s\" not found" (cdr include)))
          (setq body (concat (org-element-property :value (cdr (assoc (cdr include) named-blocks)))
                             body))
          (setf (nth 1 info) body)
          (setq include (assoc :include
                               (org-babel-parse-header-arguments
                                (org-element-property :parameters (cdr (assoc (cdr include) named-blocks)))))))
        (funcall orig-fun arg info params)))
    
    (advice-add 'org-babel-execute-src-block :around 'adviced:org-babel-execute-src-block)
    

    Before I built my own support, I did find that noweb got me most of what I needed, but required sprinkling blocks with placeholder references.

    Combining :noweb and :prologue would have been a great match, if only prologue did expand the noweb reference. I'm sure there's an alternative I'm missing. Either way, it was fun to poke at babel blocks and build my own chaining support.

    ]]>
    Tue, 27 Oct 2020 00:00:00 GMT
    Emacs: quote wrap all in region https://xenodium.com/emacs-quote-wrap-all-in-region https://xenodium.com/emacs-quote-wrap-all-in-region As I find myself moving more shell commands into Emacs interactive commands to create a Swift package/project, enrich dired's featureset, or search/play Music (macOS), I often need to take a single space-separated string, make an elisp list of strings, and feed it to functions like process-lines. No biggie, but I thought it'd be a fun little function to write: take the region and wrap all items in quotes. As a bonus, made it toggable.

    (defun ar/toggle-quote-wrap-all-in-region (beg end)
      "Toggle wrapping all items in region with double quotes."
      (interactive (list (mark) (point)))
      (unless (region-active-p)
        (user-error "no region to wrap"))
      (let ((deactivate-mark nil)
            (replacement (string-join
                          (mapcar (lambda (item)
                                    (if (string-match-p "^\".*\"$" item)
                                        (string-trim item "\"" "\"")
                                      (format "\"%s\"" item)))
                                  (split-string (buffer-substring beg end)))
                          " ")))
        (delete-region beg end)
        (insert replacement)))
    
    ]]>
    Sun, 25 Oct 2020 00:00:00 GMT
    Emacs: org block complete and edit https://xenodium.com/emacs-edit-after-org-block-completion https://xenodium.com/emacs-edit-after-org-block-completion I quickly got used to Emacs org block company completion. I did, however, almost always found myself running org-edit-special immediately after inserting completion. I use C-c ' for that. That's all fine, but it just felt redundant.

    Why not automatically edit the source block in corresponding major mode after completion? I think I can also get used to that!

    Or maybe the automatic approach is too eager? There's also a middle ground: ask immediately after.

    Or maybe I don't want either in the end? Time will tell, but I now have all three options available:

    (defcustom company-org-block-edit-mode 'auto
      "Customize whether edit mode, post completion was inserted."
      :type '(choice
              (const :tag "nil: no edit after insertion" nil)
              (const :tag "prompt: ask before edit" prompt)
              (const :tag "auto edit, no prompt" auto)))
    

    The new option is now in the company-org-block snippet with my latest config.

    ]]>
    Sun, 18 Oct 2020 00:00:00 GMT
    Emacs: create a Swift package/project https://xenodium.com/emacs-create-a-swift-packageproject https://xenodium.com/emacs-create-a-swift-packageproject Been playing around with Swift Package Manager (SPM). Creating a new Swift package (ie. project) is pretty simple.

    To create a library package, we can use the following:

    swift package init --type library
    

    Alternatively, to create a command-line utility use:

    swift package init --type executable
    

    Turns out, there are a few options: empty, library, executable, system-module, manifest.

    With a little elisp, we can write a completing function to quickly generate a Swift package/project without the need to drop to the shell.

    Bonus: I won't have to look up SPM options if I ever forget them.

    (defun ar/swift-package-init ()
      "Execute `swift package init', with optional name and completing type."
      (interactive)
      (let* ((name (read-string "name (default): "))
             (type (completing-read
                    "project type: "
                    ;; Splits "--type empty|library|executable|system-module|manifest"
                    (split-string
                     (nth 1 (split-string
                             (string-trim
                              (seq-find
                               (lambda (line)
                                 (string-match "--type" line))
                               (process-lines "swift" "package" "init" "--help")))
                             "   "))
                     "|")))
             (command (format "swift package init --type %s" type)))
        (unless (string-empty-p name)
          (append command "--name " name))
        (shell-command command))
      (dired default-directory)
      (revert-buffer))
    
    ]]>
    Sun, 11 Oct 2020 00:00:00 GMT
    Improved Ctrl-p/Ctrl-n macOS movement https://xenodium.com/improved-ctrl-p-ctrl-n-macos-movement https://xenodium.com/improved-ctrl-p-ctrl-n-macos-movement macOS supports many Emacs bindings (out of the box). You can, for example, press C-p and C-n to move the cursor up and down (whether editing text in Emacs or any other macOS app). Jacob Rus's Customizing the Cocoa Text System offers a more in-depth picture and also shows how to customize global macOS keybindings (via DefaultKeyBinding.dict).

    In addition to moving Emacs point (cursor) up/down using C-p/C-n, I've internalized the same bindings to select an option from a list. Good Emacs examples of these are company mode and ivy.

    Vertical cursor movement using Emacs bindings works well in most macOS apps, including forms and text boxes in web pages. However, selecting from a completion list doesn't quite work as expected. Although the binding is technically handled, it moves the cursor within the text widget, ignoring the suggested choices.

    Atif Afzal's Use emacs key bindings everywhere has a solution for the ignored case. He uses Karabiner Elements to remap c-p and c-n to arrow-up and arrow-down.

    It's been roughly a week since I started using the Karabiner remapping, and I've yet to find a case where a web page (or any other macOS app) did not respond to c-p and c-n to move selection from a list.

    My ~/.config/karabiner/karabiner.json configuration is as follows:

    {
        "global": {
            "check_for_updates_on_startup": true,
            "show_in_menu_bar": true,
            "show_profile_name_in_menu_bar": false
        },
        "profiles": [
            {
                "complex_modifications": {
                    "parameters": {
                        "basic.simultaneous_threshold_milliseconds": 50,
                        "basic.to_delayed_action_delay_milliseconds": 500,
                        "basic.to_if_alone_timeout_milliseconds": 1000,
                        "basic.to_if_held_down_threshold_milliseconds": 500,
                        "mouse_motion_to_scroll.speed": 100
                    },
                    "rules": [
                        {
                            "description": "Ctrl+p/Ctrl+n to arrow up/down",
                            "manipulators": [
                                {
                                    "from": {
                                        "key_code": "p",
                                        "modifiers": {
                                            "mandatory": [
                                                "control"
                                            ]
                                        }
                                    },
                                    "to": [
                                        {
                                            "key_code": "up_arrow"
                                        }
                                    ],
                                    "conditions": [
                                        {
                                            "type": "frontmost_application_unless",
                                            "bundle_identifiers": [
                                                "^org\\.gnu\\.Emacs"
                                            ]
                                        }
                                    ],
                                    "type": "basic"
                                },
                                {
                                    "from": {
                                        "key_code": "n",
                                        "modifiers": {
                                            "mandatory": [
                                                "control"
                                            ]
                                        }
                                    },
                                    "to": [
                                        {
                                            "key_code": "down_arrow"
                                        }
                                    ],
                                    "conditions": [
                                        {
                                            "type": "frontmost_application_unless",
                                            "bundle_identifiers": [
                                                "^org\\.gnu\\.Emacs"
                                            ]
                                        }
                                    ],
                                    "type": "basic"
                                }
                            ]
                        }
                    ]
                },
                "devices": [],
                "fn_function_keys": [],
                "name": "Default profile",
                "parameters": {
                    "delay_milliseconds_before_open_device": 1000
                },
                "selected": true,
                "simple_modifications": [],
                "virtual_hid_keyboard": {
                    "country_code": 0,
                    "mouse_key_xy_scale": 100
                }
            }
        ]
    }
    

    Bonus (C-g to exit)

    Pressing Esc often dismisses or cancels macOS windows, menus, etc. This is also the case for web pages. As an Emacs user, I'm pretty used to pressing C-g to cancel, quit, or exit things. With that in mind, mapping C-g to Esc is surprisingly useful outside of Emacs. Here's the relevant Karabiner C-g binding for that:

    {
        "description": "Ctrl+G to Escape",
        "manipulators": [
            {
                "description": "emacs like escape",
                "from": {
                    "key_code": "g",
                    "modifiers": {
                        "mandatory": [
                            "left_control"
                        ]
                    }
                },
                "to": [
                    {
                        "key_code": "escape"
                    }
                ],
                "conditions": [
                    {
                        "type": "frontmost_application_unless",
                        "bundle_identifiers": [
                            "^org\\.gnu\\.Emacs"
                        ]
                    }
                ],
                "conditions": [
                    {
                        "type": "frontmost_application_unless",
                        "bundle_identifiers": [
                            "^org\\.gnu\\.Emacs"
                        ]
                    }
                ],
                "type": "basic"
            }
        ]
    }
    

    ps. Note to self: Lennart's blog has notes on the topic but for linux.

    UPDATE: Ensure bindings are only active when Emacs is [not]{.underline} active.

    ]]>
    Sun, 04 Oct 2020 00:00:00 GMT
    Basmati rice pudding recipe https://xenodium.com/basmati-rice-pudding-recipe https://xenodium.com/basmati-rice-pudding-recipe

    Combine in a pot

    • 2/3 cup of basmati rice
    • 400 ml of coconut milk
    • 4 cups of milk [^6]
    • 3 tablespoons of honey [^7]
    • 1/4 teaspoon of crushed cardamom seeds [^8]
    • 1/8 teaspoon of salt

    Simple. Combine all ingredients in a pot.

    Boil and simmer

    Bring ingredients to a boil and simmer at low heat for 45 minutes. Stir occasionally.

    Mix in butter

    • 1 tablespoon of butter.

    Turn stove off, add a tablespoon of butter, and mix in.

    Serve warm or cold

    After mixing in the butter, the rice pudding is done. You can serve warm or cold.

    Garnish (optional)

    • Pistachios
    • Cinnamon

    Optionally garnish with either pistachios or cinnamon (or both).

    ]]>
    Sun, 04 Oct 2020 00:00:00 GMT
    Adding images to pdfs (macOS) https://xenodium.com/adding-images-to-pdfs-macos https://xenodium.com/adding-images-to-pdfs-macos The macOS Preview app does a great job inserting signatures to existing pdfs. I was hoping it could overlay images just as easily. Doesn't look like it's possible, without exporting/reimporting to image formats and losing pdf structure. Did I miss something?

    In any case, I found formulatepro. Dormant at Google Code Archive, but also checked in to github. With a tiny patch, it builds and runs on Catalina. One can easily insert an image via "File > Place Image…".

    ]]>
    Sun, 27 Sep 2020 00:00:00 GMT
    DIY bookmarks https://xenodium.com/diy-bookmarks https://xenodium.com/diy-bookmarks
  • Best electrical insulation tape.
  • I’ve spent the last 3 months building the home office of my dreams.
  • ]]>
    Sun, 27 Sep 2020 00:00:00 GMT
    Skiing bookmarks https://xenodium.com/skiing-bookmarks https://xenodium.com/skiing-bookmarks
  • 7 far-flung European ski resorts - Lonely Planet.
  • ]]>
    Thu, 24 Sep 2020 00:00:00 GMT
    Emacs: search/play Music (macOS) https://xenodium.com/emacs-searchplay-music-macos https://xenodium.com/emacs-searchplay-music-macos While trying out macOS's Music app to manage offline media, I wondered if I could easily search and control playback from Emacs. Spoiler alert: yes it can be done and fuzzy searching music is rather gratifying.

    Luckily, the hard work's already handled by pytunes, a command line interface to macOS's iTunes/Music app. We add ffprobe and some elisp glue to the mix, and we can generate an Emacs media index.

    Indexing takes roughly a minute per 1000 files. Prolly suboptimal, but I don't intend to re-index frequently. For now, we can use a separate process to prevent Emacs from blocking, so we can get back to playing tetris from our beloved editor:

    (defun musica-index ()
      "Indexes Music's tracks in two stages:
    1. Generates \"Tracks.sqlite\" using pytunes (needs https://github.com/hile/pytunes installed).
    2. Caches an index at ~/.emacs.d/.musica.el."
      (interactive)
      (message "Indexing music... started")
      (let* ((now (current-time))
             (name "Music indexing")
             (buffer (get-buffer-create (format "*%s*" name))))
        (with-current-buffer buffer
          (delete-region (point-min)
                         (point-max)))
        (set-process-sentinel
         (start-process name
                        buffer
                        (file-truename (expand-file-name invocation-name
                                                         invocation-directory))
                        "--quick" "--batch" "--eval"
                        (prin1-to-string
                         `(progn
                            (interactive)
                            (require 'cl-lib)
                            (require 'seq)
                            (require 'map)
    
                            (message "Generating Tracks.sqlite...")
                            (process-lines "pytunes" "update-index") ;; Generates Tracks.sqlite
                            (message "Generating Tracks.sqlite... done")
    
                            (defun parse-tags (path)
                              (with-temp-buffer
                                (if (eq 0 (call-process "ffprobe" nil t nil "-v" "quiet"
                                                        "-print_format" "json" "-show_format" path))
                                    (map-elt (json-parse-string (buffer-string)
                                                                :object-type 'alist)
                                             'format)
                                  (message "Warning: Couldn't read track metadata for %s" path)
                                  (message "%s" (buffer-string))
                                  (list (cons 'filename path)))))
    
                            (let* ((paths (process-lines "sqlite3"
                                                         (concat (expand-file-name "~/")
                                                                 "Music/Music/Music Library.musiclibrary/Tracks.sqlite")
                                                         "select path from tracks"))
                                   (total (length paths))
                                   (n 0)
                                   (records (seq-map (lambda (path)
                                                       (let ((tags (parse-tags path)))
                                                         (message "%d/%d %s" (setq n (1+ n))
                                                                  total (or (map-elt (map-elt tags 'tags) 'title) "No title"))
                                                         tags))
                                                     paths)))
                              (with-temp-buffer
                                (prin1 records (current-buffer))
                                (write-file "~/.emacs.d/.musica.el" nil))))))
         (lambda (process state)
           (if (= (process-exit-status process) 0)
               (message "Indexing music... finished (%.3fs)"
                        (float-time (time-subtract (current-time) now)))
             (message "Indexing music... failed, see %s" buffer))))))
    

    Once media is indexed, we can feed it to ivy for that narrowing-down fuzzy-searching goodness! It's worth mentioning the truncate-string-to-width function. Super handy for truncating strings to a fixed width and visually organizing search results in columns.

    (defun musica-search ()
      (interactive)
      (cl-assert (executable-find "pytunes") nil "pytunes not installed")
      (let* ((c1-width (round (* (- (window-width) 9) 0.4)))
             (c2-width (round (* (- (window-width) 9) 0.3)))
             (c3-width (- (window-width) 9 c1-width c2-width)))
        (ivy-read "Play: " (mapcar
                            (lambda (track)
                              (let-alist track
                                (cons (format "%s   %s   %s"
                                              (truncate-string-to-width
                                               (or .tags.title
                                                   (file-name-base .filename)
                                                   "No title") c1-width nil ?\s "…")
                                              (truncate-string-to-width (propertize (or .tags.artist "")
                                                                                    'face '(:foreground "yellow")) c2-width nil ?\s "…")
                                              (truncate-string-to-width
                                               (propertize (or .tags.album "")
                                                           'face '(:foreground "cyan1")) c3-width nil ?\s "…"))
                                      track)))
                            (musica--index))
                  :action (lambda (selection)
                            (let-alist (cdr selection)
                              (process-lines "pytunes" "play" .filename)
                              (message "Playing: %s [%s] %s"
                                       (or .tags.title
                                           (file-name-base .filename)
                                           "No title")
                                       (or .tags.artist
                                           "No artist")
                                       (or .tags.album
                                           "No album")))))))
    
    (defun musica--index ()
      (with-temp-buffer
        (insert-file-contents "~/.emacs.d/.musica.el")
        (read (current-buffer))))
    

    The remaining bits are straigtforward. We add a few interactive functions to control playback:

    (defun musica-info ()
      (interactive)
      (let ((raw (process-lines "pytunes" "info")))
        (message "%s [%s] %s"
                 (string-trim (string-remove-prefix "Title" (nth 3 raw)))
                 (string-trim (string-remove-prefix "Artist" (nth 1 raw)))
                 (string-trim (string-remove-prefix "Album" (nth 2 raw))))))
    
    (defun musica-play-pause ()
      (interactive)
      (cl-assert (executable-find "pytunes") nil "pytunes not installed")
      (process-lines "pytunes" "play")
      (musica-info))
    
    (defun musica-play-next ()
      (interactive)
      (cl-assert (executable-find "pytunes") nil "pytunes not installed")
      (process-lines "pytunes" "next"))
    
    (defun musica-play-next-random ()
      (interactive)
      (cl-assert (executable-find "pytunes") nil "pytunes not installed")
      (process-lines "pytunes" "shuffle" "enable")
      (let-alist (seq-random-elt (musica--index))
        (process-lines "pytunes" "play" .filename))
      (musica-info))
    
    (defun musica-play-previous ()
      (interactive)
      (cl-assert (executable-find "pytunes") nil "pytunes not installed")
      (process-lines "pytunes" "previous"))
    

    Finally, if we want some convenient keybindings, we can add something like:

    (global-set-key (kbd "C-c m SPC") #'musica-play-pause)
    (global-set-key (kbd "C-c m i") #'musica-info)
    (global-set-key (kbd "C-c m n") #'musica-play-next)
    (global-set-key (kbd "C-c m p") #'musica-play-previous)
    (global-set-key (kbd "C-c m r") #'musica-play-next-random)
    (global-set-key (kbd "C-c m s") #'musica-search)
    

    Hooray! Controlling music is now an Emacs keybinding away: ø/

    comments on twitter.

    UPDATE1: Installing pytunes with pip3 install pytunes didn't just work for me. Instead, I cloned and installed as:

    git clone https://github.com/hile/pytunes
    pip3 install file:///path/to/pytunes
    pip3 install pytz
    brew install libmagic
    

    UPDATE2: Checked in to dot files.

    ]]>
    Sat, 19 Sep 2020 00:00:00 GMT
    Cheese cake recipe (no crust) https://xenodium.com/cheese-cake-recipe-no-crust https://xenodium.com/cheese-cake-recipe-no-crust

    Preheat oven

    Preheat oven at 175°C.

    Ingredients at room temperature

    Ensure the cream cheese, sour cream, and eggs are at room temperature before starting.

    Mix cream cheese

    • 900g of cream cheese

    Mix the cream cheese thoroughly.

    Mix sugar

    • 240g of sugar

    Add half the sugar. Mix in thoroughly. Add second half and mix.

    Mix sour cream, corn flour, and vanilla.

    • 100g sour cream
    • 40g corn flour
    • 1tbsp vanilla bean paste

    Add the three ingredients and mix well.

    Mix eggs

    • 3 eggs
    • 1 egg yolk

    Add the eggs and mix for 30 seconds.

    Mix by hand

    Finish mixing thoroughly by hand, using a wooden spoon.

    Prepare pan

    • Springform pan
    • Parchment paper

    A springform pan works best here. Wrap its plate with parchment paper and lock it in place.

    Pour mix

    • Strainer

    Pour the mix through a strainer and into the prepared pan.

    Rest mix

    Let the mix rest in the pan for 10 minutes to let air bubbles out.

    Bake

    Bake for an 1 hour 10 minutes. Maybe add another 10 minutes (or more) if surface is still pale. Turn the oven off, leave door half open, and let it sit for 20 minutes.

    Cool off

    Take out and let it cool off to room temperature.

    Refrigerate

    Refrigerate for 4 hours (or overnight) before removing the sides of the pan.

    Eat!

    Nom nom. Yum yum.

    Bonus (topping)

    I winged this one and it worked out well. Heated up frozen berries with some honey and used it as topping. The whole combo was pretty tasty.

    ]]>
    Sat, 12 Sep 2020 00:00:00 GMT
    Faster macOS dock auto-hide https://xenodium.com/faster-macos-dock-auto-hide https://xenodium.com/faster-macos-dock-auto-hide

    Via Marcin Swieczkowski's Upgrading The OSX Dock, change default to make macOS's dock auto-hide faster:

    defaults write com.apple.dock autohide-time-modifier -float 0.2; killall Dock
    
    ]]>
    Fri, 28 Aug 2020 00:00:00 GMT
    Smarter Swift snippets https://xenodium.com/smarter-snippets https://xenodium.com/smarter-snippets Jari Safi published a wonderful Emacs video demoing python yasnippets in action. The constructor snippet, automatically setting ivars, is just magical. I wanted it for Swift!

    I took a look at the [[init]{.underline}]{.underline} snippet from Jorgen Schäfer's elpy. It uses elpy-snippet-init-assignments to generate the assignments.

    With small tweaks, we can get the same action going on for Swift ø/

    init.yasnippet:

    # -*- mode: snippet -*-
    # name: init with assignments
    # key: init
    # --
    init(${1:, args}) {
      ${1:$(swift-snippet-init-assignments yas-text)}
    }
    $0
    

    .yas-setup.el:

    (defun swift-snippet-init-assignments (arg-string)
      (let ((indentation (make-string (save-excursion
                                        (goto-char start-point)
                                        (current-indentation))
                                      ?\s)))
        (string-trim (mapconcat (lambda (arg)
                                  (if (string-match "^\\*" arg)
                                      ""
                                    (format "self.%s = %s\n%s"
                                            arg arg indentation)))
                                (swift-snippet-split-args arg-string)
                                ""))))
    
    (defun swift-snippet-split-args (arg-string)
      (mapcar (lambda (x)
                (if (and x (string-match "\\([[:alnum:]]*\\):" x))
                    (match-string-no-properties 1 x)
                  x))
              (split-string arg-string "[[:blank:]]*,[[:blank:]]*" t)))
    
    ]]>
    Tue, 25 Aug 2020 00:00:00 GMT
    Swift package manager build for iOS https://xenodium.com/swift-package-manager-build-for-ios https://xenodium.com/swift-package-manager-build-for-ios While playing around with Swift package manager, it wasn't immediately obvious how to build for iOS from the command line. The default behaviour of invoking swift build is to build for the host. In my case, macOS. In any case, this was it:

    swift build -Xswiftc "-sdk" -Xswiftc "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.0.sdk" -Xswiftc "-target" -Xswiftc "x86_64-apple-ios13.0-simulator"
    

    ps. Can get the SDK path with:

    xcrun --sdk iphonesimulator --show-sdk-path
    
    ]]>
    Sun, 23 Aug 2020 00:00:00 GMT
    QR code bookmarks https://xenodium.com/qr-code-bookmarks https://xenodium.com/qr-code-bookmarks
  • divan/txqr: Transfer data via animated QR codes.
  • research!rsc: QArt Codes.
  • Show HN: Photo Realistic QR-Codes (Hacker News).
  • ]]>
    Sun, 23 Aug 2020 00:00:00 GMT
    Trying out gccemacs on macOS https://xenodium.com/trying-out-gccemacs-on-macos https://xenodium.com/trying-out-gccemacs-on-macos UPDATE: I'm no longer using these steps. See Emacs plus –with-native-comp for an easier alternative.

    Below are the instructions I use to build Andrea Corallo's gccemacs on macOS. It is based on Allen Dang's handy instructions plus some changes of my own.

    Install gcc and libgccjit via homebrew

    brew install gcc libgccjit
    

    Save configure script

    Create configure-gccemacs.sh

    #!/bin/bash
    
    set -o nounset
    set -o errexit
    
    # Configures Emacs for building native comp support
    # http://akrl.sdf.org/gccemacs.html
    
    readonly GCC_DIR="$(realpath $(brew --prefix libgccjit))"
    [[ -d $GCC_DIR ]] ||  { echo "${GCC_DIR} not found"; exit 1; }
    
    readonly SED_DIR="$(realpath $(brew --prefix gnu-sed))"
    [[ -d $SED_DIR ]] ||  { echo "${SED_DIR} not found"; exit 1; }
    
    readonly GCC_INCLUDE_DIR=${GCC_DIR}/include
    [[ -d $GCC_INCLUDE_DIR ]] ||  { echo "${GCC_INCLUDE_DIR} not found"; exit 1; }
    
    readonly GCC_LIB_DIR=${GCC_DIR}/lib/gcc/10
    [[ -d $GCC_LIB_DIR ]] ||  { echo "${GCC_LIB_DIR} not found"; exit 1; }
    
    export PATH="${SED_DIR}/libexec/gnubin:${PATH}"
    export CFLAGS="-O2 -I${GCC_INCLUDE_DIR}"
    export LDFLAGS="-L${GCC_LIB_DIR} -I${GCC_INCLUDE_DIR}"
    export LD_LIBRARY_PATH="${GCC_LIB_DIR}"
    export DYLD_FALLBACK_LIBRARY_PATH="${GCC_LIB_DIR}"
    
    echo "Environment"
    echo "-----------"
    echo PATH: $PATH
    echo CFLAGS: $CFLAGS
    echo LDFLAGS: $LDFLAGS
    echo DYLD_FALLBACK_LIBRARY_PATH: $DYLD_FALLBACK_LIBRARY_PATH
    echo "-----------"
    
    ./autogen.sh
    
    ./configure \
         --prefix="$PWD/nextstep/Emacs.app/Contents/MacOS" \
         --enable-locallisppath="${PWD}/nextstep/Emacs.app/Contents/MacOS" \
         --with-mailutils \
         --with-ns \
         --with-imagemagick \
         --with-cairo \
         --with-modules \
         --with-xml2 \
         --with-gnutls \
         --with-json \
         --with-rsvg \
         --with-native-compilation \
         --disable-silent-rules \
         --disable-ns-self-contained \
         --without-dbus
    

    Make it executable

    chmod +x configure-gccemacs.sh
    

    Clone Emacs source

    git clone --branch master https://github.com/emacs-mirror/emacs gccemacs
    

    Configure build

    cd gccemacs
    ../configure-gccemacs.sh
    

    Native lisp compiler found?

    Verify native lisp compiler is found:

    Does Emacs have native lisp compiler?                   yes
    

    Build

    Put those cores to use. Find out how many you got with:

    sysctl hw.logicalcpu
    

    Ok so build with:

    make -j4 NATIVE_FAST_BOOT=1
    cp -r lisp nextstep/Emacs.app/Contents/Resources/
    cp -r native-lisp nextstep/Emacs.app/Contents
    make install
    

    Note: Using NATIVE_FAST_BOOT=1 significantly improves build time (totalling between 20-30 mins, depending on your specs). Without it, the build can take hours.

    The macOS app build (under nextstep/Emacs.app) is ready, but read on before launching.

    Remove ~/emacs.d

    You likely want to start with a clean install, byte-compiling all packages with the latest Emacs version. In any case, rename ~/emacs.d (for backup?) or remove ~/emacs.d.

    init.el config

    Ensure exec-path includes the script's "–prefix=" value, LIBRARY_PATH points to gcc's lib dir, and finally set comp-deferred-compilation. I wrapped the snippet in my exec-path-from-shell config, but setting early in init.el should be enough.

    (use-package exec-path-from-shell
      :ensure t
      :config
      (exec-path-from-shell-initialize)
      (if (and (fboundp 'native-comp-available-p)
               (native-comp-available-p))
          (progn
            (message "Native comp is available")
            ;; Using Emacs.app/Contents/MacOS/bin since it was compiled with
            ;; ./configure --prefix="$PWD/nextstep/Emacs.app/Contents/MacOS"
            (add-to-list 'exec-path (concat invocation-directory "bin") t)
            (setenv "LIBRARY_PATH" (concat (getenv "LIBRARY_PATH")
                                           (when (getenv "LIBRARY_PATH")
                                             ":")
                                           ;; This is where Homebrew puts gcc libraries.
                                           (car (file-expand-wildcards
                                                 (expand-file-name "~/homebrew/opt/gcc/lib/gcc/*")))))
            ;; Only set after LIBRARY_PATH can find gcc libraries.
            (setq comp-deferred-compilation t))
        (message "Native comp is *not* available")))
    

    Launch Emacs.app

    You're good to go. Open Emacs.app via finder or shell:

    open nextstep/Emacs.app
    

    Deferred compilation logs

    After setting comp-deferred-compilation (in init.el config section), .elc files should be asyncronously compiled. Function definition should be updated to native compiled equivalent.

    Look out for an Async-native-compile-log buffer. Should have content like:

    Compiling .emacs.d/elpa/moody-20200514.1946/moody.el...
    Compiling .emacs.d/elpa/minions-20200522.1052/minions.el...
    Compiling .emacs.d/elpa/persistent-scratch-20190922.1046/persistent-scratch.el...
    Compiling .emacs.d/elpa/which-key-20200721.1927/which-key.el...
    ...
    

    Can also check for .eln files:

    find ~/.emacs.d -iname *.eln | wc -l
    

    UPDATE1: Added Symlink Emacs.app/Contents/eln-cache section for update 11.

    UPDATE2: Noted using NATIVE_FAST_BOOT makes the build much faster.

    UPDATE3: Removed symlinks and copied content instead. This simplifies things. Inspired by Ian Wahbe's build-emacs.sh.

    UPDATE4: Removed homebrew recipe patching. Thanks to Dmitry Shishkin's instructions.

    UPDATE5: Use new flag –with-native-compilation and master branch.

    ]]>
    Sun, 16 Aug 2020 00:00:00 GMT
    SwiftUI macOS desk clock https://xenodium.com/swiftui-desk-clock https://xenodium.com/swiftui-desk-clock

    For time display, I've gone back and forth between an always-displayed macOS's menu bar to an auto-hide menu bar, and letting Emacs display the time. Neither felt great nor settled.

    With some tweaks, Paul Hudson's How to use a timer with SwiftUI, led me to build a simple desk clock. Ok, let's not get fancy. It's really just an always-on-top floating window, showing a swiftUI label, but hey I like the minimalist feel ;)

    Let's see if it sticks around or it gets in the way… Either way, here's standalone snippet. Run with swift deskclock.swift.

    import Cocoa
    import SwiftUI
    
    let application = NSApplication.shared
    let appDelegate = AppDelegate()
    NSApp.setActivationPolicy(.regular)
    application.delegate = appDelegate
    application.mainMenu = NSMenu.makeMenu()
    application.run()
    
    struct ClockView: View {
      @State var time = "--:--"
    
      let timer = Timer.publish(every: 1, on: .main, in: .common).autoconnect()
    
      var body: some View {
        GeometryReader { geometry in
    
          VStack {
            Text(time)
              .onReceive(timer) { input in
                let formatter = DateFormatter()
                formatter.dateFormat = "HH:mm"
                time = formatter.string(from: input)
              }
              .font(.system(size: 40))
              .padding()
          }.frame(width: geometry.size.width, height: geometry.size.height)
            .background(Color.black)
            .cornerRadius(10)
            .frame(maxWidth: .infinity, maxHeight: .infinity)
        }
      }
    }
    
    extension NSWindow {
      static func makeWindow() -> NSWindow {
        let window = NSWindow(
          contentRect: NSRect.makeDefault(),
          styleMask: [.closable, .miniaturizable, .resizable, .fullSizeContentView],
          backing: .buffered, defer: false)
        window.level = .floating
        window.setFrameAutosaveName("everclock")
        window.collectionBehavior = [.canJoinAllSpaces, .stationary, .ignoresCycle, .fullScreenPrimary]
        window.makeKeyAndOrderFront(nil)
        window.isMovableByWindowBackground = true
        window.titleVisibility = .hidden
        window.backgroundColor = .clear
        return window
      }
    }
    
    class AppDelegate: NSObject, NSApplicationDelegate {
      var window = NSWindow.makeWindow()
      var hostingView: NSView?
    
      func applicationDidFinishLaunching(_ notification: Notification) {
        hostingView = NSHostingView(rootView: ClockView())
        window.contentView = hostingView
        NSApp.activate(ignoringOtherApps: true)
      }
    }
    
    extension NSRect {
      static func makeDefault() -> NSRect {
        let initialMargin = CGFloat(60)
        let fallback = NSRect(x: 0, y: 0, width: 100, height: 150)
    
        guard let screenFrame = NSScreen.main?.frame else {
          return fallback
        }
    
        return NSRect(
          x: screenFrame.maxX - fallback.width - initialMargin,
          y: screenFrame.maxY - fallback.height - initialMargin,
          width: fallback.width, height: fallback.height)
      }
    }
    
    extension NSMenu {
      static func makeMenu() -> NSMenu {
        let appMenu = NSMenuItem()
        appMenu.submenu = NSMenu()
    
        appMenu.submenu?.addItem(
          NSMenuItem(
            title: "Quit \(ProcessInfo.processInfo.processName)",
            action: #selector(NSApplication.terminate(_:)), keyEquivalent: "q"
          ))
    
        let mainMenu = NSMenu(title: "Main Menu")
        mainMenu.addItem(appMenu)
        return mainMenu
      }
    }
    
    
    ]]>
    Sun, 02 Aug 2020 00:00:00 GMT
    Mending bookmarks https://xenodium.com/mending-bookmarks https://xenodium.com/mending-bookmarks
  • 12 Great Sewing Tips and Tricks ! Best great sewing tips and tricks #7 - YouTube.
  • ]]>
    Thu, 30 Jul 2020 00:00:00 GMT
    ffmpeg bookmarks https://xenodium.com/ffmpeg-bookmarks https://xenodium.com/ffmpeg-bookmarks
  • FFmpeg 4.3 (Hacker News).
  • FFMPEG from Zero to Hero | Hacker News.
  • Ken Burns Effect Slideshows with FFMPeg (mko.re).
  • Stack Videos Horizontally, Vertically, in a Grid With FFmpeg - OTTVerse.
  • ]]>
    Wed, 17 Jun 2020 00:00:00 GMT
    Black lives matter (BLM) bookmarks https://xenodium.com/black-lives-matter-blm-bookmarks https://xenodium.com/black-lives-matter-blm-bookmarks
  • Do You Know How Divided White And Black Americans Are On Racism? (FiveThirtyEight).
  • It’s Time We Dealt With White Supremacy in Tech.
  • The Real Origins of the Religious Right - POLITICO Magazine.
  • ]]>
    Sun, 14 Jun 2020 00:00:00 GMT
    Dogs bookmarks https://xenodium.com/dogs-bookmarks https://xenodium.com/dogs-bookmarks
  • All You Need to Know About Romanian Rescue Dogs.
  • ]]>
    Sun, 14 Jun 2020 00:00:00 GMT
    Emacs, search hackingwithswift.com https://xenodium.com/emacs-search-hackingwithswiftcom https://xenodium.com/emacs-search-hackingwithswiftcom

    Paul Hudson authors excellent Swift material at hackingwithswift.com. I regularly land on the site while searching for snippets from the browser. I was wondering if I could search for snippets directly from Emacs.

    Turns out, hackingwithswift uses a JSON HTTP request for querying code examples. With this in mind, we can use ivy-read like Oleh Krehel's counsel-search and search for Swift snippets from our favorite editor:

    (require 'request)
    (require 'json)
    
    (defun ar/counsel-hacking-with-swift-search ()
      "Ivy interface to query hackingwithswift.com."
      (interactive)
      (ivy-read "hacking with swift: "
                (lambda (input)
                  (or
                   (ivy-more-chars)
                   (let ((request-curl-options (list "-H" (string-trim (url-http-user-agent-string)))))
                     (request
                       "https://www.hackingwithswift.com/example-code/search"
                       :type "GET"
                       :params (list
                                (cons "search" input))
                       :parser 'json-read
                       :success (cl-function
                                 (lambda (&key data &allow-other-keys)
                                   (ivy-update-candidates
                                    (mapcar (lambda (item)
                                              (let-alist item
                                                (propertize .title 'url .url)))
                                            data)))))
                     0)))
                :action (lambda (selection)
                          (browse-url (concat "https://www.hackingwithswift.com"
                                              (get-text-property 0 'url selection))))
                :dynamic-collection t
                :caller 'ar/counsel-hacking-with-swift-search))
    
    ]]>
    Sat, 06 Jun 2020 00:00:00 GMT
    Preview SwiftUI layouts using Emacs org blocks https://xenodium.com/swiftui-layout-previews-using-emacs-org-blocks https://xenodium.com/swiftui-layout-previews-using-emacs-org-blocks

    UPDATE: The snippets in this post are outdated. See ob-swiftui for better SwiftUI babel support. ✨

    Chris Eidhof twitted a handy snippet that enables quickly bootstrapping throwaway SwiftUI code. It can be easily integrated into other tools for rapid experimentation.

    Being a SwiftUI noob, I could use some SwiftUI integration with my editor of choice. With some elisp glue and a small patch, Chris's snippet can be used to generate SwiftUI inline previews using Emacs org babel. This is particularly handy for playing around with SwiftUI layouts.

    We can piggyback ride off zweifisch's ob-swift by advicing org-babel-execute:swift to inject the org source block into the bootstrapping snippet. We also add a hook to org-babel-after-execute-hook to automatically refresh the inline preview.

    If you're a use-package user, the following snippet should make things fairly self-contained (if you have melpa set up already).

    (use-package org
      :hook ((org-mode . org-display-inline-images))
      :config
    
      (use-package ob
        :config
    
        (use-package ob-swift
          :ensure t
          :config
          (org-babel-do-load-languages 'org-babel-load-languages
                                       (append org-babel-load-languages
                                               '((swift     . t))))
    
          (defun ar/org-refresh-inline-images ()
            (when org-inline-image-overlays
              (org-redisplay-inline-images)))
    
          ;; Automatically refresh inline images.
          (add-hook 'org-babel-after-execute-hook 'ar/org-refresh-inline-images)
    
          (defun adviced:org-babel-execute:swift (f &rest args)
            "Advice `adviced:org-babel-execute:swift' enabling swiftui header param."
            (let* ((body (nth 0 args))
                   (params (nth 1 args))
                   (swiftui (cdr (assoc :swiftui params)))
                   (output))
              (when swiftui
                (assert (or (string-equal swiftui "preview")
                            (string-equal swiftui "interactive"))
                        nil ":swiftui must be either preview or interactive")
                (setq body (format
                            "
    import Cocoa
    import SwiftUI
    import Foundation
    
    let screenshotURL = URL(fileURLWithPath: NSTemporaryDirectory(), isDirectory: true).appendingPathComponent(ProcessInfo.processInfo.globallyUniqueString + \".png\")
    let preview = %s
    
    NSApplication.shared.run {
      %s
    }
    
    extension NSApplication {
      public func run<V: View>(@ViewBuilder view: () -> V) {
        let appDelegate = AppDelegate(view())
        NSApp.setActivationPolicy(.regular)
        mainMenu = customMenu
        delegate = appDelegate
        run()
      }
    }
    
    extension NSApplication {
      var customMenu: NSMenu {
        let appMenu = NSMenuItem()
        appMenu.submenu = NSMenu()
    
        let quitItem = NSMenuItem(
          title: \"Quit \(ProcessInfo.processInfo.processName)\",
          action: #selector(NSApplication.terminate(_:)), keyEquivalent: \"q\")
        quitItem.keyEquivalentModifierMask = []
        appMenu.submenu?.addItem(quitItem)
    
        let mainMenu = NSMenu(title: \"Main Menu\")
        mainMenu.addItem(appMenu)
        return mainMenu
      }
    }
    
    class AppDelegate<V: View>: NSObject, NSApplicationDelegate, NSWindowDelegate {
      var window = NSWindow(
        contentRect: NSRect(x: 0, y: 0, width: 414 * 0.2, height: 896 * 0.2),
        styleMask: [.titled, .closable, .miniaturizable, .resizable, .fullSizeContentView],
        backing: .buffered, defer: false)
    
      var contentView: V
    
      init(_ contentView: V) {
        self.contentView = contentView
      }
    
      func applicationDidFinishLaunching(_ notification: Notification) {
        window.delegate = self
        window.center()
        window.contentView = NSHostingView(rootView: contentView)
        window.makeKeyAndOrderFront(nil)
    
        if preview {
          screenshot(view: window.contentView!, saveTo: screenshotURL)
          // Write path (without newline) so org babel can parse it.
          print(screenshotURL.path, terminator: \"\")
          NSApplication.shared.terminate(self)
          return
        }
    
        window.setFrameAutosaveName(\"Main Window\")
        NSApp.activate(ignoringOtherApps: true)
      }
    }
    
    func screenshot(view: NSView, saveTo fileURL: URL) {
      let rep = view.bitmapImageRepForCachingDisplay(in: view.bounds)!
      view.cacheDisplay(in: view.bounds, to: rep)
      let pngData = rep.representation(using: .png, properties: [:])
      try! pngData?.write(to: fileURL)
    }
    "
                            (if (string-equal swiftui "preview")
                                "true"
                              "false")
                            body))
                (setq args (list body params)))
              (setq output (apply f args))
              (when org-inline-image-overlays
                (org-redisplay-inline-images))
              output))
    
          (advice-add #'org-babel-execute:swift
                      :around
                      #'adviced:org-babel-execute:swift))))
    

    Snippet also at github gist and included in my emacs config.

    UPDATE: See ob-swiftui for a better version of babel SwiftUI support.

    Once the snippet is evaluated, we're ready to use in an org babel block. We introduced the :swiftui header param to switch between inline static preview and interactive mode.

    To try out an inline preview, create a new org file (eg. swiftui.org) and a source block like:

    #+begin_src swift :results file :swiftui preview
      VStack(spacing: 10) {
          HStack(spacing: 10) {
            Rectangle().fill(Color.yellow)
            Rectangle().fill(Color.green)
          }
          Rectangle().fill(Color.blue)
          HStack(spacing: 10) {
            Rectangle().fill(Color.green)
            Rectangle().fill(Color.yellow)
          }
        }
        .frame(maxWidth: .infinity, maxHeight: .infinity)
    #+end_src
    
    #+results:
    

    Place the cursor anywhere inside the source block (#+begin_src/#+end_src) and press C-c C-c (or M-x org-ctrl-c-ctrl-c).

    To run interactively, change the :swiftui param to interactive and press C-c C-c (or M-x org-ctrl-c-ctrl-c). When running interactively, press "q" (without ⌘) to quit the Swift app.

    comments on twitter.

    Update

    • Tweaked the snippet to make it more self-contained and made the steps more reproducible. Need to work out how to package things to make them more accessible. May be best to contribute as a patch to ob-swift and we can avoid the icky advice-add.
    • Thanks to Chris Eidhof for PNG support (instead of TIFF). Also TIL Swift's print has got a terminator param.
    ]]>
    Sat, 23 May 2020 00:00:00 GMT
    Open Emacs elfeed links in the background https://xenodium.com/open-emacs-elfeed-links-in-background https://xenodium.com/open-emacs-elfeed-links-in-background

    Christopher Wellons's elfeed is a wonderful Emacs rss reader. In Mike Zamansky's Using Emacs 72 - Customizing Elfeed video, he highlights a desire to open elfeed entries in the background. That is, open the current rss entry (or selected entries) without shifting focus from Emacs to your browser. This behaviour is somewhat analogous to ⌘-clicking/ctrl-clicking on multiple links in the browser without losing focus.

    I've been wanting elfeed to open links in the background for some time. Zamansky's post was a great nudge to look into it. He points to the relevant elfeed-search-browse-url function, re-implemented to suit his needs. In a similar spirit, I wrote a function to open the current rss entry (or selected entries) in the background.

    I'm running macOS, so I took a look at [browse-url-default-macosx-browser](https://github.com/emacs-mirror/emacs/blob/d714aa753b744c903d149a1f6c69262d958c313e/lisp/net/browse-url.el#L1018 I ) to get an idea of how URLs are opened. Simple. It let's macOS handle it via the "open" command, invoked through start process. Looking at open's command-line options, we find –background which "does not bring the application to the foreground."

    open --background http://xenodium.com
    

    "b" is already bound to elfeed-search-browse-url, so in our snippet we'll bind "B" to our new background function, giving us some flexibility:

    (use-package elfeed
      :ensure t
      :bind (:map elfeed-search-mode-map
                  ("B" . ar/elfeed-search-browse-background-url))
      :config
      (defun ar/elfeed-search-browse-background-url ()
        "Open current `elfeed' entry (or region entries) in browser without losing focus."
        (interactive)
        (let ((entries (elfeed-search-selected)))
          (mapc (lambda (entry)
                  (assert (memq system-type '(darwin)) t "open command is macOS only")
                  (start-process (concat "open " (elfeed-entry-link entry))
                                 nil "open" "--background" (elfeed-entry-link entry))
                  (elfeed-untag entry 'unread)
                  (elfeed-search-update-entry entry))
                entries)
          (unless (or elfeed-search-remain-on-entry (use-region-p))
            (forward-line)))))
    

    Maybe xdg-open does a similar thing on linux (I've not looked). Ping me if you have a linux solution and I can update the function.

    Happy Emacsing.

    ps. I noticed elfeed uses browse-url-generic if elfeed-search-browse-url's is invoked with a prefix. Setting browse-url-generic-program and browse-url-generic-args to use background options may be a more generic solution. For now, a custom function does the job.

    comments on twitter.

    ]]>
    Fri, 22 May 2020 00:00:00 GMT
    Enrich Emacs dired's batching toolbox https://xenodium.com/enrich-your-dired-batching-toolbox https://xenodium.com/enrich-your-dired-batching-toolbox Update

    I now use dwim-shell-command, which reduces the logic to:

    (defun dwim-shell-commands-image-to-jpg ()
      "Convert all marked images to jpg(s)."
      (interactive)
      (dwim-shell-command-on-marked-files
       "Convert to jpg"
       "convert -verbose '<<f>>' '<<fne>>.jpg'"
       :utils "convert"))
    

    Original post

    Shell one-liners are super handy for batch-processing files. Say you'd like to convert a bunch of images from HEIC to jpg, you could use something like:

    for f in *.HEIC ; do convert "$f" "${f%.*}.jpg"; done
    

    Save the one-liner (or memorize it) and pull it from your toolbox next time you need it. This is handy as it is, but Emacs dired is just a file-management powerhouse. Its dired-map-over-marks function is just a few elisp lines away from enabling all sorts of batch processing within your dired buffers.

    Dired already enables selecting and deselecting files using all sorts of built-in mechanisms (dired-mark-files-regexp, find-name-dired, etc) or wonderful third-party packages like Matus Goljer's dired-filters.

    Regardless of how you selected your files, here's a snippet to run ImageMagick's convert on a bunch of selected files:

    ;;; -*- lexical-binding: t; -*-
    
    (defun ar/dired-convert-image (&optional arg)
      "Convert image files to other formats."
      (interactive "P")
      (assert (or (executable-find "convert") (executable-find "magick.exe")) nil "Install imagemagick")
      (let* ((dst-fpath)
             (src-fpath)
             (src-ext)
             (last-ext)
             (dst-ext))
        (mapc
         (lambda (fpath)
           (setq src-fpath fpath)
           (setq src-ext (downcase (file-name-extension src-fpath)))
           (when (or (null dst-ext)
                     (not (string-equal dst-ext last-ext)))
             (setq dst-ext (completing-read "to format: "
                                            (seq-remove (lambda (format)
                                                          (string-equal format src-ext))
                                                        '("jpg" "png")))))
           (setq last-ext dst-ext)
           (setq dst-fpath (format "%s.%s" (file-name-sans-extension src-fpath) dst-ext))
           (message "convert %s to %s ..." (file-name-nondirectory dst-fpath) dst-ext)
           (set-process-sentinel
            (if (string-equal system-type "windows-nt")
                (start-process "convert"
                               (generate-new-buffer (format "*convert %s*" (file-name-nondirectory src-fpath)))
                               "magick.exe" "convert" src-fpath dst-fpath)
              (start-process "convert"
                             (generate-new-buffer (format "*convert %s*" (file-name-nondirectory src-fpath)))
                             "convert" src-fpath dst-fpath))
            (lambda (process state)
              (if (= (process-exit-status process) 0)
                  (message "convert %s ✔" (file-name-nondirectory dst-fpath))
                (message "convert %s ❌" (file-name-nondirectory dst-fpath))
                (message (with-current-buffer (process-buffer process)
                           (buffer-string))))
              (kill-buffer (process-buffer process)))))
         (dired-map-over-marks (dired-get-filename) arg))))
    

    The snippet can be shorter, but wouldn't be as friendly. We ask users to provide desired image format, spawn separate processes (avoids blocking Emacs), and generate a basic report. Also adds support for Windows.

    BEWARE

    The snippet isn't currently capping the number of processes, but hey we can revise in the future…

    Update

    Thanks to Philippe Beliveau for pointing out a bug in snippet (now updated) and changes to make it Windows compatible.

    ]]>
    Mon, 11 May 2020 00:00:00 GMT
    Banana oats pancakes recipe https://xenodium.com/banana-oats-pancakes-recipe https://xenodium.com/banana-oats-pancakes-recipe

    Blend

    • Ripe banana.
    • 2 Eggs.
    • 1/3 cup instant oats.
    • 1/2 teaspoon baking powder.

    Really is this easy. Add all ingredients and blend.

    Cook

    Medium to low heat. Cook for 3 minutes. Flip. Cook for 1 minute. You're done.

    ]]>
    Sat, 09 May 2020 00:00:00 GMT
    Emacs: connect my Bluetooth speaker https://xenodium.com/emacs-connect-my-bluetooth-speaker https://xenodium.com/emacs-connect-my-bluetooth-speaker Connecting and disconnecting bluetooth devices on macOS is fairly simple: use the menu bar utility.

    But could we make it quicker from our beloved editor?

    Turns out with a little elisp glue, we can fuzzy search our Bluetooth devices and toggle connections. We can use Oleh Krehel's ivy-read for fuzzy searching and Felix Lapalme's nifty BluetoothConnector to list devices and toggle Bluetooth connections.

    As a bonus, we can make it remember the last selected device, so you can quickly toggle it again.

    (defun ar/ivy-bluetooth-connect ()
      "Connect to paired bluetooth device."
      (interactive)
      (assert (string-equal system-type "darwin")
              nil "macOS only. Sorry :/")
      (assert (executable-find "BluetoothConnector")
              nil "Install BluetoothConnector from https://github.com/lapfelix/BluetoothConnector")
      (ivy-read "(Dis)connect: "
                (seq-map
                 (lambda (item)
                   (let* ((device (split-string item " - "))
                          (mac (nth 0 device))
                          (name (nth 1 device)))
                     (propertize name
                                 'mac mac)))
                 (seq-filter
                  (lambda (line)
                    ;; Keep lines like: af-8c-3b-b1-99-af - Device name
                    (string-match-p "^[0-9a-f]\\{2\\}" line))
                  (with-current-buffer (get-buffer-create "*BluetoothConnector*")
                    (erase-buffer)
                    ;; BluetoothConnector exits with 64 if no param is given.
                    ;; Invoke with no params to get a list of devices.
                    (unless (eq 64 (call-process "BluetoothConnector" nil (current-buffer)))
                      (error (buffer-string)))
                    (split-string (buffer-string) "\n"))))
                :require-match t
                :preselect (when (boundp 'ar/misc-bluetooth-connect--history)
                             (nth 0 ar/misc-bluetooth-connect--history))
                :history 'ar/misc-bluetooth-connect--history
                :caller 'ar/toggle-bluetooth-connection
                :action (lambda (device)
                          (start-process "BluetoothConnector"
                                         (get-buffer-create "*BluetoothConnector*")
                                         "BluetoothConnector" (get-text-property 0 'mac device) "--notify"))))
    

    comments on twitter.

    ]]>
    Wed, 06 May 2020 00:00:00 GMT
    Duti: changing default macOS apps https://xenodium.com/duti-changing-default-macos-apps https://xenodium.com/duti-changing-default-macos-apps Future self example, setting mpv.io to open all aiff files on macOS:

    duti -s io.mpv aiff
    
    ]]>
    Sat, 02 May 2020 00:00:00 GMT
    Neapolitan pizza recipe https://xenodium.com/neapolitan-pizza-recipe https://xenodium.com/neapolitan-pizza-recipe Full disclosure: I'm a complete noob at making pizza. It's my second pizza, but hey, it was tasty and fun to make! Making pizza at home is not as far-fetched as I initially thought.

    UPDATES:

    I've made this recipe a couple of times. Made two improvements worth mentioning.

    Flan tin / quiche pan

    My first pizzas were rectangular, matching the baking tray shape, but I really wanted round pies. I found a quiche pan at home and gave that a try. Worked pretty well. The dish bottom comes up, which is pretty handy.

    Double baking

    Bake in two stages:

    1. Bake the pizza for 6 minutes (without the mozarella) at bottom of oven.
    2. Add mozzarella and make for 4 minutes at top of the oven.

    Recipe

    Ok, on to the recipe now…

    Dissolve the yeast

    • 7g of yeast.
    • 325ml of lukewarm water.

    Dissolve the yeast in the lukewarm water.

    Mixing the dough

    • 500g of flour.
    • 1 teaspoon of salt.

    Gradually add flour to the yeast and water mix, using the bottom of a spoon to work it until smooth (no lumps). The dough will be very sticky at first. Stay faithful to the spoon. It'll work. BBC's How to make pizza like a Neapolitan master has a great demo. I followed the dough technique.

    Kneading the dough

    Sprinkle some flour on the table and knead the dough (punch, stretch, and fold many times) from previous step. Eventually, the dough will hold its shape.

    Make 4 balls

    Roll the dough into a cylinder and cut into 4 pieces. Make 4 balls.

    Make the tomato sauce

    • 500g of passata.
    • 3 cloves of garlic.

    I love garlic. Who doesn't? Slice the garlic finely and combine with the passata in a class jar. Shake it a little. Garlic and passata. That's your sauce.

    Cover for 2 hours

    Place the 4 dough balls into a container and cover with a damp cloth for 2 hours. You can make 4 pizzas.

    *Rookie mistake: I should have used a bigger container. The balls grew and merged.

    Preheat oven

    Preheat the oven at 250°C.

    Stretch base

    Sprinkle more flour on table prior to shaping the dough. Place ball on table, flatten. Flip over, flatten again. Gradually stretch until you have the shape and thickness desired.

    Place base on baking tray

    • Semolina
    • Aluminium foil

    Line up the tray with some aluminium foil. Before transferring the base on to the baking tray, sprinkle semolina (or breadcrumbs) on the foil (it helps prevent the dough from sticking).

    Toppings

    • Tomato sauce.
    • Salt.
    • Olive oil.
    • Parmesan cheese.
    • 125g of Mozzarella cheese.
    • Fresh basil.

    Spread some of the tomato sauce with a spoon. Sprinkle salt, olive oil, and parmesan cheese. Break the mozzarella into pieces and spread throughout. Add some basil leaves. Your basic margherita pizza is now ready for the oven.

    Bake pizza

    Place the tray in the oven for 10 minutes. This worked for my oven, which goes up to 250°C. Either way, keep an eye on it.

    Post baking toppings

    • Anchovies.

    Controversial, but I really like anchovies. Add them post-baking and you're good to go. Enjoy your pizza.

    Helpful references

    ]]>
    Sun, 26 Apr 2020 00:00:00 GMT
    Oatmeal cookie recipe https://xenodium.com/oatmeal-cookie-recipe https://xenodium.com/oatmeal-cookie-recipe

    I combined elements from two recipes: 3 Ingredient oatmeal cookies (The Food Medic), Amy's Healthy Banana Oatmeal Raisin Cookies (Amy's Healthy Baking) and added my own touches.

    Preheat oven

    Preheat the oven at 180°C.

    Mash bananas

    • 2 medium ripe bananas.

    Mash until bananas have no significant lumps.

    Mix most ingredients (except oats)

    • 4 tablespoons crunchy peanut butter.
    • 1/2 teaspoon of ground cinnamon.
    • 1/2 teaspoon of ground cardamom.
    • 1/4 teaspoon of vanilla.
    • 1/3 cup raisins.

    Add the peanut butter, cinnamon, cardamom, and vanilla into the mashed bananas. Mix well. Add raisins and mix a little further to spread them out.

    Add oats

    • 1 3/4 cups of oats.

    Add the oats to the mix in a few rounds to ensure its evenly mixed.

    Flattened balls in tray

    Make balls, place on baking tray, and gently flatten. They'll be on the chunky side.

    Note: They won't spread as much as traditional cookies.

    Bake for 15 mins

    Bake for about 15 minutes or until golden.

    Let cool off and enjoy

    Wait a little and nom nom nom…

    ps. Full recipe source in org file.

    ]]>
    Tue, 21 Apr 2020 00:00:00 GMT
    TIL (today I learned) bookmarks https://xenodium.com/til-today-i-learned-bookmarks https://xenodium.com/til-today-i-learned-bookmarks
  • Hashrocket - Today I Learned.
  • jbranchaud/til: Today I Learned.
  • secretgeek: Today I Learned.
  • Simon Willison: TIL.
  • til - zerokspot.com.
  • Today I Learned — Sara Soueidan – Freelance-Front-End UI/UX Developer.
  • ]]>
    Tue, 21 Apr 2020 00:00:00 GMT
    mu/mu4e 1.4 released https://xenodium.com/mumu4e-14-released https://xenodium.com/mumu4e-14-released

    mu/mu4e 1.4 is out. About a week ago, I built and installed its pre-release version (1.3.10) and noted build steps on macOS. It's been working great for me. Today, I updated to 1.4.

    I was keen to try the new release out. I had been experiencing a short delay immediately after syncing/indexing mail. An initial investigation pointed to contact syncing, but I didn't dig further. The 1.4 release notes had a promising entry:

    In many cases, `mu4e' used to receive all contacts after each indexing operation; this was slow for some users, so we have updated this to only get the contacts that have changed since the last round.

    After upgrading. The delay is gone for me ø/

    Note: there are a few config tweaks needed for the 1.4 upgrade, but these are well-documented in the release notes. For me, it primarily consisted of:

    • Swapping elisp mu4e-maildir var for mu init –maildir path/to/local/IMAP.
    • Swapping elisp mu4e-user-mail-address-list for mu init –my-address [email protected] –my-address [email protected].
    • Disabling mu4e-maildirs-extension (not yet compatible with mu 1.4). No issues here, since I hardly ever look at the mu4e-main buffer. I have global binding to my unread messages that looks a little something like this:
    (defun ar/mu4e-view-unread-messages ()
      (interactive)
      (mu4e-headers-search-bookmark (concat "flag:unread AND "
                                            "flag:unread AND "
                                            "NOT flag:trashed AND "
                                            "(maildir:/box1/INBOX OR "
                                            "maildir:/box2/INBOX)")))
    

    comments on twitter.

    ]]>
    Sun, 19 Apr 2020 00:00:00 GMT
    Libya travel bookmarks https://xenodium.com/libya-travel-bookmarks https://xenodium.com/libya-travel-bookmarks
  • The city of Ghadames on the edge of the Saharan desert.
  • ]]>
    Tue, 14 Apr 2020 00:00:00 GMT
    Trimming videos with ffmpeg https://xenodium.com/trimming-videos-with-ffmpeg https://xenodium.com/trimming-videos-with-ffmpeg Via Bernd Verst's Trim Videos Instantly:

    Start time + duration

    ffmpeg -ss hh:mm:ss.msec -i in.mpeg -c copy -map 0 -t hh:mm:ss.msec out.mpeg
    

    Start time + end time

    ffmpeg -ss hh:mm:ss.msec -i in.mpeg -c copy -map 0 -to hh:mm:ss.msec out.mpeg
    
    ]]>
    Tue, 07 Apr 2020 00:00:00 GMT
    Emacs's counsel-M-x meets multiple cursors https://xenodium.com/emacss-counsel-m-x-meets-multiple-cursors https://xenodium.com/emacss-counsel-m-x-meets-multiple-cursors I'm a fan of Magnar Sveen's multiple cursors Emacs implementation. It's just so fun to use and works very well with commands bound to my favorite keys.

    Every now and then I'd like to execute extended commands on all cursors, but they have no keys bound to them. If you're an ivy/counsel fan like me (and all packages by Abo Abo), you use counsel-M-x to invoke commands. However, counsel-M-x doesn't support multiple cursors out of the box. Luckily, this is Emacs and we can fix that…

    Back in December 2019, I made a note to revisit u/snippins1987's weekly tip to pair helm-M-x with multiple cursors. Finally got back to it. With a few changes, we can also make the snippet work with counsel-M-x ø/.

    (defun adviced:counsel-M-x-action (orig-fun &rest r)
      "Additional support for multiple cursors."
      (apply orig-fun r)
      (let ((cmd (intern (car r))))
        (when (and (boundp 'multiple-cursors-mode)
                   multiple-cursors-mode
                   cmd
                   (not (memq cmd mc--default-cmds-to-run-once))
                   (not (memq cmd mc/cmds-to-run-once))
                   (or mc/always-run-for-all
                       (memq cmd mc--default-cmds-to-run-for-all)
                       (memq cmd mc/cmds-to-run-for-all)
                       (mc/prompt-for-inclusion-in-whitelist cmd)))
          (mc/execute-command-for-all-fake-cursors cmd))))
    
    (advice-add #'counsel-M-x-action
                :around
                #'adviced:counsel-M-x-action)
    

    ]]>
    Mon, 06 Apr 2020 00:00:00 GMT
    Portland travel bookmarks https://xenodium.com/portland-travel-bookmarks https://xenodium.com/portland-travel-bookmarks
  • Powell’s Books | The World’s Largest Independent Bookstore.
  • ]]>
    Sun, 05 Apr 2020 00:00:00 GMT
    String inflection Emacs package https://xenodium.com/string-inflection-emacs-package https://xenodium.com/string-inflection-emacs-package string-inflection (by Akira Ikeda) is a nifty package to cycle through string case styles: camel, snake, kebab… The package includes a handful of cycling functions for different languages (Ruby, Python and Java), but it's easy to mix and match to roll your own. For now, I'm binding C-M-j to string-inflection-cycle, which is an alias to string-inflection-ruby-style-cycle.

    (use-package string-inflection
      :ensure t
      :bind (:map prog-mode-map
                  ("C-M-j" . string-inflection-cycle)))
    

    comments on twitter

    ]]>
    Sun, 29 Mar 2020 00:00:00 GMT
    Turkey travel bookmarks https://xenodium.com/turkey-travel-bookmarks https://xenodium.com/turkey-travel-bookmarks
  • Tomb of Amyntas - Wikipedia.
  • ]]>
    Sat, 28 Mar 2020 00:00:00 GMT
    Dal Makhani (black lentils) recipe https://xenodium.com/dal-makhani-black-lentils-recipe https://xenodium.com/dal-makhani-black-lentils-recipe

    Soak beans (overnight)

    • 1 cup of rajmah (kidney beans).
    • 2 cups of sabut urad (black lentils).

    Place the beans in a bowl with plenty of water. The beans will soak it up so ensure there's enough.

    Cooking the beans

    • 3 liters of water.
    • 1 cinamon stick.
    • 1 tablespoon of turmeric.
    • 2 bay leaves.

    Drain the beans and combine new ingredients into a pot. Bring to a boil and simer for 1.5 hours. Check beans aren't firm (give 'em a try'). If so extend another 15-30 mins.

    Prepare paste

    • 1 4 cm piece of ginger.
    • 1 large onion.
    • 6 garlic cloves.
    • 2 tomatoes.

    Put through blender (with choppin pulse) or food processor until you get a paste.

    Golden paste

    • Paste.
    • 3 tablespoons of butter.
    • 1 tablespoon of cumin seeds.
    • 1 tablespoon of coriander powder.
    • 1 tablespoon of chilly powder (or less to make milder).
    • 1 fresh red hot pepper (find one with medium heat level) chopped.
    • 1 tablespoon of cumin powder.
    • 1/4 cup of water.
    • 3/4 tablespoon of salt.

    Heat up the butter (medium heat) and brown the cumin seeds (maybe 30 seconds). Add the paste from previous step. Cook for about 4 minutes or until golden. Add the remaining ingredients in step (except water) and cook for another 30 seconds. Add the water and salt and mix to make more fluid and remove from heat.

    Tying it all together

    • 1 tablespoon of panchpuram (cumin, fenugreek, mistard, and fennel seeds).
    • 300 ml of double cream.

    Combine the cooked beans, golden paste, and seeds. Simmer for about 15 minutes. Add the cream and cook for about 2 minutes. You are effectively done.

    Garnish (optional)

    You can serve and optionally garnish with some chopped coriander. Recommended.

    Serve with

    Basmati rice, rotis, buttered buns, or even corn tortillas (unorthodox, but hey).

    ]]>
    Wed, 25 Mar 2020 00:00:00 GMT
    Modern Emacs lisp libraries https://xenodium.com/modern-elisp-libraries https://xenodium.com/modern-elisp-libraries Quickly finding related built-in elisp functions (without prefixes) can sometimes take a little poking around.

    Some modern and predictable built-in exceptions I now reach out to are:

    • map.el for key/values, alists, hash-tables and arrays (built-in as of Emacs 25.1).
    • seq.el for sequence manipulation functions (built-in as of Emacs 25.1).
    • subr-x.el has a handful of string functions (built-in as of Emacs 24.4).
    • let-alist.el wonderful syntax for alists, great for json (built-in as of Emacs 25.1).

    If you don't mind reaching out to third-party libs (you likely have some of these already installed), here are some modern, predictable, and well-documented ones that always get me out of trouble:

    I'm happy with built-ins like map.el, seq.el, and let-alist.el. subr-x.el is also pretty nice, although not as full-featured as third-party s.el.

    Am I missing out on other modern built-ins or third-party libraries?

    UPDATE: Added a handful of newly discovered libraries plus suggestions by Daniel Martín (thanks!). Not tried any of these myself.

    comments on twitter

    ]]>
    Sat, 21 Mar 2020 00:00:00 GMT
    Emacs smartparens auto-indent https://xenodium.com/emacs-smartparens-auto-indent https://xenodium.com/emacs-smartparens-auto-indent While I do most editing in Emacs, I use Xcode every now and then. I like Xcode's pair matching (of brackets) combined with its auto-indent.

    While the wonderful smartparens gives Emacs pair-matching powers, it doesn't automatically indent between pairs (out of the box anyway).

    Luckily, smartparens does provide sp-local-pair, which enables us to achieve a similar goal.

    With a short snippet, we can autoindent between {}, [], and () when pressing return in-between.

    (defun indent-between-pair (&rest _ignored)
      (newline)
      (indent-according-to-mode)
      (forward-line -1)
      (indent-according-to-mode))
    
    (sp-local-pair 'prog-mode "{" nil :post-handlers '((indent-between-pair "RET")))
    (sp-local-pair 'prog-mode "[" nil :post-handlers '((indent-between-pair "RET")))
    (sp-local-pair 'prog-mode "(" nil :post-handlers '((indent-between-pair "RET")))
    

    comments on twitter

    ]]>
    Fri, 20 Mar 2020 00:00:00 GMT
    Solarpunk bookmarks https://xenodium.com/solarpunk-bookmarks https://xenodium.com/solarpunk-bookmarks
  • SOLARPUNK : A REFERENCE GUIDE - Solarpunks - Medium.
  • Solarpunk: Notes toward a manifesto (Project Hieroglyph).
  • ]]>
    Fri, 20 Mar 2020 00:00:00 GMT
    sqlite bookmarks https://xenodium.com/sqlite-bookmarks https://xenodium.com/sqlite-bookmarks
  • DuckDB: SQLite for Analytics | Hacker News.
  • GitHub - ZetloStudio/ZeQLplus: Open Source Terminal SQLite Database Browser.
  • Inserting 130M SQLite rows per minute from a scripting language | Hacker News.
  • Inserting One Billion Rows in SQLite Under A Minute - blag.
  • LiteCLI – A user-friendly command-line client for SQLite database (Hacker News).
  • SQLite As An Application File Format.
  • Zumero: Efficient sync by using multiple SQLite files.
  • ]]>
    Tue, 10 Mar 2020 00:00:00 GMT
    covid-19 bookmarks https://xenodium.com/covid-19-bookmarks https://xenodium.com/covid-19-bookmarks
  • A Data-Centric Approach to Plan Appropriate COVID-19 Response in the United States.
  • Coronavirus action plan: a guide to what you can expect across the UK - GOV.UK.
  • Coronavirus COVID-19 Global Cases by Johns Hopkins CSSE.
  • COVID-19 (r/COVID19).
  • COVID-19 Discussion (r/China_Flu/).
  • Covid-19 DocSearch free access.
  • COVID19 - AMA with r/COVID19 mod u/Jennifer Cole at 10.00pm GMT 25 Feb.
  • Handbook of Covid-19 Prevention and Treatment from Hospital with 0% fatality (HN).
  • microCOVID Project (calculate risk).
  • New research suggests runners should be further than 2m apart.
  • Novel Coronavirus (2019-nCoV) (r/coronavirus).
  • Physics of COVID-19 Transmission | MIT OpenCourseWare.
  • Self-care Tips if you become sick with COVID-19 from an activist nurse.
  • WHO: When and how to use masks.
  • ]]>
    Wed, 26 Feb 2020 00:00:00 GMT
    Security bookmarks https://xenodium.com/security-bookmarks https://xenodium.com/security-bookmarks
  • A Graduate Course in Applied Cryptography | Hacker News.
  • Jeffrey Paul: Stupid Unix Tricks (ssh).
  • Jeffrey Paul: Stupid Unix Tricks (yubikey setup).
  • Stay paranoid and trust no one. Overview of common security vulnerabilities in web applications.
  • ]]>
    Sat, 15 Feb 2020 00:00:00 GMT
    Nix bookmarks https://xenodium.com/nix-bookmarks https://xenodium.com/nix-bookmarks
  • Daniel Bergey's dotfiles/emacs.nix.
  • I Was Wrong about Nix | Hacker News.
  • I was wrong about Nix.
  • ]]>
    Sat, 15 Feb 2020 00:00:00 GMT
    Plants bookmarks https://xenodium.com/plants-bookmarks https://xenodium.com/plants-bookmarks
  • Aechmea 'Blue Rain' Blue rain Bromeliad | House of Plants.
  • Air-purifying Plants – Bakker.com.
  • Citronella Mosquito Plant.
  • Elm plants.
  • Farm Hack.
  • Guerilla Gardening (2015) | Hacker News.
  • The Gardening Club® - Crews Hill, Enfield.
  • ]]>
    Fri, 10 Jan 2020 00:00:00 GMT
    Fixing Honeywell CM927's dead screen https://xenodium.com/fixing-honeywell-cm927-dead-screens https://xenodium.com/fixing-honeywell-cm927-dead-screens My Honeywell CM927 thermostat's screen had been getting progressively worse over the last year. As of late, the screen was of little use.

    A random search yielded the Honeywell CM927 LCD screen fail - common? thread, with a promising comment by Phil:

    "Strip the unit and remove the circuit board (just a few plastic clips, no screws). Remove the LCD assembly from the circuit board (more plastic clips and an eight pin push connection). Removed the LCD unit from the clear plastic housing (more plastic clips). Finally heat up the plastic ribbon where it is stuck to the circuit board (hair dryer will do trick) and then firmly press it onto the circuit board… probably worth doing this several times; in effect you are remating the ribbon to the circuit board by softening the adhesive. Put it all back together and it should be working again."

    Phil's instructions were great. There's also a super handy video by El Tucan, also linked by Stevie.

    Success ø/

    Heating up the plastic ribbon and pressing it onto the circuit board did the trick for me. Took a few tries for all segments to appear, but the screen is looking great again.

    Thank you Internet strangers! :)

    ]]>
    Sun, 29 Dec 2019 00:00:00 GMT
    SwiftUI bookmarks https://xenodium.com/swiftui-bookmarks https://xenodium.com/swiftui-bookmarks
  • SwiftUI live-blur materials that you can use like a background color.
  • 8 Common SwiftUI Mistakes - and how to fix them – Hacking with Swift.
  • <SwiftUI for Absolute Beginners>读书 - emacsist.
  • @Environment values.
  • `@State` `onChange`.
  • `SwiftUI` Framework Learning and Usage Guide.
  • A Companion for SwiftUI - The SwiftUI Lab.
  • A deep dive into Swift’s function builders | Swift by Sundell.
  • A Fast Fuzzy Search Implementation · objc.io.
  • A guide to SwiftUI’s state management system | Swift by Sundell.
  • A guide to the SwiftUI layout system - Part 1 | Swift by Sundell.
  • A SwiftUI iOS system components and interactions demo app based on iOS 14.
  • ActionOver: A custom SwiftUI modifier to present an Action Sheet on iPhone and a Popover on iPad and Mac.
  • Advanced SwiftUI Animations - Part 1: Paths - The SwiftUI Lab.
  • Advanced SwiftUI Transitions - The SwiftUI Lab.
  • AutomaticSettings: Data driven settings UI.
  • Building a MapView app with SwiftUI — Morning SwiftUI.
  • Building a Widget for iOS with SwiftUI and WidgetKit - SchwiftyUI.
  • Building Pager view in SwiftUI | Majid’s blog about Swift development.
  • Building ViewModels with Combine framework.
  • Category: Combine – Donny Wals.
  • Combine: Asynchronous Programming with Swift.
  • Composable styling in SwiftUI | Swift with Majid.
  • Constructing Data with Swift Function Builders – Oliver Binns.
  • Context Menu, Alert and ActionSheet in SwiftUI.
  • Create an SPM Package for SwiftUI | Daniel Saidi.
  • CwlFitting: A small SwiftUI package to aid with "shrink-to-fit" + "fill-aligned" VStack and HStack arrangements.
  • debugPrint() SwiftUI modifier.
  • Deep dive into Swift frameworks - The.Swift.Dev..
  • Default a View in NavigationView with SwiftUI - DEV Community.
  • designcode's SwiftUI course.
  • Detecting changes to a folder in iOS using Swift.
  • Dismiss Gesture for SwiftUI Modals - The SwiftUI Lab.
  • First learnings from adopting SwiftUI - Christos Karaiskos - Medium (card example).
  • Function Builders in Swift and SwiftUI.
  • GeometryReader to the Rescue - The SwiftUI Lab.
  • Gestures in SwiftUI - Better Programming - Medium.
  • GitHub - AppPear/ChartView: ChartView made in SwiftUI.
  • GitHub - dasautoooo/Parma: A SwiftUI view for displaying Markdown with custom..
  • GitHub - Dimillian/MovieSwiftUI: SwiftUI & Combine app using MovieDB API..
  • GitHub - Jinxiansen/SwiftUI: `SwiftUI` Framework Learning and Usage Guide..
  • GitHub - mecid/SwiftUICharts: A simple line and bar charting library written for SwiftUI.
  • GitHub - nalexn/EnvironmentOverrides: QA assistant for a SwiftUI app.
  • GitHub - nerdsupremacist/FancyScrollView (list with growing/snapping header).
  • GitHub - paololeonardi/WaterfallGrid: A waterfall grid layout view for SwiftUI..
  • GitHub - SimpleBoilerplates/SwiftUI-Cheat-Sheet: SwiftUI Cheat Sheet.
  • GitHub - siteline/SwiftUI-Introspect: Introspect underlying UIKit components.
  • GitHub - SwiftUIX/SwiftUIX: An extension to the standard SwiftUI library..
  • Gradient in SwiftUI | Majid’s blog about Swift development.
  • How to add a toolbar above the keyboard using inputAccessoryView.
  • How to animate along zIndex in SwiftUI.
  • How to create a side menu (hamburger menu) in SwiftUI | BLCKBIRDS.
  • How to Create a Splash Screen With SwiftUI | raywenderlich.com.
  • how to display a search bar with SwiftUI - Stack Overflow.
  • How to fix slow List updates in SwiftUI – Hacking with Swift.
  • How to Schedule Notifications and Add Badges in SwiftUI.
  • Image resizing techniques in Swift (smooth scroll).
  • Implement a Search Bar in SwiftUI - Better Programming - Medium.
  • Implementing Context Menus in iOS 13 Using SwiftUI or UIKit.
  • In the new SwiftUI, is there any reason you would still use ObservedObject instead of StateObject?.
  • Inspecting the View Tree with PreferenceKey - Part 1 - The SwiftUI Lab.
  • Integrate SwiftUI on UIKIT project its actually pretty easy.
  • ios - How to make view the size of another view in SwiftUI - Stack Overflow.
  • Lessons learned with Swift + iOS development.
  • Line-Wrapping Stacks - Swift You and I.
  • LLDB "_regexp-break <file>:<line>:<column>", breakpoint at a particular source code line and column.
  • Mastering grids in SwiftUI | Swift with Majid.
  • Mastering ScrollView in SwiftUI | Swift with Majid.
  • Multiplatform Messages app for macOS, iOS, iPadOS in SwiftUI.
  • Must-have SwiftUI extensions | Majid’s blog about Swift development.
  • New property wrappers in SwiftUI (@ScaledMetric, @SceneStorage, @AppStorage, @StateObject).
  • On iOS 14, the keyboard is added to safe area.
  • Our New Book: Thinking in SwiftUI · objc.io.
  • Performance Battle: AnyView vs Group - Alexey Naumov.
  • Practical Combine: An introduction to Combine with real examples.
  • Programmatic navigation in SwiftUI project - Alexey Naumov.
  • Property Wrappers in Swift 5.1. An introduction to one of Swift 5.1’s.
  • Pull-to-Refresh in SwiftUI | Swift with Majid.
  • Recreate iOS style Welcome Screen to any app in 3 minutes.
  • Recreate this Control Center widget in SwiftUI.
  • Remote images in SwiftUI - DEV Community.
  • Resizing Techniques and Image Quality That Every iOS Developer Should Know (Swift).
  • Reusable Image Cache in Swift - Flawless iOS - Medium.
  • Search View in SwiftUI | Ordinary Coding.
  • Selecting dates and times with DatePicker.
  • Short video showing you how to debug, learn, or teach Combine operators with Timelane - the approach is always the same, add lanes - analyze the data.
  • Sidebar navigation in SwiftUI | Swift with Majid.
  • StaggeredList Sample App: A Staggered Pinterest Like Layout using SwiftUI.
  • State and Data Flow | Apple Developer Documentation.
  • Stretchable header.
  • swift - HStack with SF Symbols Image not aligned centered - Stack Overflow.
  • swift - ImagePicker in SwiftUI - Stack Overflow.
  • Swift Property Wrappers - NSHipster.
  • Swift UI Property Wrappers (@State, @StateObject, @EnvironmentObject, @ObservedObject, @Binding).
  • swiftui - Not Receiving scenePhase Changes (foreground/background).
  • SwiftUI and Redux — Clean Code and Small, Independent Components.
  • SwiftUI Animation (buttons, current-rotations, etc) | Sarun.
  • SwiftUI Animation | Sarun.
  • SwiftUI basic components (form example).
  • SwiftUI Buttons and images (using systemName).
  • SwiftUI courses.
  • SwiftUI Custom Styling - The SwiftUI Lab (scaleEffect and opacity on isPressed).
  • SwiftUI DatePicker.
  • SwiftUI displaying customizable quick action card.
  • SwiftUI for Mac 2024 :: TrozWare — Mac books & articles.
  • SwiftUI for Mac on Big Sur :: TrozWare.
  • SwiftUI gives you .isPlaceholder in WidgetKit generate a placeholders
  • SwiftUI Import/Export files | Rizwan's Blog 👨‍💻.
  • SwiftUI Layout System | Alexander Grebenyuk.
  • SwiftUI NavigationView tutorial with examples - Simple Swift Guide.
  • SwiftUI notes - Tomasz Nazarenko Blog.
  • SwiftUI picker gotchas.
  • SwiftUI Search Bar in the Navigation Bar.
  • SwiftUI snippets by Jeroen Zonneveld.
  • SwiftUI Tutorial: How to Build a Form UI for iOS Apps.
  • SwiftUI Tutorials on SwiftUI Hub.
  • swiftui.gallery | A gallery of SwiftUI code example snippets.
  • swiftui.gallery: sign up form sample.
  • swiftui: A collaborative list of awesome SwiftUI resources.
  • SwiftUI: Equal widths view constraints — finestructure.
  • SwiftUI: Shake Animation · objc.io.
  • SwiftUIStaggeredList: Staggered Layout List Using SwiftUI.
  • SwiftUI’s New App Lifecycle and Replacements for AppDelegate.
  • Swipe gesture SwiftUI | Daniel Saidi.
  • SwuiftUI books.
  • Tagged “SwiftUI” | Sarun.
  • TextField in SwiftUI | Majid’s blog about Swift development.
  • The Complete SwiftUI Documentation You’ve Been Waiting For.
  • The difference between @StateObject, @EnvironmentObject, and @ObservedObject.
  • The Power of the Hosting+Representable Combo (scroll SwiftUI list).
  • The SwiftUI Toolbar in iOS 14.
  • The ultimate Combine framework tutorial in Swift - The.Swift.Dev..
  • Trailing Closure (SwiftUI tutotials).
  • Tweet on improving List SwiftUI performace (searching).
  • UICollectionView Custom Layout Tutorial: Pinterest | raywenderlich.com.
  • URL Image view in SwiftUI.
  • URLSession: Common pitfalls with background download & upload tasks.
  • Using Combine (extensive online book).
  • Using iOS 14's Menu as a Picker in SwiftUI.
  • View composition in SwiftUI | Majid’s blog about Swift development.
  • Views Choose Their Own Sizes – Netsplit.com.
  • Visualize Combine Magic with SwiftUI Part 1 - Flawless iOS - Medium.
  • What’s the difference between @StateObject and @ObservedObject? – Donny Wals.
  • Why I quit using the ObservableObject - Alexey Naumov.
  • Working with Focus on SwiftUI Views - The SwiftUI Lab.
  • ]]>
    Sun, 29 Dec 2019 00:00:00 GMT
    Studying for Life in the UK test https://xenodium.com/studying-for-life-in-the-uk-test https://xenodium.com/studying-for-life-in-the-uk-test Today, I passed the Life in the UK test. Wasn't quite sure how to study for it. During my commutes, I listened to the Life in the UK 2019 Test audio book.

    A friend recommended lifeintheuktestweb.co.uk. Overall, I found their practice tests very useful. Taking a bunch tests helped me internalize the material.

    Took some notes along the way (mostly data with years attached) and dumped it into an org table. This helped me form a mental timeline.

    NOTE: These tables alone are not comprehensive enough to prepare for the exam. You'll need to know additional information without dates attached.

    Events

    Year Event


    2012 Diamond Jubilee 1999 Scottish Parliament formed 1973 UK joins the EU ø/ 1972 Mary Peters wins Gold medal (pentathlon) 1957 Treaty of Rome signed (March 25) 1950 UK signs European Convention of Human Rights 1949 Ireland become a republic 1947 Granted independence India, Pakistan and Ceylon (Sri Lanka) 1945 Clement Attlee elected 1945 Alexander Fleming discovers penicillin 1945 WWII ends 1944 Butler Act (free secondary education England/Wales) 1940 Battle of Britain 1939 Germany invades Poland 1930s Turing Machine 1936 BBC first regular television service 1932 First television broadcast 1930 British Film Studios Fluorish 1928 Women/men with same voting age 1918 WWI ends (November 11, 11am) 1903 Emmeline Pankhurst Women’s Social and Political Union (suffragettes) 1902 Motor-car racing in UK 1896 First film shown publicly 1899-1902 The Boer War (South Africa) 1870-1914 120000 Russian and Polish Jews fled to Britain to escape prosecution 1853-1856 Crimean War 1851 Great Exhibition (showcased Crystal Palance) 1837 Queen Victoria becomes queen (at 18) 1833 Emancipation Act (abolished slavery throughout British Emprire) 1832 The Reform Act (increase number of people with voting rights) 1776 North American colonies want out (don't tax us without representation) 1745 Bonnie Prince Charlie gets support by clansmen from Scottish highlands 1714 Queen Ann dies, George I becomes King 1689 Bill of rights (limit rights of kings) 1688 William of Orange invades England (proclaims king) 1680-1720 Huguenots refugees came to England (from France) 1695 Free press (newspapers) established 1679 Habeas Corpus Act (right to trial) 1649-1660 Cromwell rules republic for 11 years (Charles I executed) 1642 English Civil war (Cavaliers vs Roundheads) 1606 Union flag created 1588 English beat Spanish Armada 1348 Black death (third population die) 1314 Battle of Bannockburn: Robert the Bruce (Scottish King) beats English invasion 1284 Statute of Rhuddlan (Wales joins Crown, by King Edward I) 1215 Magna Carta created 1066 Norman Conquest (Saxon King Harold killed by William I) 300-400 AD Christians appear in Britain 789 AD Vikings first visit Britain and raid coastal towns 6000 years ago Farmers come to Britain

    Population

    Year Population


    2010 > 62 million 2005 < 60 million 1998 57 million 1951 50 million 1901 40 million 1851 20 million 1700 5 million 1600 > 4 million

    ]]>
    Tue, 17 Dec 2019 00:00:00 GMT
    Georgia travel bookmarks https://xenodium.com/georgia-travel-bookmarks https://xenodium.com/georgia-travel-bookmarks
  • Abandoned Georgia.
  • ]]>
    Sun, 01 Dec 2019 00:00:00 GMT
    Wizard zines comics in Emacs eshell https://xenodium.com/wizard-zines-comics-eshell-util https://xenodium.com/wizard-zines-comics-eshell-util Over at wizardzines.com, Julia Evans authors wonderful zines on topics like git, networking, linux, command-line utilities, and others. Some zines are paid. Some are free. No affiliation here, just a fan.

    A little while ago, Julia tweeted about a utility she's building to view her original comics on similar topics. I instantly thought it'd be a fun tool to implement for Emacs eshell.

    Since then, I subscribed to wizardzines.com/saturday-comics and received a few comics (awk, tar, and bash tricks). I saved them locally (using topic name and dropping file extensions).

    ls -1 ~/Downloads/wizardzines-comics/
    

    awk bash tar

    By no means battle-tested, but here's an elisp snippet defining the ecomic command. It displays inlined comics in the handy eshell.

    (require 'eshell)
    (require 'iimage)
    
    (defvar wizardzines-comics-path "~/Downloads/wizardzines-comics")
    
    (defun eshell/ecomic (&rest args)
      "Display command comic in ARGS.
    Note: ensure comic images live in `wizardzines-comics-path', named with
    command name and no extension."
      (eshell-eval-using-options
       "ecomic" args
       '((?h "help" nil nil "show this usage screen")
         :external "ecomic"
         :show-usage
         :usage "COMMAND
    
    Show COMMAND comic from Julia Evans' https://wizardzines.com/saturday-comics")
       (let* ((command (nth 0 (eshell-stringify-list (eshell-flatten-list args))))
              (image-fpath (concat (file-name-as-directory
                                    (expand-file-name wizardzines-comics-path))
                                   command)))
         (unless (file-exists-p image-fpath)
           (error "comic: \"%s\" not found :-(" command))
         (eshell-buffered-print "\n")
         (add-text-properties 0 (length image-fpath)
                              `(display ,(create-image image-fpath)
                                        modification-hooks
                                        (iimage-modification-hook))
                              image-fpath)
         (eshell-buffered-print image-fpath)
         (eshell-flush))))
    

    comments on twitter

    Updates

    • Tweaked title.
    ]]>
    Sun, 24 Nov 2019 00:00:00 GMT
    Emacs counsel default search switches https://xenodium.com/emacs-counsel-default-search-switches https://xenodium.com/emacs-counsel-default-search-switches Following up from Enhanced Emacs searching with counsel switches, rather than remembering silver searcher and ripgrep switches, we can use counsel's ivy-initial-inputs-alist to set these up as default visible switches.

    (push '(counsel-ag . "--file-search-regex '' -- ") ivy-initial-inputs-alist)
    (push '(counsel-rg . "--glob '**' -- ") ivy-initial-inputs-alist)
    

    The default switches stay out of the way in typical searches, but can be easily modified to include (or exclude) results matching specific file names.

    comments on twitter

    ]]>
    Thu, 21 Nov 2019 00:00:00 GMT
    Enhanced Emacs searching with counsel switches https://xenodium.com/enhanced-emacs-searching-with-counsel-switches https://xenodium.com/enhanced-emacs-searching-with-counsel-switches The counsel family of Emacs search commands are great for searching the filesystem. More specifically, counsel-rg, counsel-ag, and counsel-pt, which use the popular ripgrep, silver searcher, and platinum searcher utilities.

    counsel-rg is my default searcher. It returns results quickly, with live updates as I tweak the search query.

    Up until recently, my queries typically matched text in files only. This works great, but every so often I wished I could amend the query to include (or exclude) results matching specific file names. Turns out, you can prepend the search query with additional switches using the "–" separator.

    The switches are usually utility-specific, but if we wanted to keep results from file names matching a glob, we can prepend the ripgrep query with something like "–glob Make* –" or the shorter version "-g Make* –".

    rg: -g Make* – install

    ]]>
    Sun, 10 Nov 2019 00:00:00 GMT
    Emacs org block company completion https://xenodium.com/emacs-org-block-company-completion https://xenodium.com/emacs-org-block-company-completion UPDATE: This is now available on melpa.

    Back in 2015, I bound the "<" key to a hydra for quickly inserting org blocks. The idea came from Oleg's post on org-mode block templates in Hydra. The suggested binding settled in my muscle memory without much effort.

    Fast forward to Febrary 2019. I replaced the hydra with org-insert-structure-template when org-try-structure-completion was removed from org mode. No biggie, as I kept the same binding to "<" and hardly noticed the change.

    Since my primary use-case for easy templates is inserting source blocks, I was keen to expedite choosing the source language as well as inserting the source block itself.

    Writing a small company mode completion backend fits my primary use-case pretty well.

    The company backend looks as follow (Warning: Snippet needs Org v9.2).

    Note: This code is not up to date. Install via melpa or see its repository.

    (require 'map)
    (require 'org)
    (require 'seq)
    
    (defvar company-org-block-bol-p t "If t, detect completion when at
    begining of line, otherwise detect completion anywhere.")
    
    (defvar company-org--regexp "<\\([^ ]*\\)")
    
    (defun company-org-block (command &optional arg &rest ignored)
      "Complete org babel languages into source blocks."
      (interactive (list 'interactive))
      (cl-case command
        (interactive (company-begin-backend 'company-org-block))
        (prefix (when (derived-mode-p 'org-mode)
                  (company-org-block--grab-symbol-cons)))
        (candidates (company-org-block--candidates arg))
        (post-completion
         (company-org-block--expand arg))))
    
    (defun company-org-block--candidates (prefix)
      "Return a list of org babel languages matching PREFIX."
      (seq-filter (lambda (language)
                    (string-prefix-p prefix language))
                  ;; Flatten `org-babel-load-languages' and
                  ;; `org-structure-template-alist', join, and sort.
                  (seq-sort
                   #'string-lessp
                   (append
                    (mapcar #'prin1-to-string
                            (map-keys org-babel-load-languages))
                    (map-values org-structure-template-alist)))))
    
    (defun company-org-block--template-p (template)
      (seq-contains (map-values org-structure-template-alist)
                    template))
    
    (defun company-org-block--expand (insertion)
      "Replace INSERTION with actual source block."
      (delete-region (point) (- (point) (1+ ;; Include "<" in length.
                                         (length insertion))))
      (if (company-org-block--template-p insertion)
          (company-org-block--wrap-point insertion
                                         ;; May be multiple words.
                                         ;; Take the first one.
                                         (nth 0 (split-string insertion)))
        (company-org-block--wrap-point (format "src %s" insertion)
                                       "src")))
    
    (defun company-org-block--wrap-point (begin end)
      "Wrap point with block using BEGIN and END.  For example:
    #+begin_BEGIN
      |
    #+end_END"
      (insert (format "#+begin_%s\n" begin))
      (insert (make-string org-edit-src-content-indentation ?\s))
      ;; Saving excursion restores point to location inside code block.
      (save-excursion
        (insert (format "\n#+end_%s" end))))
    
    (defun company-org-block--grab-symbol-cons ()
      "Return cons with symbol and t whenever prefix of < is found.
    For example: \"<e\" -> (\"e\" . t)"
      (when (looking-back (if company-org-block-bol-p
                              (concat "^" company-org--regexp)
                            company-org--regexp)
                          (line-beginning-position))
        (cons (match-string-no-properties 1) t)))
    

    To use, add the backend enable company-mode in org-mode:

    (add-to-list 'company-backends 'company-org-block)
    (company-mode +1)
    

    Updates

    ]]>
    Sun, 10 Nov 2019 00:00:00 GMT
    IRC bookmarks https://xenodium.com/irc-bookmarks https://xenodium.com/irc-bookmarks
  • Awesome IRC.
  • ]]>
    Fri, 08 Nov 2019 00:00:00 GMT
    A more reusable Emacs shell-command history https://xenodium.com/more-reusable-emacs-shell-command-history https://xenodium.com/more-reusable-emacs-shell-command-history Cameron Desautel has a great post on Working Faster in Emacs by Reading the "Future", highlighting M-n's usefulness for inserting minibuffer default values.

    Invoking M-n in shell-command's prompt is handy for quickly getting the current buffer's file name. This works great for one-off shell commands like "chmod +x script.sh" or "tidy -xml -i -m data.xml". Unfortunately, these commands aren't easily reusable from shell-command's minibuffer history, since it'll keep hardcoded file names.

    There's likely existing built-in functionality or a more elaborate package for this, but advising read-shell-command enables us to write more reusable commands like "chmod +x $f" or "tidy -xml -i -m $f". We merely replace $f with (buffer-file-name), and let everything else continue as usual.

    (defun ar/adviced-read-shell-command (orig-fun &rest r)
      "Advice around `read-shell-command' to replace $f with buffer file name."
      (let ((command (apply orig-fun r)))
        (if (string-match-p "\\$f" command)
            (replace-regexp-in-string "\\$f"
                                      (or (buffer-file-name)
                                          (user-error "No file file visited to replace $f"))
                                      command)
          command)))
    
    (advice-add 'read-shell-command
                :around
                'ar/adviced-read-shell-command)
    

    It's worth mentioning that searching minibuffer history is pretty simple when leveraging counsel to fuzzy search (via counsel-minibuffer-history, bound to C-r by default).

    On a final note, searching minibuffer history for cache hits is way more useful with richer history content. Be sure to save minibuffer history across Emacs sessions and increase shell-command-history using the built-in savehist-mode.

    (use-package savehist
      :custom
      (savehist-file "~/.emacs.d/savehist")
      (savehist-save-minibuffer-history t)
      (history-length 10000)
      (savehist-additional-variables
       '(shell-command-history))
      :config
      (savehist-mode +1))
    
    ]]>
    Sun, 03 Nov 2019 00:00:00 GMT
    Taiwan travel bookmarks https://xenodium.com/taiwan-travel-bookmarks https://xenodium.com/taiwan-travel-bookmarks
  • Sun Moon Lake Tea: Why is it so good? (Spiritual Travels).
  • Taipei, 2019.
  • Why You Should Remote Work in Taiwan.
  • ]]>
    Sun, 20 Oct 2019 00:00:00 GMT
    Emacs swiper and multiple cursors https://xenodium.com/emacs-swiper-and-multiple-cursors https://xenodium.com/emacs-swiper-and-multiple-cursors Emacs swiper is awesome. I bound swiper-isearch to C-s. Also a big fan of multiple cursors. I use it regularly (it's fun).

    I had totally missed Ole's post back in 2015: A simple multiple-cursors extension to swiper. Turns out, swiper has multiple cursors support out of the box (bound to C-7 by default). Yay!

    UPDATE: Thanks to irreal's post, please remember to add swiper-mc to mc/cmds-to-run-once list (or things won't work as expected). This typically happens interactively when you invoke C-7 the first time around. Make sure you answer "n" when you see a prompt like:

    If you happen to choose "y" by mistake, take a look at ~/.emacs.d/.mc-lists.el to correct it. Remove swiper-mc from mc/cmds-to-run-for-all and add it to mc/cmds-to-run-once. Invoke m-x eval-buffer to reset the values and you're good to go.

    ]]>
    Thu, 10 Oct 2019 00:00:00 GMT
    Speeding up gifs with gifsycle https://xenodium.com/speeding-up-gifs-with-gifsycle https://xenodium.com/speeding-up-gifs-with-gifsycle Drop frames and speed gif up with gifsycle (via How to remove every second frame from an animated gif?):

    gifsicle -U in.gif `seq -f "#%g" 0 3 398` -O2 -o out.gif
    

    ps. 398 is the total number of frames, which you can get with:

    identify in.gif
    
    ]]>
    Tue, 08 Oct 2019 00:00:00 GMT
    Spam blacklisting with Emacs org babel https://xenodium.com/spam-blacklisting-with-emacs-org-babel https://xenodium.com/spam-blacklisting-with-emacs-org-babel Some email provider accept regular expressions to blacklist additional spam. My blacklist is long and tedious to update, but hey… Emacs org babel can simplify things here.

    It's way easier to maintain a blacklist (with no regex) using an org table.

    Blacklist

    #+name: spam-entries
    | .spammy                |
    | [email protected] |
    | henryzeespammer.com    |
    | yumspam.com            |
    

    and subsequently use org babel (elisp snippet) to generate the regex.

    Regex gen

    #+begin_src emacs-lisp :var rows=spam-entries
      (require 'dash)
      (require 's)
    
      (concat "^"
              (s-join "|"
                      (mapcar (lambda (entry)
                                (setq entry (regexp-quote
                                             (s-trim entry)))
                                (assert (s-present? entry))
                                (cond
                                 ;; Blacklist email address: [email protected]
                                 ((s-contains-p "@" entry)
                                  (format "(%s)" entry))
                                 ;; Blacklist top-level domain: .spammy
                                 ((s-starts-with-p "\\." entry)
                                  (format "([^.]*%s)" entry))
                                 ;; Blacklist domain: @spammer.spammy
                                 (t
                                  (format "(.*@%s)" entry))))
                              (-sort
                               'string<
                               (-map (lambda (row)
                                       (nth 0 row))
                                     rows))))
              "$")
    
    #+end_src
    
    #+RESULTS:
    : ^([^.]*\.spammy)|(dodgyfella@hotmail\.com)|(.*@henryzeespammer\.com)|(.*@yumspam\.com)$
    

    UPDATE: Tweaked elisp and regex (but not animation) also found John Bokma's post: Blacklisting domains with Postfix.

    ]]>
    Tue, 08 Oct 2019 00:00:00 GMT
    Rewriting dates with Emacs multiple cursors https://xenodium.com/rewriting-dates-with-emacs-multiple-cursors https://xenodium.com/rewriting-dates-with-emacs-multiple-cursors Needed to rewrite the date format in a couple of csv columns. Emacs multiple cursors helps here, but needed a function to parse and reformat the dates themselves.

    I can likely reformat dates using the built-in parse-time-string and format-time-string functions, but hey why not give the ts.el library a try…

    (defun ar/region-to-timestamp ()
      "Convert date like \"29 Apr 2019\" to \"2019-04-29\"."
      (interactive)
      (let ((date (ts-parse (buffer-substring
                             (region-beginning)
                             (region-end)))))
        (delete-region (region-beginning)
                       (region-end))
        (insert (ts-format "%Y-%m-%d" date))))
    

    Bound the new function to a temporary keybinding, so I can invoke from multiple cursors:

    (bind-key "M-q" #'ar/region-to-timestamp)
    

    and voilà!

    ]]>
    Sun, 06 Oct 2019 00:00:00 GMT
    Show/hide Emacs dired details in style https://xenodium.com/showhide-emacs-dired-details-in-style https://xenodium.com/showhide-emacs-dired-details-in-style Emacs dired is a powerful directory browser/editor. By default, it shows lots of handy file and directory details.

    I typically prefer hiding file and directory details until I need them. The built-in dired-hide-details-mode makes this easy with the "(" key toggle. Coupled with Steve Purcell's diredfl (for coloring), it strikes a great user experience.

    With a short snippet, you can also show/hide dired details in style:

    (use-package dired
      :hook (dired-mode . dired-hide-details-mode)
      :config
      ;; Colourful columns.
      (use-package diredfl
        :ensure t
        :config
        (diredfl-global-mode 1)))
    

    UPDATE: Thanks to Daniel Martín, who pointed me to dired-git-info. This package adds git logs to dired file and directory details.

    Binding dired-git-info-mode to ")" is a nice complement to dired-hide-details-mode's "(" binding.

    (use-package dired-git-info
        :ensure t
        :bind (:map dired-mode-map
                    (")" . dired-git-info-mode)))
    
    ]]>
    Sat, 05 Oct 2019 00:00:00 GMT
    Bulk buying bookmarks https://xenodium.com/bulk-buying-bookmarks https://xenodium.com/bulk-buying-bookmarks
  • Real foods.
  • ]]>
    Sun, 29 Sep 2019 00:00:00 GMT
    Speeding up Emacs tramp via ControlMaster https://xenodium.com/speeding-up-emacs-tramp-via-controlmaster https://xenodium.com/speeding-up-emacs-tramp-via-controlmaster Via Florian Margaine's Eshell config, I discovered ssh's ControlMaster. It enables sharing multiple sessions over a single network connection. This has the benefit of speeding up Emacs TRAMP.

    In your ~/.ssh/config add:

    Host *
        ControlPath ~/.ssh/master-%h:%p
        ControlMaster auto
        ControlPersist 10m
    
    ]]>
    Sun, 01 Sep 2019 00:00:00 GMT
    csv bookmarks https://xenodium.com/csv-bookmarks https://xenodium.com/csv-bookmarks
  • convert ofx to csv . Today I Learned (secretGeek).
  • Exporting Excel files to CSV with in2csv from csvkit.
  • TSV Utilities: Command line tools for large, tabular data files (Hacker News).
  • Why You Don't Want to Use CSV Files (Have a good data).
  • ]]>
    Sun, 01 Sep 2019 00:00:00 GMT
    Slovakia travel bookmarks https://xenodium.com/slovakia-travel-bookmarks https://xenodium.com/slovakia-travel-bookmarks
  • High Tatras mountains (wonderful hikes).
  • ]]>
    Sat, 10 Aug 2019 00:00:00 GMT
    Thumbnailing pdf page https://xenodium.com/thumbnailing-pdf-page https://xenodium.com/thumbnailing-pdf-page If you ever need to thumbnail a pdf page, imagemagick has got you covered. For example, to thumbnail page 3, you can use:

    convert path/to/input.pdf[2] path/to/output.png
    
    convert -resize 10000x10000 path/to/input.pdf[2] path/to/output.png
    convert: FailedToExecuteCommand `'gs' -sstdout=%stderr -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 '-sDEVICE=pngalpha' -dTextAlphaBits=4 -dGraphicsAlphaBits=4 '-r72x72' -dFirstPage=3 -dLastPage=3 '-sOutputFile=/var/folders/2y/nj_s07ms7l5gfsffh89_79zm0000gn/T/magick-30950xzlPsgqGUwtA%d' '-f/var/folders/2y/nj_s07ms7l5gfsffh89_79zm0000gn/T/magick-30950jpGyui82uGOQ' '-f/var/folders/2y/nj_s07ms7l5gfsffh89_79zm0000gn/T/magick-30950cuDVTNjArshs'' (1) @ error/pdf.c/InvokePDFDelegate/292.
    

    However, I had the error above (missing gs), resolved by installing ghostscript.

    brew install ghostscript
    
    ]]>
    Sun, 14 Jul 2019 00:00:00 GMT
    Outdoor bookmarks https://xenodium.com/outdoor-bookmarks https://xenodium.com/outdoor-bookmarks
  • The Seven Principles of Leave No Trace.
  • ]]>
    Fri, 12 Jul 2019 00:00:00 GMT
    gnuplot bookmarks https://xenodium.com/gnuplot-bookmarks https://xenodium.com/gnuplot-bookmarks
  • GNUplot tips for nice looking charts from a CSV file.
  • Voxel plotting with gnuplot 5.4 {LWN.net}.
  • ]]>
    Sun, 07 Jul 2019 00:00:00 GMT
    gnu global, ctags, and Emacs setup https://xenodium.com/gnu-global-ctags-and-emacs-setup https://xenodium.com/gnu-global-ctags-and-emacs-setup Universal ctags (newer)

    I'm now using universal ctags, as recommended by counsel-etags.

    From universal ctag's Building on Mac OS:

    brew tap universal-ctags/universal-ctags
    brew install --HEAD universal-ctags
    

    .ctags

    --langdef=swift
    --langmap=swift:+.swift
    
    --kinddef-swift=v,variable,variables
    --kinddef-swift=f,function,functions
    --kinddef-swift=s,struct,structs
    --kinddef-swift=c,class,classes
    --kinddef-swift=p,protocol,protocols
    --kinddef-swift=e,enum,enums
    --kinddef-swift=t,typealias,typealiases
    
    --regex-swift=/(var|let)[ \t]+([^:=]+).*$/\2/v/
    --regex-swift=/func[ \t]+([^\(\)]+)\([^\(\)]*\)/\1/f/
    --regex-swift=/struct[ \t]+([^:\{]+).*$/\1/s/
    --regex-swift=/class[ \t]+([^:\{]+).*$/\1/c/
    --regex-swift=/protocol[ \t]+([^:\{]+).*$/\1/p/
    --regex-swift=/enum[ \t]+([^:\{]+).*$/\1/e/
    --regex-swift=/(typealias)[ \t]+([^:=]+).*$/\2/v/
    

    Exuberant ctags (older/buggy?)

    Install gnu global (ensure homebrew uses –with-exuberant-ctags flag).

    brew install global
    brew install ctags
    pip install pygments
    

    .ctags

    --langdef=swift
    --langmap=swift:.swift
    --regex-swift=/[[:<:]]class[[:>:]][[:space:]]+([[:alnum:]_]+)/\1/c,class/
    --regex-swift=/[[:<:]]enum[[:>:]][[:space:]]+([[:alnum:]_]+)/\1/e,enum/
    --regex-swift=/[[:<:]]func[[:>:]][[:space:]]+([[:alnum:]_]+)/\1/f,function/
    --regex-swift=/[[:<:]]protocol[[:>:]][[:space:]]+([[:alnum:]_]+)/\1/P,protocol/
    --regex-swift=/[[:<:]]struct[[:>:]][[:space:]]+([[:alnum:]_]+)/\1/s,struct/
    --regex-swift=/[[:<:]]typealias[[:>:]][[:space:]]+([[:alnum:]_]+)/\1/t,typealias/
    

    .globalrc

    default:\
        :tc=pygments:
    
    ctags:\
        :tc=exuberant-ctags:
    
    exuberant-ctags|plugin-example|setting to use Exuberant Ctags plug-in parser:\
        :tc=common:\
        :ctagscom=ctags:\
        :ctagslib=$libdir/gtags/exuberant-ctags.la:\
        :langmap=Swift\:.swift:\
        :gtags_parser=Swift\:$ctagslib:
    
    pygments:\
        :tc=pygments-parser:
    
    pygments-parser|Pygments plug-in parser:\
        :langmap=Swift\:.swift:\
        :gtags_parser=Swift\:$pygmentslib:\
        :langmap=Common-Lisp\:.cl.lisp.el:\
        :gtags_parser=Common-Lisp\:$pygmentslib:\
        :langmap=Python\:.py.pyw.sc.tac.sage:\
        :gtags_parser=Python\:$pygmentslib:\
        :langmap=Ruby\:.rb.rbw.rake.gemspec.rbx.duby:\
        :gtags_parser=Ruby\:$pygmentslib:\
        :langmap=Objective-C++\:.mm.hh:\
        :gtags_parser=Objective-C++\:$pygmentslib:\
        :langmap=Objective-C\:.m.h:\
        :gtags_parser=Objective-C\:$pygmentslib:\
        :ctagscom=ctags:\
        :pygmentslib=$libdir/gtags/pygments-parser.la:\
        :tc=common:
    
    common:\
        :skip=build/,HTML/,HTML.pub/,tags,TAGS,ID,y.tab.c,y.tab.h,gtags.files,cscope.files,cscope.out,cscope.po.out,cscope.in.out,SCCS/,RCS/,CVS/,CVSROOT/,{arch}/,autom4te.cache/,*.orig,*.rej,*.bak,*~,#*#,*.swp,*.tmp,*_flymake.*,*_flymake,*.o,*.a,*.so,*.lo,*.zip,*.gz,*.bz2,*.xz,*.lzh,*.Z,*.tgz,*.min.js,*min.css:
    
    (use-package counsel-gtags
      :ensure t
      :commands counsel-gtags-mode
      :bind (:map
             counsel-gtags-mode-map
             ("M-." . counsel-gtags-dwim)
             ("M-," . counsel-gtags-go-backward))
      :hook ((swift-mode . counsel-gtags-mode)
             (swift-mode . ggtags-mode)))
    
    ;; Needs .ctags and .globalrc in $HOME.
    (use-package ggtags
      :ensure t
      :commands ggtags-mode)
    

    Helpful references

    https://github.com/osdakira/dotfiles/blob/395640726d669674496a8035458840f0742e54a5/gtags.conf https://github.com/NicholasTD07/dotfiles/blob/e66eb05b408fbcb0d47994fc8a0a79bf438b9e03/.globalrc https://github.com/NicholasTD07/dotfiles/blob/master/.ctags https://github.com/sg2002/gtags.conf-tutorial/blob/master/gtags.conf https://aozsky.com/swift/swift_ide

    ]]>
    Tue, 04 Jun 2019 00:00:00 GMT
    mu4e as macOS mail composer https://xenodium.com/mu4e-as-macos-mail-composer https://xenodium.com/mu4e-as-macos-mail-composer Via Using Emacs as Default Mailer on macOS, a tiny script to handle mailto: links.

    From //Script Editor/, save following script as Application (MailOnEmacs.app). From Mail.app, Preferences -> Default email reader and chosse MailOnEmacs.app.

    on open location myurl
            tell application "Emacs" to activate
            set text item delimiters to {":"}
            do shell script "/path/to/emacsclient --eval '(browse-url-mail \"" & myurl & "\")'"
    end open location
    
    ]]>
    Wed, 29 May 2019 00:00:00 GMT
    New sudo user snippet https://xenodium.com/new-sudo-user-snippet https://xenodium.com/new-sudo-user-snippet I don't add linux sudoers frequently enough. Always looking it up. Keeping snippet.

    adduser -m -d /home/<username> <username>
    passwd <username>
    usermod -aG sudo <username>
    
    ]]>
    Sun, 26 May 2019 00:00:00 GMT
    Plotting ledger reports in org https://xenodium.com/plotting-ledger-reports-in-org https://xenodium.com/plotting-ledger-reports-in-org My ledger file

    Save path to my.ledger in ledger-file block.

    #+name: ledger-file
    #+begin_src emacs-lisp
    "my.ledger"
    #+end_src
    

    gnuplot terminal (png or qt)

    Select gnuplot terminal. Using png to output images, but qt is handy too for interactive chart inspection.

    Use png for inline or qt for interactive
    #+name: gnuplot-term
    #+begin_src emacs-lisp
    "png"
    #+end_src
    

    Monthly Income and Expenses

    Generate income report.

    #+name: income-data
    #+begin_src bash :results table :noweb yes
      ledger -f <<<ledger-file>>> -j reg ^Income -M --collapse --plot-amount-format="%(format_date(date, \"%Y-%m-%d\")) %(abs(quantity(scrub(display_amount))))\n"
    #+end_src
    

    Generate expenses report.

    #+name: expenses-data
    #+begin_src sh :results table :noweb yes
      ledger -f <<<ledger-file>>> -j reg ^Expenses -M --collapse
    #+end_src
    

    Plot income vs expenses.

    set terminal myterm size 3500,1500
    set style data histogram
    set style histogram clustered gap 1
    set style fill transparent solid 0.4 noborder
    set xtics nomirror scale 0 center
    set ytics add ('' 0) scale 0
    set border 1
    set grid ytics
    set title "Monthly Income and Expenses"
    set ylabel "Amount"
    plot income using 2:xticlabels(strftime('%b', strptime('%Y-%m-%d', strcol(1)))) title "Income" linecolor rgb "light-salmon", '' using 0:2:2 with labels left font "Courier,8" rotate by 15 offset -4,0.5 textcolor linestyle 0 notitle, expenses using 2 title "Expenses" linecolor rgb "light-green", '' using 0:2:2 with labels left font "Courier,8" rotate by 15 offset 0,0.5 textcolor linestyle 0 notitle
    
    ]]>
    Fri, 24 May 2019 00:00:00 GMT
    Changing MAC address in org https://xenodium.com/changing-mac-address-from-org-mode https://xenodium.com/changing-mac-address-from-org-mode Via Minko Gechev's tweet. Saving in an org block, just because…

    changeMAC() {
        local mac=$(openssl rand -hex 6 | sed 's/\(..\)/\1:/g; s/.$//')
        ifconfig en0 ether $mac
        ifconfig en0 down
        ifconfig en0 up
        echo "Your new physical address is $mac"
    }
    
    changeMAC
    
    #+RESULTS:
    
    Your new physical address is b4:b2:f8:77:bb:87
    

    ps. Also see Execute org blocks as root.

    ]]>
    Tue, 21 May 2019 00:00:00 GMT
    Charting bookmarks https://xenodium.com/charting-bookmarks https://xenodium.com/charting-bookmarks
  • asciichart: Nice-looking lightweight console ASCII line charts ╭┈╯ for NodeJS and browsers with no dependencies.
  • asciigraph: Go package to make lightweight ASCII line graph.
  • Termgraph: a python command-line tool which draws basic graphs in the terminal.
  • ]]>
    Fri, 17 May 2019 00:00:00 GMT
    Building swift-format https://xenodium.com/building-swift-format https://xenodium.com/building-swift-format Trying out Google's swift-format. Build with:

    git clone -b swift-5.2-branch https://github.com/apple/swift-format.git
    cd swift-format
    swift build
    
    .build/x86_64-apple-macosx/debug/swift-format --help
    
    OVERVIEW: Format or lint Swift source code.
    
    USAGE: swift-format [options] <filename or path> ...
    
    OPTIONS:
      --configuration         The path to a JSON file containing the configuration of the linter/formatter.
      --in-place, -i          Overwrite the current file when formatting ('format' mode only).
      --mode, -m              The mode to run swift-format in. Either 'format', 'lint', or 'dump-configuration'.
      --recursive, -r         Recursively run on '.swift' files in any provided directories.
      --version, -v           Prints the version and exists
      --help                  Display available options
    
    POSITIONAL ARGUMENTS:
      filenames or paths      One or more input filenames
    

    UPDATE: Now uses swift-5.2-branch (for Xcode 11.4), according to Matching swift-format to Your Swift Version.

    ]]>
    Sat, 11 May 2019 00:00:00 GMT
    Ledger query snippets https://xenodium.com/ledger-query-snippets https://xenodium.com/ledger-query-snippets Expenses paid in cash between two dates
    ledger -f my.ledger reg "^Expenses" and expr 'any(account=~/Assets:Cash:Wallet/)' -b 02/19 -e 04/09
    

    Bank account income between two dates

    ledger -f my.ledger reg "^Assets:Bank:Acme" and expr "amount > 0" -b 02/19 -e 04/09
    

    Formatting reg output

    ledger -f my.ledger reg "^Assets:Bank:Acme" --format="%(payee) %(amount)\n"
    
    ]]>
    Mon, 06 May 2019 00:00:00 GMT
    Batch file renaming with counsel, find-dired, and wdired https://xenodium.com/batch-renaming-with-counsel-find-dired-and-wdired https://xenodium.com/batch-renaming-with-counsel-find-dired-and-wdired The first time I saw wdired in action, it blew my mind. wdired makes dired (directory editor) buffers writeable, so you can edit them like any other Emacs buffer. You can subsequently use all your favorite file-editing tricks to rename files (amongst other things). You can see it in action at the end of Emacs Rocks episode 16.

    When combining find-dired with wdired, one can easily find matching files and quickly batch rename them using something like multiple cursors or keyboard macros. I've been a fan of the find-dired -> dired-toggle-read-only -> mc/mark-all-like-this workflow for quite some time, but I always wished I could adjust find-dired queries a little quicker by getting immediate feedback.

    Completion frontends like ivy and helm are perfect for getting this kind of immediate feedback. Peeking into ivy's counsel source, I borrowed some ideas to glue counsel-style narrowing on a find command, which I can easily translate to a writeable dired buffer for all that joyful-mutiple-cursor-editing experience.

    The code for ar/counsel-find is a little rough but can be found at here.

    ]]>
    Sat, 04 May 2019 00:00:00 GMT
    VPS bookmarks https://xenodium.com/vps-bookmarks https://xenodium.com/vps-bookmarks
  • Scaleway: Scalable Cloud Platform Designed for Developers.
  • Vultr.
  • ]]>
    Fri, 26 Apr 2019 00:00:00 GMT
    Svelte bookmarks https://xenodium.com/svelte-bookmarks https://xenodium.com/svelte-bookmarks
  • Svelte 3: Rethinking reactivity.
  • Write less code (metric you're not paying attention to).
  • ]]>
    Mon, 22 Apr 2019 00:00:00 GMT
    Mark region, indent, restore location https://xenodium.com/mark-region-indent-restore-location https://xenodium.com/mark-region-indent-restore-location When I'm not using an automatic code formatter (ie. clang-format, gofmt, etc.), I often find myself using Emacs region marking commands like mark-defun, er/expand-region, and mark-whole-buffer prior to pressing <tab>, which is bound to indent-for-tab-command.

    This is all working as expected: the selection gets indented and the point is left in the current location.

    Say we have the following snippet we'd like to indent.

    Mark region with C-M-h (mark-defun)

    Indent with <tab> (indent-for-tab-command)

    We're done. The selected function is now indented as expected.

    But… I always wished the point returned to the location prior to initiating the region-marking command, in this case mark-defun.

    In short, I wish the point had ended in the following location.

    I'm not aware of an existing package that helps with this, so here's a tiny minor mode (divert-mode) to help with restoring point location after indenting a region. The diverted-events variable can be used to track specific region selecting commands and associate breadcrumb functions to replace the point location as needed.

    ;;; diverted.el --- Identify temporary diversions and automatically
    ;;; move point back to original location.
    
    ;;; Commentary:
    ;; Automatically come back to a original location prior to diversion.
    
    
    ;;; Code:
    
    (require 'cl)
    (require 'seq)
    
    (defstruct diverted-event
      from ;; Initial function (eg. 'mark-defun)
      to ;; Follow-up function (eg. 'indent-for-tab-command)
      breadcrumb)
    
    (defvar diverted-events
      (list
       (make-diverted-event :from 'mark-defun
                            :to 'indent-for-tab-command
                            :breadcrumb (lambda ()
                                          (diverted--pop-to-mark-command 2)))
       (make-diverted-event :from 'er/expand-region
                            :to 'indent-for-tab-command
                            :breadcrumb (lambda ()
                                          (diverted--pop-to-mark-command 2)))
       (make-diverted-event :from 'mark-whole-buffer
                            :to 'indent-for-tab-command
                            :breadcrumb (lambda ()
                                          (diverted--pop-to-mark-command 2))))
      "Diversion events to look for.")
    
    (defun diverted--resolve (symbol)
      "Resolve SYMBOL to event."
      (seq-find (lambda (event)
                  (equal symbol
                         (diverted-event-from event)))
                diverted-events))
    
    (defun diverted--pop-to-mark-command (n)
      "Invoke `pop-to-mark-command' N number of times."
      (dotimes (_ n)
        (pop-to-mark-command)))
    
    (defun diverted--advice-fun (orig-fun &rest r)
      "Get back to location prior to diversion using advice around `diverted-events' (ORIG-FUN and R)."
      (let ((recognized-event (diverted--resolve last-command)))
        (when recognized-event
          (funcall (diverted-event-breadcrumb recognized-event))
          (message "Breadcrumbed prior to `%s'"
                   (diverted-event-from recognized-event)))))
    
    (defun diverted-mode-enable ()
      "Enable diverted-mode."
      (interactive)
      (diverted-mode-disable)
      (mapc (lambda (event)
              (advice-add (diverted-event-to event)
                          :after
                          'diverted--advice-fun)
              (message "Looking for `%s' after `%s' diversions."
                       (diverted-event-to event)
                       (diverted-event-from event)))
            diverted-events)
      (message "diverted-mode enabled"))
    
    (defun diverted-mode-disable ()
      "Disable diverted-mode."
      (interactive)
      (mapc (lambda (event)
              (advice-remove (diverted-event-to event)
                             'diverted--advice-fun)
              (message "Ignoring `%s' after `%s' diversions."
                       (diverted-event-to event)
                       (diverted-event-from event)))
            diverted-events)
      (message "diverted-mode disabled"))
    
    (define-minor-mode diverted-mode
      "Detect temporary diversions and restore point location."
      :init-value nil
      :lighter " diverted"
      :global t
      (if diverted-mode
          (diverted-mode-enable)
        (diverted-mode-disable)))
    
    (provide 'diverted)
    
    ;;; diverted.el ends here
    

    UPDATE(2019-04-20): Source on github.

    ]]>
    Tue, 16 Apr 2019 00:00:00 GMT
    Wider web bookmarks https://xenodium.com/wider-web-bookmarks https://xenodium.com/wider-web-bookmarks
  • Attic: Search Hundreds of Small and Local Stores and Boutiques.
  • Awesome Search.
  • Indieseek.xyz Directory.
  • Million Short - What haven't you found?.
  • Pinboard: social bookmarking for introverts.
  • Qwant Lite.
  • Startpage (claims most private seatch engine).
  • UbuWeb.
  • wiby.me - the search engine for classic websites.
  • WikiArt.org - Visual Art Encyclopedia.
  • ]]>
    Sun, 14 Apr 2019 00:00:00 GMT
    Compound interest calculations https://xenodium.com/compound-interest-calculations https://xenodium.com/compound-interest-calculations Saving Tony Bedford's python snippets for calculating compound interest. Really just an excuse to fire up Emacs and play with org babel.

    t = 20 # years
    r = 0.07 # rate
    pv = 200000.00 # present value
    fv = pv * (1+r)**t # future value
    print("Pension of %.2f at %d%% will be worth %.2f in %d years" % (pv, 100 * r, fv, t))
    
    #+RESULTS:
    
    Pension of 200000.00 at 7% will be worth 773936.89 in 20 years
    
    t = 20 # years
    r = 0.07 # rate
    pv = 200000.00 # present value
    n = 1
    fv = pv * (1 + r/n)**(n*t) # future value
    print ("First formula calculates final value to: %.2f" % fv)
    
    fv = pv * (1 + r/n)**(n*1) # year 1 only
    print("Year %d: %.2f" % (1, fv))
    for i in range (2, t+1):
        fv = fv * (1 + r/n)**(n*1) # Calculate one year at a time
        print("Year %d: %.2f" % (i, fv))
    
    First formula calculates final value to: 773936.89
    Year 1: 214000.00
    Year 2: 228980.00
    Year 3: 245008.60
    Year 4: 262159.20
    Year 5: 280510.35
    Year 6: 300146.07
    Year 7: 321156.30
    Year 8: 343637.24
    Year 9: 367691.84
    Year 10: 393430.27
    Year 11: 420970.39
    Year 12: 450438.32
    Year 13: 481969.00
    Year 14: 515706.83
    Year 15: 551806.31
    Year 16: 590432.75
    Year 17: 631763.04
    Year 18: 675986.46
    Year 19: 723305.51
    Year 20: 773936.89
    
    ]]>
    Sun, 14 Apr 2019 00:00:00 GMT
    Building mu/mu4e on macOS https://xenodium.com/building-mumu4e-on-macos https://xenodium.com/building-mumu4e-on-macos I've now built Emacs's mu/mu4e releases a handful of times on macOS. These are the steps, so I don't forget.

    1.4

    Updated steps for building mu/mu4e 1.4:

    brew install gmime
    export CPPFLAGS="-I$(brew --prefix)/Cellar/gmime/3.2.3/include -I$(brew --prefix)/include"
    export LDFLAGS=-L$(brew --prefix)/Cellar/gmime/3.2.3/lib
    export PKG_CONFIG_PATH=$(brew --prefix)/Cellar/gmime/3.2.3/lib/pkgconfig:$(brew --prefix)/opt/libffi/lib/pkgconfig
    export EMACS=/Applications/Emacs.app/Contents/MacOS/Emacs
    ./configure --prefix=$(~/local)
    make install
    

    1.2

    Recently built Emacs's mu/mu4e 1.2.0 from source on macOS. Steps:

    brew install gmime
    export CPPFLAGS=-I$(brew --prefix)/Cellar/gmime/3.2.3/include
    export LDFLAGS=-L$(brew --prefix)/Cellar/gmime/3.2.3/lib
    export PKG_CONFIG_PATH=$(brew --prefix)/Cellar/gmime/3.2.3/lib/pkgconfig:$(brew --prefix)/opt/libffi/lib/pkgconfig
    ./configure --prefix=$(~/local) --disable-dependency-tracking
    make install
    

    UPDATE(2019-04-16): Another approach at Irreal's Mu/mu4e 1.2 Available.

    ]]>
    Thu, 11 Apr 2019 00:00:00 GMT
    Reading spreadsheets with python/pandas https://xenodium.com/reading-spreadsheets-with-pythonpandas https://xenodium.com/reading-spreadsheets-with-pythonpandas Via Daily python tip, a snippet to read xls files in python. This will come in handy. Saving for future.

    Get set up with:

    pip install pandas
    pip install xlrd
    

    Read with:

    import pandas
    xlf = pandas.ExcelFile("sheet.xlsx")
    print xlf.sheet_names
    
    [u'my sheet']
    
    ]]>
    Sat, 30 Mar 2019 00:00:00 GMT
    Inserting numbers with Emacs multiple cursors https://xenodium.com/inserting-numbers-with-emacs-multiple-cursors https://xenodium.com/inserting-numbers-with-emacs-multiple-cursors TIL that multiple cursor's mc/insert-numbers enables you to quickly enter increasing numbers for each cursor. I have mc/insert-numbers bound to # in region-bindings-mode-map. By default, sequence starts at 0, but invoking mc/insert-numbers with prefix enables you to quickly change that.

    Came in handy when numbering an org table:

    ]]>
    Sun, 17 Mar 2019 00:00:00 GMT
    Brazil travel bookmarks https://xenodium.com/brazil-travel-bookmarks https://xenodium.com/brazil-travel-bookmarks
  • UXUA Casa Hotel and Spa in Trancoso, Brazil.
  • ]]>
    Sun, 17 Mar 2019 00:00:00 GMT
    Bath travel bookmarks https://xenodium.com/bath-travel-bookmarks https://xenodium.com/bath-travel-bookmarks
  • Beas Vintage Tea Rooms (Yelp).
  • ]]>
    Sun, 17 Mar 2019 00:00:00 GMT
    Half marathon training https://xenodium.com/half-marathon-training https://xenodium.com/half-marathon-training From https://assets.bupa.co.uk/~/media/images/healthmanagement/pdfs/half-marathon-beginner.pdf

    Starting from week 4:

    Week Monday Tuesday Wednesday Thursday Friday Saturday Sunday


    4 Rest 40 mins easy 30 mins tempo Rest 40 mins cross Rest (03/24) 60 mins 6.7 km 5.1 Km - - 41:51 m 30:00 m 61.3 Kg 60.8 Kg 5 Rest 40 mins easy 30 mins tempo Rest 40 mins interval Rest (03/31) 11 Km 11.9 Km - 5.99 Km 11.0 Km 80:00 m 40 m 60:08 m 6 Rest 40 mins easy 30 mins tempo Rest 40 mins interval/cross Rest (04/07) 13 Km 7 Rest 40 mins easy 30 mins tempo Rest 40 mins interval Rest (04/14) 60 mins 8 Rest 40 mins easy 30 mins tempo Rest 50 mins interval/cross Rest (04/21) 16 Km 9 Rest 40 mins easy 30 mins tempo Rest 50 mins interval Rest (04/28) 8 Km 10 Rest 40 mins easy 30 mins tempo Rest 40 mins interval/cross Rest (05/05) 19 Km 11 Rest 40 mins easy 30 mins tempo Rest 40 mins interval Rest (05/12) 10 Km 12 Rest 40 mins easy 30 mins tempo Rest 50 mins easy Rest (05/19) Race

    ]]>
    Sun, 17 Mar 2019 00:00:00 GMT
    No Emacs frame refocus on macOS https://xenodium.com/no-emacs-frame-refocus-on-macos https://xenodium.com/no-emacs-frame-refocus-on-macos This one's been bugging me for a while. On macOS, Emacs automatically focuses (raises) other frames when one is closed.

    This has the unfortunate side-effect that I could be moved from one macOS desktop/space to another when closing an Emacs frame.

    Finally managed do something about it. Since I install Emacs on macOS via homebrew, a small patch on emacs-plus recipe small patch on emacs-plus recipe did the job.

    UPDATE: Pull request merged in d12frosted/emacs-plus.

    The patch patch has been merged into d12frosted/homebrew-emacs-plus. To use:

    brew tap d12frosted/emacs-plus
    brew install emacs-plus --without-spacemacs-icon --with-no-frame-refocus
    

    Balance restored.

    ]]>
    Sat, 16 Mar 2019 00:00:00 GMT
    Checksums on linux/macOS https://xenodium.com/checksums-on-linuxmacos https://xenodium.com/checksums-on-linuxmacos MD5
    md5 file
    

    SHA-1

    shasum -a 1 file
    

    SHA-256

    shasum -a 256 file
    
    ]]>
    Sat, 16 Mar 2019 00:00:00 GMT
    Language server protocol (LSP) bookmarks https://xenodium.com/language-server-protocol-lsp-bookmarks https://xenodium.com/language-server-protocol-lsp-bookmarks
  • Eclipse JDT Language Server.
  • Emacs Java IDE using Eclipse JDT Language Server.
  • vscode-html-languageserver extracted from VSCode.
  • ]]>
    Tue, 12 Mar 2019 00:00:00 GMT
    Copy from desktop to mobile via QR code https://xenodium.com/copy-from-desktop-to-mobile-via-qr-code https://xenodium.com/copy-from-desktop-to-mobile-via-qr-code Marcin Borkowski has a nice tip to quickly copy text or URLs between desktop and mobile using QR codes.

    Wrote a little elisp to do a similar thing using the clipboard via Emacs:

    (defun ar/misc-clipboard-to-qr ()
      "Convert text in clipboard to qrcode and display within Emacs."
      (interactive)
      (let ((temp-file (concat (temporary-file-directory) "qr-code")))
        (if (eq 0 (shell-command (format "qrencode -s10 -o %s %s"
                                         temp-file
                                         (shell-quote-argument (current-kill 0)))
                                 "*qrencode*"))
            (switch-to-buffer (find-file-noselect temp-file t))
          (error "Error: Could not create qrcode, check *qrencode* buffer"))))
    

    ps. Encoding your WiFi access point password into a QR code shows how to encode WiFi access point passwords:

    qrencode -o wifi.png "WIFI:T:WPA;S:<SSID>;P:<PASSWORD>;;"
    

    More comprehensively:

    SSID=SSID_GOES_HERE
    pwgen -s 63 > 00wifi.txt
    qrencode -o 00wifi.png "WIFI:T:WPA;S:${SSID};P:$(cat 00wifi.txt);;"
    
    ]]>
    Sun, 24 Feb 2019 00:00:00 GMT
    Parsing dates in Go https://xenodium.com/parsing-dates-in-go https://xenodium.com/parsing-dates-in-go Ensure the reference time ("Mon Jan 2 15:04:05 -0700 MST 2006") is used in layout string.

    For example:

    package main
    
    import (
            "fmt"
            "time"
    )
    
    func main() {
            goodLayout := "January 2 2006"
            if t, err := time.Parse(goodLayout, "March 10 2019"); err != nil {
                        fmt.Printf("%s\n", err)
            } else {
                        fmt.Printf("%v\n", t)
            }
    
            badLayout := "January 2 2009"
            if t, err := time.Parse(badLayout, "March 10 2019"); err != nil {
                        fmt.Printf("%s\n", err)
            } else {
                        fmt.Printf("%v\n", t)
            }
    }
    
    #+RESULTS:
    
    2019-03-10 00:00:00 +0000 UTC
    parsing time "March 10 2019" as "January 2 2009": cannot parse "19" as "009"
    
    ]]>
    Tue, 19 Feb 2019 00:00:00 GMT
    Life in the UK bookmarks https://xenodium.com/life-in-the-uk-bookmarks https://xenodium.com/life-in-the-uk-bookmarks
  • 'LitUK': notes by a Redditor (TextUploader.com).
  • Life In The UK Test, Practice Tests 2017.
  • ]]>
    Wed, 13 Feb 2019 00:00:00 GMT
    C language bookmarks https://xenodium.com/c-language-bookmarks https://xenodium.com/c-language-bookmarks
  • LittlevGL - Open-source Embedded GUI Library.
  • ]]>
    Sun, 10 Feb 2019 00:00:00 GMT
    Video editing bookmarks https://xenodium.com/video-editing-bookmarks https://xenodium.com/video-editing-bookmarks
  • Adding subtitles to your videos the easy way - Bernd Verst.
  • Adventures in Netflix (screenshotting HDMI).
  • Camera Stabilisation with FFmpeg - Adaptive Samples.
  • DaVinci Resolve 17 | Blackmagic Design.
  • digiKam.
  • Dragon Quest 64: Non-Rectangular Video Cropping.
  • FFmpeg - How to achieve a circular video overlay..?.
  • GitHub - mifi/lossless-cut: The swiss army knife of lossless video/audio editing.
  • GitHub - moxuse/Kusabi: Coding environment 3D graphics with PureScript..
  • GitHub - whyboris/Video-Hub-App: Official repository for Video Hub App 2.
  • HOW TO DATAMOSH: PART 1 - YouTube.
  • How to trim video clips instantly without reencoding | Hacker News.
  • Inserting a Watermark with FFmpeg (Linux Magazine).
  • Learn FFmpeg the hard way (Hacker News).
  • Non-Rectangular Video Cropping with FFMpeg | Hacker News.
  • Trim Videos Instantly - Bernd Verst.
  • ]]>
    Sun, 10 Feb 2019 00:00:00 GMT
    Icons bookmarks https://xenodium.com/icons-bookmarks https://xenodium.com/icons-bookmarks
  • Absurd Design – Free Surrealist Illustrations and Vector Art (Hacker News).
  • Find Similar Icons (using Noun Project).
  • Noun Project - Icons for Everything.
  • shape.so icons.
  • Streamline 3.0 – The World's Largest Icon Library.
  • ]]>
    Sun, 10 Feb 2019 00:00:00 GMT
    Salt beef recipe https://xenodium.com/salt-beef-recipe https://xenodium.com/salt-beef-recipe How to make salt beef (use 1.8kg brisket instead) and brining a brisket (celery and peppercorns) both from The Guardian were recommended by a friend.

    ]]>
    Sun, 27 Jan 2019 00:00:00 GMT
    Geneva travel bookmarks https://xenodium.com/geneva-travel-bookmarks https://xenodium.com/geneva-travel-bookmarks
  • La Buvette des Bains, Restaurants in Pâquis.
  • ]]>
    Sun, 27 Jan 2019 00:00:00 GMT
    Swapping Emacs ivy collections/sources https://xenodium.com/swapping-emacs-ivy-collectionssources https://xenodium.com/swapping-emacs-ivy-collectionssources Ivy is great. I've been meaning to figure out a way to swap sources while running ivy. This would enable me to cycle through different sources using the existing search parameters.

    At first look, 'ivy-set-sources seemed like the right choice, but it's used during setup to agregate sources. Subsequent 'ivy-set-sources calls are ignored during an 'ivy-read session.

    There's an ivy feature request over at github with a similar goal in mind. Although the feature is not yet supported, there's a handy suggestion to use 'ivy-quit-and-run to quit the current command and run a different one.

    With 'ivy-quit-and-run in mind, we can write our 'ar/ivy-read function to take a list of sources and add a little logic to cycle through them using a keybiding, in my case <left> and <right>.

    ;;; -*- lexical-binding: t; -*-
    
    (require 'cl)
    
    (cl-defstruct
        ar/ivy-source
      prompt
      collection
      action)
    
    (cl-defun ar/ivy-read (sources &key index initial-input)
      (let ((kmap (make-sparse-keymap))
            (source))
        (cl-assert (> (length sources) 0))
        (when (null index) (setq index 0))
        (setq source (nth index sources))
        (define-key kmap (kbd "<right>") (lambda ()
                                           (interactive)
                                           (ivy-quit-and-run (ar/ivy-read sources
                                                                          :index (if (>= (1+ index)
                                                                                         (length sources))
                                                                                     0
                                                                                   (1+ index))
                                                                          :initial-input ivy-text))))
        (define-key kmap (kbd "<left>") (lambda ()
                                          (interactive)
                                          (ivy-quit-and-run (ar/ivy-read sources
                                                                         :index (if (< (1- index)
                                                                                       0)
                                                                                    (1- (length sources))
                                                                                  (1- index))
                                                                         :initial-input ivy-text))))
        (ivy-read (ar/ivy-source-prompt source)
                  (ar/ivy-source-collection source)
                  :action (ar/ivy-source-action source)
                  :initial-input initial-input
                  :keymap kmap)))
    
    (defun ar/ivy-food-menu ()
      (interactive)
      (ar/ivy-read (list
                    (make-ar/ivy-source :prompt "Pizza: "
                                        :action (lambda (selection)
                                                  (message "Selected pizza: %s" selection))
                                        :collection (lambda (str pred v)
                                                      (list "Bianca Neve - Mozzarella, Ricotta, Sausage, Extra Virgin Olive Oil, Basil"
                                                            "Boscaiola - Mozzarella, Tomato Sauce, Sausage, Mushrooms, Extra Virgin Olive Oil, Basil"
                                                            "Calzone - Ricotta, Ham, Mushrooms, Artichokes. Topped with Tomato Sauce and Extra Virgin Olive Oil."
                                                            "Capricciosa - Mozzarella,Tomato Sauce, Prosciutto Cotto Ham, Mushrooms, Artichokes, Extra Virgin Olive Oil."
                                                            "Carciofi - Mozzarella, Tomato Sauce, Artichokes, Extra Virgin Olive Oil, Basil."
                                                            "Diavola - Mozzarella, Tomato Sauce, Spicy Salami, Extra Virgin Olive Oil, Basil."
                                                            "Funghi - Mozzarella, Tomato Sauce, Mushrooms, Extra Virgin Olive Oil, Basil.")))
                    (make-ar/ivy-source :prompt "Tacos: "
                                        :action (lambda (selection)
                                                  (message "Selected taco: %s" selection))
                                        :collection (lambda (str pred v)
                                                      (list "Pork pibil - Slow cooked in citrus & spices, with pink pickled onions."
                                                            "Grilled chicken & avocado - Ancho rub, guacamole & green tomatillo salsa."
                                                            "Plantain - Sweet & spicy chipotle & crumbled feta."
                                                            "Poblano pepper - Caramelised onions, corn & cashew nut mole."
                                                            "Buttermilk chicken - Served crispy fried with habanero & white onion relish & spiced mayo."
                                                            "Sustainable battered cod - mSC certified cod with shredded slaw, chipotle mayo & pickled cucumber."
                                                            "Chargrilled steak - Avocado & chipotle salsas.")))
                    (make-ar/ivy-source :prompt "Burgers: "
                                        :action (lambda (selection)
                                                  (message "Selected burger: %s" selection))
                                        :collection (lambda (str pred v)
                                                      (list "The cheese - Aged beef patty with american cheese, gherkins, ketchup & mustard."
                                                            "The yeah! - Aged beef patty with american cheese, gherkins, yeah! sauce & salad."
                                                            "The yfc or hot yfc - Crispy chicken with lime or chipotle crema, lettuce, pickled onion & slaw."
                                                            "The rancher - Grilled chicken with ranch dressing, bacon & salad."
                                                            "The bubbah - Aged beef patty with smokey aubergine, pickled red cabbage, lettuce, roast toms, onions & cheddar."
                                                            "The bulgogi - Sesame-spiced beef patty with miso mayo, pickled radish, onion, cucumber & spring onion."
                                                            "The summer - Aged beef patty with sriracha mayo, lettuce, onion, toms, avo, cheddar & bacon."))))))
    

    ps. Menu data from Star of Kings, Wahaca, and Pizzarino.

    ]]>
    Sun, 13 Jan 2019 00:00:00 GMT
    Podcast bookmarks https://xenodium.com/podcast-bookmarks https://xenodium.com/podcast-bookmarks
  • Destination Linux. A conversational podcast by people who love running Linux..
  • EmacsCast.
  • Free as in Freedom.
  • Gnu World Order.
  • Late Night Linux.
  • Libre Lounge.
  • Linux Lads Podcast.
  • The Binary Times Podcast (Linux/free software/hardware/culture).
  • Ubuntu Podcast.
  • ]]>
    Sat, 12 Jan 2019 00:00:00 GMT
    Emacs on macOS Mojave https://xenodium.com/emacs-on-macos-mojave https://xenodium.com/emacs-on-macos-mojave Had issues running Emacs on macOS Mojave (blank unresponsive screen). Bleeding edge emacs-plus did the job:

    brew tap d12frosted/emacs-plus
    brew install emacs-plus --without-spacemacs-icon --HEAD
    
    brew info emacs-plus
    
    d12frosted/emacs-plus/emacs-plus: stable 26.1, devel 26.1-rc1, HEAD
    GNU Emacs text editor
    https://www.gnu.org/software/emacs/
    /Users/some-user/homebrew/Cellar/emacs-plus/HEAD-8fe21b0 (3,985 files, 123.0MB) *
      Built from source on 2019-01-12 at 09:26:09 with: --without-spacemacs-icon
    From: https://github.com/d12frosted/homebrew-emacs-plus/blob/master/Formula/emacs-plus.rb
    ==> Dependencies
    Build: pkg-config
    Recommended: little-cms2, gnutls, librsvg, imagemagick@6
    Optional: dbus, mailutils
    ==> Requirements
    Optional: x11
    ==> Options
    --with-ctags
        Don't remove the ctags executable that Emacs provides
    --with-dbus
        Build with dbus support
    --with-emacs-icons-project-EmacsIcon1
        Using Emacs icon project EmacsIcon1
    --with-emacs-icons-project-EmacsIcon2
        Using Emacs icon project EmacsIcon2
    --with-emacs-icons-project-EmacsIcon3
        Using Emacs icon project EmacsIcon3
    --with-emacs-icons-project-EmacsIcon4
        Using Emacs icon project EmacsIcon4
    --with-emacs-icons-project-EmacsIcon5
        Using Emacs icon project EmacsIcon5
    --with-emacs-icons-project-EmacsIcon6
        Using Emacs icon project EmacsIcon6
    --with-emacs-icons-project-EmacsIcon7
        Using Emacs icon project EmacsIcon7
    --with-emacs-icons-project-EmacsIcon8
        Using Emacs icon project EmacsIcon8
    --with-emacs-icons-project-EmacsIcon9
        Using Emacs icon project EmacsIcon9
    --with-emacs-icons-project-emacs-card-blue-deep
        Using Emacs icon project emacs-card-blue-deep
    --with-emacs-icons-project-emacs-card-british-racing-green
        Using Emacs icon project emacs-card-british-racing-green
    --with-emacs-icons-project-emacs-card-carmine
        Using Emacs icon project emacs-card-carmine
    --with-emacs-icons-project-emacs-card-green
        Using Emacs icon project emacs-card-green
    --with-mailutils
        Build with mailutils support
    --with-modern-icon
        Using a modern style Emacs icon by @tpanum
    --with-no-titlebar
        Experimental: build without titlebar
    --with-pdumper
        Experimental: build from pdumper branch and with
             increasedremembered_data size (--HEAD only)
    --with-x11
        Experimental: build with x11 support
    --with-xwidgets
        Experimental: build with xwidgets support (--HEAD only)
    --without-cocoa
        Build a non-Cocoa version of Emacs
    --without-gnutls
        Build without gnutls support
    --without-imagemagick@6
        Build without imagemagick@6 support
    --without-librsvg
        Build without librsvg support
    --without-libxml2
        Build without libxml2 support
    --without-little-cms2
        Build without little-cms2 support
    --without-modules
        Build without dynamic modules support
    --without-multicolor-fonts
        Build without a patch that enables multicolor font support
    --without-spacemacs-icon
        Build without Spacemacs icon by Nasser Alshammari
    --devel
        Install development version 26.1-rc1
    --HEAD
        Install HEAD version
    ==> Caveats
    Emacs.app was installed to:
      /Users/some-user/homebrew/Cellar/emacs-plus/26.1
    
    To link the application to default Homebrew App location:
      brew linkapps
    or:
      ln -s /Users/some-user/homebrew/Cellar/emacs-plus/26.1/Emacs.app /Applications
    
    --natural-title-bar option was removed from this formula, in order to
      duplicate its effect add following line to your init.el file
      (add-to-list 'default-frame-alist '(ns-transparent-titlebar . t))
      (add-to-list 'default-frame-alist '(ns-appearance . dark))
    or:
      (add-to-list 'default-frame-alist '(ns-transparent-titlebar . t))
      (add-to-list 'default-frame-alist '(ns-appearance . light))
    
    If you are using macOS Mojave, please note that most of the experimental
    options are forbidden on Mojave. This is temporary decision.
    
    
    To have launchd start d12frosted/emacs-plus/emacs-plus now and restart at login:
      brew services start d12frosted/emacs-plus/emacs-plus
    Or, if you don't want/need a background service you can just run:
      emacs
    
    ]]>
    Sat, 12 Jan 2019 00:00:00 GMT
    Trying out Emacs pdf tools https://xenodium.com/trying-out-emacs-pdf-tools https://xenodium.com/trying-out-emacs-pdf-tools Late to the party, giving pdf-tools a try.

    The macOS install instructions have a prerequisite:

    brew install poppler automake
    

    Installed with:

    (use-package pdf-tools
      :ensure t
      :mode ("\\.pdf\\'" . pdf-view-mode)
      :config
      (pdf-tools-install)
      (setq-default pdf-view-display-size 'fit-page)
      (setq pdf-annot-activate-created-annotations t))
    

    ps. (pdf-tools-install) may not find libffi on macOS. Try:

    (setenv "PKG_CONFIG_PATH"
            (f-join
             (file-name-as-directory
              (nth 0
                   (split-string
                    (shell-command-to-string "brew --prefix"))))
             "Cellar" "libffi" "3.2.1" "lib" "pkgconfig"))
    
    ]]>
    Sun, 06 Jan 2019 00:00:00 GMT
    ASCII art generator bookmarks https://xenodium.com/ascii-art-generator-bookmarks https://xenodium.com/ascii-art-generator-bookmarks
  • 𝓔𝓻𝓰𝓮𝓻𝓪𝓽𝓸𝓻/Ergerator (ascii generator).
  • ]]>
    Thu, 27 Dec 2018 00:00:00 GMT
    Osaka travel bookmarks https://xenodium.com/osaka-travel-bookmarks https://xenodium.com/osaka-travel-bookmarks
  • Tsutenkaku (Osaka) - 2018 All You Need to Know BEFORE You Go (with Photos) - TripAdvisor.
  • ]]>
    Wed, 26 Dec 2018 00:00:00 GMT
    Using OCR to create searchable pdfs from images https://xenodium.com/using-ocr-to-create-searchable-pdfs-from-images https://xenodium.com/using-ocr-to-create-searchable-pdfs-from-images Used my phone to take a handful of photos of an article from a magazine. Wanted to convert the images to a searchable pdf on macOS.

    This was straightforward, having already installed tesseract.

    for i in IMG_3*.jpg; do echo $i; tesseract $i $(basename $i .tif) pdf; done
    

    Should now have a handful of OCR'd pdfs:

    ls *.jpg.pdf
    
    IMG_3104.jpg.pdf
    IMG_3105.jpg.pdf
    IMG_3106.jpg.pdf
    IMG_3107.jpg.pdf
    

    Finally, join all pdfs into one. Turns out macOS has a handy python script already installed. We can use it as:

    /usr/bin/python "/System/Library/Automator/Combine PDF Pages.action/Contents/Resources/join.py" -o joined.pdf IMG_*pdf
    

    ps. pdfgrep is great for searching pdfs.

    Useful references

    ]]>
    Tue, 25 Dec 2018 00:00:00 GMT
    Audiobook providers bookmarks https://xenodium.com/audiobook-providers-bookmarks https://xenodium.com/audiobook-providers-bookmarks
  • 1,000 Free Audio Books: Download Great Books for Free | Open Culture.
  • BBC Sound Effects Archive Resource • Research & Education Space.
  • Libro.fm (Libro.fm, Your Independent Bookstore for Digital Audiobooks).
  • Online Courses & Lectures for Home Study and Lifelong Learning.
  • The best free cultural and educational media on the web (Open Culture).
  • ]]>
    Tue, 25 Dec 2018 00:00:00 GMT
    Cookbook bookmarks https://xenodium.com/cookbook-bookmarks https://xenodium.com/cookbook-bookmarks
  • Japan: The Cookbook (Nancy Singleton Hachisu).
  • Japanese Farm Food (Nancy Singleton Hachisu).
  • Preserving the Japanese Way (Nancy Singleton Hachisu).
  • ]]>
    Tue, 25 Dec 2018 00:00:00 GMT
    Emailing pdfs to kindle from mu4e https://xenodium.com/emailing-pdfs-to-kindle-from-mu4e https://xenodium.com/emailing-pdfs-to-kindle-from-mu4e Wanted to send a pdf to my kindle for some holiday reading. You can easily do this by emailing the pdf to your kindle-bound email address.

    Now, I typically attach files when composing mu4e emails by using mml-attach-file, which attaches the file using <#part>…<#/part>. However, the Amazon service did not find the attached pdf, so no pdf was added to my Kindle.

    Fortunately, I found a handy Reddit thread, leding me to a working solution. Wrapping the part using <#multipart type=mixed>…<#/multipart> did the job, using mml-insert-multipart, followed by mml-attach-file.

    Resulting attachment should look something like:

    <#multipart type=mixed>
    <#part type="application/pdf" filename="/path/to/file.pdf" disposition=attachment>
    <#/part>
    <#/multipart>
    

    I should add a convenience elisp function for this, but that's for another time…

    ]]>
    Tue, 25 Dec 2018 00:00:00 GMT
    org tip: convert csv to table https://xenodium.com/org-tip-convert-csv-to-table https://xenodium.com/org-tip-convert-csv-to-table Needed to import some csv data to an org table. Turns out org's got you covered out of the box with M-x org-table-create-or-convert-from-region bound to C-c |.

    ]]>
    Fri, 21 Dec 2018 00:00:00 GMT
    Sponsoring platform bookmarks https://xenodium.com/sponsoring-platform-bookmarks https://xenodium.com/sponsoring-platform-bookmarks
  • Best way for artists and creators to get sustainable income and connect with fans (Patreon).
  • Buy Me A Coffee — A free, fast and beautiful way for creators to monetise their content.
  • Tallycoin is a Bitcoin fundraising platform and a Patreon alternative..
  • ]]>
    Thu, 20 Dec 2018 00:00:00 GMT
    Artistic/creative bookmarks https://xenodium.com/artisticcreative-bookmarks https://xenodium.com/artisticcreative-bookmarks
  • BoxTail fractals (DeviantArt Gallery).
  • Fermat's spiral - Wikipedia.
  • Lost Art Press (woodworking books).
  • Tom Sachs (knolling exhibits).
  • ]]>
    Thu, 20 Dec 2018 00:00:00 GMT
    Marketing bookmarks https://xenodium.com/marketing-bookmarks https://xenodium.com/marketing-bookmarks
  • Product Marketing for Engineers | Hacker News.
  • Startup Website Builder - Launchaco.
  • ]]>
    Thu, 20 Dec 2018 00:00:00 GMT
    Bluetooth low energy (BLE) bookmarks https://xenodium.com/bluetooth-low-energy-ble-bookmarks https://xenodium.com/bluetooth-low-energy-ble-bookmarks
  • blueutil » Command-Line Control of Bluetooth on the Mac.
  • The Practical Guide to Hacking Bluetooth Low Energy (Hacker News).
  • The Practical Guide to Hacking Bluetooth Low Energy.
  • ]]>
    Wed, 19 Dec 2018 00:00:00 GMT
    Fun project bookmarks https://xenodium.com/fun-project-bookmarks https://xenodium.com/fun-project-bookmarks
  • echo yang programs everyday obsolete machines to create autonomous art (designboom).
  • ]]>
    Tue, 18 Dec 2018 00:00:00 GMT
    Snowboarding bookmarks https://xenodium.com/snowboarding-bookmarks https://xenodium.com/snowboarding-bookmarks
  • Snowboarding for Geeks (Hacker News).
  • ]]>
    Fri, 14 Dec 2018 00:00:00 GMT
    Scam bookmarks https://xenodium.com/scam-bookmarks https://xenodium.com/scam-bookmarks
  • 419 Eater - The largest scambaiting community on the planet!.
  • The little black book of scams (2016) (Hacker News).
  • The little black book of scams (ACCC).
  • ]]>
    Tue, 11 Dec 2018 00:00:00 GMT
    Passive income bookmarks https://xenodium.com/passive-income-bookmarks https://xenodium.com/passive-income-bookmarks
  • Awesome products designed by independent artists (Redbubble).
  • Kit (Paul Jarvi's recording gear).
  • Merch By Amazon Discussion (Reddit).
  • Teespring.
  • What is Merch By Amazon?.
  • ]]>
    Tue, 11 Dec 2018 00:00:00 GMT
    DWIM ivy quit https://xenodium.com/dwim-ivy-quit https://xenodium.com/dwim-ivy-quit "Do-what-I-mean" (DWIM) functions enable us to introduce new Emacs powers to existing workflows without incurring the typical cost of remembering multiple related functions or introducing yet another key binding. DWIM functions invoke other functions, based on current context.

    I wanted a small tweak in Ivy's `minibuffer-keyboard-quit' invocation, commonly invoked via C-g key binding:

    1. If we have text selected in minibuffer, deselect it.
    2. If we have any text in minibuffer, clear it.
    3. If no text in minibuffer, quit.

    Added `ar/ivy-keyboard-quit-dwim' for this purpose. Binding it to C-g in ivy-minibuffer-map:

    (use-package ivy
      :ensure t
      :bind (:map ivy-minibuffer-map
                  ("C-g" . ar/ivy-keyboard-quit-dwim))
      :config
      (defun ar/ivy-keyboard-quit-dwim ()
        "If region active, deactivate. If there's content, clear the minibuffer. Otherwise quit."
        (interactive)
        (cond ((and delete-selection-mode (region-active-p))
               (setq deactivate-mark t))
              ((> (length ivy-text) 0)
               (delete-minibuffer-contents))
              (t
               (minibuffer-keyboard-quit)))))
    

    ]]>
    Sat, 08 Dec 2018 00:00:00 GMT
    Diffing directories content size https://xenodium.com/diffing-directories-content-size https://xenodium.com/diffing-directories-content-size Needed to diff two directories, but only interested in file size changes. diff, find, sort, and stat seem to do the job:

    diff <(find dir1 -type f -exec stat -f '%N %z' '{}' \; | sort) <(find dir2 -type f -exec stat -f '%N %z' '{}' \; | sort)
    
    1,3c1,2
    < dir1/one.txt 14
    < dir1/subdir/file.txt 5
    < dir1/three.txt 7
    ---
    > dir2/one.txt 19
    > dir2/two.txt 0
    

    Note: Using diff, find, sort, and stat on macOS.

    Update 1

    I've since learned about mtree (thanks Roman!). A nice utility to add to the toolbox.

    mtree -p emacs-25.1 -c -k size -d
    
    #    user: me
    # machine: my-machine
    #    tree: /path/to/emacs-25.1
    #    date: Wed Dec  5 22:21:07 2018
    # .
    /set type=dir
    .               size=1152
    # ./admin
    admin           size=960
    # ./admin/charsets
    charsets        size=544
    # ./admin/charsets/glibc
    glibc           size=3392
    # ./admin/charsets/glibc
    ..
    # ./admin/charsets/mapfiles
    mapfiles        size=640
    # ./admin/charsets/mapfiles
    ..
    

    Update 2

    I've added Emacs ediff to the mix:

    (require 'f)
    
    (defun ar/ediff-dir-content-size ()
        "Diff all subdirectories (sizes only) in two directories."
        (interactive)
        (let* ((dir1-path (read-directory-name "Dir 1: "))
               (dir2-path (read-directory-name "Dir 2: "))
               (buf1 (get-buffer-create (format "*Dir 1 (%s)*" (f-base dir1-path))))
               (buf2 (get-buffer-create (format "*Dir 2 (%s)*" (f-base dir2-path)))))
          (with-current-buffer buf1
            (erase-buffer))
          (with-current-buffer buf2
            (erase-buffer))
          (shell-command (format "cd %s; find . -type d | sort | du -h" dir1-path) buf1)
          (shell-command (format "cd %s; find . -type d | sort | du -h" dir2-path) buf2)
          (ediff-buffers buf1 buf2)))
    

    ]]>
    Wed, 05 Dec 2018 00:00:00 GMT
    Swift nil-coalescing operator https://xenodium.com/swift-nil-coalescing-operator https://xenodium.com/swift-nil-coalescing-operator Paul Hudson, over at Hacking with Swift, has written The Complete Guide to Optionals in Swift. One of the many highlights is the nil-coalescing operator. If you're a fan of the C-like syntax in ternary operations, you'd enjoy chaining with Swift's nil-coalescing operator:

    let players = [ "goose": "run!" ]
    let move = players["duck1"] ?? players["duck2"] ?? players["duck3"] ?? players["goose"]
    print("\(String(describing: move))")
    

    ps. Swift snippet run on Emacs org babel's ob-swift. See Multiline Swift strings for details.

    ]]>
    Sun, 02 Dec 2018 00:00:00 GMT
    Ocado vs Asda (org table) https://xenodium.com/ocado-vs-asda-org-table https://xenodium.com/ocado-vs-asda-org-table Someone handed me an Ocado shopping voucher for 30% off. Sounded promising, even for a one-off.

    With my Money or Your Life hat on, I took a closer look for potential savings. Results were disappointing, when compared to alternatives like Asda.

    Here's a table comparing Ocado (30% off) and Asda (no discount):

                                                                                                                                                                         Ocado    Asda
    

    Coconut Merchant Organic Raw Extra Virgin Coconut Oil 500ml 6.74 KTC 100% pure coconut oil 2.00 Waitrose Love Life Popcorn Maize 510g 1.50 Cypressa Popping Corn 2x500g = 1000g 1.50 Whitworths Ground Almonds 2.00 Whitworths Ground Almonds 1.60 Total £ 5.10 -30% £ 7.17

    #+TBLFM: @8$3=vsum(@2$3..@7$3);£ %.2f::@9$2=vsum(@2$2..@7$2) * 0.7;£ %.2f
    

    On the upside, Ocado has plenty of items I cannot find at Asda. May be a good opportunity to get these items at a discount.

    Emacs org tables

    Small tables are the perfect use-case for Emacs org-mode tables. Been a while since I used one, so great timing for a little refresh.

    Here's the org source for the table above (prior to exporting to HTML):

    |-------------------------------------------------------------+--------+--------|
    |                                                             |  Ocado |   Asda |
    |-------------------------------------------------------------+--------+--------|
    | [[https://www.ocado.com/webshop/product/Coconut-Merchant-Organic-Raw-Extra-Virgin-Coconut-Oil/372144011][Coconut Merchant Organic Raw Extra Virgin Coconut Oil 500ml]] |   6.74 |        |
    | [[https://groceries.asda.com/product/oils/ktc-coconut-hair-oil/910000033621][KTC 100% pure coconut oil]]                                   |        |   2.00 |
    | [[https://www.ocado.com/webshop/product/Waitrose-Love-Life-Popcorn-Maize/25130011][Waitrose Love Life Popcorn Maize 510g]]                       |   1.50 |        |
    | [[https://groceries.asda.com/promotion/2-for-pound-1.50/ls89129][Cypressa Popping Corn 2x500g = 1000g]]                        |        |   1.50 |
    | [[https://www.ocado.com/webshop/product/Whitworths-Ground-Almonds/275684011][Whitworths Ground Almonds]]                                   |   2.00 |        |
    | [[https://groceries.asda.com/product/baking-nuts-seeds-fruit/whitworths-ground-almonds/910000797981][Whitworths Ground Almonds]]                                   |        |   1.60 |
    |-------------------------------------------------------------+--------+--------|
    | Total                                                       |        | £ 5.10 |
    |-------------------------------------------------------------+--------+--------|
    | -30%                                                        | £ 7.17 |        |
    |-------------------------------------------------------------+--------+--------|
    #+TBLFM: @8$3=vsum(@2$3..@7$3);£ %.2f::@9$2=vsum(@2$2..@7$2) * 0.7;£ %.2f
    
    ]]>
    Sat, 01 Dec 2018 00:00:00 GMT
    Execute org blocks as root https://xenodium.com/execute-org-blocks-as-root https://xenodium.com/execute-org-blocks-as-root Been saving admin code snippets in my own org source blocks, some requiring root access. Handy for keeping tiny self-documented scripts to easily bootstrap other machines. TIL org source block's :dir argument can be used to run block as root by using tramp syntax: /:dir sudo::

    
    As user:
    
    #+BEGIN_SRC sh
      whoami
    #+END_SRC
    
    #+RESULTS:
    : user
    
    As root:
    
    #+BEGIN_SRC sh :dir /sudo::
      whoami
    #+END_SRC
    
    #+RESULTS:
    : root
    
    
    ]]>
    Sat, 24 Nov 2018 00:00:00 GMT
    Inline Swift computed properties https://xenodium.com/inline-swift-computed-properties https://xenodium.com/inline-swift-computed-properties Via objc.io and Max Howell's retweet, TIL about Swift's inline computed properties. Another one to try on Org Babel. ‏

    func greetWorld() {
     var message = "hello"
     var betterMessage: String {
       return "\(message) world"
     }
     print(betterMessage)
    }
    
    greetWorld()
    
    ]]>
    Fri, 23 Nov 2018 00:00:00 GMT
    Multiline Swift strings https://xenodium.com/multiline-swift-strings https://xenodium.com/multiline-swift-strings Paul Hudson's tweet introduced me to Swift's multiline string indentation control using closing quotes. Neat!

    Being an org-mode fan, I thought I'd give Swift multiline strings a try using Org Babel's ob-swift. I get to verify it and document at the same time. Win.

    Swift org mode source blocks (ie. BEGIN_SRC/END_SRC) can be added as follows:

    #+BEGIN_SRC swift :exports both
      print("""
           Hello World
      """)
    
      print("""
           Hello World
           """)
    #+END_SRC
    
    #+RESULTS:
    :      Hello World
    : Hello World
    

    By pressing C-c C-c anywhere in the code block, the snippet is executed and its output captured in the RESULT block. Super handy for quickly trying out snippets and keeping as future reference.

    As a bonus, the above blocks can be exported to HTML (amongst other formats). With some styling, it looks as follows:

    print("""
         Hello World
    """)
    
    print("""
         Hello World
         """)
    
         Hello World
    Hello World
    
    ]]>
    Fri, 23 Nov 2018 00:00:00 GMT
    Quickly swapping elfeed filters https://xenodium.com/quickly-swapping-elfeed-filters https://xenodium.com/quickly-swapping-elfeed-filters I seem to be more efficient in getting through rss feeds by individually browsing through related content. That is, I can get through all Emacs entries a lot faster if I look at Emacs content exclusively, instead of mixing with say BBC news. Elfeed filters are great for filtering related content.

    I wanted a way to easily switch through my typical categories of related content by quickly changing elfeed filters using a completion framework.

    Emacs's completing-read plays nicely with your favorite completing framework (mine is ivy). With a couple of functions, we can get Emacs to ask us for the filtering category using human-readable options and quickly presenting related content. Binding the new functionality to <tab> is working well for me.

    (use-package elfeed :ensure t
      :commands elfeed
      :bind (:map elfeed-search-mode-map
                  ("<tab>" . ar/elfeed-completing-filter))
      :config
      (defun ar/elfeed-filter-results-count (search-filter)
        "Count results for SEARCH-FILTER."
        (let* ((filter (elfeed-search-parse-filter search-filter))
               (head (list nil))
               (tail head)
               (count 0))
          (let ((lexical-binding t)
                (func (byte-compile (elfeed-search-compile-filter filter))))
            (with-elfeed-db-visit (entry feed)
              (when (funcall func entry feed count)
                (setf (cdr tail) (list entry)
                      tail (cdr tail)
                      count (1+ count)))))
          count))
    
      (defun ar/elfeed-completing-filter ()
        "Completing filter."
        (interactive)
        (let ((categories (-filter
                           (lambda (item)
                             (> (ar/elfeed-filter-results-count (cdr item))
                                0))
                           '(("All" . "@6-months-ago +unread")
                             ("BBC" . "@6-months-ago +unread +bbc")
                             ("Dev" . "@6-months-ago +unread +dev")
                             ("Emacs" . "@6-months-ago +unread +emacs")
                             ("Health" . "@6-months-ago +unread +health")
                             ("Hacker News" . "@6-months-ago +unread +hackernews")
                             ("iOS" . "@6-months-ago +unread +ios")
                             ("Money" . "@6-months-ago +unread +money")))))
          (if (> (length categories) 0)
              (progn
                (ar/elfeed-view-filtered (cdr (assoc (completing-read "Categories: " categories)
                                                     categories)))
                (goto-char (window-start)))
            (message "All caught up \\o/")))))
    

    We don't actually need two functions, but ar/elfeed-filter-results-count enables us to list only those feeds that actually have new content. The list will shrink as we get through our content. When no content is left, we get a little celebratory message.

    ]]>
    Sat, 17 Nov 2018 00:00:00 GMT
    Converting docx to pdf on macOS https://xenodium.com/converting-docx-to-pdf-on-macos https://xenodium.com/converting-docx-to-pdf-on-macos Wanted to convert a docx document to pdf on macOS. Pandoc to the rescue, but first needed pdflatex installed:

    pandoc -t latex some.docx -o some.pdf
    
    pdflatex not found. Please select a different --pdf-engine or install pdflatex
    

    Installed pdflatex on macOS with:

    brew install mactex
    

    Can also use HTML5. Install wkhtmltopdf with:

    brew install Caskroom/cask/wkhtmltopdf
    

    Convert with:

    pandoc -t html5 some.docx -o some.pdf
    
    ]]>
    Wed, 14 Nov 2018 00:00:00 GMT
    Faster elfeed browsing with paging https://xenodium.com/faster-elfeed-browsing-with-paging https://xenodium.com/faster-elfeed-browsing-with-paging Following up from faster junk mail deletion with mu4e, elfeed is another candidate for enabling actions on pages. In this case, marking rss entries as read, page by Page.

    If on use-package, the function can defined and bound to the "v" key using:

    (use-package elfeed
      :ensure t
      :bind (:map elfeed-search-mode-map
                  ("v" . ar/elfeed-mark-visible-as-read))
      :config
      (defun ar/elfeed-mark-visible-as-read ()
        (interactive)
        (require 'window-end-visible)
        (set-mark (window-start))
        (goto-char (window-end-visible))
        (activate-mark)
        (elfeed-search-untag-all-unread)
        (elfeed-search-update--force)
        (deactivate-mark)
        (goto-char (window-start))))
    

    ]]>
    Tue, 13 Nov 2018 00:00:00 GMT
    Faster junk mail deletion with mu4e https://xenodium.com/faster-junk-mail-deletion-with-mu4e https://xenodium.com/faster-junk-mail-deletion-with-mu4e It's been roughly 5 months since my mu4e email migration. Happy with my choice. Mu4e is awesome.

    I now have 4 email accounts managed by mu4e, and unfortunately receiving lots of junk mail.

    I regularly peek at junk folders for false positives and delete junk email permanently. I've been wanting a quick way to glance at junk mail and easily delete page by page.

    Deleting emails page by page is not supported in mu4e by default. Fortunately, this is Emacs and we can change that™.

    There's a handy package by Roland Walker called window-end-visible. We can use it to select mu4e emails by page and subsequently glue it all together to enable deleting emails by page.

    (require 'mu4e)
    (require 'window-end-visible)
    
    (defun ar/mu4e-delete-page ()
      (interactive)
      (set-mark (window-start))
      (goto-char (window-end-visible))
      (activate-mark)
      (mu4e-headers-mark-for-trash)
      (mu4e-mark-execute-all t)
      (deactivate-mark)
      (goto-char (window-start)))
    

    I'm a use-package fan, so I use it to bind the "v" key to delete visible emails (by page).

    (use-package mu4e
      :bind (:map mu4e-headers-mode-map
             ("v" . ar/mu4e-delete-page))
    

    ]]>
    Sat, 10 Nov 2018 00:00:00 GMT
    Working with vultr's ipv6-only instances https://xenodium.com/working-with-vultrs-ipv6-only-instances https://xenodium.com/working-with-vultrs-ipv6-only-instances Having recently read Your Money or Your Life, I've been cutting down on personal expenses wherever possible. Specially recurring expenses which include monthly charges from VPS hosting. Let's reduce those charges…

    My VPS needs are fairly small (mostly hobby and tinkering). Vultr† has a plan for $2.50/month (not seen anything cheaper). The caveat for the price, you get ipv6 access only (ie. 0000:1111:2222:3333:4444:5555:6666:7777:8888).

    So far so good, but my ISP doesn't yet support ipv6:

    $ ping6 0000:1111:2222:3333:4444:5555:6666:7777:8888
    $ ping6: UDP connect: No route to host
    

    Fortunately, we can still work with ipv6 by using a tunnel (TIL about Hurricane Electric's tunnel broker). After signing up and creating a tunnel, they conveniently show you "Example Configurations" from the "Tunnel Details" menu. In my case, macOS:

    ifconfig gif0 create
    ifconfig gif0 tunnel <ipv4 client broker IP or DCHP internal IP> <ipv4 server IP>
    ifconfig gif0 inet6 <ipv6 client broker IP> <ipv6 server IP> prefixlen 128
    route -n add -inet6 default <ipv6 server IP>
    

    Note: If behind router, use the DHCP internal IP.

    After configuring with ifconfig, all is good. Yay!

    $ ping6 0000:1111:2222:3333:4444:5555:6666:7777:8888
    PING6(56=40+8+8 bytes) 2001:111:22:aaa::2 --> 0000:1111:2222:3333:4444:5555:6666:7777:8888
    16 bytes from 0000:1111:2222:3333:4444:5555:6666:7777:8888, icmp_seq=0 hlim=52 time=270.019 ms
    16 bytes from 0000:1111:2222:3333:4444:5555:6666:7777:8888, icmp_seq=1 hlim=52 time=290.834 ms
    16 bytes from 0000:1111:2222:3333:4444:5555:6666:7777:8888, icmp_seq=2 hlim=52 time=311.960 ms
    16 bytes from 0000:1111:2222:3333:4444:5555:6666:7777:8888, icmp_seq=3 hlim=52 time=330.902 ms
    

    I'm an ipv6 noob. I mostly need ssh access. My typical usages need small tweaks.

    For ssh:

    ssh -6 username@0000:1111:2222:3333:4444:5555:6666:7777:8888
    

    For scp:

    scp -6 file.txt username@\[0000:1111:2222:3333:4444:5555:6666:7777:8888\]:/remote/dir/
    

    † I get $10 credit if you use this affiliate link. Thank you.

    ]]>
    Tue, 06 Nov 2018 00:00:00 GMT
    Shaving bookmarks https://xenodium.com/shaving-bookmarks https://xenodium.com/shaving-bookmarks
  • 8 best safety razors (The Independent).
  • ]]>
    Sun, 04 Nov 2018 00:00:00 GMT
    Buy it for life bookmarks https://xenodium.com/buy-it-for-life-bookmarks https://xenodium.com/buy-it-for-life-bookmarks
  • Fjällräven jackets.
  • Gillette slim (Etsy).
  • ]]>
    Sun, 04 Nov 2018 00:00:00 GMT
    Rust bookmarks https://xenodium.com/rust-bookmarks https://xenodium.com/rust-bookmarks
  • Configuring Emacs for Rust development | Robert Krahn.
  • Introducing the Rust crash course.
  • Rust Language Cheat Sheet (cheats.rs) .
  • ]]>
    Mon, 29 Oct 2018 00:00:00 GMT
    Fonts bookmarks https://xenodium.com/fonts-bookmarks https://xenodium.com/fonts-bookmarks
  • Get the Font.
  • GitHub - rsms/inter: The Inter UI font family.
  • Input: Fonts for Code.
  • Need an industrial typeface like this, anyone?.
  • Programming Fonts - Test Drive.
  • Sudo Coding Font | Jens Kutílek.
  • The package of IBM’s typeface, IBM Plex (font).
  • ]]>
    Sun, 28 Oct 2018 00:00:00 GMT
    imenu on Emacs eshell https://xenodium.com/imenu-on-emacs-eshell https://xenodium.com/imenu-on-emacs-eshell imenu navigation is one of those Emacs gems I didn't discover until much later on. It does what you'd expect in all types of modes. In rare instances, I've found specific modes missing imenu support. Fortunately, this is Emacs and you can fix that.

    Eshell has a handy feature to jump back and forth over previous prompts using M-x eshell-previous-prompt (C-c C-p) and M-x eshell-next-prompt (C-c C-n). Upon learning about these two functions, my immediate reaction was to try imenu. Surprisingly, it didn't "just work", but a tiny bit of elisp brought balance back to the Emacs universe.

    In an eshell mode hook function, one can set the imenu-generic-expression to help it find your favorite prompt:

    (setq-local imenu-generic-expression
                      '(("Prompt" " $ \\(.*\\)" 1)))
    

    Ah it's the little things…

    ps. If wondering why my imenu experience looks a little different, that's because I'm using Abo Abo's wonderful counsel and M-x counsel-semantic-or-imenu.

    ]]>
    Wed, 17 Oct 2018 00:00:00 GMT
    Encrypted disk image on macOS https://xenodium.com/encrypted-disk-image-on-macos https://xenodium.com/encrypted-disk-image-on-macos

    ]]>
    Sun, 14 Oct 2018 00:00:00 GMT
    Sheffield travel bookmarks https://xenodium.com/sheffield-travel-bookmarks https://xenodium.com/sheffield-travel-bookmarks
  • Street Food Chef.
  • Sakushi -Sushi, noodle and Japanese food restaurant in Sheffield.
  • ]]>
    Sat, 13 Oct 2018 00:00:00 GMT
    Headsphones bookmarks https://xenodium.com/headsphones-bookmarks https://xenodium.com/headsphones-bookmarks
  • Bose QuietComfort 35 II Headphones (StevenTammen.com).
  • Sony WH-1000XM3 Review - RTINGS.com.
  • ]]>
    Sat, 13 Oct 2018 00:00:00 GMT
    macOS app bookmarks https://xenodium.com/macos-app-bookmarks https://xenodium.com/macos-app-bookmarks
  • Applite - An App Store for Homebrew | App Addict.
  • Cirrus & Bailiff (iCloud debugging tools).
  • Cork: The Homebrew GUI for macOS.
  • Customizing the Cocoa Text System.
  • Dark Reader.
  • dmgbuild - A command line tool to build .dmg files.
  • GetStream/Winds: macOS rss reader.
  • GitHub - herrbischoff/awesome-macos-command-line.
  • GitHub - koekeishiya/yabai: A tiling window manager for macOS based on binary.
  • GitHub - TermiT/Flycut: Clean and simple clipboard manager for developers.
  • Hidden Bar: macOS utility to hide unused menu bar icons, written in Swift.
  • LaunchBar 6 (can I implement flows in Emacs)?.
  • List of open source applications for macOS (Hacker News).
  • Mac Open Web, by Brian Warren.
  • Mac Troubleshooting Summary – The Eclectic Light Company.
  • MachObfuscator/README.md at master · kam800/MachObfuscator · GitHub.
  • macOS · Papers, Slides and Thesis Archive.
  • Maverick Mac | A curated list of awesome mac applications and utilities.
  • My iPad Setup.
  • My wonderful world of macOS.
  • my-mac-os: My wonderful world of macOS.
  • NetNewsWire 5.0 Relaunches as an Open-Source RSS Reader for the Mac – The Sweet Setup.
  • OnlySwitch: Toggle all sorts of things from menu bar.
  • PDF Editor - PDFpen - Edit PDF Files (Smile Software).
  • PDF OCR X - Mac & Windows OCR Software to convert PDFs and Images to Text.
  • ‎RESTed - Simple HTTP Requests on the Mac App Store.
  • ]]>
    Fri, 05 Oct 2018 00:00:00 GMT
    Gaming bookmarks https://xenodium.com/gaming-bookmarks https://xenodium.com/gaming-bookmarks
  • OpenEmu - Multiple Video Game System for owned ROMs.
  • The Top 100 Android Video Games.
  • ]]>
    Sun, 30 Sep 2018 00:00:00 GMT
    Lua bookmarks https://xenodium.com/lua-bookmarks https://xenodium.com/lua-bookmarks
  • Build and Run (Standalone) · sumneko/lua-language-server Wiki · GitHub.
  • how to lua and c - a short novel.
  • Lua Digest.
  • Lua tables (Hacker News).
  • ]]>
    Sat, 29 Sep 2018 00:00:00 GMT
    Skin product bookmarks https://xenodium.com/skin-product-bookmarks https://xenodium.com/skin-product-bookmarks
  • DIY Deodorant Bars - Rebooted Mom.
  • How to Make Your Own All-Natural Deodorant Bars.
  • Sarah Frasca Makeup: The good, the bad and the ugly: Lush Cosmetics.
  • Skin Deep® Cosmetics Database (EWG).
  • ]]>
    Sat, 29 Sep 2018 00:00:00 GMT
    Sustainability bookmarks https://xenodium.com/sustainability-bookmarks https://xenodium.com/sustainability-bookmarks
  • Source Fabric. Find a Manufacturer. Raise Money to Fund Production. (Factory45).
  • ]]>
    Sat, 29 Sep 2018 00:00:00 GMT
    Investment platform bookmarks https://xenodium.com/investment-platform-bookmarks https://xenodium.com/investment-platform-bookmarks
  • Backtest Portfolio Asset Allocation.
  • Bravos.
  • CMLviz.com - BETA.
  • DEGIRO - Online Stock Trading - Stockbroking (cheaper?).
  • Free Stock API for Realtime and Historical Data (IEX).
  • Freetrade - Free Stock Investing.
  • Halifax UK | Buying and selling (Sharedealing).
  • Hargreaves Lansdown (ISAs, pensions, funds and shares).
  • How I have automated my #algotrading and spend less than ₹10.
  • IWeb Share Dealing (cheaper?).
  • Lend to UK Businesses | Investment (Funding Circle).
  • RateSetter Peer To Peer Lender (P2P Investing and Borrowing).
  • Stock Portfolio Management Software (Stock Portfolio Organizer).
  • StockDaddy - Free, real-time, easy to use stock portfolio tracker.
  • StockLight - Australia's premier investing app.
  • Stocks and cryptocurrency portfolio tracker (wallmine).
  • ]]>
    Sat, 29 Sep 2018 00:00:00 GMT
    Minimalist bookmarks https://xenodium.com/minimalist-bookmarks https://xenodium.com/minimalist-bookmarks
  • mnmll.ist: listing all things minimalist.
  • Raising Simple | Streamline your home. Simplify family life (minimalism).
  • ]]>
    Fri, 28 Sep 2018 00:00:00 GMT
    Recover from Time Machine's "backup already in use" https://xenodium.com/recover-from-time-machines-backup-already-in-use https://xenodium.com/recover-from-time-machines-backup-already-in-use Started seeing "backup already in use" error from my daily Time Machine backups, against my Synology. Disabling and re-enabling AFP did the job (via Synology -> Control Panel -> Files Services -> Enable AFP service).

    ]]>
    Sun, 23 Sep 2018 00:00:00 GMT
    CMake bookmarks https://xenodium.com/cmake-bookmarks https://xenodium.com/cmake-bookmarks
  • An Introduction to Modern CMake (Hacker News).
  • An Introduction to Modern CMake.
  • Embracing Modern CMake (Steveire's Blog).
  • ]]>
    Mon, 03 Sep 2018 00:00:00 GMT
    GTD/Get things done bookmarks https://xenodium.com/gtdget-things-done-bookmarks https://xenodium.com/gtdget-things-done-bookmarks
  • Daily Time Management with Todoist and Google Calendar | JamesStuber.com.
  • Don’t drown in email! How to use Gmail more efficiently. - Startup Lessons Learned.
  • Getting Things Done + Personal Knowledge Management - Praxis.
  • Orgmode for GTD/Get things done.
  • ]]>
    Tue, 28 Aug 2018 00:00:00 GMT
    Pandoc bookmarks https://xenodium.com/pandoc-bookmarks https://xenodium.com/pandoc-bookmarks
  • How I wrote and published my novel using only open source tools.
  • Pandoc (Hacker News).
  • Pandoc - Demos.
  • ]]>
    Tue, 28 Aug 2018 00:00:00 GMT
    Mauritius travel bookmarks https://xenodium.com/mauritius-travel-bookmarks https://xenodium.com/mauritius-travel-bookmarks
  • 20 Amazing Things to Do in Mauritius (2020 Guide).
  • Corson vanilla tea.
  • Ile aux Cerfs (Mauritius) - Jonathan/Vanessa excursions.
  • Le Morne Brabant (Wikipedia).
  • Mauritius Beaches - the Best Beaches in Mauritius - Mauritius Attractions.
  • Mauritius beaches: pictures, information, resorts, sights.
  • Mauritius sights, large pictures, best things to see and do.
  • Public Beaches :: Mauritius Island Online.
  • The 12 best beaches in Mauritius 2020 {with map and photos}.
  • The Best Markets in Mauritius.
  • The Best Spots to Eat Roti in Port Louis, Mauritius.
  • The Essential Guide to Port Louis' Central Market in Mauritius.
  • ]]>
    Mon, 27 Aug 2018 00:00:00 GMT
    Scala bookmarks https://xenodium.com/scala-bookmarks https://xenodium.com/scala-bookmarks
  • Functional Programming for Mortals (Leanpub).
  • ]]>
    Mon, 27 Aug 2018 00:00:00 GMT
    Actionable URLs in Emacs buffers https://xenodium.com/actionable-urls-in-emacs-buffers https://xenodium.com/actionable-urls-in-emacs-buffers Should have enabled actionable URLs in my Emacs buffers long ago. Can now click or press return to follow links. It's great on eshell, compilation buffers, async shell commands, code, etc.

    (use-package goto-addr
      :hook ((compilation-mode . goto-address-mode)
             (prog-mode . goto-address-prog-mode)
             (eshell-mode . goto-address-mode)
             (shell-mode . goto-address-mode))
      :bind (:map goto-address-highlight-keymap
                  ("<RET>" . goto-address-at-point)
                  ("M-<RET>" . newline))
      :commands (goto-address-prog-mode
                 goto-address-mode))
    

    ]]>
    Wed, 22 Aug 2018 00:00:00 GMT
    Bazel bookmarks https://xenodium.com/bazel-bookmarks https://xenodium.com/bazel-bookmarks
  • Bazel_with_GTest: C++ project skeleton with Bazel & GTest.
  • Build mobile apps with Bazel. Part 2: iOS.
  • GitHub - bazelbuild/rules_docker: Rules for building and handling Docker images with Bazel.
  • GitHub - jin/awesome-bazel: A curated list of Bazel rules, tooling and resources.
  • Using Bazel to help fix flaky tests - Jake McCrary.
  • ]]>
    Wed, 22 Aug 2018 00:00:00 GMT
    Palestine travel bookmarks https://xenodium.com/palestine-travel-bookmarks https://xenodium.com/palestine-travel-bookmarks
  • Rukab's Ice Cream, Ramallah (Trip advisor).
  • ]]>
    Sat, 18 Aug 2018 00:00:00 GMT
    Enabling Control-Meta(⌘)-D on macOS https://xenodium.com/enabling-control-meta-d-on-macos https://xenodium.com/enabling-control-meta-d-on-macos I use command (⌘) as my Emacs Meta key. Recently discovered C-M-d is not available to Emacs for binding keys on macOS. Stack Exchange had the workaround:

    defaults write com.apple.symbolichotkeys AppleSymbolicHotKeys -dict-add 70 '<dict><key>enabled</key><false/></dict>'
    
    ]]>
    Sat, 18 Aug 2018 00:00:00 GMT
    Recycling bookmarks https://xenodium.com/recycling-bookmarks https://xenodium.com/recycling-bookmarks
  • My Plastic-free Life.
  • ]]>
    Mon, 13 Aug 2018 00:00:00 GMT
    Comoro islands travel bookmarks https://xenodium.com/comoro-islands-travel-bookmarks https://xenodium.com/comoro-islands-travel-bookmarks
  • Visiting The Comoros Islands (Quota).
  • ]]>
    Sun, 12 Aug 2018 00:00:00 GMT
    France travel bookmarks https://xenodium.com/france-travel-bookmarks https://xenodium.com/france-travel-bookmarks
  • France's 10 top food experiences - Lonely Planet.
  • GR 20 : Best Mountain Hiking in France - The French Touch - Quora.
  • Hmmm I want to take some August vacation time in a city I can go by train from paris and is nice to visit calm and not too expensive .
  • Inside the walls of Mont Saint-Michel, France..
  • ]]>
    Sun, 12 Aug 2018 00:00:00 GMT
    Corsica travel bookmarks https://xenodium.com/corsica-travel-bookmarks https://xenodium.com/corsica-travel-bookmarks
  • National Geographic : Corsica is The Best Place… - The French Touch - Quora.
  • ]]>
    Sun, 12 Aug 2018 00:00:00 GMT
    Mozambique travel bookmarks https://xenodium.com/mozambique-travel-bookmarks https://xenodium.com/mozambique-travel-bookmarks
  • Mozambique's beaches - Africa is Back - Quora.
  • ]]>
    Sun, 12 Aug 2018 00:00:00 GMT
    M-r history search in git-commit-mode https://xenodium.com/m-r-history-search-in-git-commit-mode https://xenodium.com/m-r-history-search-in-git-commit-mode I've grown accustomed to M-r bindings to search Emacs history. Been wanting similar functionality to search commit message history. Turns out log-edit-comment-ring has some of my local commit message history. Feeding it to completing-read gives me an easily searchable history when using a completing framework like ivy or helm:

    (defun ar/git-commit-search-message-history ()
      "Search and insert commit message from history."
      (interactive)
      (insert (completing-read "History: "
                               ;; Remove unnecessary newlines from beginning and end.
                               (mapcar (lambda (text)
                                         (string-trim text))
                                       (ring-elements log-edit-comment-ring)))))
    

    Now we bind it to M-r and we're good to go:

    (bind-key "M-r" #'ar/git-commit-search-message-history git-commit-mode-map)
    

    May also want to persist log-edit-comment-ring across Emacs sessions by adding log-edit-comment-ring to savehist variables. Also ensure savehist-mode is enabled:

    (add-to-list 'savehist-additional-variables log-edit-comment-ring)
    (savehist-mode +1)
    

    ]]>
    Sun, 12 Aug 2018 00:00:00 GMT
    Morning smoothie https://xenodium.com/morning-smoothie https://xenodium.com/morning-smoothie Big fan of my morning power smoothie. Best deals I've found so far:

    ps. I have no affiliation to either retailer. Prices may change.

    ]]>
    Thu, 09 Aug 2018 00:00:00 GMT
    Installing ludget (ledger visualization https://xenodium.com/installing-ludget-ledger-visualization https://xenodium.com/installing-ludget-ledger-visualization Needed python3:

    brew install python3
    

    Use pip3 to install ludget:

    pip3 install ludget
    
    ]]>
    Wed, 08 Aug 2018 00:00:00 GMT
    Ledger bookmarks https://xenodium.com/ledger-bookmarks https://xenodium.com/ledger-bookmarks
  • "Full-fledged Hledger" Tutorial (interesting approach with great traceability and regeneration).
  • "Full-fledged Hledger" Tutorial.
  • Accounting and financial statements (Khan Academy).
  • Accounting in Plain Text, Part 1 – cvilleFOSS.
  • Command Line Accounting - A look at the various ledger ports (mkauer).
  • Conquering Your Finances with Emacs and Ledger : emacs.
  • Conquering your finances with Emacs and Ledger.
  • Convert a CSV file (comma separated values) from your bank into ledger format.
  • Envelope Budgeting with ledger.
  • Examples of recent and older CSV rules files for ledger.
  • full-fledged-hledger: Tutorial on Hledger setup.
  • GitHub - barrucadu/finances: A small tool to visualise my hledger journal..
  • GitHub - Clever/csvlint: library and command line tool that validates a CSV file.
  • Here's how you use ledger to account for Bitcoin transactions.
  • Hledger Flow: Step-By-Step.
  • Importing transactions from bank. : plaintextaccounting (Reddit).
  • Introduction to ledger and text-based accounting | Patrick Skiba.
  • Introduction to plain text accounting (sirodoht blog).
  • Ledger CLI cheatsheet.
  • Ledger CSV format cheatsheet.
  • Ledger examples cheatsheet.
  • Ledger periods cheatsheet.
  • Ledger Practices - Felix Crux.
  • Ledger queries cheatsheet.
  • Ledger Report Scripts (tested on macOS Mojave).
  • Ledger, a powerful CLI accounting tool (Hacker News).
  • ledger/ledger-mode tips and tricks? (Reddit).
  • Ledger: Command-Line Accounting (convert csv command).
  • Ledger: Command-Line Accounting (documentation).
  • ludget: ledger-cli data visualization.
  • Memo's personal Finance post on plain-text accounting.
  • Plain Text Accounting, a guide to Ledger and friends - plaintextaccounting.org (comparisons).
  • Plain Text Accounting, a guide to Ledger and friends - plaintextaccounting.org (import).
  • Program your Finances: Command-line Accounting (Pete Keen).
  • Report Scripts for Ledger CLI with Gnuplot (日光漫想).
  • Show HN: Ledger-analytics – Analytics for ledger-cli (Hacker News).
  • Terencio's Ledger Emacs config.
  • The Plain Text Project.
  • TIP: How I use ledger to track my money : emacs.
  • Tracking Investments in Lots with Hledger.
  • Unrealized gains : plaintextaccounting.
  • Using Ledger for YNAB-like envelope budgeting.
  • Visualise your finances with hledger, InfluxDB, and Grafana.
  • Ways to Categorize Your Spending (Mint).
  • Who's using ledger? · ledger/ledger Wiki.
  • ]]>
    Wed, 08 Aug 2018 00:00:00 GMT
    Tip: Convert .texi to .info https://xenodium.com/tip-convert-texi-to-info https://xenodium.com/tip-convert-texi-to-info Convert with:

    makeinfo doc.texi
    

    View with:

    Open in Emacs and render as info with:

    (defun ar/format-info-mode ()
      (interactive)
      (let ((file-name (buffer-file-name)))
        (kill-buffer (current-buffer))
        (info file-name)))
    
    ]]>
    Tue, 07 Aug 2018 00:00:00 GMT
    Marking 20k emails as read https://xenodium.com/marking-20k-emails-as-read https://xenodium.com/marking-20k-emails-as-read Mbsync and mu4e are great for syncing and handling IMAP email. I've now migrated 4 email addresses, including an old Yahoo account.

    I wanted to mark all my Yahoo unread emails as read. Yahoo's webmail enables marking 500 emails at a time, making the process a little tedious.

    Mu-discuss has a handy thread, highlighting that moving/renaming synced messages (in your local file system) would do the job. This worked well for me.

    Let's do just that…

    WARNING: Copy a small sample of your mails to a separate directory and run some trials until you feel comfortable.

    Find your mail directory.

    cd path/to/mail
    

    Peek at the messages you'd like to mark unread:

    ls -1 new/
    

    Rename message files by appending "S" to their filename and moving from new/ to cur/ directory.

    for FILE in new/*; do mv "${FILE}" cur/$(basename "${FILE}")S; done;
    

    We can verify the move.

    ls -1 cur/
    

    Let's sync the local changes.

    mbsync -Va
    

    …and we're done ;)

    ]]>
    Wed, 25 Jul 2018 00:00:00 GMT
    Show iOS simulator touches https://xenodium.com/show-ios-simulator-touches https://xenodium.com/show-ios-simulator-touches TIL from this tweet, that you can enable showing touches on iOS simulator. This is handy for making nicer screencasts.

    defaults write http://com.apple .iphonesimulator ShowSingleTouches 1
    
    ]]>
    Tue, 24 Jul 2018 00:00:00 GMT
    Amsterdam travel bookmarks https://xenodium.com/amsterdam-travel-bookmarks https://xenodium.com/amsterdam-travel-bookmarks
  • Below the Surface: The archaeological finds of the North / Southline in Amsterdam.
  • ]]>
    Sun, 15 Jul 2018 00:00:00 GMT
    Hardware bookmarks https://xenodium.com/hardware-bookmarks https://xenodium.com/hardware-bookmarks
  • Roman Zolotarev's OpenBSD on my fanless desktop computer (really sweet setup).
  • stapelberg uses this: my 2020 desk setup.
  • ]]>
    Sat, 14 Jul 2018 00:00:00 GMT
    fitbit API, org babel, and gnuplot https://xenodium.com/fitbit-api-org-babel-and-gnuplot https://xenodium.com/fitbit-api-org-babel-and-gnuplot Retook running recently. Took the dust off my aria scale and used the opportunity to check out fitbit's API.

    First register your app at dev.fitbit.com/apps/new and get a client_id=AABBCC.

    You'll also need your USER_ID, from your Fitbitx user profile.

    We'll also need a token. I used the implicit grant flow URL in my browser and extracted access_token=TOKEN.

    Now let's wire up two org source blocks to fetch the data and subsequently plot using gnuplot.

    It's pretty neat. You can take the output from one source block and use it as input to another.

    We use curl to fetch data from fitbit's API and pipe through jq and sed to massage the output format into two columns.

    Note: Before using gnuplot in org babel, you'll need to install the gnuplot package and add to babel languages.

    (use-package gnuplot :ensure t)
    
    (use-package ob
      :config
      (org-babel-do-load-languages
       'org-babel-load-languages
       '((gnuplot . t))))
    
    curl -s -H "Authorization: Bearer TOKEN" https://api.fitbit.com/1/user/USER_ID/body/weight/date/2018-06-09/2018-07-11.json | jq '.[][] | "\(.dateTime) \(.value)"' | sed 's/"//g'
    

    2018-06-09 65.753 2018-06-10 65.762 2018-06-11 65.771 2018-06-12 65.78 2018-06-13 65.789 2018-06-14 65.798 2018-06-15 65.807 2018-06-16 65.816 2018-06-17 65.825 2018-06-18 65.85 2018-06-19 65.96 2018-06-20 64.1 2018-06-21 65.64 2018-06-22 65.47 2018-06-23 65.515 2018-06-24 65.56 2018-06-25 65.605 2018-06-26 65.65 2018-06-27 65.18 2018-06-28 64.49 2018-06-29 64.49 2018-06-30 64.41 2018-07-01 64.33 2018-07-02 64.25 2018-07-03 64.17 2018-07-04 64.55 2018-07-05 64.39 2018-07-06 64.33 2018-07-07 65.06 2018-07-08 63.28 2018-07-09 63.4 2018-07-10 64.22 2018-07-11 63.95


    Now feed the two column data to gnuplot.

    reset
    set title "My recent weight"
    set xdata time
    set timefmt '%Y-%m-%d'
    set format x "%d/%m/%y"
    set term png
    set xrange ['2018-06-09':'2018-07-11']
    plot data u 1:2 with linespoints title 'Weight in Kg'
    

    Fetching data and plotting through org babel and gnuplot is pretty sweet. I've barely scratched the surface. There's more at Org-babel-gnuplot and Plotting tables in Org-Mode using org-plot. Either way, this is another Emacs super power to keep in the toolbox.

    ]]>
    Wed, 11 Jul 2018 00:00:00 GMT
    PIPESTATUS for all return codes https://xenodium.com/pipestatus-for-all-return-codes https://xenodium.com/pipestatus-for-all-return-codes From @saruspete's tweet, ${PIPESTATUS[@]} gives ya all piped commands' return codes:

    echo foo | grep bar | tr z a | cat
    echo ${PIPESTATUS[@]}
    
    ]]>
    Sun, 08 Jul 2018 00:00:00 GMT
    Emacs utilities for your OS https://xenodium.com/emacs-utilities-for-your-os https://xenodium.com/emacs-utilities-for-your-os Narrowing utilities are a wonderful way of increasing productivity. I have a few workflows using Emacs's Helm framework.

    There are great productivity boosters like Alfred and Quicksilver for macOS, with batteries included.

    If you're a tinkerer, you'd enjoy the powerful Hammerspoon. Like elisp gluing all things Emacs, Hammerspoon uses Lua to glue all things macOS. You can build your own narrowing utilities using chooser and a little Lua.

    local chooser = hs.chooser.new(function(choice)
          hs.alert.show(choice['text'])
    end)
    
    chooser:choices({
          {
             ["text"] = "Alfred\n",
             ["subText"] = "macOS only\n",
          },
          {
             ["text"] = "Quicksilver\n",
             ["subText"] = "macOS only\n",
          },
          {
             ["text"] = "Hammerspoon\n",
             ["subText"] = "macOS only\n",
          },
          {
             ["text"] = "Emacs\n",
             ["subText"] = "is everywhere :)\n",
          },
    })
    chooser:show()
    

    Howard Abrams's post on Capturing Content for Emacs inspired me to look at gluing Emacs and macOS to launch my own cross-platform narrowing utilities.

    I've also taken this opportunity to look at Oleh Krehel's wonderful completion package: Ivy. We can use it to build a macOS narrowing utility.

    Ivy is remarkably easy to use. Turns out, ivy-read is all you need. A simple Emacs completion can be accomplished with little elisp.

    (ivy-read "Hello ivy: "
              '("One "
                "Two "
                "Three "
                "Four "))
    

    Pretty nifty. Let's make this completion more accessible from the rest of the OS. To do so, we create a separate Emacs frame and make it pretty. We also want it to interact with the OS. We'll use ivy-read's :action to invoke a tiny bit of AppleScript.

    Oh and we'll also use some funny quotes to tease ourselves about our beloved editor.

    (with-current-buffer (get-buffer-create "*modal-ivy*")
      (let ((frame (make-frame '((auto-raise . t)
                                 (background-color . "DeepSkyBlue3")
                                 (cursor-color . "MediumPurple1")
                                 (font . "Menlo 15")
                                 (foreground-color . "#eeeeec")
                                 (height . 20)
                                 (internal-border-width . 20)
                                 (left . 0.33)
                                 (left-fringe . 0)
                                 (line-spacing . 3)
                                 (menu-bar-lines . 0)
                                 (minibuffer . only)
                                 (right-fringe . 0)
                                 (tool-bar-lines . 0)
                                 (top . 48)
                                 (undecorated . t)
                                 (unsplittable . t)
                                 (vertical-scroll-bars . nil)
                                 (width . 110)))))
        (set-face-attribute 'ivy-minibuffer-match-face-1 frame
                            :background nil
                            :foreground nil)
        (set-face-attribute 'ivy-minibuffer-match-face-2 frame
                            :background nil
                            :foreground "orange1")
        (set-face-attribute 'ivy-minibuffer-match-face-3 frame
                            :background nil
                            :foreground "orange1")
        (set-face-attribute 'ivy-minibuffer-match-face-4 frame
                            :background nil
                            :foreground "orange1")
        (set-face-attribute 'ivy-current-match frame
                            :background "#ffc911"
                            :foreground "red")
        (set-face-attribute 'minibuffer-prompt frame
                            :foreground "grey")
        (let ((ivy-height 20)
              (ivy-count-format ""))
          (ivy-read "Emacs acronyms: "
                    '(" Emacs: Escape-Meta-Alt-Control-Shift "
                      " Emacs: Eight Megabytes And Constantly Swapping "
                      " Emacs: Even a Master of Arts Comes Simpler "
                      " Emacs: Each Manual's Audience is Completely Stupified "
                      " Emacs: Eventually Munches All Computer Storage "
                      " Emacs: Eradication of Memory Accomplished with Complete Simplicity "
                      " Emacs: Easily Maintained with the Assistance of Chemical Solutions "
                      " Emacs: Extended Macros Are Considered Superfluous "
                      " Emacs: Every Mode Accelerates Creation of Software "
                      " Emacs: Elsewhere Maybe All Commands are Simple "
                      " Emacs: Emacs Makes All Computing Simple "
                      " Emacs: Emacs Masquerades As Comfortable Shell "
                      " Emacs: Emacs My Alternative Computer Story "
                      " Emacs: Emacs Made Almost Completely Screwed "
                      " Emacs: Each Mail A Continued Surprise "
                      " Emacs: Eating Memory And Cycle-Sucking "
                      " Emacs: Elvis Masterminds All Computer Software "
                      " Emacs: Emacs Makes A Computer Slow" )
                    :action (lambda (funny-quote)
                              (async-shell-command (format "osascript -e 'tell app \"System Events\" to display dialog \"%s\" buttons {\"OK\"}'" funny-quote)))
                    :unwind (lambda ()
                              (shell-command "/Applications/Hammerspoon.app/Contents/Resources/extensions/hs/ipc/bin/hs -c 'backFromEmacs()'")
                              (delete-frame)
                              (other-window 1))))))
    

    So where's all this going? I wrote a utility to extract all links from this page's org file and make them easily searchable from anywhere on macOS by invoking ⌥-W.

    The keys are bound using Lua, Hammerspoon, and emacsclient. This works well on macOS, but there are alternatives for other operating systems.

    hs.execute("emacsclient -ne \""..elisp.."\" -s /tmp/emacs*/server")
    

    Here's the resulting utility in action:

    These integrations look promising. They enable me to bring cross-platform Emacs utilities into areas I hadn't considered.

    ]]>
    Sat, 07 Jul 2018 00:00:00 GMT
    Web serving tools bookmarks https://xenodium.com/web-serving-tools-bookmarks https://xenodium.com/web-serving-tools-bookmarks
  • Certbot: Automatically enable HTTPS on your website, deploying Let's Encrypt certificates.
  • How to configure WireGuard to tunnel traffic from a macOS client through a Debian server with IPv4 and IPv6.
  • HTTPS Is Easy (Irreal).
  • I made my own WireGuard VPN server (Hacker News).
  • JSON:API — A specification for building APIs in JSON.
  • MirageOS: high-performance network applications across a variety of cloud computing and mobile platforms.
  • nginxconfig.io.
  • Nice nginx features for developers | There is no magic here.
  • Poor man's way of handling 1.3 million web request.
  • Postman (API Development Environment).
  • quark: an extremely small and simple HTTP GET/HEAD-only web server for static content (suckless.org tools).
  • The Missing Wireguard Documentation.
  • Web Authentication for Actual Humans, Part Two - DEV Community.
  • ]]>
    Sun, 01 Jul 2018 00:00:00 GMT
    URL shortener bookmarks https://xenodium.com/url-shortener-bookmarks https://xenodium.com/url-shortener-bookmarks
  • go: Another Google-like Go short link service.
  • zap: Blazing fast web shortcuts.
  • ]]>
    Sun, 24 Jun 2018 00:00:00 GMT
    Trying out mu4e with mbsync https://xenodium.com/trying-out-mu4e-with-mbsync https://xenodium.com/trying-out-mu4e-with-mbsync The email fun in Emacs continues. After a few weeks since I started using mu4e and offlineimap, I'm sold. Both are awesome. Mbsync is an offlineimap alternative. Despite resyncing all my mail, the transition was fairly smooth. Here's how…

    Install isync (for mbsync)

    brew install isync
    

    Configure mbsync

    Mbsync uses ~/.mbsyncrc for configuration. Migrating ~/.offlineimaprc to ~/.mbsyncrc looks like:

    IMAPAccount Personal
    Host some.imap.host.com
    User your_user_name
    PassCmd "gpg --quiet --batch -d ~/.offlineimap_accountname.gpg"
    Port 993
    SSLType IMAPS
    AuthMechs Login
    CertificateFile  ~/.offlineimapcerts.pem
    # My IMAP provider doesn't handle concurrent IMAP commands.
    PipelineDepth 1
    
    IMAPStore Personal-remote
    Account Personal
    
    MaildirStore Personal-local
    Path ~/IMAP/Personal/
    Inbox ~/IMAP/Personal/INBOX
    
    Channel Personal
    Master :Personal-remote:
    Slave :Personal-local:
    Patterns *
    Create Slave
    Sync All
    Expunge Both
    SyncState *
    

    No concurrent IMAP commands supported

    My IMAP provider doesn't handle concurrent IMAP commands. mbsync and Office 365 had the answer:

    PipelineDepth 1
    

    Initial sync

    Run initial from the command line sync:

    mbsync -Va
    

    While syncing my largest inbox, it sometimes received an unexpected EOF error:

    IMAP error: unexpected EOF from some.imap.host.com (1.2.3.4:993)
    

    First few times, I restarted the syncing manually, but then used a loop to automatically restart it.

    Bash loops:

    while true; do mbsync -V Personal; sleep 5; done
    
    for i in {1..5}; do mbsync -V Personal; sleep 5; done
    

    Eshell loop:

    for i in (number-sequence 1 10) {mbsync -V Personal; sleep 5}
    

    Create mu index

    Reindex using mu, but first remove existing index for offlineimap messages:

    rm -rf ~/.mu
    

    Ok, do index now:

    mu index --maildir=~/IMAP
    

    Mu4e tweaks

    The get mail command should now point to mbsync.

    (csetq mu4e-get-mail-command "mbsync -Va")
    

    I had issues with duplicate IDs after moving and deleting messages from mu4e. Migrating from offlineimap to mbsync for mu4e had the answer:

    (csetq mu4e-change-filenames-when-moving t)
    

    Helpful references

    ]]>
    Sun, 17 Jun 2018 00:00:00 GMT
    Sticky function keys on touch bar https://xenodium.com/sticky-function-keys-on-touch-bar https://xenodium.com/sticky-function-keys-on-touch-bar Visible (and sticky) function keys are not the touch bar default for Emacs. Let's change that:

    ]]>
    Fri, 15 Jun 2018 00:00:00 GMT
    GNU find on macOS https://xenodium.com/gnu-find-on-macos https://xenodium.com/gnu-find-on-macos At times, you may need GNU versions of command line utilities on macOS. For example, GNU find.

    As usual, Homebrew saves the day. Install with:

    brew install findutils
    

    Unless you install with –with-default-names (I don't), GNU utilities will be prefixed with a "g".

    gfind --version
    

    If you need more, there are others:

    brew install binutils
    brew install diffutils
    brew install ed
    brew install findutils
    brew install gawk
    brew install gnu-indent
    brew install gnu-sed
    brew install gnu-tar
    brew install gnu-which
    brew install gnutls
    brew install grep
    brew install gzip
    brew install screen
    brew install watch
    brew install wdiff --with-gettext
    brew install wget
    
    ]]>
    Wed, 13 Jun 2018 00:00:00 GMT
    PlantUML bookmarks https://xenodium.com/plantuml-bookmarks https://xenodium.com/plantuml-bookmarks
  • Collection of PlantUML snippets from Scripter.co.
  • Real World PlantUML.
  • Welcome to The Hitchhiker’s Guide to PlantUML!.
  • ]]>
    Wed, 13 Jun 2018 00:00:00 GMT
    Adding mu4e maildirs extension https://xenodium.com/adding-mu4e-maildirs-extension https://xenodium.com/adding-mu4e-maildirs-extension Continuing the mu4e fun, added mu4e-maildirs-extension to display a mail dirs summary.

    ]]>
    Tue, 29 May 2018 00:00:00 GMT
    Trying out mu4e and offlineimap https://xenodium.com/trying-out-mu4e-and-offlineimap https://xenodium.com/trying-out-mu4e-and-offlineimap

    Managing Email from Emacs. Surely that's crazy-talk, but hey… let's give it a try.

    Install offlineimap

    Need to sync via imap. Use offlineimap. I'm on macOS, so homebrew is king for installing:

    brew install offlineimap
    

    Before can configure offlineimap, we'll need to handle a few things first.

    Get a cert fingerprint

    Use openssl for getting a certificate fingerprint. From offlineimap's FAQ:

    SSL_CERT_DIR="" openssl s_client -connect imap.migadu.com:993 < /dev/null 2>/dev/null | openssl x509 -fingerprint -noout -text -in /dev/stdin
    

    Should give you something like:

    SHA1 Fingerprint=AA:BB:CC:DD:EE:DD:FF:AA:00:AA:2A:AA:AA:AA:A8:20:80:AA:A2:AA

    Encrypt password

    Offlineimap can read passwords in plain text in its .offlineimaprc config file, but that's yuckie. Let's encrypt the password and use gnupg for that. Install it:

    brew install gnupg
    

    If you haven't already, generate a key

    gpg --full-gen-key
    

    Generate an offlineimap account password file.

    echo "YourPassword" | gpg --encrypt --recipient "Your Name" -o ~/.offlineimap_accountname.gpg
    

    Python password wrapper

    Based on Fabian's Encrypt OfflineIMAP and msmtp password with GnuPG, I created ~/.read_password.py with:

    import os
    import subprocess
    
    def read_password(path):
      return subprocess.check_output(["gpg\n", "--quiet\n", "--batch\n", "-d\n", os.path.expanduser(path)]).strip()
    

    ps. Alternatively, see The homely Mutt's section to store password in macOS's keychain.

    Configure offlineimap

    Offlineimap uses ~/.offlineimaprc for configuration. We now have all we need to put the configuration together:

    [general]
    accounts = Personal
    
    # Load this python file.
    pythonfile = ~/.read_password.py
    
    [Account Personal]
    localrepository = Personal-Local
    
    remoterepository = Personal-Remote
    
    # After syncing, let mu index it.
    postsynchook = mu index --maildir ~/stuff/active/Mail
    
    # Sync imap every 5 minutes.
    autorefresh = 5
    
    # Alternate between 10 quick syncs and full syncs.
    quick = 10
    
    [Repository Personal-Local]
    type = Maildir
    localfolders = ~/stuff/active/Mail/Personal
    
    [Repository Personal-Remote]
    type = IMAP
    remotehost = some.imap.host.com
    remoteuser = your_user_name
    
    # Use function defined in .read_password.py to read the password.
    remotepasseval = read_password("~/.offlineimap_personal_account_password.gpg")
    
    # Use the SHA1 fingerprint retrieved with openssl.
    cert_fingerprint = aabbccddeeddffaa00aa2aaaaaaaa82080aaa2aa
    

    Cert file

    You can use macOS's certificates from Keychain Access -> System Roots -> Certificates, select all, and ⌘-⇧-e (for export items). Save to ~/certs.pem and use offlineimap configutation:

    sslcacertfile = /path/to/certs.pem

    Another option is executing lib/mk-ca-bundle.pl from curl's tarball to generate ca-bundle.crt, using certdata.txt from Mozilla's source tree.

    Install mu4e

    Manually modified mu4e recipe to pick up my Emacs binary. TIL about homebrew's edit command:

    brew edit mu
    

    Changed the one line:

    • ENV["EMACS"] = "no" if build.without? "emacs"
    • ENV["EMACS"] = "/Users/alvaro/homebrew/Cellar/emacs-plus/26.1-rc1_2/bin/emacs"

    Finally installed mu4e:

    brew install mu
    

    Configure mu4e

    Lastly, configure mu4e:

    (add-to-list 'load-path
                 (expand-file-name "~/homebrew/share/emacs/site-lisp/mu/mu4e"))
    (use-package mu4e
      :config
      ;; Update mail using 'U' in main view:
      (setq mu4e-get-mail-command "offlineimap")
      (setq mu4e-view-show-addresses t)
      (setq mu4e-attachment-dir (expand-file-name "~/Downloads/"))
      (setq mu4e-maildir "path/to/Mail")
      (setq mu4e-html2text-command "w3m -T text/html") ;; alternatively "textutil -stdin -format html -convert txt -stdout"
      (setq mu4e-user-mail-address-list '("[email protected]"
                                          "[email protected]"))
      (setq mu4e-context-policy 'pick-first)
      (setq mu4e-compose-context-policy 'always-ask)
      (setq mu4e-contexts
            (list
             (make-mu4e-context
              :name "domain1"
              :enter-func (lambda () (mu4e-message "Entering context [email protected]"))
              :leave-func (lambda () (mu4e-message "Leaving context [email protected]"))
              :match-func (lambda (msg)
                            (when msg
                              (mu4e-message-contact-field-matches
                               msg '(:from :to :cc :bcc) "[email protected]")))
              :vars '((user-mail-address . "[email protected]")
                      (user-full-name . "My name")
                      (mu4e-sent-folder . "/Domain1/Sent")
                      (mu4e-drafts-folder . "/Domain1/Drafts")
                      (mu4e-trash-folder . "/Domain1/Trash")
                      (mu4e-compose-signature . nil)
                      (mu4e-compose-format-flowed . nil)
                      (smtpmail-smtp-user . "[email protected]")
                      (smtpmail-smtp-server . "smtp.domain1.com")
                      (smtpmail-smtp-service . 587)))
             (make-mu4e-context
              :name "domain2"
              :enter-func (lambda () (mu4e-message "Entering context [email protected]"))
              :leave-func (lambda () (mu4e-message "Leaving context [email protected]"))
              :match-func (lambda (msg)
                            (when msg
                              (mu4e-message-contact-field-matches
                               msg '(:from :to :cc :bcc) "[email protected]")))
              :vars '((user-mail-address . "[email protected]")
                      (user-full-name . "My name")
                      (mu4e-sent-folder . "/Domain2/Sent")
                      (mu4e-drafts-folder . "/Domain2/Drafts")
                      (mu4e-trash-folder . "/Domain2/Trash")
                      (mu4e-compose-signature . nil)
                      (mu4e-compose-format-flowed . nil)
                      (smtpmail-smtp-user . "[email protected]")
                      (smtpmail-smtp-server . "smtp.domain2.com")
                      (smtpmail-smtp-service . 587))))))
    
    (use-package smtpmail
      :config
      (setq smtpmail-stream-type 'starttls)
      (setq smtpmail-debug-info t)
      (setq smtpmail-warn-about-unknown-extensions t)
      (setq smtpmail-queue-mail t)
      (setq smtpmail-default-smtp-server nil)
      ;; Created with mu mkdir path/to/Mail/queue
      ;; Also avoid indexing.
      ;; touch path/to/Mail/queue/.noindex
      (setq smtpmail-queue-dir "path/to/Mail/queue/cur"))
    
    (use-package message
      :config
      (setq message-send-mail-function 'smtpmail-send-it))
    

    Authinfo

    Create an ~/.authinfo file for sendmail authentication with:

    machine smtp.host1.com login [email protected] password somepassword1
    machine smtp.host2.com login [email protected] password somepassword2
    

    Encrypt ~/.authinfo with M-x epa-encrypt-file. Keep ~/.authinfo.gpg and delete ~/.authinfo.

    Mu4e helpful references

    ]]>
    Mon, 28 May 2018 00:00:00 GMT
    Transparent Emacs titlebars on macOS https://xenodium.com/transparent-emacs-titlebars-on-macos https://xenodium.com/transparent-emacs-titlebars-on-macos Happy with Emacs Plus builds on Mac. You get some eye-candy bonuses like transparent titlebars.

    To install:

    brew tap d12frosted/emacs-plus
    brew install emacs-plus --without-spacemacs-icon
    

    Config:

    (when (memq window-system '(mac ns))
      (add-to-list 'default-frame-alist '(ns-appearance . dark)) ; nil for dark text
      (add-to-list 'default-frame-alist '(ns-transparent-titlebar . t)))
    

    ]]>
    Thu, 24 May 2018 00:00:00 GMT
    Lunette: Like Spectacle but for Hammerspoon https://xenodium.com/lunette-like-spectacle-but-for-hammerspoon https://xenodium.com/lunette-like-spectacle-but-for-hammerspoon Came across Lunette. Gives ya Spectacle Keybindings for Hammerspoon.

    ]]>
    Thu, 24 May 2018 00:00:00 GMT
    Train Emacs to open files externally https://xenodium.com/train-emacs-to-open-files-externally https://xenodium.com/train-emacs-to-open-files-externally TIL about the openwith package. It enables Emacs to defer to external programs for certain files. You choose which ones. Neat.

    (use-package openwith :ensure t
      :config
      (csetq openwith-associations
             '(("\\.\\(mp4\\|mp3\\|webm\\|avi\\|flv\\|mov\\)$" "open" (file))))
      (openwith-mode 1))
    
    ]]>
    Wed, 23 May 2018 00:00:00 GMT
    Show hidden files in Finder https://xenodium.com/show-hidden-files-in-finder https://xenodium.com/show-hidden-files-in-finder defaults write com.apple.finder AppleShowAllFiles TRUE killall Finder ]]> Tue, 22 May 2018 00:00:00 GMT Ejecting USB drives on Synology https://xenodium.com/ejecting-usb-drives-on-synology https://xenodium.com/ejecting-usb-drives-on-synology For posterity:

    Control panel > External devices > USB Disk 1 > Eject

    ]]>
    Tue, 22 May 2018 00:00:00 GMT
    Remounting Synology encrypted share https://xenodium.com/remounting-synology-encrypted-share https://xenodium.com/remounting-synology-encrypted-share Had been a while since I did this… for posterity:

    Control panel > Shared Folder > Encryption > Mount

    ]]>
    Mon, 21 May 2018 00:00:00 GMT
    Synology user had no home https://xenodium.com/synology-user-had-no-home https://xenodium.com/synology-user-had-no-home Upon ssh'ing to a Synology box, the user had no home.

    Could not chdir to home directory /var/services/homes/someone: No such file or directory

    Fixed via:

    Control Panel > User > Advanced > User Home > [x] Enable user home service

    ]]>
    Sun, 20 May 2018 00:00:00 GMT
    Pre-commit hooks to save you from yourself https://xenodium.com/pre-commit-hooks-to-save-you-from-yourself https://xenodium.com/pre-commit-hooks-to-save-you-from-yourself Wanted to try out some code, but needed to ensure never checked in. Git pre-commit hooks are handy in this space. Add the following script to search for either @COMMITFAIL or @NOCOMMIT in the staged files. If found, attempts to commit will fail.

    Based on https://gist.github.com/rex/223b4be50285f6b8b3e06dea50d15887:

    #!/bin/bash
    
    set -o nounset
    set -o errexit
    
    echo "Arguments:"
    echo "$@"
    echo "---"
    
    readonly FILES_PATTERN='(\..+)?$'
    readonly FORBIDDEN='(@?NOCOMMIT|@?COMMITFAIL)'
    
    if ( git diff --cached --name-only | grep -E "$FILES_PATTERN" | xargs grep -E --with-filename -n "$FORBIDDEN" ); then
      echo "ERROR: @COMMITFAIL or @NOCOMMIT found. Exiting to save you from yourself."
      exit 1
    fi
    

    Save to a file and create a symbolic link to your .git/hooks directory:

    ln -s ../../git/commit-fail-pre-hook.sh .git/hooks/pre-commit
    
    ]]>
    Mon, 30 Apr 2018 00:00:00 GMT
    Azores travel bookmarks https://xenodium.com/azores-travel-bookmarks https://xenodium.com/azores-travel-bookmarks
  • Azores islands.
  • My configuration with init.lua and the require()ed modules.
  • This other Eden: the Azores, Europe's secret islands of adventure.
  • ]]>
    Thu, 19 Apr 2018 00:00:00 GMT
    Debugging Emacs binary https://xenodium.com/debugging-emacs-binary https://xenodium.com/debugging-emacs-binary From How do I debug an emacs crash? (Emacs Stack Exchange), disable optimizations when configuring and build:

    CFLAGS="-O0 -g3" ./configure ...
    make
    

    And good 'ol gdb (lldb works too):

    gdb ../nextstep/Emacs.app/Contents/MacOS/Emacs
    

    Reference

    ]]>
    Thu, 19 Apr 2018 00:00:00 GMT
    Paper less bookmarks https://xenodium.com/paperless-bookmarks https://xenodium.com/paperless-bookmarks
  • danielquinn/paperless: Scan, index, and archive all of your paper documents.
  • Digitizing All Your Paper Stuff.
  • Fujitsu ScanSnap iX500 Color Duplex Desk Scanner for Mac and PC.
  • Going Paperless: Scanning to Evernote, Revisited | Jamie Todd Rubin.
  • guess-filename.py: Derive a file name according to old file name cues and/or PDF file content.
  • Hazel for document/download management.
  • Installing Tesseract OCR on Mac OS X Lion.
  • Paperless | Irreal.
  • PDF OCR X - Mac & Windows OCR Software to convert PDFs and Images to Text.
  • Video: Batch OCR With The Mac Fujitsu ScanSnap.
  • ]]>
    Thu, 19 Apr 2018 00:00:00 GMT
    Bologna travel bookmarks https://xenodium.com/bologna-travel-bookmarks https://xenodium.com/bologna-travel-bookmarks
  • Il Cannone restaurant.
  • ]]>
    Wed, 18 Apr 2018 00:00:00 GMT
    Grep through pdfs https://xenodium.com/grep-through-pdfs https://xenodium.com/grep-through-pdfs Late to the party, but investing in going paperless. Got a scanner with OCR, which generates searchable pdfs. If I could only grep through them…

    brew install pdfgrep
    

    Balance restored.

    ]]>
    Tue, 17 Apr 2018 00:00:00 GMT
    Hammerspoon bookmarks https://xenodium.com/hammerspoon-bookmarks https://xenodium.com/hammerspoon-bookmarks
  • dotfiles/grid.lua at master for simple functions to resize windows.
  • Emacs keys everywhere Hammerspoon Script.
  • Getting Started With Hammerspoon (by Diego Martín Zamboni).
  • Hammerspoon config inspired by Spacemacs.
  • Just Enough Lua to Be Productive in Hammerspoon, Part 1.
  • Just Enough Lua to Be Productive in Hammerspoon, Part 2.
  • launchOrFocusByBundleID for global key bindings (there are Emacs goodies there too).
  • My configuration with init.lua and the require()ed modules.
  • Seal. Helm-like for hammerspoon.
  • Set up a Hyper Key with Hammerspoon on macOS.
  • ZeroBrane completion and here also.
  • ]]>
    Sat, 14 Apr 2018 00:00:00 GMT
    Options to reduce Go binary size https://xenodium.com/options-to-reduce-go-binary-size https://xenodium.com/options-to-reduce-go-binary-size A Hacker News's thread Go gets preliminary WebAssembly support has a couple of tips to reduce binaries compiled with Go.

    go build -ldflags=-s
    

    UPX (Ultimate Packer for eXecutables) packs the binary further.

    upx --ultra-brute
    
    ]]>
    Sat, 14 Apr 2018 00:00:00 GMT
    Trying out tesseract https://xenodium.com/trying-out-tesseract https://xenodium.com/trying-out-tesseract As part of going paperless, looking into OCR. Trying out tesseract.

    Install

    $ brew install gs
    $ brew install imagemagick
    $ brew install tesseract
    
    $ convert -density 300 -depth 8 receipt.pdf receipt.png
    $ tesseract receipt.png receipt.png.txt
    
    ]]>
    Mon, 09 Apr 2018 00:00:00 GMT
    Sapporo travel bookmarks https://xenodium.com/sapporo-travel-bookmarks https://xenodium.com/sapporo-travel-bookmarks
  • 175 ° DENO Dandan Noodles, Sapporo.
  • The Hill of the Buddha.
  • ]]>
    Sun, 08 Apr 2018 00:00:00 GMT
    Gif bookmarks https://xenodium.com/gif-bookmarks https://xenodium.com/gif-bookmarks
  • An idiot’s guide to animation compression | Taking Initiative.
  • gif-progress: Attach progress bar to animated GIF.
  • gifski — highest-quality GIF converter.
  • keycastr: an open-source keystroke visualizer.
  • phw/peek: Simple animated GIF screen recorder for Linux.
  • ]]>
    Sun, 08 Apr 2018 00:00:00 GMT
    Trying out ShellCheck https://xenodium.com/trying-out-shellcheck https://xenodium.com/trying-out-shellcheck ShellCheck gives you automatic warnings/suggestions in bash/sh shell scripts.

    $ brew install shellcheck
    

    Bonus: If using Emacs's flycheck, you get ShellCheck support out of the box.

    ]]>
    Sun, 08 Apr 2018 00:00:00 GMT
    Image editing bookmarks https://xenodium.com/image-editing-bookmarks https://xenodium.com/image-editing-bookmarks
  • Exif.tools – A multimedia file metadata tool (Hacker News).
  • Fred's ImageMagick Scripts (Hacker News).
  • How to crop in GIMP (Linux Hint).
  • ImageMagick to Sharpen an Image – Linux Hint.
  • Jpeg2png: Silky smooth JPEG decoding – no more artifacts (2016) | Hacker News.
  • Make your own meme image using Imagemagick.
  • The Art of PNG Glitch (Hacker News).
  • The Art of PNG Glitch.
  • ]]>
    Sun, 08 Apr 2018 00:00:00 GMT
    Buying matcha powder online https://xenodium.com/buying-matcha-powder-online https://xenodium.com/buying-matcha-powder-online From Reddit's thread:

    ]]>
    Thu, 05 Apr 2018 00:00:00 GMT
    Getting macOS app bundle ID https://xenodium.com/getting-macos-app-bundle-id https://xenodium.com/getting-macos-app-bundle-id From stack overflow:

    Option 1

    osascript -e 'id of app "Emacs"'
    

    Option 2

    mdls -name kMDItemCFBundleIdentifier -r SomeApp.app
    
    ]]>
    Wed, 04 Apr 2018 00:00:00 GMT
    Trying out chunkwm https://xenodium.com/trying-out-chunkwm https://xenodium.com/trying-out-chunkwm

    Installing Chunkwm

    $ brew tap crisidev/homebrew-chunkwm
    $ brew install --HEAD --with-tmp-logging chunkwm
    

    Add a configuration file. Started off from this example.

    ~.chunkwmrc chmod +x ~.chunkwmrc

    Note: Ensure core::plugin_dir matches homebrew's plugin directory. Typically something like: //path/to/homebrew/opt/chunkwm/share/chunkwm/plugins/

    Start chunkwmrc service.

    $ brew services start crisidev/chunkwm/chunkwm
    

    Installing skhd (a hotkey daemon)

    $ brew install --HEAD --with-logging  koekeishiya/formulae/skhd
    

    Start skhd service.

    $ brew services start koekeishiya/formulae/skhd
    

    Skhd logs location.

    /Users/you/homebrew/var/log/skhd/skhd.[out|err].log
    

    Add a configuration file. Started off from this example.

    ~/.skhdrc
    chmod +x ~/.skhdrc
    

    Installing khd (easily invoke hotkeys from terminal)

    $ brew install khd
    

    Some additional Mission Control and keyboard shortcut preferences:

    ]]>
    Sat, 31 Mar 2018 00:00:00 GMT
    Building bazel on macOS https://xenodium.com/building-bazel-on-macos https://xenodium.com/building-bazel-on-macos Bootstrap
    brew tap bazelbuild/tap
    brew install bazelbuild/tap/bazel
    

    Build

    git clone https://github.com/bazelbuild/bazel.git
    cd bazel
    bazel build //src:bazel
    

    Get your bazel binary

    Self-contained binary in bazel-bin/src/bazel
    

    Known revisions

    ]]>
    Tue, 06 Feb 2018 00:00:00 GMT
    Extracting files from pkg https://xenodium.com/extracting-files-from-pkg https://xenodium.com/extracting-files-from-pkg mkdir tmp cd tmp xar -xf ../Some.pkg cat Payload | gunzip -dc |cpio -i ]]> Sun, 07 Jan 2018 00:00:00 GMT Installing Inkscape with homebrew https://xenodium.com/installing-inkscape-with-homebrew https://xenodium.com/installing-inkscape-with-homebrew brew tap caskroom/cask brew install caskformula/caskformula/inkscape ]]> Sun, 07 Jan 2018 00:00:00 GMT Magit amend commit author https://xenodium.com/magit-amend-commit-author https://xenodium.com/magit-amend-commit-author Rarely use it, but handy. Use Magit to amend git commit author.

    • Rebase interactively (r, i).
    • Move point to commit to ammend.
    • Execute command (x).
    git commit --amend --author="name <email>"
    
    • Commit (c, c).

    ]]>
    Sat, 16 Dec 2017 00:00:00 GMT
    Homebrew install from cache https://xenodium.com/homebrew-install-from-cache https://xenodium.com/homebrew-install-from-cache Came across a 404 while installing graphviz-2.40.1.tar.gz via homebrew. If you can find the package elsewhere, copy over to homebrew's cache directory.

    brew --cache
    
    ]]>
    Wed, 13 Dec 2017 00:00:00 GMT
    org-babel Objective-C support https://xenodium.com/org-babel-objective-c-support https://xenodium.com/org-babel-objective-c-support Wanted to quickly execute an Objective-C snippet. org-babel didn't support it out of the box, but adding it was straightforward (looked at ob-C.el and ob-java.el):

    (require 'ob)
    
    (defcustom org-babel-objc-compile-command "clang -x objective-c -framework Foundation"
      "For example: \"clang -x objective-c -framework Foundation\"."
      :group 'org-babel
      :version "24.3"
      :type 'string)
    
    (defun org-babel-execute:objc (body params)
      "Compile Objective-C BODY with org PARAMS and execute binary."
      (let* ((src-file (org-babel-temp-file "org-babel-objc-block-" ".m"))
             (cmpflag (or (cdr (assq :cmpflag params)) ""))
             (full-body (org-babel-expand-body:generic body params))
             (bin-file
              (org-babel-process-file-name
               (org-babel-temp-file "org-babel-objc-block" org-babel-exeext))))
        (with-temp-file src-file (insert full-body))
        (org-babel-eval
         (concat org-babel-objc-compile-command " " cmpflag " " src-file " " "-o" " " bin-file) "")
    
        ;; Using 2>&1 since org babel does not include stderr in output from NSLog.
        (let ((results (org-babel-eval (concat (org-babel-process-file-name bin-file) " 2>&1")  "")))
          (org-babel-reassemble-table
           (org-babel-result-cond (cdr (assq :result-params params))
             (org-babel-read results)
             (let ((tmp-file (org-babel-temp-file "c-")))
               (with-temp-file tmp-file (insert results))
               (org-babel-import-elisp-from-file tmp-file)))
           (org-babel-pick-name
            (cdr (assq :colname-names params)) (cdr (assq :colnames params)))
           (org-babel-pick-name
            (cdr (assq :rowname-names params)) (cdr (assq :rownames params)))))))
    
    (provide 'ob-objc)
    

    Add objc to org-babel-load-languages, and you can subsequently compile and run Objective-C blocks like:

    #import <Foundation/Foundation.h>
    
    int main() {
      NSLog(@"Hello World");
      return 0;
    }
    
    ]]>
    Thu, 16 Nov 2017 00:00:00 GMT
    iOS dev command-line goodies https://xenodium.com/ios-dev-command-line-goodies https://xenodium.com/ios-dev-command-line-goodies Install ipa on device

    Get utility with:

    npm install -g ipa-deploy
    npm install -g ios-deploy
    

    Install ipa on connected iPhone:

    ipa-deploy path/to/your/App.ipa
    

    Install app on booted simulator

    Install ipa on connected iPhone:

    xcrun simctl install booted path/to/your/App.app
    

    Install ipa on booted simulator

    #!/bin/bash
    
    # Unzip ipa, install app, and run on booted simulator.
    
    set -o nounset
    set -o errexit
    
    readonly IPA_PATH=$1
    readonly TEMP_DIR_PATH=$(mktemp -d)
    readonly BASENAME=$(basename ${IPA_PATH})
    readonly NAME=${BASENAME%.*}
    readonly APP_DIR_PATH="${TEMP_DIR_PATH}/Payload/${NAME}.app"
    readonly PLIST_FILE_PATH="${APP_DIR_PATH}/Info.plist"
    
    trap "rm -rf ${TEMP_DIR_PATH}" EXIT
    
    unzip -o "${IPA_PATH=}" -d "${TEMP_DIR_PATH}"
    
    readonly BUNDLE_ID=$(/usr/libexec/PlistBuddy -c "Print CFBundleIdentifier" ${PLIST_FILE_PATH})
    
    xcrun simctl install booted "${APP_DIR_PATH}"
    xcrun simctl launch booted "${BUNDLE_ID}"
    
    ]]>
    Sun, 12 Nov 2017 00:00:00 GMT
    Eshell pcomplete company completion https://xenodium.com/eshell-pcomplete-company-completion https://xenodium.com/eshell-pcomplete-company-completion Howard Abrams's Introduction to eshell video prompted me to poke at eshell some more. This time, I got eshell context aware completion by glueing the excellent company and pcomplete packages.

    (require 'cl-lib)
    (require 'company)
    (require 'dash)
    (require 'pcomplete)
    (require 's)
    
    (defun company-pcomplete--overlap-tail (a b)
      "When A is \"SomeDev\" and B is \"Developer\", return \"eloper\"."
      (let ((prefix a)
            (remaining nil))
        (while (and (not remaining) (> (length prefix) 0))
          (when (s-starts-with? prefix b)
            (setq remaining (substring b (length prefix))))
          (setq prefix (substring prefix 1)))
        remaining))
    
    (defun company-pcomplete--candidates (prefix)
      "Get candidates for PREFIX company completion using `pcomplete'."
      ;; When prefix is: "~/Down" and completion is "Downloads", need
      ;; to find common string and join into "~/Downloads/".
      (-map (lambda (item)
              (if (s-starts-with? prefix item)
                  item
                (concat prefix (company-pcomplete--overlap-tail prefix item))))
            (all-completions prefix (pcomplete-completions))))
    
    (defun company-pcomplete (command &optional arg &rest ignored)
      "Complete using pcomplete. See `company''s COMMAND ARG and IGNORED for details."
      (interactive (list 'interactive))
      (case command
        (interactive (company-begin-backend 'company-pcomplete))
        (prefix (company-grab-symbol))
        (candidates
         (company-pcomplete--candidates arg))))
    

    Don't forget to add company-pcomplete to company-backends, and if you want an explicit binding, use something like:

    (bind-key "<backtab>" #'company-complete eshell-mode-map)
    
    ]]>
    Wed, 01 Nov 2017 00:00:00 GMT
    Basic imenu in helpful-mode https://xenodium.com/basic-imenu-in-helpful-mode https://xenodium.com/basic-imenu-in-helpful-mode I'm finding Wilfred Hughes's helpful-mode, well… rather helpful. However, I'm missing imenu support. Here's a hacky way to get basic imenu.

    (defun helpful--create-imenu-index ()
      "Create an `imenu' index for helpful."
      (beginning-of-buffer)
      (let ((imenu-items '()))
        (while (progn
                 (beginning-of-line)
                 ;; Not great, but determine if looking at heading:
                 ;; 1. if it has bold face.
                 ;; 2. if it is capitalized.
                 (when (and (eq 'bold (face-at-point))
                            (string-match-p
                             "[A-Z]"
                             (buffer-substring (line-beginning-position)
                                               (line-end-position))))
                   (add-to-list 'imenu-items
                                (cons (buffer-substring (line-beginning-position)
                                                        (line-end-position))
                                      (line-beginning-position))))
                 (= 0 (forward-line 1))))
        imenu-items))
    
    (defun helpful-mode-hook-function ()
      "A hook function for `helpful-mode'."
      (setq imenu-create-index-function #'helpful--create-imenu-index))
    
    (add-hook 'helpful-mode-hook
              #'helpful-mode-hook-function)
    
    ]]>
    Sun, 10 Sep 2017 00:00:00 GMT
    Projectile shell dir company completion https://xenodium.com/projectile-shell-dir-company-completion https://xenodium.com/projectile-shell-dir-company-completion Projectile and company are just amazing Emacs packages. Projectile gives random access to files, while company completes well… anything. For shells, Emacs has a handful of options.

    Standing on the shoulders of package giants (dash and f included) and some elisp, we can bring random access to project directories from the shell.

    (require 'cl-lib)
    (require 'company)
    (require 'dash)
    (require 'f)
    (require 'projectile)
    
    (defvar-local company-projectile-cd-prefix "cd ")
    
    (defun company-projectile-cd (command &optional arg &rest ignored)
      "Company shell completion for any projectile path."
      (interactive (list 'interactive))
      (case command
        (interactive (company-begin-backend 'company-projectile-cd))
        (prefix
         (company-grab-symbol-cons company-projectile-cd-prefix
                                   (length company-projectile-cd-prefix)))
        (candidates
         (company-projectile-cd--candidates
          (company-grab-symbol-cons company-projectile-cd-prefix
                                    (length company-projectile-cd-prefix))))
        (post-completion
         (company-projectile-cd--expand-inserted-path arg))))
    
    (defun company-projectile-cd--candidates (input)
      "Return candidates for given INPUT."
      (company-projectile-cd--reset-root)
      (when (consp input)
        (let ((search-term (substring-no-properties
                            (car input) 0 (length (car input))))
              (prefix-found (cdr input)))
          (when prefix-found
            (if (projectile-project-p)
                (company-projectile-cd--projectile search-term)
              (company-projectile-cd--find-fallback search-term))))))
    
    (defun company-projectile-cd--projectile (search-term)
      (-filter (lambda (path)
                 (string-match-p (regexp-quote
                                  search-term)
                                 path))
               (-snoc
                (projectile-current-project-dirs)
                ;; Throw project root in there also.
                (projectile-project-root))))
    
    (defun company-projectile-cd--find-fallback (search-term)
      (ignore-errors
        (-map (lambda (path)
                (string-remove-prefix "./" path))
              (apply #'process-lines
                     (list "find" "." "-type" "d"  "-maxdepth" "2" "-iname"
                           (format "\*%s\*" search-term))))))
    
    (defun company-projectile-cd--expand-inserted-path (path)
      "Replace relative PATH insertion with its absolute equivalent if needed."
      (unless (f-exists-p path)
        (delete-region (point) (- (point) (length path)))
        (insert (concat (projectile-project-root) path))))
    
    (defun company-projectile-cd--reset-root ()
      "Reset project root. Useful when cd'ing in and out of projects."
      (projectile-reset-cached-project-root)
      (when (projectile-project-p)
        (projectile-project-root)))
    
    ]]>
    Sat, 19 Aug 2017 00:00:00 GMT
    Creating icns icons https://xenodium.com/creating-icns-icons https://xenodium.com/creating-icns-icons Stack overflow yields Where can i find Icon Composer on Mac? when I did a quick search to convert a png to icns. For future reference:

    #!/bin/bash -e
    
    set -e
    set -o pipefail
    
    if [ "$#" -ne 1 ]; then
     echo "\nusage: to_icns.sh path/to/image.png\n"
     exit 1
    fi
    
    readonly IMAGE_FPATH=$1
    readonly BASENAME=$(basename ${IMAGE_FPATH%.*})
    
    mkdir ${BASENAME}.iconset
    
    sips -z 16 16   $IMAGE_FPATH --out "${BASENAME}.iconset/icon_16x16.png"
    sips -z 32 32   $IMAGE_FPATH --out "${BASENAME}.iconset/[email protected]"
    sips -z 32 32   $IMAGE_FPATH --out "${BASENAME}.iconset/icon_32x32.png"
    sips -z 64 64   $IMAGE_FPATH --out "${BASENAME}.iconset/[email protected]"
    sips -z 128 128 $IMAGE_FPATH --out "${BASENAME}.iconset/icon_128x128.png"
    sips -z 256 256 $IMAGE_FPATH --out "${BASENAME}.iconset/[email protected]"
    sips -z 256 256 $IMAGE_FPATH --out "${BASENAME}.iconset/icon_256x256.png"
    sips -z 512 512 $IMAGE_FPATH --out "${BASENAME}.iconset/[email protected]"
    sips -z 512 512 $IMAGE_FPATH --out "${BASENAME}.iconset/icon_512x512.png"
    
    cp $IMAGE_FPATH "${BASENAME}.iconset/[email protected]"
    
    iconutil -c icns ${BASENAME}.iconset
    
    rm -R ${BASENAME}.iconset
    
    echo Wrote ${BASENAME}.icns
    
    ]]>
    Wed, 09 Aug 2017 00:00:00 GMT
    Forcing aptX on MacOS bluetooth audio https://xenodium.com/forcing-aptx-on-macos-bluetooth-audio https://xenodium.com/forcing-aptx-on-macos-bluetooth-audio Bought a pair of QuietComfort 35. Audio quality on MacOS was lagging compared to iOS. Googling led to different posts suggesting the use of Bluetooth Explorer to force aptX usage. Did the trick for me.

    Bluetooth Explorer can be downloaded from https://developer.apple.com/download/more. Search for Hardware IO tools:

    Open Hardware_IO_Tools_for_Xcode_7.3.dmg and launch Bluetooth Explorer:

    Select Audio Options:

    Check Force use of aptX:

    Don't forget to disconnect and reconnect your Bluetooth device.

    ]]>
    Sun, 06 Aug 2017 00:00:00 GMT
    Hungary travel bookmarks https://xenodium.com/hungary-travel-bookmarks https://xenodium.com/hungary-travel-bookmarks
  • My city: Budapest - Lonely Planet.
  • ]]>
    Mon, 10 Jul 2017 00:00:00 GMT
    Faster cursor movement on macOS https://xenodium.com/faster-cursor-movement-on-macos https://xenodium.com/faster-cursor-movement-on-macos Faster cursor movement on macOS by increasing your keyboard's initial key repeat subsequent key repeat.

    defaults write -g KeyRepeat -int 1
    defaults write -g InitialKeyRepeat -int 10
    
    ]]>
    Sat, 08 Jul 2017 00:00:00 GMT
    Search/insert one-liners with Emacs helm-ag https://xenodium.com/search-insert-one-liners-with-emacs-helm-ag https://xenodium.com/search-insert-one-liners-with-emacs-helm-ag Emacs helm is awesome. helm-ag is double awesome. Searching for one-liners in your codebase, narrowing down with helm, and easily inserting is triple awesome.

    (defun ar/helm-ag (arg)
      "Helm-ag search remembering last location.  With ARG, forget the last location."
      (interactive "P")
      (defvar ar/helm-ag--default-locaction nil)
      (setq ar/helm-ag--default-locaction
                     (read-directory-name "search in: " (if arg
                                                            default-directory
                                                          ar/helm-ag--default-locaction) nil t))
      (helm-do-ag ar/helm-ag--default-locaction))
    
    (defun ar/helm-ag-insert (arg)
      ;; Helm-ag and insert match.
      (interactive "P")
      (let* ((actions (helm-make-actions
                       "Insert"
                       (lambda (candidate)
                         ;; Drop file:line:column. For example:
                         ;; arc_hostlink.c:13:2:#include <linux/fs.h>
                         ;; => #include <linux/fs.h>
                         (insert (replace-regexp-in-string "^[^ ]*:" "" candidate)))))
             (helm-source-do-ag (helm-build-async-source "The Silver Searcher"
                                  :init 'helm-ag--do-ag-set-command
                                  :candidates-process 'helm-ag--do-ag-candidate-process
                                  :persistent-action  'helm-ag--persistent-action
                                  :action actions
                                  :nohighlight t
                                  :requires-pattern 3
                                  :candidate-number-limit 9999
                                  :keymap helm-do-ag-map
                                  :follow (and helm-follow-mode-persistent 1))))
        (call-interactively #'ar/helm-ag)))
    
    ]]>
    Fri, 07 Jul 2017 00:00:00 GMT
    Sleep bookmarks https://xenodium.com/sleep-bookmarks https://xenodium.com/sleep-bookmarks
  • Algorithmic Solution to My Insomnia (Hacker News).
  • Melatonin - Gwern.net.
  • Melatonin: Much More Than You Wanted To Know | Slate Star Codex.
  • ]]>
    Mon, 29 May 2017 00:00:00 GMT
    Tea bookmarks https://xenodium.com/tea-bookmarks https://xenodium.com/tea-bookmarks
  • Georgia's notes on tea.
  • Nine Green Teas To Try | Video (Andrew Weil, M.D.).
  • ]]>
    Sun, 28 May 2017 00:00:00 GMT
    Math bookmarks https://xenodium.com/math-bookmarks https://xenodium.com/math-bookmarks
  • 3Blue1Brown.
  • Calculus Made Easy (1914) (Hacker News).
  • Visually stunning math concepts which are easy to explain.
  • ]]>
    Sun, 23 Apr 2017 00:00:00 GMT
    GnuPG and macOS https://xenodium.com/gnupg-and-macos https://xenodium.com/gnupg-and-macos Had problems installing and using GnuPG on macOS, primarily for Emacs use:

    gpg: problem with the agent: Inappropriate ioctl for device
    gpg: error creating passphrase: Operation cancelled
    gpg: symmetric encryption of '[stdin]' failed: Operation cancelled
    

    Basic installation required:

    brew install gnupg
    

    But worked around the error above by using pinentry-mac (UI), instead of Emacs prompts.

    brew install pinentry-mac
    

    Edited ~/.gnupg/gpg-agent.conf with:

    pinentry-program path/to/homebrew/bin/pinentry-mac
    

    May need to kill gpg-agent to reload config.

    gpgconf --kill gpg-agent
    
    ]]>
    Sun, 23 Apr 2017 00:00:00 GMT
    Installing gnuplot on macOS https://xenodium.com/installing-gnuplot-on-macos https://xenodium.com/installing-gnuplot-on-macos UPDATE(2019-05-19 Sun): Plan A and B use options no longer available since the recent changes to remove all options from Homebrew/homebrew-core formulae. See Plan C.

    Plan A

    Install gnuplot Qt

    If you have the resources, you can try the Qt flavor. You need at least 15GB to download and a long build. Ran out of space on my Macbook Air. Aborted.

    brew install gnuplot --with-qt
    

    Plan B

    Install xquartz

    brew install Caskroom/cask/xquartz
    

    Install gnuplot x11

    brew install gnuplot --with-x11
    

    Install feedgnuplot

    Feedgnuplot is handy for plotting data streams realtime.

    brew install feedgnuplot
    

    Plan C

    Install with no options

    brew install gnuplot
    

    So far so good, but default gnuplot formula uses Qt and the Cocoa plugin could not be loaded:

    qt.qpa.plugin: Could not find the Qt platform plugin "cocoa" in ""

    Debugging

    1. QT_DEBUG_PLUGINS

      Turns out you can get plugin logs using the QT_DEBUG_PLUGINS environment variable:

      export QT_DEBUG_PLUGINS=1
      

      QFactoryLoader::QFactoryLoader() checking directory path "/Users/myuser/homebrew/Cellar/gnuplot/5.2.6_1/libexec/gnuplot/5.2/platforms" …

      This led me to find out about the gnuplot/5.2/gnuplot_qt binary.

    2. qt_prfxpath

      Getting the Qt prefix can be done by inspecting QtCore's strings:

      strings /Users/myuser/homebrew/Cellar/qt/5.12.3/Frameworks/QtCore.framework/QtCore | grep qt_prfxpath
      
      qt_prfxpath=/usr/local/Cellar/qt/5.12.3
      

      Ok so qt_prfxpath is pointing to usr/local/Cellar/qt, while my installation's is at //Users/myuser/homebrew/Cellar/qt. This is problematic and indeed my fault for installing homebrew in Users/myuser/homebrew instead of the recommended //usr/local.

      Symlinking did the job:

      sudo mkdir -p /usr/local/Cellar
      sudo ln -s ~/homebrew/Cellar/qt /usr/local/Cellar/qt
      
      /Users/myuser/homebrew/Cellar/gnuplot/5.2.6_1/libexec/gnuplot/5.2/gnuplot_qt
      

      Success.

    ]]>
    Mon, 13 Mar 2017 00:00:00 GMT
    Tel Aviv travel bookmarks https://xenodium.com/tel-aviv-travel-bookmarks https://xenodium.com/tel-aviv-travel-bookmarks
  • Breakfast club (dancing).
  • Claro/Sarona Market.
  • Dizengoff Square - Wikipedia.
  • Drink Cafe hafuch at Rothschild 12.
  • Jaffa's Flea market.
  • Nightlife: Kuli Alma's hipster haven. Imperial craft cocktail bar (drink Gold fashioned).
  • Park HaYarkon.
  • Tel Aviv museum of art.
  • ]]>
    Sun, 22 Jan 2017 00:00:00 GMT
    Jerusalem travel bookmarks https://xenodium.com/jerusalem-travel-bookmarks https://xenodium.com/jerusalem-travel-bookmarks
  • Jerusalem: Rooftop Mamilla restarurant.
  • ]]>
    Sun, 22 Jan 2017 00:00:00 GMT
    Nepal travel bookmarks https://xenodium.com/nepal-travel-bookmarks https://xenodium.com/nepal-travel-bookmarks
  • Annapurna Circuit Itinerary - Erika's Travelventures.
  • Nepal in Pictures: 19 Beautiful Places to Photograph.
  • Patan Durbar square.
  • The Truth Behind the Mysterious Magnetic Hill of Ladakh - Vargis Khan.
  • ]]>
    Sun, 22 Jan 2017 00:00:00 GMT
    Singapore notes https://xenodium.com/singapore-notes https://xenodium.com/singapore-notes
  • Hotel Mono, 18 Mosque street #01-04.
  • Buddha tooth relic museum.
  • Best Hawker centers.
  • Kong Meng San Phor Kark See Monastery.
  • Go there (figure out fastest MRT route).
  • What to eat at ABC Market (Hawker Centre) aka ABC Brickworks Food Centre?.
  • Curry puffs (see Taste test: Crisp curry puffs).
  • Singapore’s 17 Michelin-rated Hawker Stalls in 2016.
  • Temples
  • Hawkers
    • Mr and Mrs Mohgan's Super Crispy Roti Prata (source) on Crane Road. Dhal/fish/mutton curry side.
    • Roast Paradise (maybe) Address: #01-122 Old Airport Road Food Centre. Hours: Tues-Sun: 11am to 4pm or till sold out, Wed and Sun: 11am to 2pm, Closed on Mondays.
    • Fatty Cheong, 肥仔详, (#01-120, ABC Brickworks Food Centre, 6 Jalan Bukit Merah Singapore 150006): char siew and xio bak rice and char siew noodles.
    • Hoo Kee Bak Chang (Amoy Street Food Centre): bak zhang (glutinous rice dumpling). Try Choose from three kinds: chestnut ($2.80); chestnut with salted egg yolk ($3.60); and chestnut with mushroom ($3.60).
    • Lim Kee (Orchard) Banana Fritters (Maxwell food centre, source).
    • Mr Avocado Exotic Juice (Alexandra village food centre, source).
    • Tanglin Crispy Curry Puff (Hong Lim Food Centre or Maxwell, source) (东陵酥皮咖喱角). Try sardine curry puff?
    • Chuan Kee Satay (source). Long queue for pork satay.
    • Selera Rasa Nasi Lemak (source).
    • Fu Shun Jin Ji Shao La Mian Jia (Maxwell food centre, source): Char siu + noodles.
    • Shanghai La Mian Xiao Long Bao (Alexandra Village food centre, source): xiao long bao or soup dumplings ($4.50 for 7 pieces).
  • Timbre+ (hipster hawker centre? source).
  • Supertree Grove (go at dusk, see lights turn on).
  • Singapore Botanic garden.
    • Ginger Garden.
    • Palms valley.
    • Orchid garden.
  • Sri Mariamman Temple.
  • Kusu Island?
  • Chilly crab (“Jumbo” Chilli Crab Restaurant in Clarke Quay or Harvest Seafood Restaurant)?
  • Afternoon tea?
    • www.tea-chapter.com.sg
  • Bumboats (£2.50 return) leave Changi Point between 6am and 9.30pm for the 10-minute crossing to Palau Ubin. Hire a bicycle in the village where the boats dock.
  • Haji Lane (colorful road).
  • Tiong Bahru 1930s public housing estate (**)
    • Chong Yu Wanton Mee (Tiong Bahru Market And Food Centre #02-30, 30 Seng Poh Road, source).
    • old-fashioned treats at Tiong Bahru Galicier (55 Tiong Bahru Rd).
  • Chinatown
    • Pek Sin Choon Tea: Oldest team merchants.
    • Ang Mo Kio: Sri Mariamman Hindu temple.
    • Strangelets: quirky stuff from around the world.
    • 40 Hands: Allegedly one of most popular coffee joints.
    • BooksActually: Coolest book shop.
  • Keong Saik (next to Chinatown)
  • Everton park (old housing estate), new meets old
    • Coffee
    • Sweets
      • Grin Affair (grinaffair.com): natural ingredients into glass jar creations.
      • Batterworks (batter-works.com): pastries.
      • http://cozycornercoffee.com.
      • Seriously ice scream (facebook.com/seriouslyicecream).
      • Ji Xiang Confectionery (jixiangconfectionery.com): Traditional glutinous sweets. (**)
    • Food
      • The Provision Shop (Blk 3 Everton Park): for a classic and affordable meal.
      • Chew the Fat (Blk 6 Everton Park): comfort food.
      • Eden's Kitchen (http://edenskitchen.sg): healthy, green tea, coconut oil, etc.
  • Jalan Besar
  • Geylang (preserved shophouses and rich in Malay history)
  • ]]>
    Fri, 02 Dec 2016 00:00:00 GMT
    Email provider bookmarks https://xenodium.com/email-provider-bookmarks https://xenodium.com/email-provider-bookmarks
  • Dropping G Suite - Robin Whittleton.
  • Heluna - Cloud-based antispam.
  • Mail-in-a-Box.
  • mailbox.org – Ihr sicherer E-Mail-Anbieter.
  • Mailbox.org.
  • Migadu.
  • Posteo.
  • ProtonMail.
  • Soverin - Home - Soverin.
  • Understanding SPF, DKIM, and DMARC: A Simple Guide | Hacker News.
  • ]]>
    Fri, 02 Dec 2016 00:00:00 GMT
    Go snippets https://xenodium.com/go-snippets https://xenodium.com/go-snippets Command-line flags
    import (
          "flag"
    )
    
    type args struct {
          flag1  string
          flag2  string
            arg    string
    }
    
    func parseArgs() args {
          args := args{}
    
          flag.StringVar(&args.flag1, "flag1\n", "\n", "some flag 1 with sample `value`")
          flag.StringVar(&args.flag2, "flag2\n", "\n", "some flag 2 with sample `value`")
    
          flag.CommandLine.Usage = func() {
              fmt.Fprintf(os.Stderr, "Usage of %s:\n\n", os.Args[0])
              fmt.Fprintf(os.Stderr, "\n  myarg\n\n")
              flag.PrintDefaults()
          }
    
          flag.Parse()
    
          args.arg = flag.Arg(0)
    
          if args.flag1 == "" || args.flag2 == "" || args.arg == "" {
              flag.CommandLine.Usage()
              os.Exit(1)
          }
          return args
    }
    
    func main() {
            args := parseArgs()
            fmt.Printf("Args: %#v\n", args)
    }
    
    
    go run main.go -flag1 val1 -flag2 val2 arg
    
    ]]>
    Thu, 01 Dec 2016 00:00:00 GMT
    Javascript snippets https://xenodium.com/javascript-snippets https://xenodium.com/javascript-snippets Thu, 01 Dec 2016 00:00:00 GMT Sydney travel bookmarks https://xenodium.com/sydney-travel-bookmarks https://xenodium.com/sydney-travel-bookmarks
  • 17 Stunning Sydney Pools That Will Make You Want To Jump Back In The Water.
  • 48 Hours in Sydney.
  • Bourke Street Bakery.
  • Collector Store (Surrey Hills).
  • Coogee Pavilion.
  • Four ate five.
  • Harry's Cafe de Wheels: Famous for Pies and Peas, Meat Pies, Hot Dogs.
  • Hurricane’s grill & bar Bondi beach.
  • Lox Stock & Barrel.
  • Marigold citymark (dim sum).
  • Reuben Hills.
  • Seans.
  • Sydney's Best Markets - The Trusted Traveller.
  • The eight (dim sum).
  • The Glenmore.
  • Three Blue Ducks.
  • ]]>
    Sun, 27 Nov 2016 00:00:00 GMT
    Laos travel bookmark https://xenodium.com/laos-travel-bookmark https://xenodium.com/laos-travel-bookmark
  • Best Way to Enjoy Luang Prabang.
  • ]]>
    Sun, 16 Oct 2016 00:00:00 GMT
    Singapore travel bookmarks https://xenodium.com/singapore-travel-bookmarks https://xenodium.com/singapore-travel-bookmarks
  • Any place to go thrift shopping in Singapore? (Reddit).
  • East coast lagoon.
  • Food post on SG.
  • Hillstreet Tai Hwa Pork Noodles: Everybody Queue up!.
  • Little India.
  • More SG spots.
  • Second hand shopping in Singapore.
  • SG spots.
  • Singapore's best hawker centres - Telegraph.
  • The Insider's Guide to Singapore (SG Magazine Online).
  • Treasure Hunt: 5 Places to thrift in Singapore.
  • Visakan Veerasamy on Twitter: "what do you know about Singapore?".
  • What is the best hawker center in singapore? (Reddit).
  • ]]>
    Sat, 08 Oct 2016 00:00:00 GMT
    Cambodia travel bookmarks https://xenodium.com/cambodia-travel-bookmarks https://xenodium.com/cambodia-travel-bookmarks
  • Pub Street (Siem Reap, Cambodia).
  • ]]>
    Sat, 01 Oct 2016 00:00:00 GMT
    New York travel bookmarks https://xenodium.com/new-york-travel-bookmarks https://xenodium.com/new-york-travel-bookmarks
  • Best taco joints in New York City - Lonely Planet.
  • Nice and/or fancy restaurant to eat at in brooklyn (Erica Joy's tweet).
  • ]]>
    Sat, 01 Oct 2016 00:00:00 GMT
    API design bookmarks https://xenodium.com/api-design-bookmarks https://xenodium.com/api-design-bookmarks
  • A bird's eye view on API development.
  • A Guide to Designing and Building RESTful Web Services with WCF 3.5 (Microsoft).
  • Ask HN: Suggestions for books about API design? | Hacker News.
  • Best Practices for Designing a Pragmatic RESTful API.
  • Build APIs You Won't Hate.
  • Designing and Evaluating Reusable Components.
  • Harry Moreno | API Design Link Roundup.
  • How Do I Make This Hard to Misuse?.
  • How to Design a Good API and Why it Matters (Google).
  • How To Design A Good API and Why it Matters - YouTube.
  • How to design API function creating objects: By Neil Henning.
  • HTTP API Design Guide.
  • JSON API — A specification for building APIs in JSON.
  • Microsoft REST API Guidelines.
  • Notes on RESTful APIs (Updated).
  • REST API Documentation Best Practices.
  • REST API Tutorial.
  • REST+JSON API Design - Best Practices for Developers - YouTube.
  • RESTful Service Design - UC Berkeley.
  • Rusty's API Design Manifesto.
  • Scott Meyers: The Most Important Design Guideline?.
  • Swift.org - API Design Guidelines.
  • Teach a Dog to REST.
  • The Best API Documentation.
  • The Little Manual of API Design (Jasmin Blanchette, Trolltech).
  • Web API Design - Crafting interfaces that developers love.
  • Write code that is easy to delete, not easy to extend.
  • ]]>
    Sun, 18 Sep 2016 00:00:00 GMT
    Handy pdf utilities https://xenodium.com/handy-pdf-utilities https://xenodium.com/handy-pdf-utilities Straight out of How (and why) I made a zine, some handy utilities for generating pdfs…

    Convert pngs to pdfs

    # start with a bunch of PNG images of your zine pages
    # convert them all to PDF
    for i in *.png
       do
          # imagemagick is the best thing in the world
          convert $i $i.pdf
       done
    

    Combine pdfs

    Combine pdfs using pdftk:

    pdftk *.pdf cat output zine.pdf
    

    Combine pdfs using poppler:

    pdf unite PDF1.pdf PDF2.pdf PDF3.pdf
    

    Reorder pdf pages

    # pdfmod is a GUI that lets you reorder pages
    pdfmod zine.pdf
    

    Add margins to pdf

    # pdfcrop lets you add margins to the pdf. this is good because otherwise the
    # printer will cut off stuff at the edges
    pdfcrop --margin '29 29 29 29' zine.pdf zine-intermediate.pdf
    

    Turn pdf into booklet

    # pdfjam is this wizard tool that lets you take a normal ordered pdf and turn
    # it into something you can print as a booklet on a regular printer.
    # no more worrying about photocopying machines
    pdfjam --booklet true --landscape --suffix book --letterpaper --signature 12 --booklet true --landscape zine-intermediate.pdf -o zine-booklet.pdf
    
    ]]>
    Sun, 18 Sep 2016 00:00:00 GMT
    Fuzzy search Emacs compile history https://xenodium.com/fuzzy-search-emacs-compile-history https://xenodium.com/fuzzy-search-emacs-compile-history I wrote about searching bash history with Emacs Helm some time ago. Since then, I've learned about completing-read to generically handle simple Emacs completions (very handy for supporting Helm, Ivy, and Ido completions).

    Here's a simple way to combine completing-read and the compile command to enable fuzzy searching your compile history:

    (defun ar/compile-completing ()
      "Compile with completing options."
      (interactive)
      (let ((compile-command (completing-read "Compile command: " compile-history)))
        (compile compile-command)
        (add-to-list 'compile-history compile-command)))
    
    ]]>
    Thu, 15 Sep 2016 00:00:00 GMT
    Jumping on the Emacs 25 bandwagon https://xenodium.com/jumping-on-emacs-25-bandwagon https://xenodium.com/jumping-on-emacs-25-bandwagon Can't miss out on all the new fun. Emacs 25 RC2 is out and lots of people already using it. Since I'm mostly on MacOS these days, installing via homebrew with –devel, gets you RC2:

    brew install emacs --devel --with-cocoa --with-gnutls --with-librsvg --with-imagemagick
    

    The only hiccup so far's been org mode failing to export, which was fixed by re-installing it (follow this thread).

    ]]>
    Mon, 05 Sep 2016 00:00:00 GMT
    San Francisco's Mission District travel bookmarks https://xenodium.com/san-franciscos-mission-district-travel-bookmarks https://xenodium.com/san-franciscos-mission-district-travel-bookmarks
  • Atlas Cafe.
  • Blue Bottle Coffee.
  • Cafe la Boheme.
  • Clarion Alley.
  • Coffee Bar.
  • Dynamo donut & coffee.
  • Four Barrel Coffee.
  • Grand Coffee.
  • Haus Coffee.
  • Kafe 99.
  • Linea cafe.
  • Mission skateboards.
  • pNakamoto's Bitcoin shop.
  • Philz Coffee.
  • Ritual Coffee roasters.
  • Rodger's coffee & tea.
  • Sightglass Coffee.
  • Stable Cafe.
  • Sugar lump coffee lounge.
  • ]]>
    Sun, 31 Jul 2016 00:00:00 GMT
    Moscow travel bookmarks https://xenodium.com/moscow-travel-bookmarks https://xenodium.com/moscow-travel-bookmarks
  • Drюzhivago (restaurant).
  • Gorky park.
  • Hotel Peking.
  • Izmailovo.
  • Kolomenskoe (park).
  • Kremlin.
  • Kuskovo (park).
  • Mariinsky (see ballet or opera).
  • Moskow times (check for events).
  • Strelka (lectures, cocktails and dances).
  • Tarasbulba (food).
  • Tsaritsyno park.
  • ]]>
    Mon, 25 Jul 2016 00:00:00 GMT
    Vietnam travel bookmarks https://xenodium.com/vietnam-travel-bookmarks https://xenodium.com/vietnam-travel-bookmarks
  • Can Ba Quan
    • Nikki Tren.
    • Vietnamese Cajun.
  • Exploring Vietnam's remote Con Dao Islands.
  • Hoi An, Vietnam- Travel guide.
  • List of Locations: Somebody Feed Phil - Ho Chi Minh City, Vietnam.
  • Pho Bo Phu Gia
    • DC: 146K LY Chinh Thang.
    • 0908 208 866.
  • Simon Standly and Vin Dao (food journalists)
  • Somebody Feed Phil, List of Locations: Ho Chi Minh City.
  • Thuc Pham Duc Viet
    • Bahn Mi
    • Pate Bu Cha
    • Nhan Dat Bi Cha
  • Another favorite bookstore - Bookworm Hanoi | The Saigon boy
  • ]]>
    Sun, 24 Jul 2016 00:00:00 GMT
    Pokémon Go bookmarks https://xenodium.com/pokemon-go-bookmarks https://xenodium.com/pokemon-go-bookmarks
  • Pokémon GO Lengthy Introduction Guide (Reddit).
  • Pokémon locations.
  • Some tips from my last days playing (Reddit).
  • Yet another "Tips and Tricks" from a level 20+ (Reddit).
  • ]]>
    Tue, 19 Jul 2016 00:00:00 GMT
    Coffee bookmarks https://xenodium.com/coffee-bookmarks https://xenodium.com/coffee-bookmarks
  • Changes properties of coffee brew during roasting.
  • Aeropress Iced Coffee.
  • ]]>
    Sun, 03 Jul 2016 00:00:00 GMT
    Machine learning bookmarks https://xenodium.com/machine-learning-bookmarks https://xenodium.com/machine-learning-bookmarks
  • A Course in Machine Learning (Hacker News).
  • How to start learning deep learning (Hacker News).
  • How to start learning deep learning.
  • Machine Learning is Fun! The world’s easiest introduction to Machine Learning.
  • Practical Deep Learning for Coders 2019 (Hacker News).
  • What are the best ways to pick up Deep Learning skills as an engineer? (Quora).
  • ]]>
    Sun, 03 Jul 2016 00:00:00 GMT
    Emacs and emotional vocab https://xenodium.com/emacs-and-emotional-vocab https://xenodium.com/emacs-and-emotional-vocab Having read Are You in Despair? That’s Good, I was encouraged to expand my emotional vocabulary. As a zone.el fan (checkout nyan, sl, and rainbow), I looked into writing a zone program. When zone-when-idle is set, zone acts as a screensaver of sorts. We can use this to display random emotional vocab whenever Emacs is idle for a period of time. Let's get to it…

    Zone keeps a list of programs to choose from when kicked off. Below is a basic zone-hello program, along with an interactive command for previewing. Not much to these. The tiny program prepares the screen for zoning and inserts text while no input is pending.

    (defun zone-hello ()
      (delete-other-windows)
      (setq mode-line-format nil)
      (zone-fill-out-screen (window-width) (window-height))
      (delete-region (point-min) (point-max))
      (goto-char (point-min))
      (while (not (input-pending-p))
        (insert "hello zone\n")
        (zone-park/sit-for (point-min) 0.2)))
    
    (defun zone-hello-preview ()
      (interactive)
      (let ((zone-programs [zone-hello]))
        (zone)))
    

    Here's what zone-hello looks like:

    Back to improving our emotional vocabulary, we'll need a dictionary for our goal. A quick search yields a potential list of words. We can use WordNet to define them while offline. These two sources will do for now. We tie it all together in zone-words.el and the resulting zone program looks as follow:

    UPDATE: Just came across Animations With Emacs. A post with awesome zone examples.

    ]]>
    Fri, 17 Jun 2016 00:00:00 GMT
    Emacs: Find number of days between dates https://xenodium.com/emacs-find-number-of-days-between-dates https://xenodium.com/emacs-find-number-of-days-between-dates Needed to find the number of days between two dates. Emacs calendar must know this…

    • Fire up the manual (M-x info-emacs-manual or C-h r).
    • Info-goto-node (or g).
    • Type "counting days" and voilá:

    To determine the number of days in a range, set the mark on one date using `C-<SPC>', move point to another date, and type `M-=' (`calendar-count-days-region'). The numbers of days shown is [inclusive]{.underline}; that is, it includes the days specified by mark and point.

    Note: you can use the mouse to jump to another date, or "g d" (calendar-goto-date).

    ]]>
    Tue, 10 May 2016 00:00:00 GMT
    RoutingHTTPServer snippet https://xenodium.com/routinghttpserver-snippet https://xenodium.com/routinghttpserver-snippet RoutingHTTPServer snippet:

    RoutingHTTPServer *routingHTTPServer = [[RoutingHTTPServer alloc] init];
    [routingHTTPServer setPort:8000];
    [routingHTTPServer setDefaultHeader:@"Server" value:@"YourAwesomeApp/1.0"];
    [routingHTTPServer handleMethod:@"GET"
                           withPath:@"/hello"
                              block:^(RouteRequest *request, RouteResponse *response) {
        [response setHeader:@"Content-Type" value:@"text/plain"];
        [response respondWithString:@"Hello!"];
      }];
    NSError *error = nil;
    if (![routingHTTPServer start:&error]) {
      NSLog(@"Error starting HTTP Server: %@\n", error);
     }
    
    ]]>
    Sun, 08 May 2016 00:00:00 GMT
    Alaska travel bookmarks https://xenodium.com/alaska-travel-bookmarks https://xenodium.com/alaska-travel-bookmarks
  • Anchorage.
  • Denali NP.
  • Exit Glacier / Kenai Fjord NP.
  • Ice Falls Hike.
  • Iditarod race husky camp.
  • Seward: Kenai Fjord Wildlife cruise (Major Marine cruises).
  • Talkeetna fishing.
  • ]]>
    Fri, 06 May 2016 00:00:00 GMT
    UIViewController bookmarks https://xenodium.com/uiviewcontroller-bookmarks https://xenodium.com/uiviewcontroller-bookmarks
  • What's your number one tip for avoiding massive view controllers?.
  • 8 Patterns to Help You Destroy Massive View Controller.
  • Blending Cultures: The Best of Functional, Protocol-Oriented, and Object-Oriented Programming.
  • Dan Abramov - Live React: Hot Reloading with Time Travel.
  • Comparing Reactive and Traditional.
  • ReSwift: Getting Started.
  • StateView is a UIView substitute that automatically updates itself when data changes.
  • The Objective-C version to "Comparing Reactive and Traditional".
  • Let's Play: Refactor the Mega Controller!.
  • How to use Redux to manage navigation state in a React Native.
  • StateView: UIView substitute automatically updating itself when data changes.
  • Mysteries of Auto Layout, Part 2.
  • Netflix JavaScript Talks - RxJS Version 5.
  • Reactive Streams.
  • ]]>
    Fri, 06 May 2016 00:00:00 GMT
    When OOO impulse kicks in… https://xenodium.com/when-ooo-impulse-kicks-in https://xenodium.com/when-ooo-impulse-kicks-in
  • You start moving trivial bits of code into classes, with the anticipation that you might use it one day. Stop.
  • On naming, semantic clarity trumps brevity. Yup, the verbosity may be worth it.
  • ]]>
    Tue, 03 May 2016 00:00:00 GMT
    Pakistan travel bookmarks https://xenodium.com/pakistan-travel-bookmarks https://xenodium.com/pakistan-travel-bookmarks
  • How Philly Cheesesteaks Became a Big Deal in Lahore, Pakistan.
  • Karachi.
  • Lahore.
  • Rabelpindi.
  • Shinwari BBQ.
  • ]]>
    Mon, 02 May 2016 00:00:00 GMT
    Money bookmarks https://xenodium.com/money-bookmarks https://xenodium.com/money-bookmarks
  • 10 Countries Where That Social Security Check Will Let You Retire in Style (TheStreet).
  • 20 items to consider for taxes: Income Tax, Council Tax, and Inheritance Tax (lovemoney.com).
  • 25 Bloggers Share The Worst Financial Advice They've Ever Received - Be Net Worthy.
  • 25 y/o. Potentially £2m. Bit overwhelmed. : UKPersonalFinance.
  • 9 Best New Personal Finance Podcasts - Financial Panther.
  • A guide to index funds : UKPersonalFinance.
  • A guide to passive investing in the UK.
  • A Simple Example of Contributing Half Your Age as a Percentage of Salary to a Pension : UKPersonalFinance.
  • AdviserBook | Find a regulated financial adviser near you.
  • Amazon.com: How to Interview a Financial Advisor eBook: Piaw Na: Kindle Store.
  • Any critique against the Vanguard FTSE global all cap index? : UKPersonalFinance.
  • Authorised and recognised funds (FCA).
  • Bank Account Savings: Open up multiple accounts to maximise your savings.
  • Benefit Calculator - About You - Turn2us.
  • Best practices for portfolio rebalancing (Vanguard research July 2010).
  • Best practices for portfolio rebalancing (Vanguard).
  • Bogleheads® investment philosophy - Bogleheads.
  • Borderless account pricing: What are the fees? - TransferWise.
  • Buy-to-Let Rental Yield Map 2019 - TotallyMoney.
  • Bye Yahoo, and thanks for all the fish (The Financial Hacker) - See comments for alternatives.
  • Calculating Your Portfolio’s Rate of Return.
  • Can I open a LISA and a Private Pension (Vanguard LifeStrategy)?.
  • Capital Gains Tax for Expats - Experts for Expats.
  • cFIREsim.
  • Cheapest way to pay for a yearly USD subscription in the UK : UKPersonalFinance.
  • Check if you need to send a Self Assessment tax return - GOV.UK.
  • Check the recognised overseas pension schemes notification list - GOV.UK.
  • ChooseFI (Join the Financial Independence Movement).
  • Citizens Advice.
  • Codementor (Get live 1:1 coding help, hire a developer, & more).
  • Coursera (Online Courses From Top Universities. Join for Free).
  • Crowdsourced Financial Independence and Early Retirement Simulator/Calculator.
  • Crystal's Quora answer to becoming a millionaire (full sensible/conservative advice) .
  • Don't Steal Money from Day Traders Before They Lose It (Hacker News).
  • EricaJoy on Twitter: what is the process for finding a financial advisor/accountant/etc.
  • ETF portfolios made simple (justETF).
  • EU investing - Bogleheads.
  • European active managers beaten by passives, 10-year study finds (Financial Times).
  • Fin-dee (FIRE calculator).
  • Finance and capital markets | Economics and finance | Khan Academy.
  • Financial education book for teenagers by Martin Lewis : UKPersonalFinance.
  • Financial Independence Podcast.
  • Financial Independence Retiring Early UK (r/fireuk).
  • Financial independence/retire early in Europe (reddit).
  • Financial Samurai png (typical reasons to sell assets in short term = bad idea long term).
  • Find an Adviser.
  • Find Top-Rated Financial Advisers, Mortgage Advisers, Solicitors and Accountants.
  • FIRECalc: A different kind of retirement calculator.
  • Fund Charting – top-performing funds.
  • Fund managers rarely outperform the market for long - Buttonwood #passive-over-active.
  • Global All Cap VS Small Cap - first time 24 Male : UKPersonalFinance.
  • globaltracker - UKPersonalFinance.
  • How do I take a wage from my vanguard lifestrategy fund.
  • How does AQR Capital compare with Two Sigma? - Quora.
  • How I built a six figure passive income by age 47.
  • How I paid off £5000 of consumer debt in 5 months – URBANPLANNED.
  • How much more expensive do kids get as they get older? : UKPersonalFinance.
  • How to become rich by investing: rational Investing Based on Evidence vs Speculation.
  • How to buy your first house for dummies : UKPersonalFinance.
  • How to work out what the tax will be on my bonus?.
  • I have £x, what should I do with with it? - UKPersonalFinance Wiki.
  • IAMA 24yo selling my company for £500,000 - need serious advice. : UKPersonalFinance.
  • Income tax calculator: Find out your take-home pay.
  • Index Funds - UKPersonalFinance Wiki.
  • Index Trackers vs. Managed Funds | The Motley Fool UK #passive-over-active.
  • Invaluable Books - Cashflow Cop.
  • Investing 101 - UKPersonalFinance Wiki.
  • Investing in gold.
  • Investment for beginners.
  • Investment Jargon Putting Me Off : UKPersonalFinance.
  • Is BTL still worth it? : UKPersonalFinance.
  • ISA allowance: ISA limits & rules - MoneySavingExpert.
  • jlcollinsnh.
  • Killik Explains: A short guide to personal pensions (SIPPs) - YouTube.
  • Killik Explains: Retirement Saving - Lifetime ISAs vs Pensions - YouTube.
  • LifeStrategy® 100 vs FTSE Global All Cap Index Fund – What are the differences?.
  • Lifetime ISAs: free 1000 towards your first home or retirement.
  • Lifetime ISAs: free £33,000 towards your first home or retirement.
  • Low cost index trackers that will save you money (Monevator).
  • Mad Fientist: Financial Independence Podcast.
  • Managing a windfall - Bogleheads.
  • Meet The FIREstarter! - theFIREstarter.
  • Millennial Money (Next Generation Personal Finance).
  • Mom's Rules of Finance (Workforce Millionaire - Investing in Your Future).
  • Monevator — Make more money, invest profitably, retire early.
  • Monevator: Compare the UK’s cheapest online brokers.
  • Money transfer: compare ways to send money online with Monito.
  • Monolune (trading tools, articles).
  • Monthly Savings Juggler.
  • Morningstar® Integrated Web Tools™ - Instant X-Ray.
  • Mortgages - UKPersonalFinance Wiki.
  • Mr. Money Mustache — Early Retirement through Badassity.
  • National Savings and Investments NS&I.
  • NDAQ Stock Quote - Nasdaq, Inc. Common Stock Price - Nasdaq.
  • Overseas mortgages: everything you need to know.
  • Parking Ticket Appeals: Fight unfair fines - Money Saving Expert.
  • Paying missing UK national insurance contributions - good for FIRE?.
  • Personal Finance Flowchart (github).
  • Personal Savings Allowance 2018/19 - up to £1,000 interest tax-free.
  • Plotted my income and outgoings.
  • Portfolio Performance (crossplatform app).
  • Post-Retirement Calculator: Will My Money Survive Early Retirement? Visualizing Longevity Risk - Engaging Data.
  • Premium Bond Probability Calculator.
  • Premium Bonds: are they worth it? - MoneySavingExpert.
  • Purchasing a new property with a baby on the way..? : UKPersonalFinance.
  • rebo - Portfolio management software for UK private investors.
  • Reddit Personal Finance Flowchart (interactive).
  • Remortgaging in 2019 - is now the right time to fix & for how long? - Money To The Masses.
  • Rockstar Finance (Curating the best of money and personal finance).
  • Rockstar Finance's Directory of Bloggers.
  • Safe withdrawal rate (morningstar).
  • Salary Negotiation: Make More Money, Be More Valued | Kalzumeus Software.
  • SankeyMATIC (BETA): Build a diagram (redditor expenses/wages).
  • Saving Ninja: What Platform to Use Now? (iWeb vs Charles Stanley vs Halifax share dealing vs Aviva vs Vanguard Investor).
  • Savings accounts: 1.5% easy access or up to 2.7% fixed.
  • So, you want to be a landlord?? : financialindependence.
  • Started my dream job and now I am pregnant : UKPersonalFinance.
  • Starting Late But Retiring Rich: The Story Of Stephen And Becky ChooseFI.
  • Stocks & shares ISAs: find the best platform - MSE.
  • Stocks — Part XXI: Investing with Vanguard for Europeans.
  • Tax rates 2018/19: tax bands explained - MoneySavingExpert.
  • Tax rates 2018/19: tax bands explained - MoneySavingExpert.
  • The 10 Pillars Of FI ChooseFI.
  • The Escape Artist (You can escape to financial freedom).
  • The Financial Hacker – A new view on algorithmic trading.
  • The Lemon Fool (Discussion forums for UK shares, Personal Finance and Investment).
  • The Rise Of Stealth Wealth.
  • The world according to fleet-float equity market capitilization.
  • Tim Bennett Explains: Which is best - an ISA or a SIPP? - YouTube.
  • Top Cash ISAs: 1.35% easy access, 2.3% fixed - MSE.
  • UK Financial Planning Week.
  • UK Funds FAQ.
  • UKPersonalFinance redditor quote: "Deprogrammed myself from the zeitgeist of brands/labels. I either buy cheap or I buy quality dependent on application, but in either event I ignore the label."
  • Understanding your employees' tax codes: What the numbers mean - GOV.UK.
  • United Kingdom | Countries (FIREhub.eu).
  • Use the Avios Rewards Flight Calculator to plan flights.
  • Vanguard FTSE Global All Cap Index A Acc GBP (trustnet).
  • Vanguard FTSE Global All Cap Index Fund Investor A GBP Accumulation (Morningstar).
  • Vanguard FTSE Global All Cap Index Fund Investor A GBP Accumulation, GB00BD3RZ582:GBP summary - FT.com.
  • Vanguard LifeStrategy 100% Equity A Acc (Trustnet).
  • Vanguard LifeStrategy 80% Equity A (Trustnet).
  • Vanguard LifeStrategy® Funds.
  • Vanguard: Helping you reach your investing goals | Vanguard.
  • Vanguard: LifeStrategy® 40% Equity Fund - Accumulation.
  • Vanguard’s simple Pension Calculator.
  • Way Of The Financial Samurai: Core Principles For Financial Independence.
  • What are some good net worth tracking tools? (for the UK) : FIREUK.
  • What Does a Declaration of Trust / Deed of Trust Do?.
  • What if You Only Invested at Market Peaks?.
  • What is the smartest financial habit that you have? - Quora.
  • Where does export to? (2018) | OEC - The Observatory of Economic Complexity.
  • Why a world equity index tracker?.
  • Why are most people broke? - Quora.
  • Why Bond Prices and Yields Move in Opposite Directions.
  • Why do we believe that the price of stocks will grow over the long term.
  • Why Jack Bogle Doesn't Like ETFs (Forbes - YouTube).
  • www.stonebanks.co.uk (capital gains calculator).
  • X-O.co.uk - Execution Only Share Dealing (broker).
  • ]]>
    Mon, 02 May 2016 00:00:00 GMT
    Scotland travel bookmarks https://xenodium.com/scotland-travel-bookmarks https://xenodium.com/scotland-travel-bookmarks
  • The Open Book (AirBnB + a bookshop).
  • Where to eat in Edinburgh? (Twitter)
  • ]]>
    Mon, 02 May 2016 00:00:00 GMT
    St. Petersburg travel bookmarks https://xenodium.com/st-petersburg-travel-bookmarks https://xenodium.com/st-petersburg-travel-bookmarks
  • Faberge Muse.
  • Find a place to eat Koryushka (fried fish).
  • Get "Pyshka" at Pyshechnaya in Saint Petersburg: local donut shop with 60 years of history.
  • Hermitage Museum.
  • Savior on the Spilled Blood Church.
  • Stolle (pie shop).
  • ]]>
    Mon, 02 May 2016 00:00:00 GMT
    8 week half-marathon training https://xenodium.com/8-week-half-marathon-training https://xenodium.com/8-week-half-marathon-training An 8-week training schedule:

    WEEK MON TUE WED THU FRI SAT SUN


    1 Rest 5 Km 5 Km Cycle Rest 5 Km 8 Km 9 Km 29:56 29:54 29:45 1:00:55 2 Rest 7 Km 5 Km Cycle Rest 5 Km 10 Km 41:36 27:52 28:23 59:17 3 Rest 8 Km 8.1 Km 5 Km Cycle Rest 5 Km 12 Km 49:29 29:33 27:50 1:06 4 Rest 8 Km Rest 8 Km Rest 5 Km 14 Km 46:39 49:28 29:40 5 Rest 8 Km Rest 8 Km Rest 6 Km 16 Km 10 Km 48:50 53:38 6 Rest 8 Km 8 Km 8 Km Rest 8 Km 19 Km 51:39 37:09 2:02 7 Rest 8 Km Rest 12 Km Rest 8 Km 16 Km 52:55 8 Rest 8 Km Rest 5 Km 5 K Rest Race

    ]]>
    Mon, 02 May 2016 00:00:00 GMT
    Haskell bookmarks https://xenodium.com/haskell-bookmarks https://xenodium.com/haskell-bookmarks
  • A gentle introduction to profunctors talk.
  • A Haskell Reading List (Hacker News).
  • A Haskell Reading List.
  • Advice for Haskell beginners (2017) (Hacker News).
  • An opinionated guide to Haskell in 2018.
  • Haskell Programming: From First Principles.
  • Haskell's kind system - a primer.
  • Higher order functions.
  • Intero: Complete interactive development program for Haskell.
  • Introduction to higher-order functions.
  • Pragmatic Haskell for Beginners, Lecture 1.
  • Renzo Carbonara (Hackage).
  • ]]>
    Mon, 02 May 2016 00:00:00 GMT
    Haskell notes https://xenodium.com/haskell-notes https://xenodium.com/haskell-notes Referential transparency

    An expression consistently evaluating to the same result, regardless of context.

    References

    ]]>
    Sun, 17 Apr 2016 00:00:00 GMT
    Emacs Objective-C tagging with RTags https://xenodium.com/emacs-objective-c-tagging-with-rtags https://xenodium.com/emacs-objective-c-tagging-with-rtags Install libclang on Mac
    brew install llvm --with-clang
    

    Install RTags

    git clone --recursive https://github.com/Andersbakken/rtags.git
    cd rtags
    cmake -DCMAKE_PREFIX_PATH=/Users/your-user-name/homebrew/opt/llvm -DCMAKE_EXPORT_COMPILE_COMMANDS=1 .
    make
    

    Start RTags daemon

    path/to/rtags/bin/rdm 2> /tmp/rdm.log
    

    Compilation database

    Install xctool

    brew install xctool
    

    Generate a compilation database

    cd path/to/your/objc-project
    xctool -sdk iphonesimulator -arch x86_64 -scheme SomeScheme -reporter pretty -reporter json-compilation-database:compile_commands.json clean build
    

    Load compilation database

    path/to/rtags/bin/rc -J path/to/your/objc-project/compile_commands.json
    

    Install RTags Emacs package

    (use-package rtags :ensure t
      :config
      (setq rtags-use-helm t) ;; Optional. Enable if helm fan (I am!).
      (setq rtags-path "path/to/rtags/bin/"))
    

    Ready to go

    Use any of the rtags interactive commands. For example:

    M-x rtags-find-symbol
    

    References

    ]]>
    Mon, 28 Mar 2016 00:00:00 GMT
    Database bookmarks https://xenodium.com/database-bookmarks https://xenodium.com/database-bookmarks
  • Considering MySQL? Use something else.
  • Frank's compulsive guide to postal addresses.
  • ]]>
    Thu, 10 Mar 2016 00:00:00 GMT
    Python tips backlog https://xenodium.com/python-tips-backlog https://xenodium.com/python-tips-backlog [TODO]{.todo .TODO} A Better Pip Workflow (Hacker News).

    ]]>
    Sun, 06 Mar 2016 00:00:00 GMT
    Bruges travel bookmarks https://xenodium.com/bruges-travel-bookmarks https://xenodium.com/bruges-travel-bookmarks
  • assietteblanche.be.
  • Beer flavored meals at Den Dyver.
  • bistrozwarthuis.be.
  • Eat fries in front of the belfry and climb it.
  • kok-au-vin.be.
  • kurtspan.be.
  • Minnewater and the old Beguinage.
  • Old Saint john's Hospital.
  • Relic of the Holy Blood and City hall.
  • restomojo.tk.
  • The Chocolate Line.
  • The Garre, near the Burg and drink their house Tripel.
  • tomsdiner.be.
  • Try out Straffe Hendrik beer at brewery terrace.
  • Walk behind Gruuthuse over the little Saint Bonifaas bridge.
  • ]]>
    Sat, 05 Mar 2016 00:00:00 GMT
    Emacs lisp snippets https://xenodium.com/emacs-lisp-snippets https://xenodium.com/emacs-lisp-snippets cl-loop for in
    (cl-loop for day in '("mon" "tue" "wed" "thu" "fri" "sat" "sun")
             do (print day))
    

    cl-loop for from to

    (cl-loop for x from 1 to 5
             do (print x))
    

    pcase literal matching

    (pcase "word"
      ('word (message "Matched 'word symbol"))
      ("word" (message "Matched \"word\" string")))
    

    Avoid nesting with the help of thread-first and thread-last.

    (thread-last "12.....34"
      (string-remove-prefix "1")
      (string-remove-suffix "4"))
    

    Find file upwards, up parents, up hierarchy

    (locate-dominating-file FILE NAME)
    

    Find executable in PATH

    (executable-find COMMAND)
    

    Read string with completion (helm/ido/ivy friendly)

    (completing-read PROMPT COLLECTION &optional PREDICATE REQUIRE-MATCH INITIAL-INPUT HIST DEF INHERIT-INPUT-METHOD)
    

    Execute command/process and return list (similar to shell-command-to-string)

    (process-lines PROGRAM &rest ARGS)
    

    Iterating org buffer

    (org-element-map (org-element-parse-buffer) '(headline link)
      (lambda (element)
        (cond
         ((and (eq (org-element-type element) 'headline)
               (= (org-element-property :level element) 1))
          (print "headline"))
         ((eq (org-element-type element) 'link)
          (print "link")))
        nil))
    
    ]]>
    Wed, 02 Mar 2016 00:00:00 GMT
    Some modern Objective-C idioms https://xenodium.com/some-modern-objective-c-idioms https://xenodium.com/some-modern-objective-c-idioms NSNumber literals
    NSNumber *number1 = @1024;
    NSNumber *number2 = @1024.123f;
    NSNumber *number3 = @'A';
    NSNumber *number4 = @YES;
    NSNumber *number5 = @24ul; // Unsigned long.
    NSNumber *number6 = @123456ll; // Long Long.
    NSNumber *number7 = @5050.50; // Float.
    NSNumber *number8 = @1543; // Integer
    NSNumber *number9 = @111.456; // Double
    

    Array literals

    NSArray *names = @[@"John\n", @"Peter\n", @"Jaye\n", @"George\n", @"Max"];
    NSArray *mutableNames = [@[@"John\n", @"Peter\n", @"Jaye\n", @"George\n", @"Max"] mutableCopy];
    
    ]]>
    Thu, 18 Feb 2016 00:00:00 GMT
    Cross-platform development bookmarks https://xenodium.com/cross-platform-development-bookmarks https://xenodium.com/cross-platform-development-bookmarks
  • How to Distribute Binaries for OS X Using Homebrew (Hacker News).
  • ]]>
    Tue, 16 Feb 2016 00:00:00 GMT
    Generating a random MAC address https://xenodium.com/generating-a-random-mac-address https://xenodium.com/generating-a-random-mac-address As some point I had to generate a random MAC address. This is the snippet I used:

    import random
    
    def randomMAC():
      mac = [0x00, 0x16, 0x3e,
             random.randint(0x00, 0x7f),
             random.randint(0x00, 0xff),
             random.randint(0x00, 0xff),
      ]
      return ':'.join(map(lambda x: "%02x" % x, mac))
    
    print 'MAC => %s' % randomMAC()
    
    MAC => 00:16:3e:7e:f7:fa
    
    ]]>
    Mon, 15 Feb 2016 00:00:00 GMT
    Defined elisp variables matching regexp https://xenodium.com/defined-elisp-variables-matching-regexp https://xenodium.com/defined-elisp-variables-matching-regexp You can use "M-x apropos-variable" to get documentation for variables matching a pattern. For more flexibility, some elisp can help with getting a list of all variables matching a regexp:

    (defun ar/variables-matching-pattern (pattern)
      "Get a list of all variables matching PATTERN."
      (let ((matched-variables '()))
        (mapatoms
         (lambda (symbol)
           ;; Symbol is variable?
           (when (and (boundp symbol)
                      (string-match pattern (symbol-name symbol)))
             (add-to-list 'matched-variables symbol))))
        matched-variables))
    
    (let ((variables ""))
      (mapc (lambda (variable-symbol)
              (setq variables
                    (concat variables
                            (format "%s => %s\n"
                                    (symbol-name variable-symbol)
                                    (symbol-value variable-symbol)))))
            (ar/variables-matching-pattern "^tern-.*"))
      variables)
    
    tern-mode-keymap => (keymap (3 keymap (4 . tern-get-docs) (3 . tern-get-type) (18 . tern-rename-variable)) (27 keymap (44 . tern-pop-find-definition) (67108910 . tern-find-definition-by-name) (46 . tern-find-definition)))
    tern-update-argument-hints-async => nil
    tern-known-port => nil
    tern-mode => nil
    tern-activity-since-command => -1
    tern-project-dir => nil
    tern-last-point-pos => nil
    tern-last-completions => nil
    tern-explicit-port => nil
    tern-idle-time => 2.5
    tern-find-definition-stack => nil
    tern-last-argument-hints => nil
    tern-idle-timer => nil
    tern-server => nil
    tern-last-docs-url => nil
    tern-buffer-is-dirty => nil
    tern-command-generation => 0
    tern-flash-timeout => 0.5
    tern-update-argument-hints-timer => 500
    tern-mode-hook => nil
    tern-command => (tern)
    
    ]]>
    Sun, 14 Feb 2016 00:00:00 GMT
    Proselint via Emacs flycheck https://xenodium.com/proselint-via-emacs-flycheck https://xenodium.com/proselint-via-emacs-flycheck Based on Linting Prose in Emacs

    Needs proselint installed:

    pip install proselint
    

    Also needs a flycheck checker defined:

    (flycheck-define-checker proselint
      "A linter for prose."
      :command ("proselint" source-inplace)
      :error-patterns
      ((warning line-start (file-name) ":" line ":" column ": "
                (id (one-or-more (not (any " "))))
                (message) line-end))
      :modes (gfm-mode
              markdown-mode
              org-mode
              text-mode))
    
    (add-to-list 'flycheck-checkers 'proselint)
    
    ]]>
    Sat, 13 Feb 2016 00:00:00 GMT
    Generate go struct definition from json file https://xenodium.com/generate-go-struct-definition-from-json-file https://xenodium.com/generate-go-struct-definition-from-json-file From Generate go struct definition from json file, and before I forget:

    curl http://url.tld/file.json | gojson -name=Repository
    
    ]]>
    Thu, 11 Feb 2016 00:00:00 GMT
    Doh! undo last commit (Magit edition) https://xenodium.com/doh-undo-last-commit-magit-edition https://xenodium.com/doh-undo-last-commit-magit-edition I previously noted how to undo your last git commit (ie. soft reset). Using Magit:

    1. M-x magit-log-current.
    2. Move point to prior revision.
    3. M-x magit-reset-soft (defaults to revision at point).

    Or if you want a single function:

    (require 'magit)
    
    (defun ar/magit-soft-reset-head~1 ()
      "Soft reset current git repo to HEAD~1."
      (interactive)
      (magit-reset-soft "HEAD~1"))
    
    ]]>
    Thu, 11 Feb 2016 00:00:00 GMT
    Redux bookmarks https://xenodium.com/redux-bookmarks https://xenodium.com/redux-bookmarks
  • A different way of supplying React-components with state.
  • A SoundCloud client in React and Redux (Hacker News).
  • Awesome redux (collection of libraries in ecosystem).
  • Building React Applications with idiomatic redux (Hacker News).
  • Connecting Redux to your API.
  • Curated awesome Redux tutorial and resource links.
  • Flux Standard Action utilities for Redux.
  • How to integrate Redux with very large data-sets and IndexedDB? (Stack Overflow).
  • Introducing Redux operations.
  • Managing data flow on the client-side.
  • Motivation for flux.
  • NavigationExperimental notes.
  • Preethi Kasireddy - MobX vs Redux: Comparing the Opposing Paradigms.
  • Presentational and Container Components.
  • React-redux official bindings.
  • React: Flux Architecture (ES6) - Course by @joemaddalone @eggheadio.
  • Reactive Programming with RxJS.
  • Redux async actions.
  • Redux best practices.
  • Redux code examples.
  • Redux ecosystem links.
  • Redux promise.
  • Redux state persistence with a database (State Overflow).
  • Redux thunk.
  • Redux: Opinions/examples of how to do backend persistence? (Stack Overflow).
  • RefluxCocoa: an implementation of Reflux in Objective-C.
  • Rules for structuring (redux) applications .
  • The case for flux.
  • Two weird tricks with redux.
  • TypeScript Redux.
  • Understanding unidirectional data flow in React – Elizabeth Denhup – Medium.
  • ]]>
    Sat, 06 Feb 2016 00:00:00 GMT
    Javascript tips backlog https://xenodium.com/javascript-tips-backlog https://xenodium.com/javascript-tips-backlog [TODO]{.todo .TODO} Tern.js with Atom.

    [TODO]{.todo .TODO} Object spread syntax proposed for ES7.

    [TODO]{.todo .TODO} if (typeof myvar = 'undefined') …

    [TODO]{.todo .TODO} copy object and set with Object.assign({}, state, {property: newValue}).

    [TODO]{.todo .TODO} Use ES6 computed property syntax.

    [TODO]{.todo .TODO} ES6 syntax: import * as reducers from './reducers'.

    ]]>
    Sat, 06 Feb 2016 00:00:00 GMT
    Emacs lisp tips backlog https://xenodium.com/emacs-lisp-tips-backlog https://xenodium.com/emacs-lisp-tips-backlog [TODO]{.todo .TODO} Signal: a library offering enriched hook-like features.

    [TODO]{.todo .TODO} Debugging tips.

    [TODO]{.todo .TODO} Examples of Emacs modules.

    [TODO]{.todo .TODO} htop-like CPU and memory graphs for Emacs.

    [TODO]{.todo .TODO} Timp: multithreading library.

    [TODO]{.todo .TODO} Effortless Major Mode Development.

    [TODO]{.todo .TODO} cl-spark implementation of Zach Holman's spark and Gil Gonçalves' vspark with little extension.

    [TODO]{.todo .TODO} map.el for map-like collections built-in as of 25.1.

    [TODO]{.todo .TODO} Standard library for key/value data structures.

    [TODO]{.todo .TODO} Making Elisp regex look nicer.

    [TODO]{.todo .TODO} Adapting code using the old defadvice.

    [TODO]{.todo .TODO} seq.el sequence library built-in as of 25.1.

    [TODO]{.todo .TODO} Binding of parson JSON parser.

    [TODO]{.todo .TODO} Helm-dash find-as-you-type.

    [TODO]{.todo .TODO} Org mode - Parsing rich HTML directly when pasting? (Stack Overflow).

    [TODO]{.todo .TODO} From @_wilfredh, use (interactive "*") for commands that edit the buffer, so they show a helpful error if the buffer is read only.

    ]]>
    Sat, 06 Feb 2016 00:00:00 GMT
    Entering accents in Emacs https://xenodium.com/entering-accents-in-emacs https://xenodium.com/entering-accents-in-emacs Via Irreal's Entering Accented Characters in Emacs, a reminder on how to enter accents using C-x 8. For example:

    C-x 8 ' A -> Á
    
    ]]>
    Thu, 04 Feb 2016 00:00:00 GMT
    Really delete iPhone photos https://xenodium.com/really-delete-iphone-photos https://xenodium.com/really-delete-iphone-photos After deleting photos, go to:

    Albums -> Recently Deleted -> Select -> Delete All

    ]]>
    Thu, 04 Feb 2016 00:00:00 GMT
    Vancouver travel bookmarks https://xenodium.com/vancouver-travel-bookmarks https://xenodium.com/vancouver-travel-bookmarks
  • 17 Reasons To Visit Vancouver This Summer.
  • The 15 most incredible places to visit in Canada.
  • ]]>
    Wed, 03 Feb 2016 00:00:00 GMT
    Schnitzel recipe https://xenodium.com/schnitzel-recipe https://xenodium.com/schnitzel-recipe Since eating at Fischers's, I've been inclined to make Schnitzel. This is my attempt.

    Ingredients

    • Salt and ground black pepper.
    • All-purpose flour.
    • Eggs (beaten).
    • Bread crumbs (natural).
    • Oil.

    Preparation

    • Flatten the pork/chicken/veal.
    • Season (salt and pepper).
    • Heat pan with a generous amount of oil.
    • Dip into flour -> egg -> bread crumbs.

    Garnish

    • Anchovies.
    • Capers.

    Photo

    ]]>
    Wed, 03 Feb 2016 00:00:00 GMT
    Hot reloading with react and redux https://xenodium.com/hot-reloading-with-react-and-redux https://xenodium.com/hot-reloading-with-react-and-redux By Robert Knight (@robknight_).

    Checkout

    Slides

    ]]>
    Wed, 03 Feb 2016 00:00:00 GMT
    Converting Unix epoc time to human readable date https://xenodium.com/converting-unix-epoc-time-to-human-readable-date https://xenodium.com/converting-unix-epoc-time-to-human-readable-date Via climagic's Turn a Unix epoch time back into a human readable date:

    GNU

    date -d @192179700
    
    Tue Feb  3 07:15:00 GMT 1976
    

    BSD/OS X

    date -r 192179700
    
    Tue Feb  3 07:15:00 GMT 1976
    
    ]]>
    Wed, 03 Feb 2016 00:00:00 GMT
    Objective-C bookmarks https://xenodium.com/objective-c-bookmarks https://xenodium.com/objective-c-bookmarks
  • Adopting Nullability Annotation.
  • Adopting Objective-C generics.
  • Cocoa at Tumblr.
  • Curated list of awesome Objective-C frameworks, libraries and software.
  • Documenting in Xcode with HeaderDoc Tutorial.
  • How Do I Declare A Block in Objective-C?.
  • Introduction to MVVM.
  • Nullability and Objective-C.
  • Ole Begemann's page.
  • ReactiveCocoa.
  • The Xcode Build System.
  • Tip: Avoid retain cycles without doing the strong to weak dance.
  • Using Swift String enums in Objective-C.
  • ]]>
    Wed, 03 Feb 2016 00:00:00 GMT
    Timesinking bookmarks https://xenodium.com/timesinking-bookmarks https://xenodium.com/timesinking-bookmarks
  • In a Nutshell channel (YouTube).
  • Oddly Satisfying (Subreddit).
  • Related subreddits based on your comments.
  • To knoll me is to love me (Subreddit).
  • ]]>
    Tue, 02 Feb 2016 00:00:00 GMT
    Suspend and reattach processes https://xenodium.com/suspend-and-reattach-processes https://xenodium.com/suspend-and-reattach-processes Via climagic's Suspend and reattach a process to screen:

    longcmd ; [Ctrl-Z] ; bg ; disown ; screen ; reptyr $( pidof longcmd )
    
    ]]>
    Tue, 02 Feb 2016 00:00:00 GMT
    Czech Republic travel bookmarks https://xenodium.com/czech-republic-travel-bookmarks https://xenodium.com/czech-republic-travel-bookmarks
  • Strahov Monastery.
  • ]]>
    Tue, 02 Feb 2016 00:00:00 GMT
    Meditation tips backlog https://xenodium.com/meditation-tips-backlog https://xenodium.com/meditation-tips-backlog [TODO]{.todo .TODO} Real Happiness Audio Files.

    [DONE]{.done .DONE} The science of craving.

    ]]>
    Tue, 02 Feb 2016 00:00:00 GMT
    Append jpegs in a video sequence https://xenodium.com/append-jpegs-in-a-video-sequence https://xenodium.com/append-jpegs-in-a-video-sequence Via climagic's make slideshow from *.jpg:

    for p in *.jpg; do
        ffmpeg -loop_input -f image2 -i $p -t 3 -r 4 -s 1080x720 -f avi - >> slides.avi;
    done
    
    ]]>
    Tue, 02 Feb 2016 00:00:00 GMT
    Regular expressions bookmarks https://xenodium.com/regular-expressions-bookmarks https://xenodium.com/regular-expressions-bookmarks
  • Regex Cheat Sheet - DEV Community.
  • Regex For Noobs (like me!) - An Illustrated Guide - Janmeppe.com.
  • regex101.com.
  • Regex101: Online regex tool.
  • Regular Expressions for Regular Folk.
  • Rubular: a Ruby regular expression editor.
  • ]]>
    Tue, 02 Feb 2016 00:00:00 GMT
    Typescript bookmarks https://xenodium.com/typescript-bookmarks https://xenodium.com/typescript-bookmarks
  • Building TypeScript Projects with Bazel (Minko Gechev's blog).
  • DefinitelyTyped: The repository for high quality TypeScript type definitions.
  • gulp-typescript.
  • Modern Emacs Typescript Web (React) Config with lsp-mode, treesitter, tailwind, TSX & more….
  • React/JSX Typescript support.
  • tslint.
  • Typed-react.
  • TypeScript Tricks: Type Guards (Hacker News).
  • TypeStrong: TypeScript workflows.
  • Typings: The type definition manager for TypeScript.
  • Up and Running with React Native and TypeScript.
  • ]]>
    Tue, 02 Feb 2016 00:00:00 GMT
    Hiding HTML elements https://xenodium.com/hiding-html-elements https://xenodium.com/hiding-html-elements Hide with display:none (exclude from layout) and visibility:hidden (include in layout).

    ]]>
    Tue, 02 Feb 2016 00:00:00 GMT
    Echo Emacs keybiding from function name https://xenodium.com/echo-emacs-keybiding-from-function-name https://xenodium.com/echo-emacs-keybiding-from-function-name Picked up via Emacs Redux's Display the Keybinding for a Command With Substitute-command-keys, with my own example:

    (message (substitute-command-keys "Press \\[ar/ox-html-export] to export org file"))
    
    Press <f6> to export org file
    
    ]]>
    Mon, 01 Feb 2016 00:00:00 GMT
    Emacs dired for batch byte compilation https://xenodium.com/emacs-dired-for-batch-byte-compilation https://xenodium.com/emacs-dired-for-batch-byte-compilation Recently updated org-mode and started seeing an invalid function error:

    Error (use-package): ob :config: Invalid function: org-babel-header-args-safe-fn

    Just learned dired enables you to mark files and byte compile via M-x dired-do-byte-compile.

    ]]>
    Mon, 01 Feb 2016 00:00:00 GMT
    Serializing to JSON on iOS https://xenodium.com/serializing-to-json-on-ios https://xenodium.com/serializing-to-json-on-ios NSDictionary *dictionary = @{ @"key1" : @"val1\n", @"key2" : @"val2\n", @"key3" : @"val3\n", @"key4" : @"val4\n", @"key5" : @"val5\n", @"key6" : @"val6\n", }; NSError *error; NSData *jsonData = [NSJSONSerialization dataWithJSONObject:dictionary options:0 error:&error]; if (error) { // noooooooooo! } NSString *json = [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding]; ]]> Fri, 29 Jan 2016 00:00:00 GMT Fischer's London: yes, but… https://xenodium.com/fischers-london-yes-but https://xenodium.com/fischers-london-yes-but Yes

    Step into a Viennese blast from the past. Beautiful setting and pleasant vibe. Ordered a dirty martini on the rocks, a bottle of Merlot, Käsespätzle (with bacon), and Wiener Schnitzel (with anchovy/capers/egg). All very tasty.

    But…

    Surprisingly, desserts (Topfenstrudel, Berggasse and coffee) were nothing spectacular. Also not a cheap eat (£50 per person).

    Photos

    ]]>
    Mon, 25 Jan 2016 00:00:00 GMT
    Polar travel bookmarks https://xenodium.com/polar-travel-bookmarks https://xenodium.com/polar-travel-bookmarks
  • Quark expeditions.
  • ]]>
    Mon, 25 Jan 2016 00:00:00 GMT
    Sweden travel bookmarks https://xenodium.com/sweden-travel-bookmarks https://xenodium.com/sweden-travel-bookmarks
  • Fäviken restaurant (world's most isolated restaurant).
  • Hangouts in Stockholm.
  • Vasa Museum.
  • ]]>
    Sun, 24 Jan 2016 00:00:00 GMT
    Handwriting bookmarks https://xenodium.com/handwriting-bookmarks https://xenodium.com/handwriting-bookmarks
  • briem.net.
  • Handwriting that works.
  • ]]>
    Wed, 20 Jan 2016 00:00:00 GMT
    Chocolate fondant recipe https://xenodium.com/chocolate-fondant-recipe https://xenodium.com/chocolate-fondant-recipe My girlfriend recently made a delicious chocolate fondant. Saving the The Guardian's recipe:

    Ingredients (2 servings)

    • 60g unsalted butter, cut into dice, plus extra to grease
    • 1 tbsp cocoa powder
    • 60g dark chocolate, broken into pieces
    • 1 egg and 1 egg yolk
    • 60g caster sugar
    • 1 tbsp plain flour

    Preparation

    1. Pre-heat the oven to 200C if cooking immediately, and put a baking tray on the middle shelf. Butter the inside of 2 small ramekins or pudding moulds, and then put the cocoa in one and turn it to coat the inside, holding it over the second mould to catch any that escapes. Do the same with the other mould.
    2. Put the butter and chocolate into a heatproof bowl set over, but not touching, a pan of simmering water and stir occasionally until melted. Allow to cool slightly.
    3. Vigorously whisk together the egg, yolk, sugar and a pinch of salt until pale and fluffy. Gently fold in the melted chocolate and butter, and then the flour. Spoon into the prepared moulds, stopping just shy of the top – at this point the mixture can be refrigerated until needed, or even frozen, as the puddings will not wait around once cooked.
    4. Put on to a hot baking tray and cook for 12 minutes (14 if from cold, 16 if frozen) until the tops are set and coming away from the sides of the moulds. Leave to rest for 30 seconds and then serve in the ramekins or turn out on to plates if you're feeling confident – they're great with clotted cream or plain ice cream.
    ]]>
    Wed, 20 Jan 2016 00:00:00 GMT
    Parenting bookmarks https://xenodium.com/parenting-bookmarks https://xenodium.com/parenting-bookmarks
  • A Toddler's Do-It-Myself Attitude Ends In Tantrums - Janet Lansbury.
  • Ask HN: Any good collaboratively built documentation on good parenting? (Hacker News).
  • Ask HN: I need ideas to impress fifth graders with technology.
  • Ask HN: Recommend a maths book for a teenager? | Hacker News.
  • CodeCombat - Learn how to code by playing a game.
  • Everyone's a Aliebn When Ur a Aliebn Too by Jomny Sun.
  • For parents out there, how much money did you have saved up when you had your first kid?.
  • Growing With Science Blog.
  • Home - Mindful Parenting Online Conference.
  • How Inuit Parents Teach Kids To Control Their Anger (NPR).
  • How to get kids to pay attention (Hacker News).
  • How to raise a child – 10 rules from young single mom.
  • How to Raise a Child: 10 Rules from Young Susan Sontag – Brain Pickings.
  • How to Talk so Kids Will Listen and Listen so Kids Will Talk.
  • I'm becoming a Dad for the first time in May. What are you top finacial tips when becoming a parent? : UKPersonalFinance.
  • Is it OK to have kids?.
  • Let Grow | When Adults Step Back, Kids Step Up..
  • Let's Talk About Protecting Our Families (debunked gun defense arguments).
  • On Parenthood.
  • Tech kits for bright sparks (from techwillsaveus).
  • The disintegration of the parent-child bond.
  • The Intersection of Design & Motherhood | Top Lifestyle Blog | Design Mom.
  • The Monster at the End of This Book: Jon Stone, Michael Smollin.
  • Things people don't warn you about parenthood.
  • Visual Book Notes: No-Drama Discipline (2014).
  • Why It's Okay to Throw Your Children's Art Away - The Atlantic.
  • Yoto player review// is it worth it? everything you need to know - YouTube.
  • ]]>
    Wed, 20 Jan 2016 00:00:00 GMT
    Ippudo London: yes, but… https://xenodium.com/ippudo-london-yes-but https://xenodium.com/ippudo-london-yes-but Yes

    Central St. Giles location. Ordered a Kirin Ichiban beer and a Spicy Tonkotsu with a seasoned boiled egg. Awesome medium-spice broth, tasty egg and firm noodles. Got additional noodles for £1.50.

    But…

    The space feels soulless. Think generic, chain, Pizza Express…

    Photos

    ]]>
    Tue, 19 Jan 2016 00:00:00 GMT
    Added Emacs zone-rainbow https://xenodium.com/added-emacs-zone-rainbow https://xenodium.com/added-emacs-zone-rainbow kawabata's zone-rainbow popped up on melpa today. Added to zone-programs. Just because :)

    (use-package zone-rainbow :ensure t
      :after zone
      :config
      (setq zone-programs (vconcat [zone-rainbow] zone-programs)))
    

    ]]>
    Tue, 19 Jan 2016 00:00:00 GMT
    Safari's Web Inspector keyboard shortcuts https://xenodium.com/safaris-web-inspector-keyboard-shortcuts https://xenodium.com/safaris-web-inspector-keyboard-shortcuts Via WebKit's blog, Web Inspector Keyboard Shortcuts:

    • ⌃⌘Y or ⌘\ continue.
    • F8 or ⇧⌘; step out.
    • F7 or ⌘; step in.
    • F6 or ⌘’ step over.
    ]]>
    Tue, 19 Jan 2016 00:00:00 GMT
    Copenhagen travel bookmarks https://xenodium.com/copenhagen-travel-bookmarks https://xenodium.com/copenhagen-travel-bookmarks
  • Christiania.
  • Hija de Sanchez restaurant.
  • Marv og Ben restaurant.
  • Mikkeller Bar – Mikkeller.
  • Mikkeller Bar.
  • Schonnemann restaurant.
  • Tivoli.
  • Torvehallerne (food).
  • ]]>
    Thu, 14 Jan 2016 00:00:00 GMT
    Import UIKit for simpler debugging https://xenodium.com/import-uikit-for-simpler-debugging https://xenodium.com/import-uikit-for-simpler-debugging I bookmarked An @import-ant Change in Xcode and immediately forgot about it. The gist is to import UIKit to simplify inspecting objects during an lldb session:

    (lldb) expr @import UIKit
    

    Shorten typing by creating aliases in ~/.lldbinit:

    command alias uikit expr @import UIKit
    command alias foundation expr @import Foundation
    
    ]]>
    Tue, 12 Jan 2016 00:00:00 GMT
    iOS development tips backlog https://xenodium.com/ios-development-tips-backlog https://xenodium.com/ios-development-tips-backlog [DONE]{.done .DONE} Static Analysis on iOS - Part II.

    [DONE]{.done .DONE} Clang-based C/C++/Objective-C refactoring toolset (unmaintained).

    [DONE]{.done .DONE} SimSim: access to application data folders.

    [DONE]{.done .DONE} xcpretty (fast and flexible formatter/prettifier for xcodebuild output).

    [DONE]{.done .DONE} xctool.

    ]]>
    Tue, 12 Jan 2016 00:00:00 GMT
    Basic Emacs keybindings on Linux desktop https://xenodium.com/basic-emacs-keybindings-on-linux-desktop https://xenodium.com/basic-emacs-keybindings-on-linux-desktop Miss C-a, C-e in your browser and other Linux apps? You can enable the GTK Emacs key theme:

    $ gsettings set org.gnome.desktop.interface gtk-key-theme "Emacs"
    

    or if on Cinnamon:

    $ gsettings set org.cinnamon.desktop.interface gtk-key-theme Emacs
    

    If your desktop environment is not running gnome-settings-daemon, start it with:

    $ gnome-settings-daemon
    

    More at Emacs Keybindings in Chrome Without Gnome and How to get Emacs key bindings in Ubuntu.

    ]]>
    Mon, 11 Jan 2016 00:00:00 GMT
    Emacs Objective-C completion with Irony https://xenodium.com/emacs-objective-c-completion-with-irony https://xenodium.com/emacs-objective-c-completion-with-irony Install libclang on Mac
    brew install llvm --with-clang
    

    Configure Emacs

    (use-package irony :ensure t
      :config
      (add-hook 'objc-mode-hook 'irony-mode)
      (add-hook 'irony-mode-hook 'irony-cdb-autosetup-compile-options))
    
    (use-package company-irony :ensure t
      :config
      (add-hook  'objc-mode-hook (lambda ()
                                   (setq-local company-backends '((company-irony)))))
      (add-hook 'irony-mode-hook 'company-irony-setup-begin-commands))
    

    install irony server

    Run:

    M-x irony-install-server
    

    NOTE: Needs libclang: Install with "brew install llvm –with-clang" By default, irony-install-server did not find libclang on Mac OS. irony-install-server invokes cmake for you. Work around by adding:

    -DCMAKE_PREFIX_PATH=/Users/your-user-name/homebrew/opt/llvm
    

    For example:

    cmake -DCMAKE_PREFIX_PATH=/Users/your-user-name/homebrew/opt/llvm -DCMAKE_INSTALL_PREFIX\=/Users/your-user-name/.emacs.d/irony/ /Users/your-user-name/.emacs.d/elpa/irony-20160106.1223/server && cmake --build . --use-stderr --config Release --target install
    

    Compilation database

    Install xctool

    brew install xctool
    

    Generate compilation database

    xctool -sdk iphonesimulator -arch x86_64 -scheme SomeScheme -reporter pretty -reporter json-compilation-database:compile_commands.json clean build
    

    Set Irony's database path

    M-x irony-cdb-json-add-compile-commands-path

    ]]>
    Fri, 08 Jan 2016 00:00:00 GMT
    Finland travel bookmarks https://xenodium.com/finland-travel-bookmarks https://xenodium.com/finland-travel-bookmarks
  • 36 Hours in Helsinki.
  • Boat to the Baltics; Tallinn (Estonia).
  • Helsinki - Suomenlinna (former maritime fortress).
  • Lapland (husky sledding, reindeer, Santa Claus village).
  • Päivä no:23 Reitti no:23 no:12 | Leipomo K.E.Avikainen (try munkkipossu: pig shaped donut).
  • Ragu Ravintola (try panfried fiesh, pulled pork, steak tartare, chocolate mouse).
  • Rovaniemi for reindeer, dog sled, santaland, artic circle photos.
  • ]]>
    Thu, 07 Jan 2016 00:00:00 GMT
    Northern lights travel bookmarks https://xenodium.com/northern-lights-travel-bookmarks https://xenodium.com/northern-lights-travel-bookmarks
  • Aim for a new moon (eg. 2016-01-10 or 2016-02-08).
  • Aim for auroral zone.
  • Guide Gunnar will go distance to ensure you see the lights.
  • Kiruna Sleddog Tours.
  • Tromsø's reindeer racing.
  • Tromsø.
  • Hundekjøring: drive your own sled.
  • Tromsø whale watching.
  • ]]>
    Thu, 07 Jan 2016 00:00:00 GMT
    Mexico travel bookmarks https://xenodium.com/mexico-travel-bookmarks https://xenodium.com/mexico-travel-bookmarks
  • 15 best places to visit in Mexico.
  • San Francisco Acatepec.
  • ]]>
    Wed, 06 Jan 2016 00:00:00 GMT
    Emacs highlight-symbol-mode https://xenodium.com/emacs-highlight-symbol-mode https://xenodium.com/emacs-highlight-symbol-mode Been a fan of highlight-thing-mode. It automatically highlights all instances of symbol at point. Today, I gave highlight-symbol a try. Similar concept, but also adds the ability to jump to next/previous instances of symbol at point.

    (use-package highlight-symbol :ensure t
      :config
      (set-face-attribute 'highlight-symbol-face nil
                          :background "default"
                          :foreground "#FA009A")
      (setq highlight-symbol-idle-delay 0)
      (setq highlight-symbol-on-navigation-p t)
      (add-hook 'prog-mode-hook #'highlight-symbol-mode)
      (add-hook 'prog-mode-hook #'highlight-symbol-nav-mode))
    

    ]]>
    Sun, 03 Jan 2016 00:00:00 GMT
    Gandhi's ever-contemporary wisdom https://xenodium.com/gandhis-ever-contemporary-wisdom https://xenodium.com/gandhis-ever-contemporary-wisdom From Gandhi: Radical Wisdom for a Changing World:

    Anger

    "I do get angry, but I feel angry with myself for it. Full conquest of anger is possible only through self-realization. We should love even those who have the worst opinion of us. This is ahimsa, the rest is only ignorance."

    Bad handwriting

    "I am now of opinion that children should first be taught the art of drawing before learning how to write. Let the child learn his letters by observation as he does different objectives, such as flowers, birds, etc., and let him learn handwriting only after he has learned to draw objects."

    Conduct of the Ashram

    "Service without humility is selfishness and egotism."

    Eating

    "There is a great deal of truth in the saying that man becomes what he eats. The grosser the food, the grosser the body."

    Heart

    "There are chords in every human heart. If we only know how to strike the right chord, we bring out the music."

    Moral law

    The law of truth and love.

    Renouncing or forgoing

    Nishkulanand sings: "Renunciation of objects, without the renunciation of desires, is short-lived, however hard you may try."

    Silence

    "Man spoils matters much more by speech than by silence."

    Time

    "Every minute that runs to waste never returns. Yet, knowing this, how much time do we waste?"

    The palate

    "Turn to the birds and beasts, and what do you find? They never eat merely to please the palate, they never go on eating till their inside is full to overflowing. And yet, we regard ourselves as superior to the animal creation!"

    Vow of Swadeshi

    "The person who has taken the vow of swadeshi will never use articles which conceivably involve violation of truth in their manufature or on the part of their manufacturers."

    ]]>
    Sun, 03 Jan 2016 00:00:00 GMT
    Functional programming bookmarks https://xenodium.com/functional-programming-bookmarks https://xenodium.com/functional-programming-bookmarks
  • Functors, Applicatives, And Monads In Pictures.
  • Functors, Applicatives, and Monads in Plain English.
  • Tom Ducalf's Programming Fundamentals Talk.
  • What is functional programming?
  • Which programming languages are functional?
  • Why Functional Programming Matters.
  • ]]>
    Sat, 02 Jan 2016 00:00:00 GMT
    9 Productivity tips https://xenodium.com/9-productivity-tips https://xenodium.com/9-productivity-tips From HBR's 9 Productivity Tips from People Who Write About Productivity:

    1. Block time away from reactive tasks (email).
    2. Business = wasted energy.
    3. Exercise, sleep, and 90 minute work bursts.
    4. Incomplete tasks prompt healthy thinking out of context.
    5. Time off or stepping back is invaluable.
    6. Genuinely help were most successful/enjoyable.
    7. Plan for saying no while highlighting priority and seeking feedback.
    8. Measure important behavior change.
    9. Make time now (automate, simplify, etc.).
    ]]>
    Sat, 02 Jan 2016 00:00:00 GMT
    First meal of 2016 https://xenodium.com/first-meal-of-2016 https://xenodium.com/first-meal-of-2016 Pancakes
    • 1 teaspoon of salt.
    • 1.5 cups of milk.
    • 2 cups of flour.
    • 2 eggs.
    • 2 tablespoons sugar.
    • 4 tablespoons of melted butter.
    • 6 teaspoons of baking powder.

    Makes 10/11 pancakes.

    ]]>
    Fri, 01 Jan 2016 00:00:00 GMT
    Last meal of 2015 https://xenodium.com/last-meal-of-2015 https://xenodium.com/last-meal-of-2015 For our last meal of 2015, I contributed dal and rotis. This is my first attempt at making either one of these. Both recipes based on Anupy Singla's Indian for Everyone.

    Dal Makhani (Buttered black lentils)

    Roti-Chapati-Phulka

    ]]>
    Fri, 01 Jan 2016 00:00:00 GMT
    Find in \$PATH with type and which https://xenodium.com/find-in-path-with-type-and-which https://xenodium.com/find-in-path-with-type-and-which I typically use which to figure out the first binary found in $PATH:

    which -a emacsclient
    
    /Users/user/homebrew/bin/emacsclient
    /usr/bin/emacsclient
    

    I always forget about type though:

    type -a emacsclient
    
    emacsclient is /Users/user/homebrew/bin/emacsclient
    emacsclient is /usr/bin/emacsclient
    
    ]]>
    Wed, 30 Dec 2015 00:00:00 GMT
    npm basics https://xenodium.com/npm-basics https://xenodium.com/npm-basics Global vs local package installation location

    {prefix}/lib/node_modules

    vs

    path/to/project/node_modules

    View npm config

    npm config list
    
    ; cli configs
    user-agent = "npm/2.14.2 node/v4.0.0 darwin x64"
    
    ; node bin location = /Users/user/.nvm/versions/node/v4.0.0/bin/node
    ; cwd = /Users/user/stuff/active/blog
    ; HOME = /Users/user
    ; 'npm config ls -l' to show all defaults.
    
    

    Get config value

    npm config get prefix
    
    /Users/user/.nvm/versions/node/v4.0.0
    

    Set config value

    npm config set prefix=$HOME/some/location
    

    Install package globally

    node install --global <package-name>
    

    or

    node install -g <package-name>
    

    List global packages

    npm list --global
    

    You can also use –depth=0 to make less verbose.

    /Users/user/.nvm/versions/node/v4.0.0/lib
    ├─┬ [email protected]
    │ ├── [email protected]
    │ ├─┬ [email protected]
    │ │ ├── [email protected]
    │ │ ├── [email protected]
    ...
    

    Install local package

    npm install <package-name> --save
    

    –save will add <package-name> dependency to your package.json.

    package.json

    See using a package.json.

    Uninstall package

    npm uninstall <package-name>
    

    Install package at version

    npm install <package-name>@1.7.0
    

    Search packages

    npm search linter
    

    Online documentation

    Online documentation is great so far. More at docs.npmjs.com.

    ]]>
    Wed, 30 Dec 2015 00:00:00 GMT
    Clojure bookmarks https://xenodium.com/clojure-bookmarks https://xenodium.com/clojure-bookmarks
  • Clojure in Emacs from absolute zero .
  • 2015 in review.
  • A call for Clojure stacks · Clojure Stacks.
  • GitHub - nrepl/nrepl: A Clojure network REPL that provides a server and client, along with some common APIs of use to IDEs and other tools that may need to evaluate Clojure code in remote environments.
  • Getting Started with Cider for Clojure Programming - Blog.
  • ]]>
    Fri, 25 Dec 2015 00:00:00 GMT
    Mac OS X tips backlog https://xenodium.com/mac-os-x-tips-backlog https://xenodium.com/mac-os-x-tips-backlog [TODO]{.todo .TODO} Uebersicht: Keep an eye on what is happening on your machine and in the World.

    [DONE]{.done .DONE} Kwm: Tiling window manager with focus follows mouse for OSX.

    cp ~/homebrew/Cellar/kwm/1.1.3/homebrew.mxcl.kwm.plist ~/Library/LaunchAgents/
    launchctl load ~/Library/LaunchAgents/homebrew.mxcl.kwm.plist
    

    [DONE]{.done .DONE} Turn off shadows with ShadowToggle.

    [DONE]{.done .DONE} Disk Inventory X: disk usage utility for Mac.

    ]]>
    Mon, 21 Dec 2015 00:00:00 GMT
    Search bash history with Emacs helm https://xenodium.com/search-bash-history-with-emacs-helm https://xenodium.com/search-bash-history-with-emacs-helm Following up from changing CWD with helm projectile, here's a way to search your bash history with helm:

    (defun ar/helm-helm (title candidates on-select-function)
      "Helm with TITLE CANDIDATES and ON-SELECT-FUNCTION."
      (helm :sources `((name . ,title)
                       (candidates . ,candidates)
                       (action . ,on-select-function))
            :buffer "*helm-exec*"
            :candidate-number-limit 10000))
    
    (defun ar/shell-send-command (command)
      "Send COMMAND to shell mode."
      (assert (string-equal mode-name "Shell") nil "Not in Shell mode")
      (goto-char (point-max))
      (comint-kill-input)
      (insert command)
      (comint-send-input))
    
    (defun ar/helm-shell-search-history ()
      "Narrow down bash history with helm."
      (interactive)
      (assert (string-equal mode-name "Shell") nil "Not in Shell mode")
      (ar/helm-helm "bash history"
                    (with-temp-buffer
                      (insert-file-contents "~/.bash_history")
                      (reverse
                       (delete-dups
                        (split-string (buffer-string) "\n"))))
                    #'ar/shell-send-command))
    

    Bonus: Replace existing M-r binding to use ar/helm-shell-search-history.

    (bind-key "M-r" #'ar/helm-shell-search-history shell-mode-map)
    
    ]]>
    Sun, 20 Dec 2015 00:00:00 GMT
    Medicine bookmarks https://xenodium.com/medicine-bookmarks https://xenodium.com/medicine-bookmarks
  • Science-Based Medicine – Exploring issues and controversies in science and technology.
  • ]]>
    Sat, 19 Dec 2015 00:00:00 GMT
    View DICOM files from your X-ray https://xenodium.com/view-dicom-files-from-your-x-ray https://xenodium.com/view-dicom-files-from-your-x-ray Got a CD with my chest X-ray from the hospital. Was expecting a pdf or an image of sorts, but the CD content was rather different. For starters, it was targeted at Windows users (AUTORUN.INF, MediaViewerLauncher.EXE and a bunch of DLLs):

    $ find . -exec file --mime-type '{}' \;
    
    ./AUTORUN.INF: text/plain
    ./DICOMDIR: application/dicom
    ./MediaViewerLauncher.EXE: application/octet-stream
    ...
    ./Libraries/BASEPRINTER.DLL: application/octet-stream
    ./Libraries/CDDATABURNER.DLL: application/octet-stream
    ./Libraries/COM.DLL: application/octet-stream
    ...
    ./Libraries/ACE.DLL: application/octet-stream
    ./Libraries/ACE_SSL.DLL: application/octet-stream
    ./Libraries/ATL90.DLL: application/octet-stream
    ...
    ./DICOM/PAT_0000: application/x-directory
    ./DICOM/PAT_0000/STD_0000/SER_0000/OBJ_0001/IM_0001: application/dicom
    ./DICOM/PAT_0000/STD_0000/SER_0001/OBJ_0001/ED_0001: application/dicom
    ./DICOM/PAT_0000/STD_0000/SER_0002/OBJ_0001/ED_0001: application/dicom
    ./Worklist/ClinicalInfo/067eccde-b299-e511-9114-005056ad3afe.mht: text/html
    ./Worklist/Report/067eccde-b299-e511-9114-005056ad3afe.mht: text/html
    ./Worklist/Worklist.wl: application/octet-stream
    

    I'm on a Mac, so most of these files were not useful to me. The more interesting files were IM_0001 and ED_0001 with "application/dicom" MIME type. DICOM files stand for Digital Imaging and Communications in Medicine. How to view these on a Mac? OsiriX viewer is an option. OsiriX, though on the heavy side (100.7MB download), it rendered the X-ray successfully.

    Unsurprisingly, ImageMagick's convert utility also handles DICOM files. Converting to PNG worked well.

    $ convert ./DICOM/PAT_0000/STD_0000/SER_0001/OBJ_0001/ED_0001 ED_0001.png
    

    DICOM files also hold patient's metadata and optional reports. The file format is well known. OsiriX gives you access to it, but a few lines of python can also extract it for you. First install the pydicom package:

    $ sudo pip install pydicom
    

    Running the python interpreter is enough to peek at the metadata:

    >>> import dicom
    >>> ds = dicom.read_file("./DICOM/PAT_0000/STD_0000/SER_0000/OBJ_0001/IM_0001")
    >>> ds
    
    (0008, 0000) Group Length                        UL: 400
    (0008, 0005) Specific Character Set              CS: 'ISO_IR 100'
    (0008, 0016) SOP Class UID                       UI: Computed Radiography Image Storage
    (0008, 0020) Study Date                          DA: '20151203'
    (0008, 0021) Series Date                         DA: '20151203'
    (0008, 0023) Content Date                        DA: '20151203'
    (0008, 0030) Study Time                          TM: '120519.000000'
    (0008, 0031) Series Time                         TM: '120520.000000'
    (0008, 0033) Content Time                        TM: '120643.000000'
    (0008, 0060) Modality                            CS: 'CR'
    (0008, 0070) Manufacturer                        LO: 'Canon Inc.'
    ...
    

    There were other DICOM files with a report:

    >>> import dicom
    >>> ds = dicom.read_file("./DICOM/PAT_0000/STD_0000/SER_0001/OBJ_0001/ED_0001")
    >>> ds
    
    (0008, 0005) Specific Character Set              CS: 'ISO_IR 100'
    (0008, 0016) SOP Class UID                       UI: Encapsulated PDF Storage
    ...
    (0042, 0012) MIME Type of Encapsulated Document  LO: 'application/pdf'
    

    DCMTK is another alternative tool to extract DICOM metadata. The source is available and can be built:

    $ tar xf dcmtk-3.6.0.tar.gz
    $ cd dcmtk-3.6.0
    $ cmake .
    $ make
    

    Or installed via homebrew:

    $ brew install dcmtk
    

    DCMTK includes dcmdump. You can use it to dump DICOM files:

    $ dcmdata/apps/dcmdump DICOM/PAT_0000/STD_0000/SER_0000/OBJ_0001/IM_0001
    
    # Dicom-File-Format
    
    # Dicom-Meta-Information-Header
    # Used TransferSyntax: Little Endian Explicit
    (0002,0000) UL 192                                      #   4, 1 FileMetaInformationGroupLength
    (0002,0001) OB 01\00                                    #   2, 1 FileMetaInformationVersion
    (0002,0002) UI =ComputedRadiographyImageStorage         #  26, 1 MediaStorageSOPClassUID
    (0002,0003) UI [1.2.392.200046.100.2.1.1.42667.20151203120519.1.1.1] #  52, 1 MediaStorageSOPInstanceUID
    (0002,0010) UI =LittleEndianExplicit                    #  20, 1 TransferSyntaxUID
    (0002,0012) UI [1.3.46.670589.42.1.4.4.5]               #  24, 1 ImplementationClassUID
    (0002,0013) SH [PhilipsISPACS445]                       #  16, 1 ImplementationVersionName
    ...
    

    Of interest, David Clunie's Medical Image Format Site.

    ]]>
    Sat, 19 Dec 2015 00:00:00 GMT
    Tip: GOOGLETRANSLATE your Spreadsheet https://xenodium.com/tip-googletranslate-your-spreadsheet https://xenodium.com/tip-googletranslate-your-spreadsheet Examples from reference:

    =GOOGLETRANSLATE("Hello World\n","en\n","es")
    =GOOGLETRANSLATE(A2,B2,C2)
    =GOOGLETRANSLATE(A2)
    
    ]]>
    Fri, 18 Dec 2015 00:00:00 GMT
    Organize your data with camlistore https://xenodium.com/organize-your-data-with-camlistore https://xenodium.com/organize-your-data-with-camlistore Checking out camlistore to organize all sorts of data. Scaleway enables you to deploy camlistore servers.

    ]]>
    Fri, 18 Dec 2015 00:00:00 GMT
    Maps dev bookmarks https://xenodium.com/maps-dev-bookmarks https://xenodium.com/maps-dev-bookmarks
  • A new way to make maps with OpenStreetMap | Hacker News.
  • borders: Country, region and city boundary data from OpenStreetMap, served monthly (mapzen.com).
  • Farewell, Google Maps (In der Apotheke).
  • Fast, Offline, Reverse Geocoding; or, in Which Polygon am I?.
  • Free OpenStreetMap tile library: watercolor, black and white, terrain.
  • Import OpenStreetMap XML data into your Unreal Engine 4.
  • Location Tech.
  • Map's POI categories.
  • Mapbox.
  • Maperitive (offline maps).
  • Mapzen.
  • Medium's mapping tag.
  • Migrating away from Google Maps and cutting costs by 99% (Hacker News).
  • Open Addresses.
  • OpenStreetCam.
  • Openstreetmap, a global map for worldwide insight | Hacker News.
  • OpenStreetMap: Introducing OpenStreetView.
  • Organicmaps: Android and iOS offline maps app for travelers, tourists, hikers….
  • OSM data in one file.
  • OSM on paper.
  • OSM raw indices.
  • Pigeon Maps – Maps in React with no external dependencies (Hacker News).
  • Portable OSM.
  • Show HN: Tilemaker – DIY vector tiles from OpenStreetMap data | Hacker News.
  • Static Map API - Overview | MapQuest API Documentation.
  • Using QGIS to create a custom map.
  • Why Openstreetmap’s product fails to compete with Google Maps | Hacker News.
  • World Borders Dataset (thematicmapping.org).
  • ]]>
    Thu, 17 Dec 2015 00:00:00 GMT
    Use ImageMagick to convert image to grayscale https://xenodium.com/use-imagemagick-to-convert-image-to-grayscale https://xenodium.com/use-imagemagick-to-convert-image-to-grayscale Another ImageMagick one-liner I'll likely forget.

    mogrify -type Grayscale image.png
    
    ]]>
    Thu, 17 Dec 2015 00:00:00 GMT
    Drill down Emacs dired with dired-subtree https://xenodium.com/drill-down-emacs-dired-with-dired-subtree https://xenodium.com/drill-down-emacs-dired-with-dired-subtree JCS, from Irreal, recently highlighted fuco's dired-hacks. dired-subtree is super handy for drilling subdirectories down. Bound <tab> and <backtab> to toggle and cycle subtrees.

    (use-package dired-subtree :ensure t
      :after dired
      :config
      (bind-key "<tab>" #'dired-subtree-toggle dired-mode-map)
      (bind-key "<backtab>" #'dired-subtree-cycle dired-mode-map))
    

    ]]>
    Mon, 14 Dec 2015 00:00:00 GMT
    GPG (GnuPG) examples https://xenodium.com/gpg-examples https://xenodium.com/gpg-examples Generate key
    gpg --full-generate-key
    

    Export private key

    gpg --export-secret-key -a <keyid> > <private.asc>
    

    Import key

    gpg --import < <private.asc>
    

    Delete public key

    gpg --delete-keys <keyid>
    

    Delete private key

    gpg --delete-secret-keys <keyid>
    

    Edit key

    gpg --edit-key <keyid>
    gpg> uid (lists IDs)
    gpg> uid 2 (marks ID)
    gpg> deluid (deletes marked ID)
    Really remove this user ID? (y/N) y
    

    Change passphrase of the secret key

    gpg --edit-key Your-Key-ID-Here
    gpg> passwd
    gpg> save
    

    References

    ]]>
    Mon, 14 Dec 2015 00:00:00 GMT
    CSS bookmarks https://xenodium.com/css-bookmarks https://xenodium.com/css-bookmarks
  • 58 bytes of css to look great nearly everywhere.
  • CSS Layout.
  • CSS Protips: A collection of tips to help take your CSS skills pro (Hacker News).
  • CSS Protips: A collection of tips to help take your CSS skills pro.
  • CSS style guide.
  • CSS-Tricks.
  • CSStickyHeaderFlowLayout.
  • Dynamics.js: JavaScript library to create physics-based CSS animations.
  • Flexbox Froggy, a game for writing CSS code.
  • Howtocenterincss.com (Hacker News).
  • Howtocenterincss.com.
  • Optimize CSS delivery (Google Developers).
  • Web Design in 4 minutes (minimal css rules).
  • ]]>
    Mon, 14 Dec 2015 00:00:00 GMT
    Resume partial downloads with ssh and rsync https://xenodium.com/resume-partial-downloads-with-ssh-and-rsync https://xenodium.com/resume-partial-downloads-with-ssh-and-rsync rsync --rsync-path=/usr/local/bin/rsync \ --partial \ --progress \ --rsh=ssh \ john@host:/path/to/file \ path/to/partial/file ]]> Sat, 12 Dec 2015 00:00:00 GMT Emacs text faces https://xenodium.com/emacs-text-faces https://xenodium.com/emacs-text-faces
  • Text faces = Text styles.
  • Face attributes: font, height, weight, slant, foreground/background color, and underlining or overlining.
  • Font lock mode automatically assigns faces to text.
  • M-x list-faces-display: Shows faces defined.
  • M-x helm-colors: Also handy.
  • Unspecified attributes are taken from 'default' face.
  • ]]>
    Sat, 12 Dec 2015 00:00:00 GMT
    Preview HTML pages on github https://xenodium.com/preview-html-pages-on-github https://xenodium.com/preview-html-pages-on-github Prepend with http://htmlpreview.github.io/?. For example: http://htmlpreview.github.io/?https://github.com/xenodium/xenodium.github.io/blob/master/index.html

    ]]>
    Tue, 08 Dec 2015 00:00:00 GMT
    Flutter setup https://xenodium.com/flutter-setup https://xenodium.com/flutter-setup Based on Getting Started with Flutter.

    $ curl -O https://storage.googleapis.com/dart-archive/channels/stable/release/1.13.0/sdk/dartsdk-macos-x64-release.zip
    $ unzip dartsdk-macos-x64-release.zip
    $ export PATH=`pwd`/dart-sdk/bin:$PATH
    

    Verify with:

    $ pub --version
    
    ]]>
    Mon, 07 Dec 2015 00:00:00 GMT
    Playing with Dart's analysis server https://xenodium.com/playing-with-darts-analysis-server https://xenodium.com/playing-with-darts-analysis-server Dart SDK ships with an analysis server. Very handy if you'd like to write a completion plugin for your favorite editor. The API is well documented. Of interest, there's LocalDartServer.java, part of dartedit.

    $ dart path/to/bin/snapshots/analysis_server.dart.snapshot  --sdk=path/to/dart-sdk
    

    NOTE: The server reads requests from standard input. Either escape or execute the following as one-liner json requests.

    {
      "id": "1\n",
      "method": "analysis.setAnalysisRoots\n",
      "params": {
        "included": [
          "path/to/your/dart/project"
        ],
        "excluded": []
      }
    }
    
    {
      "id": "3\n",
      "method": "completion.getSuggestions\n",
      "params": {
        "file": "path/to/some/file.dart\n",
        "offset": 673
      }
    }
    
    ]]>
    Mon, 07 Dec 2015 00:00:00 GMT
    Dart bookmarks https://xenodium.com/dart-bookmarks https://xenodium.com/dart-bookmarks
  • Access Dart Analysis server from Java.
  • Analysis server API.
  • Dart tools.
  • ]]>
    Mon, 07 Dec 2015 00:00:00 GMT
    Flutter bookmarks https://xenodium.com/flutter-bookmarks https://xenodium.com/flutter-bookmarks
  • Eric Seidel introduces Sky, Dart Developer Summit 2015 (YouTube).
  • Flutter - Futures - Isolates - Event Loop.
  • Flutter: Futures, Isolates, Event Loop (Hacker News).
  • Flutter: the good, the bad and the ugly – The ASOS Tech Blog – Medium.
  • ]]>
    Sun, 06 Dec 2015 00:00:00 GMT
    Swift bookmarks https://xenodium.com/swift-bookmarks https://xenodium.com/swift-bookmarks
  • 10 Swift One Liners To Impress Your Friends.
  • 5 secrets of Swift API design.
  • 5 small but significant improvements in Swift 5.1 | Swift by Sundell.
  • @State messing with initializer flow - Using Swift - Swift Forums.
  • A beautiful graphics framework for Material Design in Swift.
  • A collection view layout capable of laying out views in vertically scrolling grids and lists (AirBnB).
  • A first look at the new diffable data sources for table views and collection view.
  • A Technology Freelancer's Guide to Starting a Worker Cooperative.
  • AES256-CBC File Encryption from the Command Line with Swift.
  • All Episodes · Swift Talk · objc.io.
  • App Architecture (objc.io).
  • Async/await in Swift unit tests.
  • Avoiding race conditions in Swift | Swift by Sundell.
  • Awesome server side swift.
  • Awesome-Swift-Education.
  • Building DSLs in Swift (Swift by Sundell).
  • Conditional Compilation in Swift, Part 1 (Dave DeLong).
  • Constructing URLs in Swift.
  • Creating a simple browser with WKWebView in Swift.
  • Curated Swift 5 documentation and reference in GNU Info format.
  • Debugging sourcekit-lsp using LLDB - LLDB - Swift Forums.
  • Deciding whether to adopt new Swift technologies | Swift by Sundell.
  • Deep dive into Swift frameworks - The.Swift.Dev..
  • Difference: diff between 2 Swift object instances.
  • Encapsulating configuration code in Swift | Swift by Sundell.
  • Episode 125 – Building a Layout Library: Building a Responsive Layout · Swift Talk · objc.io.
  • Equatable - Swift Unboxed.
  • Formatting everything in swift (lovation, dates, time).
  • From NSRegularExpression to SwiftRegex.
  • FunctionKit/README.md at master · mpangburn/FunctionKit · GitHub.
  • Get your current address in Swift – Ravi Shankar.
  • Getting started with WKWebView using Swift in iOS 8.
  • Getting to know UITextField.
  • GitHub - almassapargali/LocationPicker (Swift).
  • GitHub - anas-p/ImagePicker: UIImagePickerController for camera and photo library.
  • GitHub - burczyk/XcodeSwiftSnippets: Swift 4 code snippets for Xcode.
  • GitHub - DevLiuSir/CircleProgressBar: This is a simple animation circle progress bar.
  • GitHub - hyperoslo/Cache: Nothing but Cache..
  • GitHub - liuliu/dflat: Structured Data Store for Mobile.
  • GitHub - phynet/iOS-URL-Schemes: iOS URL list schemes (Settings).
  • GitHub - Raizlabs/BonMot: Beautiful, easy attributed strings in Swift.
  • GitHub - raywenderlich/swift-algorithm-club: Swift Algorithm Club.
  • GitHub - saoudrizwan/Disk: Delightful framework for iOS to easily persist strcts, images, and data.
  • GitHub - swift-embedded/swift-embedded: Swift for Embedded Systems .
  • GitHub - zhuorantan/LocationPicke (Swift).
  • How to Add Compiled Frameworks in Swift Package Manager.
  • How to bridge a Swift View.
  • How to calculate the SHA hash of a String or Data instance.
  • How to capture Regex group values in Swift | What did I learn.
  • How to check for internet connectivity using NWPathMonitor.
  • How to create a random terrain tile map using SKTileMapNode and GKPerlinNoiseSource.
  • How to run an external program using Process.
  • How to work with dates and times in Swift 5, part 4: Adding Swift syntactic sugar.
  • I made a “What’s new in Swift 4.2” playground.
  • iphone - UIImagePNGRepresentation issues? / Images rotated by 90 degrees.
  • It Looks Like You're Still Trying to Use/Create a Swift Framework.
  • Jason Zurita - Compositional UI Styling in Swift - YouTube.
  • Khanlou | Implementing Dictionary In Swift.
  • Large Title and Search in iOS 11 – Pavel Gnatyuk – Medium.
  • Lightbox is a convenient and easy to use image viewer for your iOS app.
  • Location picker: A ready for use and fully customizable location picker for your app.
  • Logging in Swift | steipete's blog.
  • macOS Swift Development for Beginners: Part 1.
  • Martin Lasek on Twitter: "Handling prices in Swift.".
  • Migrating an Objective-C class to Swift: a piecemeal approach – Ole Begemann.
  • Migrating from CocoaPods to Swift Package Manager - The.Swift.Dev..
  • Migrating from Swift 4 to Swift 5 – The Create School – Medium.
  • More fun with Swift 5 String Interpolation: Radix (Erica Sadun).
  • Netguru's Swift Style Guide.
  • Never: Eliminating Impossible States in Swift Generic Types - NSHipster.
  • NSWindow Styles | lukakerr.github.io.
  • Optionals in Swift for newbies.
  • Path.swift: Delightful, robust, cross-platform and chainable file-pathing functions.
  • Pro Pattern-Matching in Swift - Digital product development agency | Big Nerd Ranch.
  • Regular Expressions in Swift (groups) - NSHipster.
  • Simple networking in Swift.
  • Slot-based UI development in Swift (Sundell).
  • Splitting a JSON object into an enum and an associated object with Codable.
  • Splitting up Swift types | Swift by Sundell.
  • SRChoco: Seorenn's Development Libraries for OS X and iOS (github).
  • [[https://twitter.com/steipete/status/1281578201165320192][String(string[currentIndex])]].
  • Swift - How to authenticate a gRPC call for the Assistant SDK?.
  • Swift 5 Interpolation Part 3: Dates and Number Formatters (Erica Sadun).
  • Swift Development with Visual Studio Code - NSHipster.
  • Swift Resources.
  • swift sh adds automatic dependency loading in scripts.
  • Swift Style, Second Edition: An Opinionated Guide to an Opinionated Language by Erica Sadun (The Pragmatic Bookshelf).
  • Swift Tip: Using AppKit from the Command-line · objc.io.
  • Swift.org - Announcing ArgumentParser.
  • Swift.org - API Design Guidelines.
  • swift/ErrorHandlingRationale.rst at master · apple/swift · GitHub.
  • SwiftLinkPreview: Link Previewer for iOS, macOS, watchOS and tvOS.
  • SwiftMothly.
  • TextKit 2 – The Promised Land | Hacker News.
  • The Complete Guide to Optionals in Swift – Hacking with Swift.
  • The Shift Language (YouTube).
  • The SwiftPM Library, a place to find packages for Swift.
  • Today marks 4 years since shipping the first release of the rewrite of the Lyft app in Swift.
  • TrozWare blogs on Swift.
  • UILayoutGuide – The Traveled iOS Developer’s Guide – Medium.
  • Understanding DispatchQueues - SwiftRocks.
  • Understanding Swift - free quick start tutorials for Swift developers (hackingwithswift).
  • Use Neovim as Swift IDE - The Go Blog.
  • Using errors as control flow in Swif (Sundell).
  • Why Swift Enums with Associated Values Cannot Have a Raw Value.
  • WKWebView (NSHipster).
  • Writing Your App Swiftly.
  • ]]>
    Sun, 06 Dec 2015 00:00:00 GMT
    Installing Emacs spaceline https://xenodium.com/installing-emacs-spaceline https://xenodium.com/installing-emacs-spaceline Gave Spaceline a try. Spacemacs's powerline theme. Setup was super simple (Thanks Eivind Fonn and Sylvain Benner):

    (use-package spaceline :ensure t
      :config
      (use-package spaceline-config
        :config
        (spaceline-toggle-minor-modes-off)
        (spaceline-toggle-buffer-encoding-off)
        (spaceline-toggle-buffer-encoding-abbrev-off)
        (setq powerline-default-separator 'rounded)
        (setq spaceline-highlight-face-func 'spaceline-highlight-face-evil-state)
        (spaceline-define-segment line-column
          "The current line and column numbers."
          "l:%l c:%2c")
        (spaceline-define-segment time
          "The current time."
          (format-time-string "%H:%M"))
        (spaceline-define-segment date
          "The current date."
          (format-time-string "%h %d"))
        (spaceline-toggle-time-on)
        (spaceline-emacs-theme 'date 'time))
    

    ]]>
    Mon, 30 Nov 2015 00:00:00 GMT
    package.el incomprehensible buffer https://xenodium.com/package-el-incomprehensible-buffer https://xenodium.com/package-el-incomprehensible-buffer Came across "incomprehensible buffer" error in package.el. Workaround patch:

    --- a/lisp/emacs-lisp/package.el
    +++ b/lisp/emacs-lisp/package.el
    @@ -1161,6 +1161,7 @@ package--with-work-buffer
    (let* ((url (concat ,url-1 ,file))
           (callback (lambda (status)
                       (let ((b (current-buffer)))
    +                    (goto-char (point-min))
                         (unwind-protect (wrap-errors
                                          (when-let ((er (plist-get
                                                          status :error)))
                                            (error "Error retrieving: %s %S" url er))
    
    ]]>
    Sun, 29 Nov 2015 00:00:00 GMT
    Leading bookmarks https://xenodium.com/leading-bookmarks https://xenodium.com/leading-bookmarks
  • Agile's early evangelists wouldn't mind watching Agile die.
  • An incomplete list of skills senior engineers need, beyond coding | Hacker News.
  • Ask HN: How to Be a Good Technical Lead? (Hacker News).
  • Books on leveling up as a manager.
  • Bryan Cantrill on Twitter: "So, my thoughts on engineering performance management…".
  • Dan Abramov: What is your favorite book about management… (twitter).
  • Do You Have a Manager’s Mindset?.
  • First Timers Only: A suggestion to Open Source project maintainers.
  • How to Give Tough Feedback That Helps People Grow.
  • Interviews with developers who became managers (Hacker News).
  • Secrets of the Superbosses.
  • Shifting from Star Performer to Star Manager.
  • The Joel Test: 12 Steps to Better Code.
  • The Manager as Debugger.
  • The Manager's Path: A Guide for Tech Leaders Navigating Growth and Change.
  • ]]>
    Sun, 29 Nov 2015 00:00:00 GMT
    Online reading backlog https://xenodium.com/online-reading-backlog https://xenodium.com/online-reading-backlog [TODO]{.todo .TODO} Phrack 69.

    [TODO]{.todo .TODO} A Simple Formula for Changing Our Behavior.

    [TODO]{.todo .TODO} Be Grateful More Often.

    [TODO]{.todo .TODO} GTD sucks for creative work.

    [TODO]{.todo .TODO} Land, Capital, Attention: This Time it Is the Same.

    [TODO]{.todo .TODO} Mindset: What You Believe Affects What You Achieve (Gates Notes).

    [TODO]{.todo .TODO} The Case for Getting Rid of Borders—Completely.

    [TODO]{.todo .TODO} The Ultimate Guide to Personal Productivity Methods.

    [TODO]{.todo .TODO} Thing Explainer: A Basic Guide for Curious Minds (Gates Notes).

    [TODO]{.todo .TODO} Your body language shapes who you are.

    ]]>
    Sun, 29 Nov 2015 00:00:00 GMT
    Travel lifestyle bookmarks https://xenodium.com/travel-lifestyle-bookmarks https://xenodium.com/travel-lifestyle-bookmarks
  • 1991 VW Vanagon Westfalia campervan.
  • 5 Travel Lessons You Can Use at Home.
  • 50 Best Travel Tips from 10 Years of Travel - Your RV Lifestyle.
  • A new chapter – full-time working from a van in a forest | Hacker News.
  • Bali Digital Nomad Guide - How To Live In Bali As A Digital Nomad.
  • Bootstrapping in Bangkok is the best option.
  • goruck bag.
  • Grooming on airplanes: What's acceptable? - The Washington Post.
  • How Much Does it Cost to Drop Everything and Travel Asia for 3 Months?.
  • I am a US citizen and I am thinking of retiring in Thailand..
  • Lessons in Planning and Travel During COVID-19 – Uncornered Market.
  • My 30 Best Travel Tips After 8 Years Traveling The World • Expert Vagabond.
  • My partner & I want to backpack around as much of the world as we can for 6-12 months. What surprises did you learn on the way I should plan for?.
  • NomadList: Best cities to work from remotely.
  • OECD Better Life Index.
  • onlinetaxman.com Prices.
  • Peace and understanding through travel and hosting | Servas Online.
  • Round The World Trip 2017/2018: The Costs - Just Another Backpacker.
  • Show HN: I made a database of remote companies (Hacker News).
  • Show HN: Nomad Visa – Working remotely? Explore your visa options | Hacker News.
  • tom bihn bags.
  • Travis translators.
  • waveUPtravel.
  • What are the best ways to earn money while traveling around the world? (Quora).
  • where to emigrate to?.
  • Why You Should Remote Work in Taiwan.
  • ]]>
    Sat, 28 Nov 2015 00:00:00 GMT
    SQL bookmarks https://xenodium.com/sql-bookmarks https://xenodium.com/sql-bookmarks
  • Launching LiteCLI.
  • Literate SQL.
  • Show HN: SQL Trainer – Learn SQL by doing live data exercises (Hacker News).
  • SQL Series: From A to Z - DEV Community.
  • SQL tips and tricks.
  • The interesting ideas in Datasette.
  • You Can Do it in SQL, Stop Writing Extra Code for it - DEV Community.
  • ]]>
    Thu, 26 Nov 2015 00:00:00 GMT
    Unix/Linux tools bookmarks https://xenodium.com/unix-linux-tools-bookmarks https://xenodium.com/unix-linux-tools-bookmarks
  • (small) Guide on using mtree (The FreeBSD Forums).
  • 15 Practical Linux cURL Command Examples.
  • 20 awk examples – Linux Hint.
  • 7 Awesome Open Source Analytics Software For Linux and Unix - nixCraft.
  • A practical proposal for migrating to safe long sessions on the web (Hacker News).
  • A practical security guide for web developers (Hacker News).
  • A Unix Utility to Know About: lsof (2009) (Hacker News).
  • agnoster.bash.
  • An Elegant Way of Managing Dotfiles.
  • Announcing gRPC Support in Nginx (Hacker News).
  • ASCII art text with figlet.
  • Autotools Mythbuster.
  • awk FAQ.
  • awk in 20 minutes.
  • Balthazar – Text processing in the shell.
  • Bash Parameter Expansion (Linux Hint).
  • Bash pipe tutorial (Linux Hint).
  • Bash Until Loops (Linux Hint).
  • Basic SSH Security (The Art of Not Asking Why).
  • Best Practices for UNIX chroot.
  • Blacklisting domains with Postfix - John Bokma.
  • Bruce Barnett's awk tutorial.
  • Bruce Barnett's sed tutorial.
  • Cast All The Things.
  • CLI: improved (better cli alternatives).
  • CLI: Improved, better CLI alternatives (Hacker News).
  • Command-line-text-processing: From finding text to search and replace, from sorting to beautifying text and more.
  • Cool but obscure unix tools at kkovacs.eu.
  • Curl Cookbook.
  • curl exercises (Julia Evans).
  • Curl in Bash Scripts by Example (Linux Hint).
  • Curl vs Wget (Hacker News).
  • CURRYFINGER - SNI & Host header spoofing utility - DUALUSE.
  • CyberChef.
  • Encrypt disk with bioctl(8) and CRYPTO - Roman Zolotarev.
  • entr runs commands when a file changes.
  • Every Linux networking tool I know (zine).
  • fasd a command-line productivity booster.
  • Find Length of String in Bash (Linux Hint).
  • For the Love of Pipes (Hacker News).
  • git-annex.
  • GitHub - antonmedv/fx: Command-line tool and terminal JSON viewer.
  • GitHub - atorstling/origin: Track down the origin of a command.
  • GitHub - insanum/gcalcli: Google Calendar Command Line Interface.
  • GitHub - raboof/nethogs: Linux 'net top' tool.
  • How to trim string in bash (Linux Hint).
  • How to use array in awk command (Linux Hint).
  • How To Use Bash's Job Control to Manage Foreground and Background Processes.
  • How to use conditional statement in awk command (Linux Hint).
  • How to Use dd Command on Linux (Linux Hint).
  • How to use for loop in awk command (Linux Hint).
  • HTTP static server one-liners | Hacker News.
  • httpie: Command line HTTP client, a user-friendly curl alternative.
  • Iptables for beginners (Linux Hint).
  • Jeffrey Paul: Stupid Unix Tricks (Yubikey ssh on macOS).
  • Jessie Frazelle's Blog: For the Love of Pipes.
  • Julia Evans's zines (unix tools).
  • Kira McLean | How To Set Up Your Own Nextcloud Server.
  • LD_DEBUG awesomeness (using ls).
  • Learn a Little AWK (Irreal).
  • Linux cp Command (Linux Hint).
  • Linux environment management.
  • Linux grep Command (Linux Hint).
  • Linux lsof Command (Linux Hint).
  • Linux profiling at Netflix.
  • Linux tar Command (Linux Hint).
  • Linux tr Command (Linux Hint).
  • Magic Pipes: suite of tools to construct powerful Unix shell pipelines that operate on structured data.
  • Make cURL follow redirects.
  • Managing macOS dot files with stow.
  • Marcin Borkowski: 2019-03-11 Name-based UUID generation.
  • More than you really wanted to know about Patch (Hacker News).
  • My First 10 Minutes on a Server (Hacker News).
  • Nginx vs Apache.
  • Nmap Alternatives (Linux Hint).
  • NMAP basics Tutorial (Linux Hint).
  • nmap flags and what they do (Linux Hint).
  • Nmap: scan IP ranges (Linux Hint).
  • Peek: Simple animated GIF screen recorder with an easy to use interface.
  • Practical Linux Hardening Guide (Hacker News).
  • Rclone (mount many cloud services locally).
  • redbean.
  • Remove duplicate lines from files keeping the original order.
  • Ripgrep Cheatsheet • Phil's Blog.
  • Show HN: Ultimate Plumber – a tool for writing Linux pipes with live preview (Hacker News).
  • smenu is a selection filter just like sed is an editing filter.
  • SoftEther VPN.
  • SSH: Best practices.
  • Text Manipulation with Command Line Utilities.
  • the-book-of-secret-knowledge: A collection of inspiring lists, manuals, cheatsheets, blogs, hacks, one-liners, cli/web tools, and more.
  • trackerjacker/README.md at master · calebmadrigal/trackerjacker · GitHub.
  • Understanding Awk (Practical Guide).
  • Unison File Synchronizer.
  • Unix commands you wish you knew years ago (Reddit).
  • Unix for the Beginning Mage.
  • usbrip: Simple CLI forensics tool for tracking USB device artifacts (history of USB events) on GNU/Linux.
  • Using gnu stow to manage your dotfiles.
  • Welcome & Magic-Wormhole.
  • xdotool - fake keyboard/mouse input, window management, and more - semicomplete.
  • xmllint –format.
  • Your terminal is not a terminal: An Introduction to Streams.
  • Your unofficial guide to dotfiles on GitHub.
  • ]]>
    Thu, 26 Nov 2015 00:00:00 GMT
    Couchbase React Native bookmarks https://xenodium.com/couchbase-react-native-bookmarks https://xenodium.com/couchbase-react-native-bookmarks
  • Couchbase Mobile discussion group.
  • Couchbase Mobile Native API.
  • Couchbase Mobile.
  • Couchbase sync gateway.
  • Getting Started with React Native Android and Couchbase Lite.
  • ]]>
    Thu, 26 Nov 2015 00:00:00 GMT
    Installing Emacs 25 devel on Mac OS X https://xenodium.com/installing-emacs-on-mac-os-x https://xenodium.com/installing-emacs-on-mac-os-x Stable
    brew update
    brew install emacs --HEAD --use-git-head --with-cocoa --with-srgb --with-gnutls
    brew linkapps emacs
    

    Development

      brew update
      brew install emacs --devel --with-cocoa --with-srgb --with-gnutls
      brew linkapps emacs
    then
    

    Had problems loading seq. Removed byte-compiled packages:

    $ find ~/.emacs.d/elpa -iname *.elc -exec rm '{}' \;
    
    ]]>
    Thu, 26 Nov 2015 00:00:00 GMT
    Diagram tools bookmarks https://xenodium.com/diagram-tools-bookmarks https://xenodium.com/diagram-tools-bookmarks
  • A Quick Introduction to Graphviz.
  • Create diagrams with code using Graphviz – ncona.com – Learning about computers.
  • Diagram.Codes.
  • Flowchart Maker & Online Diagram Software.
  • Graphviz it! - fiddle with diagrams.
  • Graphviz node shapes.
  • PlantText UML Editor.
  • Svgbob: Convert your ASCII diagram scribbles into happy little SVG.
  • TeXample.net (TeX examples).
  • What do you like using for software architecture diagrams? (twitter).
  • ]]>
    Wed, 25 Nov 2015 00:00:00 GMT
    Licensing bookmarks https://xenodium.com/licensing-bookmarks https://xenodium.com/licensing-bookmarks
  • choosealicense.com (Choosing an open source license doesn’t need to be scary).
  • choosealicense.com (github).
  • tldrlegal.com (Software Licenses in Plain English).
  • ]]>
    Tue, 24 Nov 2015 00:00:00 GMT
    Synology bookmarks https://xenodium.com/synology-bookmarks https://xenodium.com/synology-bookmarks
  • Backup your files to an external drive or a shared file DSM 6.0 – Synoguide.
  • Ext4 vs. Btrfs: Why We're Making The Switch {Linux}.
  • How to make your Synology Disk station (NAS) more secure? – BPMSG.
  • How to use the Files app to connect to a network server from your iPhone.
  • Josh Dick » Configuring SSH and SCP/SFTP on DSM 5.0 for Synology DiskStations.
  • Log in to a Synology DiskStation using SSH keys as a user other than root.
  • Look into Synology's file encryption.
  • RAID5 vs SHR - Ars Technica OpenForum.
  • reddit: Please confirm that I chose the right option (SHR1 with DS718+).
  • Reset your Admin password in your Synology – Synoguide.
  • ]]>
    Mon, 23 Nov 2015 00:00:00 GMT
    Backup bookmarks https://xenodium.com/backup-bookmarks https://xenodium.com/backup-bookmarks
  • HGST Deskstar NAS 3.5-Inch 6TB 7200RPM SATA III 128MB Cache Internal Hard Drive (0S03839).
  • I found the Holy Grail of backups.
  • Kingston Technology 4GB 1600MHz DDR3L PC3-12800 1.35V Non-ECC CL11 SODIMM Intel Laptop Memory KVR16LS11/4.
  • Show HN: Baxx – Unix-friendly backup service (Hacker News).
  • Synology Disk Station 8-Bay (Diskless) Network Attached Storage (NAS) (DS1815+).
  • Tarsnap: online backups for the truly paranoid.
  • ]]>
    Sun, 22 Nov 2015 00:00:00 GMT
    Making hummus https://xenodium.com/making-hummus https://xenodium.com/making-hummus Made hummus, based on Delicious Istanbul's 5 Secrets to Perfect Hummus (wayback machine) post.

    • 160 g dry chickpeas.
    • 4 cloves garlic minced.
    • 1 tsp fine sea salt.
    • 1 1/2 tbsp lemon juice.
    • 1/4 tsp ground cumin.
    • 6 tbsp tahini paste.
    • 2/3 cup cooking water.
    • Extra virgin olive oil, for serving.
    • Red pepper flakes, for serving.
    • Zahter mixture, for serving.
    1. Soak chickpeas overnight.
    2. Discard water and rinse chickpeas.
    3. Cook in low heat (about 5 cups water) for 1.5 hours for until soft (but keeping shape.) Check if can be mashed with thumnb.
    4. Save cooking water.
    5. Peal chickpeas (optional).
    6. Blend ingredients until silky paste. Taste and add lemon/salt/cooking water.

    Keeps in fridge for 3-4 days. Freeze otherwise.

    ]]>
    Sun, 22 Nov 2015 00:00:00 GMT
    Nara travel bookmarks https://xenodium.com/nara-travel-bookmarks https://xenodium.com/nara-travel-bookmarks
  • Kōfuku-ji.
  • Nara Buddha temple.
  • ]]>
    Sun, 22 Nov 2015 00:00:00 GMT
    Kubernetes bookmarks https://xenodium.com/kubernetes-bookmarks https://xenodium.com/kubernetes-bookmarks
  • A Tutorial Introduction to Kubernetes (Hacker News).
  • Borg, Omega, Kubernetes: Lessons learned from container management over a decade (Hacker News).
  • Fabric8 is an integrated open source DevOps and Integration Platform (Kubernetes or OpenShift).
  • hokusai: Artsy's Docker / Kubernetes CLI and Workflow.
  • Kubernetes by Example | Hacker News.
  • Swarm vs. Fleet vs. Kubernetes vs. Mesos (Hacker News).
  • Swarm vs. Fleet vs. Kubernetes vs. Mesos.
  • The ultimate guide for local development on Kubernetes.
  • ]]>
    Sat, 21 Nov 2015 00:00:00 GMT
    Docker bookmarks https://xenodium.com/docker-bookmarks https://xenodium.com/docker-bookmarks
  • [[https://news.ycombinator.com/item?id=25619319
  • ][Dockerfile Best Practices | Hacker News]].

    ]]>
    Sat, 21 Nov 2015 00:00:00 GMT
    Angular bookmarks https://xenodium.com/angular-bookmarks https://xenodium.com/angular-bookmarks
  • Egghead.io's Angular 2 lessons.
  • ]]>
    Sat, 21 Nov 2015 00:00:00 GMT
    Mac OS bookmarks https://xenodium.com/mac-os-bookmarks https://xenodium.com/mac-os-bookmarks
  • Customizing the Cocoa Text System (github).
  • Customizing the Cocoa Text System (~/Library/KeyBindings/DefaultKeyBinding.dict).
  • GitHub - ttscoff/KeyBindings: DefaultKeybindings.dict for Mac OS X.
  • NSResponder (useful for DefaultKeyBinding.dict).
  • DaisyDisk (what's taking up your disk space).
  • DTrace: {even better than} strace for OS X | 8th Light.
  • Getting absolute path in Bash in OSX.
  • GitHub - fitztrev/shuttle: A simple SSH shortcut menu for macOS.
  • Guide to Securing Apple OS X.
  • Hammerspoon.
  • kextstat.
  • KextViewr: View all modules on that are loaded in the OS kernel.
  • Little Snitch.
  • macOS Development for Beginners: Part 1.
  • macOS Development for Beginners: Part 2.
  • macOS Development for Beginners: Part 3.
  • Marzipan: Porting iOS Apps to the Mac (Inside PSPDFKit).
  • Phoenix: A lightweight macOS window and app manager scriptable with JavaScript.
  • Subler: Mac OS X app created to mux and tag mp4 files.
  • Which OS X Applications do you find indispensable? (Stack Exchange).
  • ]]>
    Sat, 21 Nov 2015 00:00:00 GMT
    easy_install-\>pip-\>conda https://xenodium.com/easy_install-pip-conda https://xenodium.com/easy_install-pip-conda Spotted Conda package manager. It handles python installations, in addition to package management. There's also a package index provided by Binstar. Installed Miniconda, the bare bones Conda environment.

    Can't find a python package in Binstar? Here's a post on Using PyPi Packages with Conda. If that fails, you can try pip from your Conda python environment.

    ]]>
    Sat, 21 Nov 2015 00:00:00 GMT
    Traditional music bookmarks https://xenodium.com/traditional-music-bookmarks https://xenodium.com/traditional-music-bookmarks
  • Cliff Sloane's asian classical music in mp3 format.
  • Oriental traditional music.
  • Shruti Box comparison.
  • ]]>
    Mon, 16 Nov 2015 00:00:00 GMT
    Recover from an unresponsive Emacs https://xenodium.com/recover-from-an-unresponsive-emacs https://xenodium.com/recover-from-an-unresponsive-emacs Wilfred Hughes has a handy tip to bail you out of a hung Emacs instance:

    pkill -SIGUSR2 emacs
    

    ps. Not had a chance to try it, but next time it happens…

    ]]>
    Wed, 04 Nov 2015 00:00:00 GMT
    Training for under 50 min 10k run https://xenodium.com/training-for-under-50-min-10k-run https://xenodium.com/training-for-under-50-min-10k-run Not much training time for an under 50 minute 10k run, but here's an attempt (based on time-to-run's sub-50):

    Mon Tue Wed Thu Fri Sat Sun


    Oct 26 Oct 27 Oct 28 Oct 29 Oct 30 Oct 31 Nov 1 60 min 30 min 2k @ 4.55/k rest 105 min 2 min rest ✔ (repeat x 3) Nov 2 Nov 3 Nov 4 Nov 5 Nov 6 Nov 7 Nov 8 30 min 30 min 1k @ 4.50/k 30 min 30 min rest 5k @ 4.55/k 90 sec rest (repeat x 5) Nov 9 Nov 10 Nov 11 Nov 12 Nov 13 Nov 14 Nov 15 10k easy 30 min 1k @ 4.55/k 30 min 30 min rest race day 1 min easy (repeat x 3)

    ]]>
    Sun, 25 Oct 2015 00:00:00 GMT
    Reading a running training plan https://xenodium.com/reading-a-running-training-plan https://xenodium.com/reading-a-running-training-plan A sample from Kona Part 2's comments:

    2.5 w/u to 4x([email protected] w/0.25R@7) to 3x([email protected] w/0.5R@7) to 2.5 c/d.
    

    Is read from left to right as:

    2.5 mile warm up to four times through 1.25 miles at 11.5 miles per hour with 0.25 miles recovery at 7 miles per hour to three times through 3.75 miles at 10.5 miles per hour with 0.5 miles recovery at 7 miles per hour to 2.5 miles cool down.
    
    ]]>
    Sun, 25 Oct 2015 00:00:00 GMT
    Find binary in PATH using python https://xenodium.com/find-binary-in-path-using-python https://xenodium.com/find-binary-in-path-using-python import distutils.spawn print distutils.spawn.find_executable('git')
    /usr/bin/git
    
    ]]>
    Fri, 23 Oct 2015 00:00:00 GMT
    Indonesia travel bookmarks https://xenodium.com/indonesia-travel-bookmarks https://xenodium.com/indonesia-travel-bookmarks
  • Borobudur.
  • Hiking Padar Island in Komodo National Park (Indonesia) | The Backpack Almanac.
  • Rumah Gadang.
  • ]]>
    Thu, 22 Oct 2015 00:00:00 GMT
    Malaysia travel bookmarks https://xenodium.com/malaysia-travel-bookmarks https://xenodium.com/malaysia-travel-bookmarks
  • Coliseum Cafe, Kuala Lupur.
  • How to Visit Penang's Kek Lok Si Temple (and What to Eat).
  • ]]>
    Thu, 22 Oct 2015 00:00:00 GMT
    Mongolia travel bookmarks https://xenodium.com/mongolia-travel-bookmarks https://xenodium.com/mongolia-travel-bookmarks
  • Beyond the dunes: road-tripping Mongolia's Gobi Desert.
  • Terra cotta warriors at Mount Khan, Inner Mongolia.
  • ]]>
    Thu, 22 Oct 2015 00:00:00 GMT
    Running bookmarks https://xenodium.com/running-bookmarks https://xenodium.com/running-bookmarks
  • 10k in under 50 mins — Runner's World UK Forum.
  • Garmin Forerunner 230 & 235 In-Depth Review (DC Rainmaker).
  • Harvard's Running barefoot or in minimal footwear FAQ.
  • How to run a sub-50 10K - The Running Bug.
  • Is Running Good Or Bad For Your Health?.
  • Mornington Chasers running club.
  • Open track: Race Management System.
  • Review : Newton Gravity IV & Motion IV | Ramblings of an IronRose.
  • The Race Organiser.
  • Training towards a sub 50 minute 10K.
  • ]]>
    Thu, 22 Oct 2015 00:00:00 GMT
    Media player bookmarks https://xenodium.com/media-player-bookmarks https://xenodium.com/media-player-bookmarks
  • cmus, a small, fast and powerful console music player for Unix-like OS.
  • mps-youtube.
  • mpv (a fork of mplayer2 and MPlayer).
  • Multimedia on Linux Command Line: wget, PdfTK, ffmpeg, flac, SoX.
  • PLEX (stream your media everywhere).
  • Soul – A language and IDE for audio coding .
  • ]]>
    Thu, 22 Oct 2015 00:00:00 GMT
    Get Emacs to gather links in posts https://xenodium.com/get-emacs-to-gather-links-in-posts https://xenodium.com/get-emacs-to-gather-links-in-posts Comments in posts can be a great source of recommendations. Here's a way to extract post links using Emacs and enlive.

    (require 'enlive) ;; https://github.com/zweifisch/enlive
    (require 'org)
    
    (defun ar/input-clipboard-url-or-prompt ()
      "Return a URL from clipboard or prompt user for one."
      (let* ((clipboard (current-kill 0))
             (url (if (string-match "^https?://" clipboard)
                      clipboard
                    (read-string "URL: "))))
        (unless (string-match "^https?://" url)
          (error "Not a URL"))
        url))
    
    (defun ar/url-fetch-anchor-elements (url)
      "Fetch anchor elements in URL as list of alist:
    \((title . \"my title\")
     (url . \"http://some.location.com\"))."
      (let ((elements (enlive-query-all (enlive-fetch url) [a])))
        (mapcar (lambda (element)
                  `((title . ,(enlive-text element))
                    (url . ,(enlive-attr element 'href))))
                elements)))
    
    (defun ar/url-view-links-at ()
      "View external links in HTML from prompted URL or clipboard."
      (interactive)
      (with-current-buffer (get-buffer-create "*links*")
        (org-mode)
        (view-mode -1)
        (erase-buffer)
        (mapc (lambda (anchor)
                (let-alist anchor
                  (when (and .url (string-match "^http" .url))
                    (insert (org-make-link-string .url
                                                  .title) "\n"))))
              (ar/url-fetch-anchor-elements
               (ar/input-clipboard-url-or-prompt)))
        (delete-duplicate-lines (point-min) (point-max))
        (goto-char (point-min))
        (toggle-truncate-lines +1)
        (view-mode +1)
    (switch-to-buffer (current-buffer))))
    

    UPDATE(2019-04-13): Refreshed post with latest code from my init. Thanks to Gijs for pinging.

    ]]>
    Sat, 17 Oct 2015 00:00:00 GMT
    UX toolbox bookmarks https://xenodium.com/ux-toolbox-bookmarks https://xenodium.com/ux-toolbox-bookmarks
  • Affinity Designer: the perfect tool for UI and UX design.
  • Affinity Publisher – Professional Desktop Publishing Software.
  • Build a static site with Material Design Lite.
  • Eye dropper Chrome extension (pick colors in browser).
  • Generate - Coolors.co.
  • Google, but for colors (Hacker News).
  • Nodesign.dev | Design less develop more..
  • PaintCode - Turn your drawings into Objective-C or Swift drawing code.
  • Paletton - The Color Scheme Designer.
  • WhatTheFont! (find out font names).
  • ]]>
    Fri, 16 Oct 2015 00:00:00 GMT
    Change Emacs shell's CWD with helm projectile https://xenodium.com/change-emacs-shells-cwd-with-helm-projectile https://xenodium.com/change-emacs-shells-cwd-with-helm-projectile If using Emacs shell and helm projectile, you can wire these up to quickly change your current working directory.

    (require 'helm-projectile)
    
    (defun ar/shell-cd (dir-path)
    "Like shell-pop--cd-to-cwd-shell, but without recentering."
      (unless (string-equal mode-name "Shell")
        (error "Not in Shell mode"))
      (message mode-name)
      (goto-char (point-max))
      (comint-kill-input)
      (insert (concat "cd " (shell-quote-argument dir-path)))
      (let ((comint-process-echoes t))
        (comint-send-input)))
    
    (defun ar/helm-projectile-shell-cd ()
      "Change shell current working directory using helm projectile."
      (interactive)
      (unless (string-equal mode-name "Shell")
        (error "Not in Shell mode"))
      (let ((helm-dir-source (copy-tree  helm-source-projectile-directories-list)))
        (add-to-list 'helm-dir-source '(action . ar/shell-cd))
        (add-to-list 'helm-dir-source '(keymap . nil))
        (add-to-list 'helm-dir-source '(header-line . "cd to directory..."))
        (helm :sources helm-dir-source
              :buffer "*helm-dirs*"
              :candidate-number-limit 10000)))
    
    ]]>
    Thu, 08 Oct 2015 00:00:00 GMT
    Thermostat reset on Bosch WKD28350GB https://xenodium.com/thermostat-reset-on-bosch-wkd28350gb https://xenodium.com/thermostat-reset-on-bosch-wkd28350gb My Bosch washer/dryer (WKD28350GB) stopped drying recently. Resetting the dryer's thermostat red breaker did the trick.

    Edit: Similar post here.

    ]]>
    Wed, 07 Oct 2015 00:00:00 GMT
    Javascript fetch node sample https://xenodium.com/javascript-fetch-node-sample https://xenodium.com/javascript-fetch-node-sample Playing with node and fetch:

    // Requisite: npm install node-fetch --save
    // Save to fetch-demo.js
    // Run: node fetch-demo.js
    
    var fetch = require('node-fetch');
    
    fetch("http://xenodium.com/data/javascript-fetch-node-sample/message.json\n", {
      method: 'GET',
      timeout: 5000
    }).then(function(response) {
      return response.json();
    }).then(function(response) {
      console.log('subject: ' + response.subject);
      console.log('body: ' + response.body);
    }).catch(function(reason) {
      console.log(reason);
    });
    
    ]]>
    Mon, 05 Oct 2015 00:00:00 GMT
    Extract dominant colors in images https://xenodium.com/extract-dominant-colors-in-images https://xenodium.com/extract-dominant-colors-in-images There's a handy HN post pointing to Javier López's Using imagemagick, awk and kmeans to find dominant colors in images. A comment also highlights color-extract, written in Go.

    ]]>
    Thu, 01 Oct 2015 00:00:00 GMT
    Find a word with regex and WordNet https://xenodium.com/find-a-word-with-regex-and-wordnet https://xenodium.com/find-a-word-with-regex-and-wordnet Recently wanted to come up with a random keyword. Querying WordNet and a regular expression did the job.

    Installed WordNet on Mac:

    $ brew install wordnet
    

    Want a word ending in "esome"?

    $ wn esome -grepn -grepv -grepa -grepr | egrep -o -e "\w*esome\b" | sort | uniq
    
    adventuresome
    awesome
    blithesome
    bunglesome
    cuddlesome
    esome
    fivesome
    gruesome
    lithesome
    lonesome
    lovesome
    meddlesome
    mettlesome
    nettlesome
    threesome
    tiresome
    torturesome
    troublesome
    unwholesome
    venturesome
    wholesome
    
    ]]>
    Mon, 28 Sep 2015 00:00:00 GMT
    Soundcloud's Go best practices (GopherCon 2014) https://xenodium.com/soundclouds-go-best-practices-gophercon-2014 https://xenodium.com/soundclouds-go-best-practices-gophercon-2014 Having watched the video, some takeaways:

    Single GOPATH

    $GOPATH/src/github.com/soundcloud/foo

    Repo structure

    github.com/soundcloud/whatever

    1. README.md

    2. Makefile

    3. main.go

    4. support.go

    5. foo

      1. foo.go

      2. bar.go

    6. whatever-server

      1. main.go
    7. wharever-worker

      1. main.go

    Formatting and style

    Use gofmt.

    Google's codereview guidelines.

    Avoid named return parameters.

    Avoid make and new (unless you know sizes).

    Use struct{} for sentinel values: sets, signal chans.

    1. Conveys no information in it this part.

    2. Instead of empty interface.

    3. instead of boolean.

    Break long lines at parameters

    1. No need to compact.

    2. Keep trailing coma in last argument.

    Flags

    func main() {
      var (
        foo = flags.String("foo\n", "doch\n", "...")
        bar = flat.Int("bar\n", 34, "...")
      )
      flag.Parse()
      // ...
    }
    

    Logging

    1. package log

    2. Telemetry

    3. Push model (gets expensive over time)

      1. Graphite

      2. Statsd

      3. AirBrake

    4. Pull model (chosen)

      1. expvar

      2. Prometheus

    Testing

    1. package testing

      1. Unit tests

      2. reflect.DeepEqual

    2. Integration

      1. Use flags for starting services

      2. // +build integration

    Code validation

    1. On Save

      1. Go fmt

      2. Go import (go fmt++)

    2. On Build

      1. Go vet

      2. Golint

      3. Go test

    3. On Deploy

      1. go test -tags=integration
    4. GoCov?

    Dependency management

    1. Unimportant projects

      1. go get -d (and hope)
    2. Important

      1. VENDOR (ie. copy into your repo)

        1. Git submodules (no!).

        2. Git subtrees (seem OK).

        3. Tool (godep?).

        4. Build

        5. For binaries (use _vendor subdir)

    ]]>
    Sat, 26 Sep 2015 00:00:00 GMT
    Sync pip with Mac OS updates https://xenodium.com/sync-pip-with-mac-os-updates https://xenodium.com/sync-pip-with-mac-os-updates My pip installation recently broke after a Mac OS update.

    $ pip
    Traceback (most recent call last):
      File "/usr/local/bin/pip\n", line 5, in <module>
        from pkg_resources import load_entry_point
      File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py\n", line 2793, in <module>
        working_set.require(__requires__)
      File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py\n", line 673, in require
        needed = self.resolve(parse_requirements(requirements))
      File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py\n", line 576, in resolve
        raise DistributionNotFound(req)
    pkg_resources.DistributionNotFound: pip==1.1
    

    Updating my pip installation fixes the break:

    $ sudo easy_install -U pip
    
    ]]>
    Wed, 23 Sep 2015 00:00:00 GMT
    Chinatown treats review https://xenodium.com/chinatown-treats-review https://xenodium.com/chinatown-treats-review Recommended? yep

    There's a corner in Chinatown hosting some truly superb treats. If you get caught in the rush between Newport court and Newport place, you'd likely fail to notice some the awesome street food stands.

    Chilly squid

    I've walked past this place many times and never noticed it. They serve a handful of items, but the grilled chilly squid skewers caught my attention. They're grilled, brushed with chilly sauce and finished with sprinkled sesame and cumin seeds. Super tasty.

    Pancake + Crisp + Egg + Hot chillies = Jiān Bǐng 煎餅

    I first had these delicious breakfast savory pancakes at a Beijing street food stall. Never expected to randomly find Jiān Bǐng in London. It's a crepe with an additional egg spread, hoisin sauce, chilly sauce, hot chillies, topped with spring onions and coriander, all wrapping a wonderfully crispy bread cracker. And.. it's awesome.

    Tai Yaki

    Chinatown Bakery is hard to miss. Pedestrian traffic slows down as we all fall under the spell of the Tai Yaki machine. This wonderful assembly line produces fish-shaped sweet waffles filled with custard. They are the perfect dessert after some savory street snacks. You can get a bag of 4 for £2.

    All near each other

    All these delights are within a stone's throw away from each other.

    Useful?

    Was this post useful to you? do reply!

    Better suggestion?

    London is full of overhyped, gimmicky, and unnecessarily expensive restaurants. Very few deliver truly awesome food (even those expensive ones). Got suggestions? I'd love to hear from you @xenodium.

    ]]>
    Sun, 20 Sep 2015 00:00:00 GMT
    React bookmarks https://xenodium.com/react-bookmarks https://xenodium.com/react-bookmarks
  • 11 mistakes I’ve made during React Native / Redux app development.
  • 9 things every React.js beginner should know (Hacker News).
  • 9 things every React.js beginner should know.
  • A Complete Guide to Flexbox.
  • A complete native navigation solution for React Native with optional redux support - nav bars, tabs, drawer, modals.
  • A Material Design style React Native component library.
  • A pull to refresh ListView for React Native.
  • Adam Wolf's React Native talk.
  • Aligning Children using Flexbox in React Native.
  • Applying baisc styles in react native (video).
  • Applying Basic Styles in React Native.
  • Avoid premature fluxing.
  • Awesome React: a collection of awesome things regarding React ecosystem.
  • babel-eslint.
  • Beginner’s Guide to Using CocoaPods with React Native.
  • Beyong React Native's "getting started guide".
  • Bonnie Eisenman's blog (some react).
  • Breaking up Heavy Processing in React Native (Blog post).
  • Brent Vatne - Building li.st for Android with Exponent and React Native at react-europe 2016.
  • Bridging in React Native: An in-depth look into React Native's core.
  • Building React Native Apps.
  • Bulding the F8 app.
  • Cairn: a tiny library for React Native replacing default styling syntax.
  • Coding Apps with React Native at Exponent.
  • Configuring Emacs to use eslint and babel with flycheck for javascript and React.js JSX.
  • Curated tutorial and resource links I've collected on React, Redux, ES6, and more.
  • Dan Abramov - Live React: Hot Reloading with Time Travel at react-europe 2015.
  • Deep Diving React Native Debugging.
  • Developing React.js Components Using ES6.
  • Device Information for React Native iOS and Android.
  • Didact: a DIY guide to build your own React – Hexacta Engineering.
  • ECMAScript 5 Strict Mode, JSON, and More.
  • ESLint plugin for React Native.
  • eslint-plugin-flowtype.
  • Exponentjs.
  • Flowery: prettifies the result generated by Facebook Flow.
  • Flux diagram.
  • Getting Started with Redux (30 lessons).
  • Idiomatic React Testing Patterns.
  • Implement XHR timeout for Android and IOS natively.
  • Improved shadow performance on iOS.
  • Learn Raw React – No JSX, No Flux, No ES6, No Webpack (Hacker News).
  • LearnRxSwift.
  • ListView rendering issue.
  • Native image/photo picker for react native.
  • Native react navigation in every platform.
  • OfflineMovies: retrieves movies from an api and caches the result offline.
  • One day with React Native for Android.
  • Optimizing React Native views (Screencast).
  • Optimizing React Native views (Screencast).
  • Passing info automatically through a tree.
  • Progressive image loading.
  • React and React Native Layout Components - ReactScript.
  • React Component Starter Kit.
  • React Custom Renderers (Blog post).
  • React Design Principles.
  • React Native accordion.
  • React Native action button.
  • React Native and Typescript.
  • React Native Animated ScrollView Row Swipe Actions.
  • React Native App initial setup.
  • React Native in an Existing iOS App: Dynamic Routing.
  • React Native in the Github Community.
  • React Native Layout System.
  • React Native Mapview component for iOS + Android.
  • React Native Material Design (react-native-material-design).
  • React Native Material Design (xinthink).
  • React Native Newsletter - Issue #24.
  • React Native Newsletter - Issue #25.
  • React Native Package Manager (rnpn).
  • React Native Playground.
  • React Native scrollable decorator.
  • React Native Toolkit (navigation examples).
  • React Native Tutorial: Building Apps with JavaScript.
  • React Native’s LayoutAnimation is Awesome.
  • React Tips and Best Practices.
  • React-Move – Animate anything in React (Hacker News).
  • react-native-camera: A Camera component for React Native.
  • react-native-redux-router (replace push/pop screens with easy syntax).
  • React.js Program: A project based, linear approach to learning React.js and the React.js ecosystem.
  • react.parts/native feed.
  • Reactive Programming Overview.
  • ReactNativeAutoUpdater.
  • Redux: Predictable state container for JavaScript apps.
  • Removing User Interface Complexity, or Why React is Awesome.
  • Responsive Design in React Native.
  • rnplay.org: Test and share React Native code samples.
  • Snowflake (React iOS/Android + Redux + Jest testable + parse.com + bitrise.io).
  • Some Thoughts On Gluing React Native and Meteor (Blog post).
  • Testing react Native with jest.
  • The beginners guide to React Native and Firebase (Blog post).
  • The Case for Flux.
  • The Reactive Extensions for JavaScript.
  • The reactive manifesto.
  • Thinking in React.
  • Thoughts on the future of mobile app development (Blog post).
  • Tips for styling your React Native apps.
  • Tutorial: Handcrafting an iOS Application with React Native (and lots of love).
  • Unit Testing React Native Components: A Firsthand Guide.
  • Using redux-saga To Simplify Your Growing React Native Codebase.
  • Ways to pass objects between native and JavaScript in React Native.
  • What I learned from building with React.
  • Why React Native is Better than Native for Your Mobile Application.
  • Writing Modular JavaScript With AMD, CommonJS & ES Harmony.
  • Yasnippets for React.
  • ]]>
    Fri, 18 Sep 2015 00:00:00 GMT
    Chinese rice vinegar https://xenodium.com/chinese-rice-vinegar https://xenodium.com/chinese-rice-vinegar Note to self to buy Gold Plum Chinkiang Vinegar. Awesome with dim sum.

    ]]>
    Wed, 16 Sep 2015 00:00:00 GMT
    Use ImageMagick to batch-resize images https://xenodium.com/use-imagemagick-to-batch-resize-images https://xenodium.com/use-imagemagick-to-batch-resize-images Using percentage:

    $ mogrify -resize 10% *.png
    

    Using dimensions:

    $ mogrify -resize 120x120 *.png
    

    Lots of other alternatives from ImageMagick's documentation:


    -resize scale% -resize scale-x%xscale-y% -resize width -resize xheight -resize widthxheight -resize widthxheight^ -resize widthxheight! -resize widthxheight> -resize widthxheight< -resize area@


    Fix image aspect ratios for Instagram:

    $ mogrify -resize 1080x1350 -gravity center -extent 1080 *.jpg
    
    ]]>
    Sun, 13 Sep 2015 00:00:00 GMT
    Lucky 7 review https://xenodium.com/lucky-7-review https://xenodium.com/lucky-7-review Recommended? yep

    Lucky 7 is a small nostalgic American diner on Westbourne Park road. I like the vibe, the space, and the unpretentious waiting staff. I go to Lucky 7 often enough, originally for the buttermilk pancakes, but the list of favorites on the menu keeps growing.

    Smileys by w.dyer.

    Buttermilk Banana pancakes

    These are my favorite pancakes in London by far. Banana buttermilk pancakes and a few free coffee refills usually sort me out until dinner time. Add a side of bacon if extra hungry. You probably don't need it though.

    Reuben sandwich

    The reuben has been on Lucky 7's specials menu for months now. Not had many of these in London, but compared to The Brass Rail's, this reuben was a clear winner. The sandwich is huge and comes with fries. My girlfriend and I struggled to finish one between the two of us.

    Vanilla milkshake (add malt!)

    This milkshake hits the spot every time, but it's filling. You almost have to decide between the shake and an actual meal. If you must have it, add malt. Sorry, no picture.

    Huevos Rancheros

    This is a breakfast dish I can equally make (better?) at home, but Lucky 7 wins hands down every time I'm feeling particularly lazy. Sorry, no picture.

    Useful?

    Was this post useful to you? do reply!

    Better suggestion?

    London is full of overhyped, gimmicky, and unnecessarily expensive restaurants. Very few deliver truly awesome food (even those expensive ones). Got suggestions? I'd love to hear from you @xenodium.

    ]]>
    Tue, 08 Sep 2015 00:00:00 GMT
    Sierra Leone travel bookmarks https://xenodium.com/sierra-leone-travel-bookmarks https://xenodium.com/sierra-leone-travel-bookmarks
  • Sierra Leone marathon.
  • Street Child charity.
  • ]]>
    Wed, 02 Sep 2015 00:00:00 GMT
    London travel bookmarks https://xenodium.com/london-travel-bookmarks https://xenodium.com/london-travel-bookmarks
  • Chiswick House & Gardens.
  • Heath Robinson Museum.
  • London Library (book your free tour).
  • Quaker gardens, Islington.
  • Soho Theatre (not tried yet).
  • The best brunch London 2020 | CN Traveller.
  • The most beautiful restaurants in London for 2020 | CN Traveller.
  • ]]>
    Wed, 02 Sep 2015 00:00:00 GMT
    Use ImageMagick to auto-orient images https://xenodium.com/use-imagemagick-to-auto-orient-images https://xenodium.com/use-imagemagick-to-auto-orient-images Recently needed to rotate images based on EXIF metadata. ImageMagick to the rescue:

    $ for i in *.png; do convert -auto-orient "$i" "$i"; done
    
    ]]>
    Sun, 23 Aug 2015 00:00:00 GMT
    Bengali Macher Jhol https://xenodium.com/bengali-macher-jhol https://xenodium.com/bengali-macher-jhol My friend Sakhya brought me the wonderful Cookbook of Regional Cuisines of India. After improvisations and substitutions, here's my attempt at making Bengali Machcher Jhol:

    ]]>
    Sun, 23 Aug 2015 00:00:00 GMT
    New habits for 2015 https://xenodium.com/new-habits-for-2015 https://xenodium.com/new-habits-for-2015
  • 20 min morning meditations.
  • A better way to tie your shoes.
  • Cold showers (all of them!).
  • Keys, wallet, phone, badge, and headphones live together.
  • Listen to audio books.
  • Morning runs.
  • Nightly flossing.
  • ]]>
    Sat, 22 Aug 2015 00:00:00 GMT
    Meditation retreats bookmarks https://xenodium.com/meditation-retreats-bookmarks https://xenodium.com/meditation-retreats-bookmarks
  • Best places to seek silence.
  • Opening to life @ Dhanakosa Buddhist Retreat Centre.
  • Samye Ling (Tibetan- buddhist monastery).
  • Vipassana Meditation (centers across world).
  • ]]>
    Sat, 22 Aug 2015 00:00:00 GMT
    Human memory bookmarks https://xenodium.com/human-memory-bookmarks https://xenodium.com/human-memory-bookmarks
  • Augmenting Long-term Memory (Michael Nielsen).
  • Ludism's memory techniques.
  • Using Anki to remember what you read | Hacker News.
  • Using Anki to remember what you read | Hacker News.
  • ]]>
    Sun, 08 Jul 2018 00:00:00 GMT
    Mindfulness/meditation bookmarks https://xenodium.com/meditation-bookmarks https://xenodium.com/meditation-bookmarks
  • 10% Happier: Mindfulness Meditation Courses with Dan Harris and Joseph Goldstein.
  • Aimless Wandering.
  • Are You in Despair? That’s Good (NY Times).
  • Beating procrastination.
  • Best 10 life changes.
  • Breathing Exercise: Three To Try | 4-7-8 Breath (Andrew Weil, M.D.).
  • Contemplative Practice That Isn’t Meditating.
  • Day One - The award-winning journal app for iPhone, iPad, and Mac..
  • Developing Lotus Flexibility - Preparing Yoga Padmasana Sitting Position, part 1 (YouTube).
  • Free meditations from Mindfulness | Mindfulness: Finding Peace in a Frantic World.
  • How to Make Yourself Work When You Just Don’t Want To.
  • How to sit Zen.
  • Jonathan Foust's talks.
  • Kalyanamittas: We'll See - A Zen Story.
  • Meditation centres around the UK.
  • MEGATHREAD TIME: In 40 tweets I will describe 40 power powerful concepts for understanding the world.
  • Memreise's blog.
  • Mental Models I Find Repeatedly Useful - Gabriel Weinberg (Medium).
  • Mental Models I Find Repeatedly Useful.
  • Mind Body Attention — thinking, moving, and meditating.
  • Mindfulness breathing.
  • Mindfulness Mitigates Biases You May Not Know You Have.
  • Nam Myoho Renge Kyo.
  • Ram Dass has died (Hacker News).
  • Smiling Mind free apps.
  • The Challenge of Consciousness (Hacker News).
  • The effect of meditation on brain structure (2012) | Hacker News.
  • The Energy Project blog.
  • ]]>
    Sat, 22 Aug 2015 00:00:00 GMT
    Learning bookmarks https://xenodium.com/learning-bookmarks https://xenodium.com/learning-bookmarks
  • Best YouTube channels for learning (Quora).
  • Effective learning: Twenty rules of formulating knowledge.
  • HN's comments on learning languages.
  • HN's comments on memory.
  • How to Finally Play the Guitar: 80/20 Guitar and Minimalist Music.
  • Learn Difficult Concepts with the ADEPT Method.
  • Learning to learn.
  • Learning to Learn: Intuition Isn’t Optional | BetterExplained.
  • Scientific Speed Reading: How to Read 300% Faster in 20 Minutes.
  • ]]>
    Sat, 22 Aug 2015 00:00:00 GMT
    Bundi travel bookmarks https://xenodium.com/bundi-travel-bookmarks https://xenodium.com/bundi-travel-bookmarks
  • Bundi Haveli (accomodation).
  • Hadoti Palace (accomodation).
  • Haveli Braj Bhushan Ji ki (accomodation).
  • Haveli Katkoun Guest House (accomodation).
  • Kasera Paradise (accomodation).
  • ]]>
    Sat, 22 Aug 2015 00:00:00 GMT
    Upgrading PL30 headphones https://xenodium.com/upgrading-pl30-headphones https://xenodium.com/upgrading-pl30-headphones I've loved my Soundmagic PL30 in-ear headphones. They're relatively inexpensive, comfortable, and great for exercising (they stay in). Audio quality and bass have been good enough (I don't need much). Unfortunately, I've had two pairs of PL30's and both stopped working after a year or two. I'm replacing the last pair with RHA's MA750 (an upgrade, me hopes).

    Other contenders considered: Etymotic Research HF5, and Shure SE215. Also considered bluetooth alternatives like JayBird BlueBuds X and Plantronics BackBeat GO 2.

    I'm somewhat nervous to pay more for a pair of headphones. Let's hope they don't meet the same unfortunate fate. We'll see.

    ]]>
    Fri, 14 Aug 2015 00:00:00 GMT
    Quotes https://xenodium.com/quotes https://xenodium.com/quotes
  • "Being good at something is about being curious enough to explore things to a level where most people give up."
  • "The world is a book and those who do not travel read only one page." - Augustine of Hippo.
  • "National identity is not your only identity." - Xiaolu Guo?
  • "Choose your words carefully. Words are cheap, but their effect can be expensive."
  • ]]>
    Thu, 13 Aug 2015 00:00:00 GMT
    Bhutan travel bookmarks https://xenodium.com/bhutan-travel-bookmarks https://xenodium.com/bhutan-travel-bookmarks
  • Taktsang (Tiger’s Nest) Monastery.
  • ]]>
    Thu, 13 Aug 2015 00:00:00 GMT
    Cooking bookmarks https://xenodium.com/cooking-bookmarks https://xenodium.com/cooking-bookmarks
  • 14 Best Indian Breakfast Recipes | Easy Indian Breakfast Recipes - NDTV Food.
  • 25 Cocktails Everyone Should Know.
  • Amazon.com: Taylor Precision Products Stainless Steel Kitchen Scale.
  • Basic New York-Style Pizza Dough Recipe | Serious Eats.
  • Cast Iron Fry Pans.
  • ChienLing Koo's answer to How is authentic fried rice prepared? (Quora).
  • Eggs Kejriwal Recipe - NYT Cooking.
  • Equipment Review: Best Carbon-Steel Skillets (YouTube).
  • Equipment: How to Buy, Season, and Maintain Cast Iron Cookware.
  • How do Chinese restaurants get their beef to be so tender?.
  • How To Cook With Cast Iron (YouTube).
  • How To Make French Onion Soup.
  • Imperia Italian Double Cutter Pasta Machine.
  • It's Not Rocket Science, Steaming Hard-Boiled Eggs Makes Peeling Easier (Digital trends).
  • Jeff Varasano's NY Pizza Recipe.
  • Marcato Atlas 150 pasta machine Chrome, Silver Wellness.
  • Masoor Dal Tadka - Indian Red Lentil Dal.
  • My Favourite Homemade Almond Milk + Step By Step Photos.
  • New York Times cooking.
  • Pho Tai Lan (Hanoi style flash-fried steak & garlic soup).
  • Pizza Recipes - PizzaMaking.com.
  • Portland Farmers Market » Cookbook.
  • Swedish Cardamom Rolls (Kardemummabullar) — Fix Feast Flair.
  • The Ringer Cast Iron Cleaner XL 8x6 Inch Stainless Steel Chainmail (Amazon).
  • The Truth About Cast Iron Pans: 7 Myths That Need To Go Away.
  • The ultimate way to season cast iron.
  • Why do steaks at high end restaurants taste so different from other steaks? (Quora).
  • ]]>
    Wed, 12 Aug 2015 00:00:00 GMT
    9 week half-marathon training https://xenodium.com/9-week-half-marathon-training https://xenodium.com/9-week-half-marathon-training While reading Zen Habits: Mastering the Art of Change, I comitted to running half marathon in mid-October. That's roughly two months from now. Here's a 9 week training schedule:

    WEEK MON TUE WED THU FRI SAT SUN


    1 Rest 5 Km 5 Km Cycle Rest 5 Km 7 Km 2 Rest 5 Km 5 Km Cycle Rest 5 Km 8 Km 3 Rest 7 Km 5 Km Cycle Rest 5 Km 10 Km 4 Rest 8 Km 5 Km Cycle Rest 5 Km 12 Km 5 Rest 8 Km Rest 8 Km Rest 5 Km 14 Km 6 Rest 8 Km Rest 8 Km Rest 6 Km 16 Km 7 Rest 8 Km 8 Km 8 Km Rest 8 Km 19 Km 8 Rest 8 Km Rest 12 Km Rest 8 Km 16 Km 9 Rest 8 Km Rest 5 Km 5 Km Rest Race

    My times:

    WEEK MON TUE WED THU FRI SAT SUN


    1 Rest ✘ 29:04 ✔ Rest 26:36 38:40 2 Rest 29:11 28:50 ✔ Rest 27:07 44:55 3 Rest 40:46 26:29 ✔ Rest ✘ 57:01 4 Rest 46:46 ✘ ✘ Rest 30:08 1:12:10 5 Rest 46:59 Rest 44:46 Rest 24:50 1:25:24 6 Rest 50:02 Rest 46:24 Rest ✘ 1:37:39 7 Rest 46:54 46:41 46:42 Rest ✘ 1:57:57 8 Rest 45:28 Rest 48:13 (8km) Rest 43:56 ✘ 9 Rest 44:24 Rest 27:12 26:09 Rest 1:58:28

    ]]>
    Tue, 11 Aug 2015 00:00:00 GMT
    Shanghai travel bookmarks https://xenodium.com/shanghai-travel-bookmarks https://xenodium.com/shanghai-travel-bookmarks
  • 36 Hours in Shanghai.
  • Shanghai Xiaolongbao at Dumpling House Edison (on Rt 27).
  • Tianzi Fang street art (Google maps).
  • Tianzi Fang street art.
  • Town God's Temple, street Food!
  • Yu Garden/Huxinting Teahouse.
  • 佳家 for 小龙包.
  • 小样 (Little Yang's) for 生煎包 (sheng jian bao). Fried soup filled dumplings. Think skin crunchy bottom texture.
  • ]]>
    Tue, 11 Aug 2015 00:00:00 GMT
    Singapore job board bookmarks https://xenodium.com/singapore-job-board-bookmarks https://xenodium.com/singapore-job-board-bookmarks
  • Angel.co (Singapore Startup Jobs).
  • e27.
  • Startupjobs.asia.
  • Those who relocated to Europe for a tech position: where did you find your job?.
  • ]]>
    Mon, 10 Aug 2015 00:00:00 GMT
    Germany travel bookmarks https://xenodium.com/germany-travel-bookmarks https://xenodium.com/germany-travel-bookmarks
  • Azalea and Rhododendron Park Kromlau.
  • Having a post-lockdown bucket list - zerokspot.com.
  • Home - 7STERN Bräu.
  • Kerrie's Cup of Tea: lai fufu in Munich Germany.
  • Laifufu Teesalon - Teezeremonie - Tee - Oolong - München - Laifufu Teesalon.
  • SUDHAUS — Brauerei & Restaurant (try beef tartar. also pizza?).
  • ]]>
    Sat, 08 Aug 2015 00:00:00 GMT
    Menorca travel bookmarks https://xenodium.com/menorca-travel-bookmarks https://xenodium.com/menorca-travel-bookmarks
  • Cala Macarella, Menorca.
  • Punta Nati.
  • Scooter rental in Menorca.
  • ]]>
    Sat, 08 Aug 2015 00:00:00 GMT
    Travel tools bookmarks https://xenodium.com/travel-tools-bookmarks https://xenodium.com/travel-tools-bookmarks
  • Cool cities, a visual city guide.
  • Detour 2.0.
  • Dojo: Best stuff to do in London.
  • escapethecity.org.
  • Find the best places to sleep, eat and play.
  • hostelworld.com.
  • How to travel the world without money.
  • Indie: a simple, powerful way to buy multi-stop flights.
  • International SOS Assistance App.
  • IziTravel: audio guides and city/museum tours.
  • Jet Setter.
  • Louis Vuitton city guide.
  • Mapiac: discover hidden wonders.
  • roadsharing.com.
  • Tripcast.
  • Triposo.
  • Vayable (find a new experience).
  • Visa Requirements by Citizenship.
  • What is the best website or app to use for trip planning, and why? (Quora).
  • What travel hacks have saved you a lot of money? (Quora).
  • wwoof.net (Worldwide Opportunities on Organic Farms).
  • ]]>
    Sat, 08 Aug 2015 00:00:00 GMT
    Philippines travel bookmarks https://xenodium.com/philippines-travel-bookmarks https://xenodium.com/philippines-travel-bookmarks
  • 5 Unique Tourist Spots in the Philippines - RachFeed.
  • 7 first-timer fails.
  • Palawan (island).
  • The best beaches of the Philippines.
  • ]]>
    Sat, 08 Aug 2015 00:00:00 GMT
    Add site-specific browsers to your workflow https://xenodium.com/add-site-specific-browsers-to-your-workflow https://xenodium.com/add-site-specific-browsers-to-your-workflow There are three browser tabs continously used in my workflow: GMail, Google Calendar, and Google Play Music. I normally have many more tabs open, but these three I access periodically. As the number of open tabs increases, and I fail to cleanup, getting back to my usual three gets a little trickier.

    So far, I've kept each of these services open in separate windows. But that doesn't always work. Click on any link in your inbox and you're back to playing cleanup. This is where site-specific browsers (SSB) can help.

    Epichrome enables you to build Chrome-based SSBs (on Mac OSX). Build an SSB for the usual suspects and easily jump to them using the app switcher.

    More at OSX Chrome SSB and Quora thread

    UPDATE: Enable the Chrome extension to open URLs in default browser.

    And choose the default browser to open URLs.

    ]]>
    Thu, 23 Jul 2015 00:00:00 GMT
    Sardinia travel bookmarks https://xenodium.com/sardinia-travel-bookmarks https://xenodium.com/sardinia-travel-bookmarks
  • Alghero.
  • Baja Sardinia.
  • Budoni.
  • Cala Goloritze, Sardinia.
  • Castelsardo (gifts maybe?).
  • Food: Maialetto sardo (Pig), Sebadas, Pardula, Papassinas, Pani e sapa.
  • L'Asinara boat trip (abandoned penitentiary).
  • La Pelosa beach.
  • Nuraghe.
  • Porto Cervo.
  • Porto Torres.
  • San Teodoro.
  • Stintino (fishing port).
  • Zedda e Piras vinyards (Alghero).
  • ]]>
    Mon, 20 Jul 2015 00:00:00 GMT
    Open closest build file in Emacs https://xenodium.com/open-closest-build-file-in-emacs https://xenodium.com/open-closest-build-file-in-emacs Whether it's Makefile, SConstruct, BUILD, or your favorite build file, chances are you have to tweak it from time to time. ar/open-build-file searches your current and parent directories to find a build file.

    (defvar ar/project-file-names '("Makefile" "SConstruct" "BUILD"))
    
    (defun ar/parent-directory (path)
      "Get parent directory for PATH."
      (unless (equal "/" path)
        (file-name-directory (directory-file-name path))))
    
    (defun ar/find-upwards (path filename)
      "Search upwards from PATH for a file named FILENAME."
      (let ((file (concat path filename))
            (parent (ar/parent-directory (expand-file-name path))))
        (if (file-exists-p file)
            file
          (when parent
            (ar/find-upwards parent filename)))))
    
    (defun ar/open-closest (filename)
      "Open the closest FILENAME in current or parent dirs (handy for finding Makefiles)."
      (let ((closest-file-path (ar/find-upwards (buffer-file-name)
                                                     filename)))
        (when closest-file-path
          (message closest-file-path)
          (switch-to-buffer (find-file-noselect closest-file-path)))
        closest-file-path))
    
    (defun ar/open-build-file ()
      "Open the closest project file in current or parent directory.
    For example: Makefile, SConstruct, BUILD, etc.
    Append `ar/project-file-names' to search for other file names."
      (interactive)
      (catch 'found
        (mapc (lambda (filename)
                (when (ar/open-closest filename)
                  (throw 'found t)))
              ar/project-file-names)
        (error "No project file found")))
    
    ]]>
    Fri, 17 Jul 2015 00:00:00 GMT
    Create iOS static fat libraries https://xenodium.com/create-ios-static-fat-libraries https://xenodium.com/create-ios-static-fat-libraries Have separate static libraries for different iOS architectures? Stitch 'em up into a single fat library using with lipo:

    $ lipo -create libOne_i386.a libOne_x86_64.a libOne_armv7.a libOne_arm64.a -output libOne.a
    
    ]]>
    Wed, 15 Jul 2015 00:00:00 GMT
    Settling scores with an org table https://xenodium.com/settling-scores-with-an-org-table https://xenodium.com/settling-scores-with-an-org-table Recently kept track of expenses between a group of us. To settle the scores, I emailed an exported HTML table from an org file. This was simple enough and required no external viewer from recepients. The org table, in all its textful glory, looked as follows…

    
    | Date             | Item           |   Charge |
    |------------------+----------------+----------|
    | [2015-06-18 Thu] | Cash           |    20.00 |
    | [2015-07-11 Sat] | Lucky 7        |    42.97 |
    | [2015-07-13 Mon] | Santa Maria    |    32.00 |
    | [2015-07-12 Sun] | Tayyabs        |    46.00 |
    | [2015-07-13 Mon] | The Brass Rail |    39.00 |
    | [2015-07-13 Mon] | Underground    |    10.00 |
    | [2015-07-10 Fri] | Cash           |    20.00 |
    | [2015-07-13 Mon] | Cash           |    20.00 |
    | [2015-07-14 Tue] | Cash           |    20.00 |
    |------------------+----------------+----------|
    |                  | total          | £ 249.97 |
    #+TBLFM: @11$3=vsum(@2..@10);£ %.2f
    

    …while the exported HTML below could be easily pasted on to an email.

    Date Item Charge


    [2015-06-18 Thu] Cash 20.00 [2015-07-11 Sat] Lucky 7 42.97 [2015-07-13 Mon] Santa Maria 32.00 [2015-07-12 Sun] Tayyabs 46.00 [2015-07-13 Mon] The Brass Rail 39.00 [2015-07-13 Mon] Underground 10.00 [2015-07-10 Fri] Cash 20.00 [2015-07-13 Mon] Cash 20.00 [2015-07-14 Tue] Cash 20.00 total £ 249.97

    #+TBLFM: @11$3=vsum(@2..@10);£ %.2f
    
    ]]>
    Wed, 15 Jul 2015 00:00:00 GMT
    Recognize new password prompts in Emacs shell https://xenodium.com/recognize-new-password-prompts-in-emacs-shell https://xenodium.com/recognize-new-password-prompts-in-emacs-shell At some point, you may come across a trusted command-line utility prompting you for a password, and Emacs shell happily displaying each typed character to the nearby-world to see. Luckily, you can train Emacs to recognize new password prompts and hide the typed characters in modes deriving from comint. Append the password prompt REGEXP:

    (setq comint-password-prompt-regexp (concat comint-password-prompt-regexp
                                                "\\|"
                                                "Password for red alert:"))
    
    ]]>
    Mon, 13 Jul 2015 00:00:00 GMT
    Bosnia and Hercegovina travel bookmarks https://xenodium.com/bosnia-and-hercegovina-travel-bookmarks https://xenodium.com/bosnia-and-hercegovina-travel-bookmarks
  • Ten reasons to visit Bosnia & Hercegovina.
  • ]]>
    Sat, 11 Jul 2015 00:00:00 GMT
    Ireland travel bookmarks https://xenodium.com/ireland-travel-bookmarks https://xenodium.com/ireland-travel-bookmarks
  • Skellig Michael.
  • Fishy Fishy in Kinsale: beautiful town on the water.
  • Belfast.
  • Giant's Causeway.
  • Greyhound dog races at Shelbourne Park.
  • Old library chamber, Trinity College, Dublin.
  • ]]>
    Sat, 11 Jul 2015 00:00:00 GMT
    Pizza in London https://xenodium.com/pizza-in-london https://xenodium.com/pizza-in-london Not tried these yet. Taking note:

    • Bravi Ragazzi (Streatham).
    • Homeslice (Covent Garden).
    • Lord Morpeth (Hackney).
    • Santa Maria (Ealing).
    • Voodoo Ray's (Dalston).
    • Well Kneaded Wagon (Date-dependent location).
    ]]>
    Thu, 09 Jul 2015 00:00:00 GMT
    mp4 to gif https://xenodium.com/mp4-to-gif https://xenodium.com/mp4-to-gif Converting mp4 to gif is handy for posting short screencasts. You can convert to gif using ffmpeg and optimize with imagemagick. To install:

    apt-get install ffmpeg imagemagick (linux)
    brew install ffmpeg imagemagick (Mac)
    

    Convert to gif:

    ffmpeg -i my.mp4 -pix_fmt rgb24 -r 5 my.gif
    

    Optimize with:

    convert -dither none -layers Optimize my.gif my_optimized.gif
    

    UPDATE: There's also licecap and subsequently optimize with:

    cat source.gif | gifsicle --colors 256 --optimize=3 --delay=15 > target.gif
    

    UPDATE: Also consider for .mov:

    ffmpeg -i in.mov -pix_fmt rgb24 -r 10 -f gif - | gifsicle --optimize=3 --delay=3 > out.gif
    
    ]]>
    Thu, 09 Jul 2015 00:00:00 GMT
    Keyboards bookmarks https://xenodium.com/keyboards-bookmarks https://xenodium.com/keyboards-bookmarks
  • An introduction to Cherry MX mechanical switches.
  • Code keyboard.
  • I ♥ Keyboards | Ethan Anderson.
  • Keyboardio Blog.
  • Keychron | Wireless Mechanical Keyboards for Mac, Windows and phones.
  • Learn - Colemak keyboard layout.
  • Mechanical Keyboards Database - custom keyboards photos.
  • Plaid // Keyboard base board.
  • Products – Ultimate Hacking Keyboard.
  • r/cyberDeck.
  • r/ErgoMechKeyboards.
  • Ultimate Hacking Keyboard (Hacker News).
  • Why Learn the Colemak Keyboard Layout?.
  • ]]>
    Mon, 06 Jul 2015 00:00:00 GMT
    United States travel bookmarks https://xenodium.com/united-states-travel-bookmarks https://xenodium.com/united-states-travel-bookmarks
  • Abandoned America.
  • America's best food cities for travelers on a budget - Lonely Planet.
  • Antelope Canyon (Arizona).
  • Law Library in Iowa.
  • Peter Wade's answer has restaurants throughout the US.
  • Supai, Arizona.
  • The Texas Triffid Ranch | Dallas's Pretty Much Only Carnivorous Plant Gallery.
  • Turnip Rock in Port Austin, Michigan.
  • Vance Creek Bridge in Washington.
  • Washington trail association (hiking).
  • Where can I afford to live in NYC with a $100,000 salary and no debt? (Quora).
  • ]]>
    Sun, 05 Jul 2015 00:00:00 GMT
    Lebanon travel bookmarks https://xenodium.com/lebanon-travel-bookmarks https://xenodium.com/lebanon-travel-bookmarks
  • Baatara gorge waterfall.
  • STEAK CRUSH (@steakcrush).
  • ]]>
    Sun, 05 Jul 2015 00:00:00 GMT
    Slovenia travel bookmarks https://xenodium.com/slovenia-travel-bookmarks https://xenodium.com/slovenia-travel-bookmarks
  • Lake Bohinj.
  • ]]>
    Sun, 05 Jul 2015 00:00:00 GMT
    Belgium travel bookmarks https://xenodium.com/belgium-travel-bookmarks https://xenodium.com/belgium-travel-bookmarks
  • The Flower Carpet event at the Grand-Place in Brussels.
  • Travel arrangements around Brussels - zerokspot.com.
  • ]]>
    Sun, 05 Jul 2015 00:00:00 GMT
    Fishing with Emacs https://xenodium.com/fishing-with-emacs https://xenodium.com/fishing-with-emacs OK not quite, but having recently learned about C-M-w (append-next-kill), I used it in a keyboard macro to fish out matching lines. This is similar to flush-lines, except the kill ring is also populated. This is handy, if you need the flushed lines. Here's an example.

    Here's the equivalent in Emacs lisp:

    (defun flush-kill-lines (regex)
      "Flush lines matching REGEX and append to kill ring.  Restrict to \
    region if active."
      (interactive "sFlush kill regex: ")
      (save-excursion
        (save-restriction
          (when (use-region-p)
            (narrow-to-region (point) (mark))
            (goto-char 0))
          (while (search-forward-regexp regex nil t)
            (move-beginning-of-line nil)
            (kill-whole-line)))))
    
    ]]>
    Fri, 03 Jul 2015 00:00:00 GMT
    California travel bookmarks https://xenodium.com/california-travel-bookmarks https://xenodium.com/california-travel-bookmarks
  • General Sherman Tree at Sequoia National Park.
  • ]]>
    Fri, 03 Jul 2015 00:00:00 GMT
    Rebind caps lock to control key on Mac OS X https://xenodium.com/rebind-caps-lock-to-control-key-on-mac-os-x https://xenodium.com/rebind-caps-lock-to-control-key-on-mac-os-x Let's see if this one sticks. I'll give caps lock as control a try. Rebinding the keys on Mac OS X is easy enough:

    System Preferences -> Keyboard -> Keyboard Tab -> Modifier Keys…

    ]]>
    Wed, 01 Jul 2015 00:00:00 GMT
    Searchable ebooks in Emacs https://xenodium.com/searchable-ebooks-in-emacs https://xenodium.com/searchable-ebooks-in-emacs If you haven't bought Mastering Emacs by Mickey Petersen, you should. It's a wonderful source of Emacs tips. Having just finished the ebook on my Kindle, I was keen to go back and fish out some of that newly found wisdom. My immediate reaction was to figure out a way to make the ebook searchable from Emacs.

    The ebook is available in epub and pdf format. Though Emacs's docview is super handy for viewing pdf's, searching didn't feel as comfortable as searching in org mode. The epub, on the other hand, proved useful. Pandoc can easily convert from epub to org.

    pandoc  --from=epub --to=org mastering-emacs.epub > mastering-emacs.org
    

    After a some tidying (mostly removing BEGIN_HTML/END_HTML blocks and adding TITLE/AUTHOR), the resulting org file is surprisingly clean and easy to search/navigate. helm-swoop and helm-org-in-buffer-headings are great for that.

    ]]>
    Tue, 30 Jun 2015 00:00:00 GMT
    Portugal travel bookmarks https://xenodium.com/portugal-travel-bookmarks https://xenodium.com/portugal-travel-bookmarks
  • As a Dermatologist, what life changing skin care advice would you give me?.
  • Avenida dos Platanos.
  • Beautiful Lisbon.
  • Best restaurants in Alghero?.
  • Boca do inferno.
  • Cabo da Roca.
  • Casa dos passarinhos (Steak on hot stone, tuna steak with “mirandesa” sauce, monkfish masada).
  • Cascais - Guincho.
  • Cervejaria Ramiro (seafood restaurant in town).
  • Eduard 7th park.
  • Estoril.
  • Fox Trot (bar).
  • Hachijō-jima island.
  • Ilha da Culatra (good for families).
  • Ilha da Tavira (good for food @ Portas do Mar).
  • Ilha Deserta (seafood as Estaminé).
  • Jeronimos Monastery (Lisbon).
  • Lisbon Castle.
  • Mercado da Ribeira in Lisbon.
  • Mouro's castle (Sintra).
  • Mouro's castle.
  • Pasteis de Belem (Lisbon).
  • Pastelaria piriquita eat queijadas de sintra.
  • Pasteleria Piriquita (Sintra).
  • Pavilhao Chines (bar).
  • Pena's Pallace (must see if you go to sintra)
  • Pena's Pallace (Sintra).
  • Pensao do Amor (bar).
  • Portugal Archives - ET Food Voyage.
  • Praça do comercio.
  • Quinta da Regaleira
  • Quinta da Regaleira (Sintra).
  • Sintra village
  • Sintra.
  • Stop do bairro (tamboril rice, prawn curry, and seafood rice).
  • Surfcastle.
  • São Bento railway station.
  • Sé (Lisbon Cathedral).
  • The best beaches in Portugal's Algarve.
  • Torre Belem (Lisbon).
  • Web Summit Ladies Craft Night - Tote Bag Embroidery Workshop Tickets, Tue, Nov 6, 2018 at 7:00 PM (Eventbrite).
  • What tips would you give to a newbie who wants to travel like you? - Quora.
  • World's longest pedestrian suspension bridge.
  • ]]>
    Sun, 21 Jun 2015 00:00:00 GMT
    Bulgaria travel bookmarks https://xenodium.com/bulgaria-travel-bookmarks https://xenodium.com/bulgaria-travel-bookmarks
  • Devetashka Cave.
  • ]]>
    Sun, 21 Jun 2015 00:00:00 GMT
    Presenting bookmarks https://xenodium.com/presenting-bookmarks https://xenodium.com/presenting-bookmarks
  • How to give a presentation people will remember.
  • How to give a stellar presentation.
  • Speaker style bingo: 10 presentation anti-patterns.
  • ]]>
    Sun, 21 Jun 2015 00:00:00 GMT
    Bali travel bookmarks https://xenodium.com/bali-travel-bookmarks https://xenodium.com/bali-travel-bookmarks
  • Gili Islands travel (Nusa Tenggara, Indonesia - Lonely Planet).
  • Manta snorkeling Nusa Penida – When? Where? How much?.
  • Pura Lempuyang, Bali.
  • ]]>
    Sun, 21 Jun 2015 00:00:00 GMT
    WWDC app for OS X https://xenodium.com/wwdc-app-for-os-x https://xenodium.com/wwdc-app-for-os-x Guilherme Rambo created a great OS X OS X app for viewing WWDC content. Just installed it. Super handy. Thanks. Installing as simple as:

    $ brew cask install wwdc
    
    ]]>
    Wed, 17 Jun 2015 00:00:00 GMT
    Debugging Objective-C reference cycles https://xenodium.com/debugging-objective-c-reference-cycles https://xenodium.com/debugging-objective-c-reference-cycles Overriding retain/release/autorelease may be handy while debugging:

    - (instancetype)retain {
      NSLog(@"%p, retain\n", self);
      return [super retain];
    }
    
    - (oneway void)release {
      NSLog(@"%p, release\n", self);
      [super release];
    }
    
    - (instancetype)autorelease {
      NSLog(@"%p, autorelease\n", self);
      return [super autorelease];
    }
    
    ]]>
    Mon, 15 Jun 2015 00:00:00 GMT
    London grub https://xenodium.com/london-grub https://xenodium.com/london-grub Beyond the hype, buzz, and pricey gimmicks… Places to eat in London:

    • Antipode.
    • Arang.
    • Bone Daddies.
    • Gelupo.
    • Grind.
    • Holy Cow.
    • Kerbisher and Malt.
    • Kulu Kulu (South Ken).
    • Le Relais de Venise.
    • Lucky 7's.
    • Royal China.
    • Shree Krishna Vada Pav.
    • Sri Suwoon.
    • Tayyabs.
    • The Cow.
    • Tonkotsu.
    ]]>
    Sat, 13 Jun 2015 00:00:00 GMT
    My working playlist https://xenodium.com/my-working-playlist https://xenodium.com/my-working-playlist It's been a while since I spotted The Ultimate Music Collection for Getting Work Done. Since then, I've been on the lookout for music to work to. Some favorites:

    ]]>
    Mon, 08 Jun 2015 00:00:00 GMT
    Xcode bookmarks https://xenodium.com/xcode-bookmarks https://xenodium.com/xcode-bookmarks
  • A Better Way to Automatically Merge Changes in Your XCode Project Files.
  • Clean Code: A Handbook of Agile Software Craftsmanship (Book).
  • From Xcode to TestFlight using command line.
  • Fuzzy autocomplete for Xcode.
  • Multiplex (like Emacs multiple cursor but for Xcode).
  • Reverse-engineering Xcode with dtrace.
  • ]]>
    Tue, 02 Jun 2015 00:00:00 GMT
    Costa Rica travel bookmarks https://xenodium.com/costa-rica-travel-bookmarks https://xenodium.com/costa-rica-travel-bookmarks
  • Catarata del Toro.
  • What are the best travel hacks when traveling to Costa Rica? (Quora).
  • ]]>
    Tue, 02 Jun 2015 00:00:00 GMT
    Australia travel bookmarks https://xenodium.com/australia-travel-bookmarks https://xenodium.com/australia-travel-bookmarks
  • Australia's best food experiences: state by state.
  • Best Queensland island escapes for small budgets.
  • Des and Debi O’Tooles Honey.
  • Fish and chips at Bondi beach.
  • Tasmania: the isle that's wild at heart.
  • The Butler Potts Point (bar & restaurant).
  • Tree Top Walk (Walpole, Australia): Top Tips Before You Go - TripAdvisor.
  • ]]>
    Tue, 02 Jun 2015 00:00:00 GMT
    Samoa travel bookmarks https://xenodium.com/samoa-travel-bookmarks https://xenodium.com/samoa-travel-bookmarks
  • To Sua ocean trench.
  • ]]>
    Tue, 02 Jun 2015 00:00:00 GMT
    Norway travel bookmarks https://xenodium.com/norway-travel-bookmarks https://xenodium.com/norway-travel-bookmarks
  • Atlantic Road.
  • Bergen (check out colorful wooden houses).
  • Bergen railway (Bergen-Oslo): 300 miles of beautiful Norwegian scenery.
  • Lofoten Islands.
  • Norwegian Air (cheap flights between all the
  • Olden.
  • Reine.
  • Sakrisøy, Lofoten Islands.
  • Spitsbergen.
  • The Atlantic Road - Atlanterhavsveien / Atlanterhavsvegen.
  • ]]>
    Tue, 02 Jun 2015 00:00:00 GMT
    Los Angeles travel bookmarks https://xenodium.com/los-angeles-travel-bookmarks https://xenodium.com/los-angeles-travel-bookmarks
  • Beer Belly (Craft Beer + Crafty Food).
  • Blue Star Donuts (SF + LA).
  • ]]>
    Tue, 02 Jun 2015 00:00:00 GMT
    Mastering Emacs is out https://xenodium.com/mastering-emacs-is-out https://xenodium.com/mastering-emacs-is-out Emacs is amazingly alive. New packages are regularly listed on melpa and a new book just came out: Mastering Emacs by Mickey Petersen.

    ]]>
    Thu, 28 May 2015 00:00:00 GMT
    South Carolina travel bookmarks https://xenodium.com/south-carolina-travel-bookmarks https://xenodium.com/south-carolina-travel-bookmarks
  • Angel Oak tree.
  • ]]>
    Mon, 25 May 2015 00:00:00 GMT
    Colorado travel bookmarks https://xenodium.com/colorado-travel-bookmarks https://xenodium.com/colorado-travel-bookmarks
  • Horseshoe Bend.
  • ]]>
    Mon, 25 May 2015 00:00:00 GMT
    Cuzco travel bookmarks https://xenodium.com/cuzco-travel-bookmarks https://xenodium.com/cuzco-travel-bookmarks
  • Gelatina de patita (mercado)
  • Yolanda. Adobo/chicarron. Chicarroneria Yoli.
  • Pan de chocolate Oropeza.
  • La esquina de los lechones y tamales dulces de Sra Elsa.
  • Cafe el Ayllu (lengua de suegra)
  • La Chomba (picanteria). Costillar frito. Frutillada. Chicharron. Ubre. Tripa.
  • La quinta Eulaia. Asado y chicarron. Rocoto. Humita.
  • Chicheria la loba.
  • ]]>
    Mon, 25 May 2015 00:00:00 GMT
    Bash bookmarks https://xenodium.com/bash-bookmarks https://xenodium.com/bash-bookmarks
  • Bash conditional statement (Linux Hint).
  • Bash Echo Examples (Linux Hint).
  • Bash Error Handling (Linux Hint).
  • Bash for loop examples (Linux Hint).
  • Bash Reference Manual.
  • Common shell script mistakes (Hacker News).
  • Defensive bash programming.
  • HowTo: Use bash For Loop In One Line - nixCraft.
  • Rich’s sh (POSIX shell) tricks.
  • Safe ways to do things in bash.
  • shellcheck: ShellCheck, a static analysis tool for shell scripts.
  • String concatenation in bash (Linux Hint).
  • The Bash Academy.
  • ]]>
    Mon, 25 May 2015 00:00:00 GMT
    restclient.el https://xenodium.com/restclient.el https://xenodium.com/restclient.el Installed Pashky's restclient.el Emacs package. Super helpful when trying out REST APIs.

    ]]>
    Mon, 25 May 2015 00:00:00 GMT
    Seatle travel bookmarks https://xenodium.com/seatle-travel-bookmarks https://xenodium.com/seatle-travel-bookmarks
  • 14 free things to do in Seattle.
  • Indi chocolate.
  • Le Panier.
  • ]]>
    Mon, 25 May 2015 00:00:00 GMT
    Berlin travel bookmarks https://xenodium.com/berlin-travel-bookmarks https://xenodium.com/berlin-travel-bookmarks
  • 10 things to do in Berlin.
  • Berlin On A Budget: Our Slow Travel Guide.
  • Perfect day in Berlin.
  • The best of hidden Berlin.
  • ]]>
    Mon, 25 May 2015 00:00:00 GMT
    Skeuomorph https://xenodium.com/skeuomorph https://xenodium.com/skeuomorph From Wikipedia, skeuomorph ˈskjuːəmɔrf is a derivative object that retains ornamental design cues from structures that were necessary in the original. Examples include pottery embellished with imitation rivets reminiscent of similar pots made of metal and a software calendar that imitates the appearance of binding on a paper desk calendar.

    ]]>
    Mon, 25 May 2015 00:00:00 GMT
    define-word https://xenodium.com/define-word https://xenodium.com/define-word Installed Abo Abo's define-word Emacs package. A handy package to define words at point.

    ]]>
    Mon, 25 May 2015 00:00:00 GMT
    Flushing empty lines in Emacs https://xenodium.com/flushing-empty-lines-in-emacs https://xenodium.com/flushing-empty-lines-in-emacs Via masteringemacs.org, removing blank lines in a buffer:

    M-x flush-lines RET ^$ RET
    
    ]]>
    Fri, 22 May 2015 00:00:00 GMT
    Regex bookmarks https://xenodium.com/regex-bookmarks https://xenodium.com/regex-bookmarks
  • Emacs: Text Pattern Matching (regex) tutorial.
  • Regex Cheat Sheet (DEV Community).
  • Regex quick reference: From regexrenamer.
  • RegExr, see hacker news comments for other suggestions.
  • RegExr: A website for interactive regex prototyping with syntax highlighting.
  • ]]>
    Fri, 22 May 2015 00:00:00 GMT
    Write to temp iOS snippet https://xenodium.com/write-to-temp-ios-snippet https://xenodium.com/write-to-temp-ios-snippet NSString *tempDir = NSTemporaryDirectory(); NSLog(@"%@\n", tempDir); NSString *dataFilePath = [tempDir stringByAppendingPathComponent:@"my.file"]; [data writeToFile:dataFilePath atomically:YES]; ]]> Wed, 06 May 2015 00:00:00 GMT Greece travel bookmarks https://xenodium.com/greece-travel-bookmarks https://xenodium.com/greece-travel-bookmarks
  • Armenistis - Ikaria.
  • Hydra (island). No cars or motorcycles allowed.
  • Kathisma Beach - Lefkada.
  • Kefalonia Island.
  • Melissani Cave.
  • Momnevasia.
  • Navagio bay.
  • Papafragas beach.
  • Preveza at DuckDuckGo.
  • ]]>
    Mon, 04 May 2015 00:00:00 GMT
    Sri Lanka travel bookmarks https://xenodium.com/sri-lanka-travel-bookmarks https://xenodium.com/sri-lanka-travel-bookmarks
  • Ambuluwawa Temple.
  • Sri Lanka Travel Guide | Best Tips For Your Trip (Nomadic Matt).
  • The best train journeys in Sri Lanka.
  • The Safari Hotel (great area to go on safari, see leopards).
  • ]]>
    Mon, 04 May 2015 00:00:00 GMT
    Switzerland travel bookmarks https://xenodium.com/switzerland-travel-bookmarks https://xenodium.com/switzerland-travel-bookmarks
  • Bernina railway.
  • Lauterbrunnen village.
  • Lion Monument (Lucerne).
  • Lucerne lake/city.
  • Oeschinen Lake.
  • ]]>
    Mon, 04 May 2015 00:00:00 GMT
    Thailand travel bookmarks https://xenodium.com/thailand-travel-bookmarks https://xenodium.com/thailand-travel-bookmarks
  • Best Thai street food: Bangkok stall Raan Jay Fai awarded with Michelin star.
  • Buddha Statue in Forest Pak Chong.
  • Phanom Rung Historical Park.
  • Rama IX park, Bangkok.
  • Sanctuary of Truth.
  • What makes Bangkok so popular? (Quora).
  • ]]>
    Mon, 04 May 2015 00:00:00 GMT
    Madagascar travel bookmarks https://xenodium.com/madagascar-travel-bookmarks https://xenodium.com/madagascar-travel-bookmarks
  • Avenue of the Baobabs.
  • ]]>
    Mon, 04 May 2015 00:00:00 GMT
    Hong Kong travel bookmarks https://xenodium.com/hong-kong-travel-bookmarks https://xenodium.com/hong-kong-travel-bookmarks
  • Causeway Bay pedestrian crossing.
  • Hong Kong's most breathtaking views: where to glimpse the city from above.
  • Hotel Icon (allegedly amazing service/extras).
  • Lin Heung Tea House (bakery/tea/dim sum).
  • Mak's Noodle (Jordan).
  • Siu yuk (Roasted Pig).
  • Tsang Tsou Choi (King of Hong Kong).
  • Tsim Chai Kee (recommended over Mak's wonton/soup).
  • ]]>
    Mon, 04 May 2015 00:00:00 GMT
    Barcelona travel bookmarks https://xenodium.com/barcelona-travel-bookmarks https://xenodium.com/barcelona-travel-bookmarks
  • 18 free things to do in Barcelona.
  • Dessert place you can recommend in Barcelona? (Twitter).
  • La Pedrera.
  • ]]>
    Mon, 04 May 2015 00:00:00 GMT
    Iceland travel bookmarks https://xenodium.com/iceland-travel-bookmarks https://xenodium.com/iceland-travel-bookmarks
  • An Iceland travel log.
  • Apartmenthouse.is for local flats.
  • Blue lagoon spa.
  • citywalk.is: Free walking tour.
  • Design March.
  • Drive it yourself: The Snæfellsnes peninsula.
  • Efstidalur: farm to table restaurant.
  • Eight must-see spots in Iceland's wild west.
  • Fridrikv restaurant.
  • Gangleri outfitters.
  • Golden circle's waterfalls and geysers.
  • grillmarkadurinn.is restaurant.
  • Horse farm hotel.
  • Hotel Budir.
  • How to have a budget break in iceland.
  • Iceland itinerary.
  • Lebowski Bar seriously?
  • Noodle Station.
  • Pink Iceland tours.
  • Reykjavik Apartment Hotel – Accommodation in City Centre (swanhouse.is).
  • Reykjavik City Breaks (Book now with British Airways).
  • Sandholt.
  • South coast's waterfalls and caves.
  • ]]>
    Mon, 04 May 2015 00:00:00 GMT
    Building clang-format https://xenodium.com/building-clang-format https://xenodium.com/building-clang-format Based on instructions from Building clang-format and friends on OSX Mountain Lion.

    #!/bin/bash
      set -o nounset
      set -o errexit
    
      # Based on instructions from:
      # http://blog.hardcodes.de/articles/63/building-clang-format-and-friends-on-osx-mountain-lion
    
      readonly LLVM_DIR_PATH='/tmp/llvm'
    
      update_repo() {
        if [[ ! -d $1 ]]; then
          git clone $2
        else
          cd $1
          git pull
          cd ..
        fi
        cd ..
      }
    
      update_all_repos() {
        update_repo "llvm" "http://llvm.org/git/llvm.git"
        pushd "${LLVM_DIR_PATH}/llvm/tools"
        update_repo "clang" "http://llvm.org/git/clang.git"
        popd
        cd "../../${LLVM_DIR_PATH}/llvm/tools/clang/tools"
        update_repo "clang-tools-extra" "http://llvm.org/git/clang-tools-extra.git"
        cd "../../.."
      }
    
      build_clang() {
        mkdir -p clang
        mkdir -p build
        cd clang
        ../llvm/configure --enable-libcpp --enable-cxx11 --enable-debug-symbols=no --enable-optimized --prefix="${LLVM_DIR_PATH}/build"
        make install
      }
    
      mkdir -p $LLVM_DIR_PATH
      cd ${LLVM_DIR_PATH}
      update_all_repos
      build_clang
    

    Bonus: use clang-format-configurator.

    ]]>
    Thu, 30 Apr 2015 00:00:00 GMT
    Programmatic iOS Auto Layout https://xenodium.com/programmatic-ios-auto-layout https://xenodium.com/programmatic-ios-auto-layout Basic iOS auto layout usage. See Adopting Auto Layout and Visual Format language for reference.

    - (instancetype)initWithFrame:(CGRect)frame {
      self = [super initWithFrame:frame];
      if (self) {
        // Disable autoresizing mask translation for parent.
        self.translatesAutoresizingMaskIntoConstraints = NO;
    
        _subview1 = [[UIView alloc] init];
        // Disable autoresizing mask translation for subview.
        _subview1.translatesAutoresizingMaskIntoConstraints = NO;
    
        _subview1.backgroundColor = [UIColor redColor];
        [self addSubview:_subview1];
    
        // Creates a dictionary of bindings to be used in visual format.
        NSDictionary *viewBindings = NSDictionaryOfVariableBindings(_subview1);
    
        // H: horizontal layout
        // |-50- spacing in relation to superview
        // [_subview1(==50)] subview1's width
        [self addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"H:|-50-[_subview1(==50)]"
                                                                     options:0
                                                                     metrics:nil
                                                                       views:viewBindings]];
        [self addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"V:[_subview1(==50)]"
                                                                     options:0
                                                                     metrics:nil
                                                                       views:viewBindings]];
      }
      return self;
    }
    

    Also consider:

    • A UIView Subclass should implement intrinsicContentSize.
    • A UIView Subclass should never add constraints on neither itself (ie. self) nor superview.

    References

    ]]>
    Thu, 30 Apr 2015 00:00:00 GMT
    Learning Japanese bookmarks https://xenodium.com/learning-japanese-bookmarks https://xenodium.com/learning-japanese-bookmarks
  • Beginners Japanese - International House London.
  • Hiragana stroke table.
  • I discovered a website that has a list of the most common 6000.
  • Japanese Beginners Course | SOAS.
  • Japanese Guide - TheMoeWay.
  • Japanese Resources - Google Docs.
  • Junji Ito's Cat Diary: Yon & Mu (reading).
  • Kansai-ben: Kansai Dialect Self-study Site.
  • Learn Hiragana: Tofugu's Ultimate Guide.
  • Sites to practice Japanese reading? .
  • The Japan Foundation, London - Language Centre - Japanese Language Courses.
  • The shortest guide to learning Japanese.
  • Tofugu’s Learn Kana Quiz.
  • ]]>
    Thu, 23 Apr 2015 00:00:00 GMT
    Japan travel bookmarks https://xenodium.com/japan-travel-bookmarks https://xenodium.com/japan-travel-bookmarks
  • 21 Awesome Things to Do in Yokohama, Japan (2020 Guide).
  • 21 free things to do in Tokyo.
  • 6 Tokyo Travel Tips to Help You Get Around the City | Tokyo Weekender.
  • 7 day Japan Rail pass (first class?), possibly only sold outside Japan.
  • 80/20 Japanese by Richard Webb - Publishizer.
  • A Guide to the regional ramen of Japan.
  • A guide to understanding "Small Seasons".
  • A Moss Girl’s Guide to Japanese Moss Viewing.
  • A no-sushi guide to food in Japan.
  • A trip to Japan (Quora answer).
  • An unsponsored review of the Tawaraya Ryokan in Kyoto, Japan.
  • Arashiyama Bamboo Grove.
  • Autumn Leaves in Hokkaido.
  • BBC - Travel - Japan’s special take on a packed lunch.
  • Bushido: Way of Total Bullshit.
  • COOL JAPAN(?)" - What are things about Japan that you think are actually cool?.
  • Drinking Japan.
  • Eki-stamps / 駅スタンプ | eli's japan blog.
  • Five Best: Japanese Ryokan.
  • Fuji Q Highland (rollercoaster theme park). Check out haunted hospital.
  • Furano, Hokaido.
  • Going to Kyushu, Japan? Why Visiting Yakushima is Worth it - The Ruby Ronin.
  • Guest houses: Kazariya, Rakuza, Musubian.
  • Hiiragiya ryokan.
  • Himeji Castle.
  • Hiroshima oysters (try the one with cheese).
  • Historic Villages of Shirakawa-gō and Gokayama - Wikipedia.
  • Hokkaido summer flowers.
  • Hypermedia (internal travel website).
  • jalan.net (travel booking site).
  • Japan guide.
  • Japan Info.
  • Japan is launching a program that will give away abandoned homes - INSIDER.
  • Japan Rail Pass.
  • Japan Study Program.
  • JAPAN TRAVEL DATA 15DAYS, 3.5GB on 4G/LTE- NANO SIM.
  • Japan's glut of abandoned homes: Hard to sell but bargains when opportunity knocks (The Japan Times).
  • Japanese beaches.
  • Japanese Foods Encounter Like No Others (food search).
  • Japanese rule of 7.
  • Japan’s 72 Microseasons.
  • Kawachi Fujien 河内藤園 (Kawachi Wisteria Garden).
  • Kodo – Preparing the Censor.
  • Kongō Sanmai-in at Kōya-san.
  • Koya Bound – Eight Days on the Kumano Kodo | Hacker News.
  • Koyasan (needs booking).
  • Landed Japan Book (local knowledge to buy Japanese real estate).
  • Lots of goodies. Bamboo forest, oh my.
  • Michael’s Cafe American – Black Ship Coffee.
  • Miyajima: One of the top three scenic spots in Japan.
  • Monument in front of the Shin-Yatsushiro Station.
  • Nagakushiyama park.
  • Nagoya.
  • Natadera Temple in winter.
  • Niseko Ski Resort.
  • Okinawa: secrets for a long and happy life.
  • Okonomimura (all okonomiyaki restaurants).
  • Onsen.
  • Quora: What are some of Japans best kept secrets?
  • Saitamaya: The Master of Grilled Meat - YouTube.
  • Satsuma Rebellion: Satsuma Clan Samurai Against the Imperial Japanese Army.
  • Shitamachi #Museum in Ueno and catch a glimpse into old-fashioned living.
  • Siege of Kumamoto Castle (Wikipedia).
  • Snapshots of Tokyo’s vivid street life (Hacker News).
  • Table of Content for japan2013.
  • Table of Content for japan2014.
  • Table of Content for japan2015.
  • TAKAZAWA Candle (or look for ikaragata shape candle).
  • The 2020 Hachinohe Enburi Festival Schedule (Sakura festival).
  • The village of living water.
  • Things to look out for in Japan (Quora).
  • Tohoku Travel Guide.
  • Try out sukiyaki.
  • Uncharted Tokyo.
  • Vitra | The Hill of the Buddha.
  • Zao Fox Village.
  • 国指定重要文化財「野村別邸 碧雲荘」.
  • Neighbourhoods
    • Mishuku
    • Sancha neighborhood. Lots of places to eat.
    • Sangenjaya
    • Soba Noodle Kochi
    • Seiki (Japanese dishes)
    • Sent from my iPhone
    • Sakae street
    • Tokoshima (wine and yakitori)
  • ]]>
    Thu, 23 Apr 2015 00:00:00 GMT
    Kyoto travel bookmarks https://xenodium.com/kyoto-travel-bookmarks https://xenodium.com/kyoto-travel-bookmarks
  • Eating My Way Through Nishiki Market, Kyoto | Ever In Transit.
  • Fushimi Inari Temple: 4KM mountain trail lined with bright orange shinto gates.
  • Golden Pavillion (macha and biscuits at tea house).
  • Hakone (day trip for hot baths), see Yuryo spa. Also the pirate boat.
  • Kibune.
  • Kinkakuji Temple.
  • Kiyomizu Temple.
  • Kuramadera Temple & Kibune Shrine: More peaceful shrine.
  • Kyoto itineraries.
  • Kyoto travel tips (doc).
  • Kyoto walking maps.
  • Kyoto's train station itself.
  • Nijo-Jo’.
  • Nishiki Market: Awesome market. Some say better than Tsukiji.
  • Origami master and school http://www.orizurusalon-yume.com [email protected]
  • orizurusalon yume (origami).
  • Ryokan ("kaiseki" meals).
  • Ryōan-ji (竜安寺).
  • Sanjusangendo.
  • Things to do in Kyoto, Japan.
  • Walking courses (Google maps).
  • WaRaiDo Nighttime tour.
  • ]]>
    Wed, 21 Oct 2015 00:00:00 GMT
    Tokyo travel bookmarks https://xenodium.com/tokyo-travel-bookmarks https://xenodium.com/tokyo-travel-bookmarks
  • 14 Things to Know Before You Go to Tokyo.
  • 5 alternative things to do in Tokyo (by globalhelpswap).
  • A History of Tokyo in 8 Dishes.
  • Akasaka area (N/E of Roppongi).
  • Akasaka Sagamiya (also Mamekan, established in 1895).
  • Akihabara: Electronics district, arcades and comic stores.
  • Asakusa (tourist spot). Kaminarimon, Nakamise (oldest shopping street in Japan). Sensoji Temple.
  • Asakusa hotel.
  • Asakusa Shrine: Shinto shrine and market.
  • Bar Epilogue.
  • Bar Odin.
  • Benten, Taito - 3-21-8 Asakusa, Ueno, Asakusa (Buckwheat noodles shop).
  • Bentomi (Sushi).
  • CHEESE STAND (チーズスタンド).
  • Coffee Tengoku, Asakusa (best hotcakes/pancakes). Noting is premade. After 12 years, best hotcakes.
  • Cup noodle museum.
  • Daiwasushi (food). An account here.
  • Dorayaki (in Ukenbukuru). Seijuken is long established in Ningyocho.
  • Doteno-Iseya 土手の伊勢屋: 127-year old Tempura.
  • Eateries around Takadanobaba eki
  • Ebisu (area for izakaya experience, drink/chat with bartender). Look for Ebisu Yokocho.
  • Fish market (6am sushi).
  • Five of the worst areas to live in and around Tokyo | SoraNews24.
  • Fu-unji & 風雲児 | Tokyo Eats.
  • Ghibli museum (book in advance or try lawson).
  • Ginza Kimuraya (bakery). Try anpan (invented here).
  • Ginza.
  • Ginzakyuubee (food).
  • Golden Gai (lots tiny bars).
  • How to Spend a Magical Christmas in Tokyo (2019 update).
  • https://www.timeout.com/tokyo/restaurants/tokyo-coolest-kakigori
  • Ichiran Ramen.
  • Imperial Palace: Book to go inside. Beautiful park, great for pictures.
  • In which ward are you living?.
  • Irie known (sweet shop) for Mamekan. In Monzen-Nakacho.
  • Isetan (upscale food market).
  • Isozushi (food).
  • Jimbocho Book Town (largest second-hand book town in the world, classic-style cafes, old school charm).
  • Kaiden-don, near tsukiji (Sushi).
  • Kajitsuen Libre. Peach Parfait. Fresh fruit.
  • Kinozen restaurant for Matcha Bavarian cream (matcha bavaroa). Kagurazaka. Check out the backstreets.
  • Kodai's Fukui restaurant (old tea house).
  • Kushikatsu restaurant in Golden Gai, a karaoke booth in Ebisu, or drifting through the back alley izakayas of Akabane.
  • Menya Musashi and Fuunji are both generally very well regarded and about a 5-7 minute walk from the SW part of Shinjuku station.
  • Mikimoto building in Ginza.
  • Mori Art museum.
  • Musashiya ramen.
  • Nakiryu: Tantalizing Tantanmen Noodles with a Michelin Star.
  • Nezu museum.
  • Odaiba.
  • Okonomiyaki in Tokyo.
  • Omoide yokocho: Alleyway next to Shinjuku station. Lots of yakitori restaurants.
  • Omotesando Koffee (coffee and baked custard slice).
  • Omotesando side streets.
  • Pan No Tora Bakery (Kyoto?).
  • Pignon | French Restaurant.
  • Pound cake from Patisserie Gondola in Kudanue.
  • Roppongi.
  • Savarin (brioge-based, of french origin) in Yokohama. Cafe Recherche.
  • Seafood street south of Ueno eki
  • Secret snapshots of Tokyo vivid street life.
  • Shibamata: Snacking and Sightseeing in Tokyo’s Old Edo Neighborhood.
  • Shibuya Crossing: Largest pedestrian crossing in the world.
  • Shimokitazawa (Shimokita for short). Bohemian, vintage shopping.
  • Shimokitazawa (thirft stores, music bands, pubs, and cafes).
  • Short trips from Tokyo.
  • Short trips from Tokyo.
  • Sukiyabashi Jiro.
  • Sushi dai (Sushi, long queue, maybe turisty).
  • Sushi Kanesaka.
  • Sushi places around Tsukiji market in the morning (much better than the market visit itself, these days)
  • Sushi Saito.
  • Sushidai (food).
  • Sushitsu (food).
  • Sutekihausukatsura.
  • Takaosan (Mount Takao).
  • Tempura Tsunahachi en Tokio: 4 opiniones y 7 fotos.
  • Tenkazushi (food).
  • The whole of Kabukicho (area in-between Shinjuku station and Shin-Okubo)
  • Things to Do in Tokyo Japan - Sunday Spotlight.
  • Tokyo Gov on Twitter: Higashikurume Station.
  • Tokyo in winter: what to see, do and eat (Lonely Planet).
  • Tokyo Municipal Government building: Only for observation deck with view to Fuji (if clear day).
  • Tokyo on a budget: tips for making your yen go further (Lonely Planet).
  • Tokyo play blog.
  • Tokyo Salaries: all you need to know.
  • Tokyo station: Friendly JR office (english spoken). They help book all trips/tickets/reservations.
  • Tokyo Station: Massive station. Lots of restaurants and shops (check out ramen street).
  • Tokyo Travel Tips: 5 Things You Need In Japan | Coffee and Passport.
  • Tokyo Twitter: any Japanese breakfast restaurants.
  • Tokyo, Japan - Condé Nast Traveller | CN Traveller.
  • TokyoCheapo.
  • Tokyo’s oldest train line – in pictures | Art and design | The Guardian.
  • Tokyu Hands and Loft (shops in Shibuya).
  • Toritake (yakitori at Shibuya).
  • Try Mos rice burger (fast food).
  • Try out Pancan (bread in can).
  • Tsukiji Fish Market calendar.
  • Tsukiji Fish Market: Sushi bars and food vendors (get there early, visitor numbers restricted).
  • Umemura in Asakusa (also Mamekan).
  • Unusual things to do in Tokyo? .
  • Walk around Yoyogi-Uehara Station, Shibuya, Binaural City Sounds(ASMR) in Tok….
  • What's something you know about in Tokyo that you think others should know about?.
  • Yurakucho Yakitori Alley
  • Zauo.com "Let's fixhing enjoy". Catch your own fish to eat.
  • 婁熊東京 (raw and grilled pork).
  • 酒友 (Sake & good Shabushabu), Roppongi.
  • ]]>
    Sun, 19 Apr 2015 00:00:00 GMT
    UK travel bookmarks https://xenodium.com/uk-travel-bookmarks https://xenodium.com/uk-travel-bookmarks
  • 25 stunning british places you can reach from London.
  • A graveyard of red telephone boxes located in the small village of Carlton Miniott.
  • Dunmore Pinapple.
  • Hitchin Lavender.
  • In search of Scotland’s best beach.
  • Isle of Man.
  • Sandwood Bay.
  • Sark island.
  • Scotland’s new North Coast 500 route.
  • The 8 most dramatic hikes in England.
  • The New Forest.
  • Where to Find Street Art in Liverpool.
  • X-Pilot (Redsand towers).
  • ]]>
    Sun, 19 Apr 2015 00:00:00 GMT
    Development quotes https://xenodium.com/development-quotes https://xenodium.com/development-quotes
  • If your backlog is exploding the problem is not that your developers are slow, but that your business model is not based on reality.
  • If you lose out on object allocation, you still win by avoiding expensive re-renders and re-calculations.
  • Duplication is far cheaper than the wrong abstraction (prefer duplication up to a point).
  • Choosing an appropriate design to duplication avoid might benefit from more examples to see patterns in. Attempting premature refactoring risks selecting a wrong abstraction.
  • Patterns failed, why we should case.
  • ]]>
    Sun, 19 Apr 2015 00:00:00 GMT
    Development philosophy https://xenodium.com/development-philosophy https://xenodium.com/development-philosophy
  • Boyscout rule: Leave campground cleaner than found.
  • What can clang-format teach us about the human condition?.
  • ]]>
    Sun, 19 Apr 2015 00:00:00 GMT
    Spain travel bookmarks https://xenodium.com/spain-travel-bookmarks https://xenodium.com/spain-travel-bookmarks
  • 7 CAFETERIAS BONITAS, ORIGINALES y CON ENCANTO en MADRID.
  • BOMBONERIA SANTA, Madrid - Barrio de Salamanca.
  • Cine Doré Filmoteca Española | Cinemas in Lavapiés, Madrid.
  • Espacio Fundación Telefónica | Art in Malasaña, Madrid.
  • Fundación Masaveu | Art in Madrid, Madrid.
  • JUANCHI'S BURGERS.
  • La Duquesita. Pastelería - Bombonería - Confitería repostería desde 1914.
  • La Palma, most north-westerly of the Canary Islands.
  • La Perejila - Madrid - Bar de tapas y restaurante, Restaurante español.
  • Lanzarote's green lagoon.
  • Madri: onde comer | Restaurantes e bares de tapas recomendados.
  • Madricioso.
  • Matadero Madrid | Art in Legazpi, Madrid.
  • Matadero Madrid. Centro de creación contemporánea.
  • Mercado de San Fernando | Shopping in Lavapiés, Madrid.
  • Mercado de Vallehermoso | Things to do in Chamberí, Madrid.
  • Rock carved hermitage of Saints Justus and Pastor, Olleros de Pisuerga.
  • triciclo - grupotriciclo.
  • ]]>
    Sun, 19 Apr 2015 00:00:00 GMT
    Meet up bookmarks https://xenodium.com/meet-up-bookmarks https://xenodium.com/meet-up-bookmarks
  • Couchsurfing.org.
  • Meetup.
  • Tea with strangers.
  • ]]>
    Sun, 19 Apr 2015 00:00:00 GMT
    Plantuml example https://xenodium.com/plantuml-example https://xenodium.com/plantuml-example Played with Plantuml. Convenient for generating UML diagrams from text. Here's the Language Reference Guide. Here's an example:

    @startuml
      abstract class Singer {
        abstract void sing()
        void Dance()
      }
    
      skinparam monochrome true
      Singer <|-- PopSinger
      Singer <|-- SalsaSinger
    
      class PopSinger {
        void sing()
      }
    
      class SalsaSinger {
        void sing()
      }
    
    @enduml
    

    Install plantuml on Mac OS X:

    brew install plantum
    

    Generating diagram:

    $GRAPHVIZ_DOT=~/homebrew/bin/dot java -jar path/to/plantuml.8018.jar diagram.plantuml
    

    ps. Installation and verification gist.

    ps2. More handy UML examples in this fork.

    ]]>
    Fri, 17 Apr 2015 00:00:00 GMT
    Helm-describe-helm-attribute https://xenodium.com/helm-describe-helm-attribute https://xenodium.com/helm-describe-helm-attribute Writing A Spotify Client in 16 Minutes is fantastic for picking up helm and Emacs lisp tips. Of interest helm-describe-helm-attribute, second to the awesomeness of helm-spotify integration.

    <iframe width='420'
            height='315'
            src='https://www.youtube.com/embed/XjKtkEMUYGc'
            frameborder='0'
            allowfullscreen>
    </iframe>
    
    ]]>
    Tue, 14 Apr 2015 00:00:00 GMT
    Youtube videos in your org html export https://xenodium.com/youtube-videos-in-your-org-html-export https://xenodium.com/youtube-videos-in-your-org-html-export Sacha Chua and John Wiegley posted a wonderful video on Emacs lisp development tips. Embedding the following raw HTML using #+BEGIN_HTML/#+END_HTML:

    <iframe width="420"
            height="315"
            src="https://www.youtube.com/embed/QRBcm6jFJ3Q"
            frameborder="0"
            allowfullscreen>
    </iframe>
    

    results in an embedded video when exporting your org file:

    <iframe width="420"
            height="315"
            src="https://www.youtube.com/embed/QRBcm6jFJ3Q"
            frameborder="0"
            allowfullscreen>
    </iframe>
    
    ]]>
    Sun, 12 Apr 2015 00:00:00 GMT
    .net bookmarks https://xenodium.com/dot-net-bookmarks https://xenodium.com/dot-net-bookmarks
  • Open Source .Net libraries that make your life easier.
  • ]]>
    Sun, 12 Apr 2015 00:00:00 GMT
    UK property bookmarks https://xenodium.com/uk-property-bookmarks https://xenodium.com/uk-property-bookmarks
  • Commute from (find property based on potential commute).
  • Mapumental Property (find property by travel time).
  • ]]>
    Fri, 10 Apr 2015 00:00:00 GMT
    Git commit message style https://xenodium.com/git-commit-message-style https://xenodium.com/git-commit-message-style Adopted Tim Pope's Git commit message style. Also enabled Emacs's git-commit-training-wheels-mode:

    (use-package git-commit-training-wheels-mode :ensure t
      :commands (git-commit-training-wheels-mode))
    
    (use-package git-commit-mode :ensure t
      :config
      (add-hook 'git-commit-mode-hook 'git-commit-training-wheels-mode)
      :commands (git-commit-mode))
    

    Another great post by Chris Beams.

    ]]>
    Thu, 09 Apr 2015 00:00:00 GMT
    fci-mode and org-html-export-to-html bug https://xenodium.com/fci-mode-and-org-html-export-to-html-bug https://xenodium.com/fci-mode-and-org-html-export-to-html-bug Having enabled fci-mode in most programing modes, org-html-export-to-html now exports an additional unicode character in source blocks. This thread has a workaround:

    (defun org-html-fontify-code (code lang)
      ;; ...
      (funcall lang-mode)
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
      (when (require 'fill-column-indicator nil 'noerror)
        (fci-mode -1))
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
      (insert code)
      ;; ...
    
    ]]>
    Mon, 06 Apr 2015 00:00:00 GMT
    Try cocoapods out https://xenodium.com/try-cocoapods-out https://xenodium.com/try-cocoapods-out Cocapods try:

    $ pod try POD_NAME
    
    ]]>
    Fri, 03 Apr 2015 00:00:00 GMT
    Cornwall travel bookmarks https://xenodium.com/cornwall-travel-bookmarks https://xenodium.com/cornwall-travel-bookmarks
  • Food along the way.
  • ]]>
    Fri, 03 Apr 2015 00:00:00 GMT
    Austria travel bookmarks https://xenodium.com/austria-travel-bookmarks https://xenodium.com/austria-travel-bookmarks
  • Coffee houses in Vienna.
  • Melk Abbey library.
  • ]]>
    Fri, 03 Apr 2015 00:00:00 GMT
    Cinnamon desktop run dialog https://xenodium.com/cinnamon-desktop-run-dialog https://xenodium.com/cinnamon-desktop-run-dialog Note to self. Open with Alt-f2.

    ]]>
    Thu, 02 Apr 2015 00:00:00 GMT
    Books for 2015 https://xenodium.com/books-for-2015 https://xenodium.com/books-for-2015
  • Catch 22.
  • The Circle.
  • Born to Run.
  • Thinking, Fast and Slow.
  • ]]>
    Sun, 29 Mar 2015 00:00:00 GMT
    Ayahuasca bookmarks https://xenodium.com/ayahuasca-bookmarks https://xenodium.com/ayahuasca-bookmarks
  • Ayaadvisor.
  • Ayahuasca fatalities.
  • Ayahuasca on erowid.
  • Jennifer Logan's death in Peru.
  • The hacker who drank Ayahuasca.
  • ]]>
    Sun, 29 Mar 2015 00:00:00 GMT
    Emacs init.el bookmarks https://xenodium.com/emacs-init.el-bookmarks https://xenodium.com/emacs-init.el-bookmarks
  • Adam Schwartz's init.
  • Andrew Gwozdziewycz's init.el.
  • Andrew Kensler's init.el.
  • Andrew's .emacs.
  • Anler Hernandez's literate config.
  • Chen Bin's init.el.
  • Clinton Ryan's init (JS config).
  • daviderestivo/emacs-config (clean/macOS).
  • dotfiles/config.org at master · iocanel/dotfiles · GitHub (mu4e config).
  • EmacsWiki: Starter Kits.
  • Eric James Michael Ritz.
  • GitHub - alhassy/emacs.d: My Emacs configuration, literately.
  • GitHub - FIXME rememberYou/.emacs.d: Personal GNU Emacs configuration.
  • GitHub - Fuco1/.emacs.d: My emacs config.
  • GitHub - MatthewZMD/.emacs.d: M-EMACS, a full-feature GNU Emacs configuration.
  • GitHub - zamansky/emacs.dz: Awesome emacs config files.
  • GitHub - zoliky/dotemacs: My GNU Emacs configuration (super clean).
  • Grant Rettke's literate config.
  • Hardcore Freestyle Emacs.
  • Huseyin Yilmaz.
  • ianpan870102/.personal-emacs.d.
  • Ivan Malison's Emacs init.
  • Ivan Malison's init.el.
  • John's Emacs Config (mu4e and ledger usage).
  • Justin Abrahms: My Emacs Configuration.
  • Ladicle's Emacs Configuration.
  • M-EMACS's lsp config.
  • Mark Sparks's init.el.
  • Marten Lienen's init.el.
  • Mathew Lee Hinman's Emacs settings file.
  • Mathieu Marques's wonderful literary config (uses tern for Javascript).
  • Rinat Abdullin's literary config.
  • Temacco's init.
  • Temacco's Plutonium empowered emacs.
  • Wasamama's extensive init TODO .
  • zzamboni.org | My Emacs Configuration, With Commentary.
  • Étienne Deparis's Emacs Main Initialization File.
  • ]]>
    Sat, 28 Mar 2015 00:00:00 GMT
    CSS vertical align using flex https://xenodium.com/css-vertical-align-using-flex https://xenodium.com/css-vertical-align-using-flex Codepen snippet:

    div{
      height: 200px;
      background: #ccc;
      display: flex;
      justify-content: center;
      align-items: center;
    }
    
    p{
      margin: auto
    }
    
    ]]>
    Sat, 28 Mar 2015 00:00:00 GMT
    London diving schools https://xenodium.com/london-diving-schools https://xenodium.com/london-diving-schools
  • London Diving School. Not heard good comments.
  • Dive Wimbledon. Heard ok comments.
  • Clidive is a BSAC club (amateur organisation). Not commercial but may take longer.
  • Sublime Diving. Heard good comments.
  • Oyster Diving. Pool in cetral London. Good comments.
  • SS Thistlegorm mentioned as a memorable site.
  • Many suggest to get certified elsewhere. Perhaps Egypt via Poseidon Divers.
  • ]]>
    Thu, 26 Mar 2015 00:00:00 GMT
    Helm buffer URLs https://xenodium.com/helm-buffer-urls https://xenodium.com/helm-buffer-urls Venturing into Emacs lisp and Helm. Here's a go at listing all URLs in current buffer.

    (require 'goto-addr)
    
    (defun ar/helm-buffer-url-candidates ()
      "Generate helm candidates for all URLs in buffer."
      (save-excursion
        (goto-char (point-min))
        (let ((helm-candidates '())
              (url))
          (while (re-search-forward goto-address-url-regexp
                                    nil t)
            (setq url
                  (buffer-substring-no-properties (match-beginning 0)
                                                  (match-end 0)))
            (add-to-list 'helm-candidates
                         (cons url
                               url)))
          helm-candidates)))
    
    (defun ar/helm-buffer-urls ()
      "Narrow down and open a URL in buffer."
      (interactive)
      (helm :sources `(((name . "Buffer URLs")
                        (candidates . ,(ar/helm-buffer-url-candidates))
                        (action . (lambda (url)
                                    (browse-url url)))))))
    
    ]]>
    Thu, 26 Mar 2015 00:00:00 GMT
    Doh! undo last git commit https://xenodium.com/doh-undo-last-git-commit https://xenodium.com/doh-undo-last-git-commit $ git reset --soft HEAD~1 ]]> Mon, 23 Mar 2015 00:00:00 GMT Resetting variables using defvar https://xenodium.com/resetting-variables-using-defvar https://xenodium.com/resetting-variables-using-defvar Want to re-evaluate defvars and modify variables? eval-defun (bound to C-M-x) can help. From the manual:

    If the current defun is actually a call to `defvar', then reset the variable using its initial value expression even if the variable already has some other value. (Normally `defvar' does not change the variable's value if it already has a value.) Treat `defcustom' similarly.

    ]]>
    Sun, 22 Mar 2015 00:00:00 GMT
    Broken Xcode plugins? https://xenodium.com/broken-xcode-plugins https://xenodium.com/broken-xcode-plugins Some Xcode plugins stopped loading after updating Xcode. Ensure the latest DVTPlugInCompatibilityUUIDs is added to the plugin's Info.plist. Get from:

    $ defaults read \
        /Applications/Xcode.app/Contents/Info DVTPlugInCompatibilityUUID
    

    Additional suggestions as Stack Overflow.

    ]]>
    Sun, 22 Mar 2015 00:00:00 GMT
    Born to Run references https://xenodium.com/born-to-run-references https://xenodium.com/born-to-run-references References from reading Christopher McDougall's Born to Run:

    Recipe by Megan Mignot, based on book references:

    Mama Tita’s Pancakes

    • 1 ½ cups cooked brown rice
    • 1 cup coconut milk
    • 2 ripe bananas
    • 1 tablespoon honey
    • ½ cup white cornmeal
    • 2 teaspoons baking powder
    ]]>
    Sun, 22 Mar 2015 00:00:00 GMT
    Org tips from 2015-03-18 Emacs hangout https://xenodium.com/org-tips-from-2015-03-18-emacs-hangout https://xenodium.com/org-tips-from-2015-03-18-emacs-hangout Lots of great tips in Emacs Hangout 2015-03-18. Favorites:

    • Private org drawer to prevent export:
    :PRIVATE:
    My super duper secret text I don't want to export.
    :END:
    
    • C-c C-p/C-c C-n Jump over sections.
    • (setq org-hide-leading-stars t).
    • (org-bullets-mode).
    • (org-refile).
    • C-u (org-refile) jumps, no refile.
    • (helm-org-in-buffer-headings).
    ]]>
    Thu, 19 Mar 2015 00:00:00 GMT
    Food bookmarks https://xenodium.com/food-bookmarks https://xenodium.com/food-bookmarks
  • Cher's hot sauce collection.
  • Scott Martin's hot sauce collection.
  • Summer tomato.
  • Tarladalal recipes.
  • ]]>
    Thu, 19 Mar 2015 00:00:00 GMT
    Ethiopia travel bookmarks https://xenodium.com/ethiopia-travel-bookmarks https://xenodium.com/ethiopia-travel-bookmarks
  • Bet Giyorgis Church.
  • ]]>
    Thu, 19 Mar 2015 00:00:00 GMT
    China travel bookmarks https://xenodium.com/china-travel-bookmarks https://xenodium.com/china-travel-bookmarks
  • "If you have not been to Kashgar, then you haven’t really been to Xinjiang”.
  • 7 first-timer fails to avoid on your trip to Beijing.
  • Archpng on Twitter: "Mount Maiji Grottoes,China… ".
  • Beijing on a budget.
  • Chinese cities you've never heard of.
  • Ctrip for hotels. Stick to high-rated only.
  • Essential regional cuisine of China.
  • Fenghuang ancient town.
  • Hallelujah Mountains.
  • Houhai Lake (Beijing). Miscellaneous bars.
  • Jiuzhaigou nature reserve.
  • Luotuofeng peak, Sichuan.
  • Mount Huashan.
  • Mount Maiji Grottoes (DuckDuckGo).
  • Nan Luo Gu Xiang (Beijing). Street Food!
  • Qianmen Street. Near Tiananmen Square. Artifact shopping and famous food.
  • Rock pools.
  • Shanghai Street Food #7 Jiān Bǐng 煎餅.
  • Shenzhen (Hong Kong). The worlds manufacturing ecosystem.
  • Suspended Temple of Mt. Hengshan.
  • The essential guide to backpacking China's silk road.
  • What are some must-try foods when visiting China? (Quora).
  • Zhangjiajie National Forest Park.
  • China's most epic high-speed rail journeys.
  • ]]>
    Thu, 19 Mar 2015 00:00:00 GMT
    South Korea travel bookmarks https://xenodium.com/south-korea-travel-bookmarks https://xenodium.com/south-korea-travel-bookmarks
  • 8 Amazing Things to Do in Jeonju, South Korea (2020 Guide).
  • Hongdae, Seoul.
  • Koi fish mural at Naksan Park, Seoul.
  • ]]>
    Wed, 18 Mar 2015 00:00:00 GMT
    Sharing on iOS https://xenodium.com/sharing-on-ios https://xenodium.com/sharing-on-ios
  • UIActivityViewController.
    • Use completionWithItemsHandler on iOS 8.
    • Sample:
  • NSString *title = @"Sharing on iOS bookmarks.";
    NSURL *url = [NSURL URLWithString:@"http://xenodium.com/#sharing-on-ios"];
    UIImage *image = [UIImage imageNamed:@"beautiful-image"];
    
    UIActivityViewController *controller =
      [[UIActivityViewController alloc]
        initWithActivityItems:@[title, url, image]
        applicationActivities:nil];
    
    // self being a UIViewController.
    [self presentViewController:controller animated:YES completion:nil];
    
    • Sharing through Mail app on simulator isn't supported.

    viewServiceDidTerminateWithError: Error Domain=_UIViewServiceInterfaceErrorDomain Code=3 "The operation couldn’t be completed. (_UIViewServiceInterfaceErrorDomain error 3.)" UserInfo=… {Message=Service Connection Interrupted}

    ]]>
    Wed, 18 Mar 2015 00:00:00 GMT
    San Francisco travel bookmarks https://xenodium.com/san-francisco-travel-bookmarks https://xenodium.com/san-francisco-travel-bookmarks
  • Blue Star Donuts (Portland + LA).
  • Mr. and Mrs. Miscellaneous.
  • Smitten Ice Cream.
  • Tiled steps at 16th Moraga Street in San Francisco.
  • ]]>
    Wed, 18 Mar 2015 00:00:00 GMT
    Istanbul travel bookmarks https://xenodium.com/istanbul-travel-bookmarks https://xenodium.com/istanbul-travel-bookmarks
  • Altan Şekerleme (turkish delight shop).
  • Cheap eats in Istanbul's Bazaar District.
  • Findikli rainbow stairs.
  • Historic neighborhood of Arnavutkoy in Istanbul.
  • Istanbul Food: after the perfect bite.
  • The rise of Karakoy: Istanbul's hippest neighbourhood.
  • Uskudar Fish Market.
  • ]]>
    Wed, 18 Mar 2015 00:00:00 GMT
    Rome travel bookmarks https://xenodium.com/rome-travel-bookmarks https://xenodium.com/rome-travel-bookmarks
  • Bike rental in Rome.
  • Darkrome tours.
  • First time Rome: a beginner’s guide to the Eternal City.
  • ]]>
    Wed, 18 Mar 2015 00:00:00 GMT
    Italy travel bookmarks https://xenodium.com/italy-travel-bookmarks https://xenodium.com/italy-travel-bookmarks
  • 22 Towns in Italy That Are Almost Too Perfect Looking.
  • Abbazia di Monte Oliveto Maggiore.
  • Abbruzzo's Sulmona: one of the oldest towns in the area and home to the Latin poet Ovid, confetti (sugared almonds) and arrosticini (barbecued lamb skewers).
  • Alberobello - Wikipedia.
  • Amalfi coast's Furore beach.
  • Boboli Gardens, Florence.
  • Braie lake.
  • Caffe Meletti.
  • Cinque Terre.
  • Emilia Romagna. (foood!).
  • Fixe small towns in Italy.
  • Herculaneum - Wikipedia.
  • Italy's six best road trips.
  • Le Sirenuse (Positano).
  • Live the good life: 12 local experiences on the Amalfi Coast.
  • Manarola.
  • Milan - Deus cafe.
  • Milan - Gelato joints.
  • Milan - Il mangione to find restaurants.
  • Milan - Mercato Metropolitani.
  • Milan - Navigli and eat at "el brellin".
  • Milan - Taveggia for hot chocolate.
  • Milan - Where to go for aperitivo in Milan.
  • Montalcino, and Brunello wine.
  • Palace of Venaria.
  • Piazza dei Miracoli.
  • Piedmont.
  • Pienza, Tuscany.
  • Rabbit beach.
  • Re di Macchia, restaurant in Montalcino.
  • San Galgano, Tuscany.
  • San Gimignano, Tuscany.
  • San Lorenzo leather market.
  • Skiing in Italy: find your perfect resort.
  • The Devil's Bridge in Borgo a Mozzano, Tuscany, Italy - Love from Tuscany.
  • The New Treasures of Pompeii.
  • Volterra, Tuscany.
  • ]]>
    Tue, 17 Mar 2015 00:00:00 GMT
    Emacs lisp debug on entry https://xenodium.com/emacs-lisp-debug-on-entry https://xenodium.com/emacs-lisp-debug-on-entry Wanted to track down which package was enabling ido-mode on my behalf. debug-on-entry to the rescue. Pass the method name in question and you're good to go.

    (debug-on-entry 'ido-mode)
    

    When done, use cancel.

    (cancel-debug-on-entry 'ido-mode)
    
    ]]>
    Tue, 17 Mar 2015 00:00:00 GMT
    Burma travel bookmarks https://xenodium.com/burma-travel-bookmarks https://xenodium.com/burma-travel-bookmarks
  • Bagan and Inle lake are the "touristy" areas.
  • Balloons over Bagan.
  • For Bagan, get bicycles.
  • Inle lake guided boat tour.
  • Ngapali beach.
  • Ngwe Saung beach.
  • Shwesandaw at sunset.
  • zyklusdiewelt's Myanmar's photos.
  • ]]>
    Tue, 17 Mar 2015 00:00:00 GMT
    OS X Screencasts to animated GIF https://xenodium.com/os-x-screencasts-to-animated-gif https://xenodium.com/os-x-screencasts-to-animated-gif
  • Alex Dergachev has a great howto for generating animated GIF out of OS X Screencasts.
  • Of interest GIF Brewery.
  • ]]>
    Mon, 16 Mar 2015 00:00:00 GMT
    Writing Xcode plugins https://xenodium.com/writing-xcode-plugins https://xenodium.com/writing-xcode-plugins
  • Xcode-Plugin-Template from Delisa Mason/kattrali.
    • Ensure DVTPlugInCompatibilityUUIDs is in Info.plist.
    • Get from:
  • defaults read \
        /Applications/Xcode.app/Contents/Info DVTPlugInCompatibilityUUID
    
    ]]>
    Sun, 15 Mar 2015 00:00:00 GMT
    Uninstalling Alcatraz from Xcode https://xenodium.com/uninstalling-alcatraz-from-xcode https://xenodium.com/uninstalling-alcatraz-from-xcode $ rm -rf ~/Library/Application\ Support/Developer/Shared/Xcode/Plug-ins/Alcatraz.xcplugin $ rm -rf ~/Library/Application\ Support/Alcatraz

    ps. Removing all plugins:

    $ rm -rf ~/Library/Application\ Support/Developer/Shared/Xcode/Plug-ins/*
    
    ]]>
    Sun, 15 Mar 2015 00:00:00 GMT
    Prefill Emacs swiper with current region https://xenodium.com/prefill-emacs-swiper-with-current-region https://xenodium.com/prefill-emacs-swiper-with-current-region The new swiper Emacs package is proving to be a great alternative to helm-swoop. Here's how to prefill with current region:

    (defun ar/prefilled-swiper ()
      "Pre-fill swiper input with region."
      (interactive)
      (if (region-active-p)
          (let ((region-text (buffer-substring (region-beginning)
                                               (region-end))))
            (swiper region-text))
        (swiper)))
    
    (global-set-key (kbd "C-s")
                    #'ar/prefilled-swiper)
    
    ]]>
    Sat, 14 Mar 2015 00:00:00 GMT
    Change macOS app icon https://xenodium.com/change-mac-os-app-icon https://xenodium.com/change-mac-os-app-icon
  • Open the new icon (.icns) in Preview.
  • Click on large image
  • Select all (⌘-a).
  • Copy (⌘-c).
  • Ctrl-click on app icon.
  • Select Get Info.
  • Click on app icon (top-left).
  • Paste (⌘-v).
  • Done!
  • ]]>
    Sat, 14 Mar 2015 00:00:00 GMT
    Hack on Emacs London meetup bookmarks https://xenodium.com/hack-on-emacs-meetup https://xenodium.com/hack-on-emacs-meetup
  • European Lisp Symposium.
  • guide-key displays available key bindings.
  • iplayer-el Emacs interface to the BBC's iPlayer.
  • swankr REPL (swank protocol for R).
  • ]]>
    Wed, 11 Mar 2015 00:00:00 GMT
    Working with OS X and Emacs tips https://xenodium.com/working-with-os-x-and-emacs-tips https://xenodium.com/working-with-os-x-and-emacs-tips From M-x all-things-emacs, Ryan McGeary's OS X/Emacs workflow.

    Frequently used apps:

    Dotfiles

    ]]>
    Mon, 09 Mar 2015 00:00:00 GMT
    Building ycmd https://xenodium.com/building-ycmd https://xenodium.com/building-ycmd Build

    id: build-3

    $ git clone https://github.com/Valloric/ycmd.git
    $ cd ycmd
    $ git submodule update --init --recursive
    $ ./build.sh --clang-completer
    

    Test

    $ python ycmd
      serving on http://127.0.0.1:54265
    

    More info

    ]]>
    Mon, 09 Mar 2015 00:00:00 GMT
    Regular bookmarks https://xenodium.com/regular-bookmarks https://xenodium.com/regular-bookmarks
  • Roads & Kingdoms (food).
  • Roads & Kingdoms (music).
  • Roads & Kingdoms (travel).
  • ]]>
    Sun, 08 Mar 2015 00:00:00 GMT
    Photography bookmarks https://xenodium.com/photography-bookmarks https://xenodium.com/photography-bookmarks
  • 77 photography techniques, tips and tricks for taking pictures of anything.
  • Course schedule - Digital Photography.
  • ExifRenamer: Batch rename photos using exif information.
  • Exposé, A simple static site generator for photoessays.
  • Japanese Storefront Reference set - Elora 's Ko-fi Shop - Ko-fi.
  • Michael Gakuran's Gakuranman.
  • OpenMV (Small - Affordable - Expandable).
  • Photo Critique (Subreddit).
  • ]]>
    Sun, 08 Mar 2015 00:00:00 GMT
    Paris travel bookmarks https://xenodium.com/paris-travel-bookmarks https://xenodium.com/paris-travel-bookmarks
  • Atelier Maitre Albert (known for its rotisserie chicken).
  • Au Passage. Small plates in fun atmosphere.
  • Berthillon Ice Cream.
  • Breizh Café (traditional gallete, savory buckwheat crepes).
  • Buvette Gastrotheque. Wine bar with small dishes.
  • Cheri Bibi, possibly hipster, underneath Sacre Coeur, good cocktails.
  • Creperie Josseline. Worth the queue. Drink Breton cider with crepes.
  • Holybelly Canal Saint Martin.
  • How To Spend a Culinary Weekend In Paris.
  • L'Aller Retour. The place for steak-frites.
  • L'Office. Wine bar/bistrot.
  • Le Barav'.
  • Le Petit Poucet (restaurant next to Place de Clichy, Paris).
  • Le Reminet (Paris restaurant).
  • Marché d'Aligre. Authentic neighbourhood market.
  • Marché des Enfants Rouge. Small covered market. Eat at food stalls.
  • Mosquee de Paris. City mosque. Drink mint tea at courtyard under olive trees or eat in restaurant inside. North African food.
  • Musee d'Orsay.
  • Paris: A Guide To Some Of The Best Cafes In Canal St. Martin.
  • Pierre Herme. For great pastries and macarons.
  • RATP for transport info including the "carnet" of 10 tickets.
  • Rodin Museum.
  • West Country Girl (crepes).
  • What are the best boulangeries and patisseries in Paris for each arrondissement? (Quora).
  • What are the best places to buy cheese in Paris? (Quora).
  • Where are best vintage stores in Paris? (Quora).
  • Where are the best flea markets in Paris? (Quora).
  • ]]>
    Sun, 08 Mar 2015 00:00:00 GMT
    Org mode bookmarks https://xenodium.com/org-mode-bookmarks https://xenodium.com/org-mode-bookmarks
  • A Baby Steps Guide to Managing Your Tasks with Org.
  • An Agenda for Life With Org Mode.
  • An Org Table Spreadsheet cheatsheet.
  • Assigning ids to entries.
  • Automating boilerplate in org-mode journalling.
  • Beautiful Emacs tags (maybe for org mode?).
  • Beautifying Org Mode in Emacs.
  • Blogging from GNU Emacs/org (with rss example).
  • Blogging with Emacs org-mode.
  • Build a second brain.
  • Compounding Confoundment: arbitrary interpreters for Babel.
  • Creating org atom xml feed with blog-atom.sh.
  • Creating scientific posters with org-mode.
  • Customizing pandoc to generate beautiful pdfs from markdown (helpful to tweak org export).
  • dfeich/org-babel-examples (GitHub).
  • Dfeich’s Org-babel, org-exporter, org-table example collection.
  • Diego Zamboni / ox-leanpub · GitLab.
  • Drawing Git Graphs with Graphviz and Org-Mode.
  • Elisp: Parse Org Mode (API examples by Xah Lee).
  • Emacs org-mode examples and cookbook.
  • Emacs Orgmode Source Code Blocks 2 | jherrlin.
  • Executing org source blocks when loading file (and defining file-local vars).
  • Export Org HTML SRC blocks as PNG files using Chrome.
  • feed-builder/feed-builder.el an org/blog rss implementation.
  • Getting Boxes Done, the Code.
  • GitHub - DarkBuffalo/ox-report: Export your org file to minutes report PDF file.
  • GitHub - misohena/el-easydraw: Embedded drawing tool for Emacs.
  • GitHub - niklasfasching/go-org: Org mode parser with html & pretty printed org rendering.
  • helm-org-rifle: Rifle through your Org buffers and acquire your target.
  • How can org-babel be configured to set variables across multiple language? (Reddit).
  • How I use org-mode.
  • HTML doctypes (The Org Manual).
  • Image display size in Org.
  • Karl Voit's personal information management PIM Lecture at TU Graz.
  • Kevin's org notes.
  • Literate DevOps with org source blocks (Howardism).
  • Literate DevOps.
  • Literate Programming with Org-mode.
  • Literate Programming: Empower Your Writing with Emacs Org-Mode.
  • Lost in Technopolis (getting things done with org agenda).
  • Making a Poster with Org-mode (Irreal).
  • Managing your contacts in org-mode and syncing them to your phone.
  • Managing Your Life With org-mode and Other Tools.
  • Marcin Borkowski: 2018-08-18 Embedding files in Org-mode revisited.
  • Multiline fontification (ie. bold) with org-emphasis-alist.
  • My Org Capture Templates - Part 1 · The Art of Not Asking Why.
  • My Org Capture Templates - Part 3 · The Art of Not Asking Why.
  • My org-mode agenda, much better now with category icons! : emacs.
  • My Org-mode use cases (Patrick Skiba).
  • My Workflow with Org-Agenda.
  • Native macOS Notifications for Emacs Org Tasks and Appointments.
  • New link features in org 9.
  • om.el/README.md at master · ndwarshuis/om.el · GitHub.
  • Org babel examples repo.
  • Org Babel reference card.
  • org babel scraps.
  • Org crypt and LOGBOOK: how they can work together for a secure agenda..
  • Org CV/resume.
  • Org mode basics.
  • Org mode blogging: RSS feed.
  • Org mode examples and cookbook.
  • Org mode examples.
  • Org Mode Habits : emacs.
  • Org mode reference card.
  • Org tutorials.
  • org-almanac.
  • org-capture-extension (GitHub).
  • org-ehtml: Export Org-mode files as editable web pages.
  • org-mind-map: creates graphviz directed graphs from org-mode files.
  • Org-mode basics VII: A TODO list with schedules and deadlines | Pragmatic Emacs.
  • Org-mode features You May Not Know · Bastien Guerry - Liberté, informatique.
  • Org-mode Hidden Gems - 02 Tables.
  • org-mode support for vCard export and import.
  • org-noter: Emacs document annotator, using Org-mode.
  • org-special-block-extras.
  • org-web-tools: Commands and functions for retrieving web page content and processing it into and displaying it as Org-mode content..
  • org-web-tools: View, capture, and archive Web pages in Org-mode.
  • org/uml examples.
  • Organize you life in Emacs Org | ZCL.SPACE.
  • Organize your life in plain text.
  • OrgMode tutorial - YouTube channel.
  • Pablo Stafforini’s Forecasting System - EA Forum.
  • Plan your day: Daily Time Management with Emacs, Org-Mode, and Google Calendar.
  • Prettifying Org Mode with CSS | Hacker News.
  • Prettifying Org Mode with CSS.
  • puntoblogspot: 3 basic org agenda tips for the fundamentally forgetful.
  • Querying RESTful webservices into Emacs orgmode tables (vxlabs).
  • Rainer König's OrgMode YouTube tutorials.
  • Refiling hydra with pre-defined targets.
  • Ricing up Org Mode - EMACS-DOCUMENT.
  • Ricing up Org Mode.
  • Robust Notes with Embedded Code (extensive org babel usage).
  • The compact Org-mode Guide.
  • The Poor Org-User Spaced Repetition - Where parallels cross.
  • Tutorial 16.1 - Emacs orgmode tables.
  • UOMF: Org Mode As a Rabbit Hole: Agenda Tasks Piling Up.
  • UOMF: Recurring Events with Org Mode.
  • Use Emacs Org Mode and REST APIs for an up-to-date Stock Portfolio.
  • Using Emacs - 24 - Org Capture 2.
  • Using Emacs 54 Org Tables.
  • Using Emacs's org-mode As Your Zettelkasten.
  • Using org-capture with org-protocol be like - Diego Berrocal.
  • Using results from one code block in another org-mode.
  • Using sudo in org-babel.
  • Visit tangled file with org-open-at-point (supports tramp/ssh).
  • WorgSheet Calc Intro – Dj Pj (lots of tips and shortcuts).
  • Writing Specs with Org-mode.
  • YouTube: org introduction.
  • Zero to Emacs and Org-roam: a step-by-step guide.
  • ]]>
    Sun, 08 Mar 2015 00:00:00 GMT
    London bar backlog https://xenodium.com/london-bar-backlog https://xenodium.com/london-bar-backlog Soho ]]> Tue, 11 Sep 2018 00:00:00 GMT London food backlog https://xenodium.com/london-food-backlog https://xenodium.com/london-food-backlog B_acklog

    Saporitalia (Italian/pizza), Notting Hill.

    Menus | Lunch, Dinner, Sunday Roast - Blacklock.

    Food & Drink - The Barbary | Covent Garden Restaurant | Neal's Yard | London.

    Pophams Bakery.

    Yipin China | Restaurants in Islington, London.

    Sunday (breakfast).

    The Quince Tree Cafe London (Cafe), Paddington.

    Bombay Bustle (Indian), Mayfair.

    Kyseri (modern turkish), Fitzrovia.

    Pied a Terre (fine dining), Fitzrovia.

    The Ledbury (fine dining), Notting Hill.

    Flour and Grape (Pasta), Bermondsey.

    Honi Pokē (poke), Soho.

    ZIA LUCIA (pizza), Highbury Islington.

    Yeast Bakery.

    Pavillion Cafe.

    Palm Vaults.

    Angel

    [TODO]{.todo .TODO} Shawarma Bar - Berber and Q.

    [TODO]{.todo .TODO} Bombay Burrito (Indian burrito takeaway & restaurant: Angel, Islington).

    Baker Street

    [DONE]{.done .DONE} L’ANTICA PIZZERIA DA MICHELE (Pizza), Baker Street.

    Barbican

    [TODO]{.todo .TODO} Sushi Tetsu (must book, well in advance).

    Barnsbury

    [TODO]{.todo .TODO} Sunday (breakfast, cafe, working).

    Battersea

    [TODO]{.todo .TODO} Tonkotsu (ramen).

    Brick Lane

    [TODO]{.todo .TODO} Chez Elles (french).

    [TODO]{.todo .TODO} Fika (Swedish, cinnamon buns, coffee).

    Bermondsey

    [TODO]{.todo .TODO} Druid Street market

    1. FAT London (Kimchee ).

    2. & Cultured butter.

    Bethnal Green

    [DONE]{.done .DONE} Lahpet (Burmese) <2018-12-02 Sun> <2018-12-27 Thu>


    id: lahpet-burmese-2018-12-02-sun-2018-12-27-thu

    Brixton

    [TODO]{.todo .TODO} Nanban (Japanese soul food).

    Borough

    [DONE]{.done .DONE} Padella (great fresh pasta).

    [TODO]{.todo .TODO} Roasting Plant: Fresh Roasted Coffee <2019-01-15 Tue>

    Camberwell

    [TODO]{.todo .TODO} Sun of Camberwell (Roast beef, Yorkshire, and sticky toffee pudding).

    [TODO]{.todo .TODO} Silk Road (Chinese, Lamb/cumin skewers).

    Canada Water

    [TODO]{.todo .TODO} Chuck burger (truck).

    Cannon street

    [TODO]{.todo .TODO} The Brigadiers (Indian) <2019-01-22 Tue>

    Chiswick

    [TODO]{.todo .TODO} The Coffee Traveller <2019-01-16 Wed>

    Covent Garden

    [TODO]{.todo .TODO} Punjab (Punjabi).

    [TODO]{.todo .TODO} 鼎泰豐・Din Tai Fung・ディンタイフォン・딘타이펑 (soup dumplings) <2019-03-12 Tue>

    [TODO]{.todo .TODO} Little Kolkata (London Restaurant - Kolkata Spirits) <2019-03-12 Tue>

    [TODO]{.todo .TODO} Duende (modern Spanish).

    [TODO]{.todo .TODO} Rock & Sole Plaice (fish and chips).

    [TODO]{.todo .TODO} Timber Yard (coffee, working).

    [TODO]{.todo .TODO} Chicks 'n' Sours.

    [TODO]{.todo .TODO} Jidori (chicken yakitori) <2018-12-02 Sun>

    [DONE]{.done .DONE} Dishoom (Indian), try Lamb raan.

    [DONE]{.done .DONE} Sagar (South Indian): Great food!

    Clapham

    [TODO]{.todo .TODO} Joe Public Pizza.

    Crouch end

    [TODO]{.todo .TODO} The Haberdashery (coffee, working).

    [TODO]{.todo .TODO} Blend (coffee, working).

    Ealing

    [TODO]{.todo .TODO} Kiraku (Sushi).

    [TODO]{.todo .TODO} Wa Cafe (Japanese Patiserie).

    Earls court

    [TODO]{.todo .TODO} MAM (Vietnamese) <2018-12-02 Sun>

    [TODO]{.todo .TODO} Jollibee UK (filipino fried chicken/fast food) <2019-03-12 Tue>

    Edware road

    [DONE]{.done .DONE} GOGI (korean): Average. Also, they lied to me and apologized with £10 credit.

    Euston

    [TODO]{.todo .TODO} Roti King (Indian/Pakistani/Singaporean): 40, Doric Way, Euston, NW1 1LH.

    Farringdon

    [TODO]{.todo .TODO} Quality Chop House.

    [TODO]{.todo .TODO} Daddy Donkey (Mexican).

    [TODO]{.todo .TODO} J+A (coffe, working).

    Fitzrovia

    [TODO]{.todo .TODO} Indian YMCA (inexpensive Indian).

    [TODO]{.todo .TODO} Pastificio al dente (Italian, fresh pasta) <2019-03-12 Tue>

    [TODO]{.todo .TODO} House of Ho (Vietnamese).

    Golders Green

    [TODO]{.todo .TODO} Cafe Japan (Sushi).

    Hackney

    [TODO]{.todo .TODO} Pidgin.

    [TODO]{.todo .TODO} DabbaDrop (Indian delivery subscription).

    Hammersmith

    [DONE]{.done .DONE} Indian Zing (Indian): It was OK (not great).

    [TODO]{.todo .TODO} Dragon cat cafe (bubble tea and wheel cake). <2019-07-14 Sun>

    Hamstead

    [TODO]{.todo .TODO} Jin Kichi (Japanese).

    Harrow

    [TODO]{.todo .TODO} Mazar (Afghan).

    Hatch End

    [TODO]{.todo .TODO} Chuck Burger.

    Holborn

    [TODO]{.todo .TODO} Prufrock Café (coffee, working).

    [TODO]{.todo .TODO} Good & Proper (coffee, tea, working).

    [TODO]{.todo .TODO} Noble Rot (wine bar/food) <2019-01-22 Tue>

    Holloway Road

    [TODO]{.todo .TODO} Xi'an impression (Xi'an)

    Islington

    [TODO]{.todo .TODO} Delhi Grill (Indian), try chicken makhani and naan.

    [TODO]{.todo .TODO} BabaBoom (the kebab makers) <2018-12-02 Sun>

    [TODO]{.todo .TODO} Roots N1 (Indian).

    [TODO]{.todo .TODO} The pig and butcher (sunday roast).

    [TODO]{.todo .TODO} Busan BBQ (Korean meets American diner/burgers and fried chicken).

    [TODO]{.todo .TODO} Smokehouse Islington.

    [TODO]{.todo .TODO} Katsuke 100 (Japanese tea/cake room). <2019-07-14 Sun>

    Kensington

    [TODO]{.todo .TODO} Clarke's, try the burger.

    Kensal Green

    [TODO]{.todo .TODO} Centro Galego de Londres (Gallician).

    Kentish town

    [TODO]{.todo .TODO} The Fields Beneath (coffee, working).

    King's Cross

    [TODO]{.todo .TODO} Itadaki Zen.

    [TODO]{.todo .TODO} German Gymnasium.

    [DONE]{.done .DONE} Yeah! Burger at Star of Kings.

    [TODO]{.todo .TODO} Wing Wing (Korean fried chicken)s.

    [TODO]{.todo .TODO} Sambal Shiok known for laksa and satai burger. <2019-07-14 Sun>

    Leicester square

    Curry House Ichibanya UK Japanese Restaurant London WC2H <2019-03-12 Tue>.

    Leytonstone

    Singburi (Thai) <2019-05-07 Tue>.

    Liverpool street

    [TODO]{.todo .TODO} Gunpowder (Indian).

    [TODO]{.todo .TODO} Cinnamon Kitchen (Indian).

    London Bridge

    [TODO]{.todo .TODO} Santo Remedio (Mexican).

    Marylebone

    [DONE]{.done .DONE} Fischer's (Austrian). Great atmosphere and schnitzel. Not cheap.

    [TODO]{.todo .TODO} Nambutei (Sushi).

    [TODO]{.todo .TODO} Lurra (Basque).

    Mayfair

    [TODO]{.todo .TODO} Mayfair chippy (Fish and chips).

    [TODO]{.todo .TODO} Ikeda (Japanese).

    [TODO]{.todo .TODO} THE ARAKI (Sushi) / pricey.

    Mornington Crescent

    [TODO]{.todo .TODO} Asakusa (Japanese).

    Notting Hill

    [TODO]{.todo .TODO} Blend (coffee, working).

    [TODO]{.todo .TODO} The continental pantry.

    [TODO]{.todo .TODO} MAM (Vietnamese) <2018-12-02 Sun>

    Old Street

    [TODO]{.todo .TODO} Sardine (French).

    [TODO]{.todo .TODO} Sasuke (ramen).

    Olympia

    [DONE]{.done .DONE} Aborz (Iranian). <2018-12-27 Thu>

    Oxford street

    [TODO]{.todo .TODO} Roti Chai (Indian).

    Peckham

    [TODO]{.todo .TODO} Ganapati (South Indian).

    [TODO]{.todo .TODO} The Begging Bowl (Thai) <2019-05-07 Tue>.

    Piccadilly

    [TODO]{.todo .TODO} Urban tea rooms (coffee/tea/brunch) <2019-03-12 Tue>

    [TODO]{.todo .TODO} Machiya (Japanese comfort) <2018-12-02 Sun>

    [TODO]{.todo .TODO} YORI-Korean Restaurant <2019-03-12 Tue>

    [TODO]{.todo .TODO} Rochelle Canteen @ The Institute of Contemporary Arts (ICA) (Pie and ping Sunday special) <2019-02-12 Tue>

    [TODO]{.todo .TODO} Dark Chocolate Coated Chocolate Pearl, 190g - Fortnum & Mason <2020-06-14 Sun>.

    Putney

    [TODO]{.todo .TODO} authentic Japanese restaurant in Putney - Tomoe, London Traveller Reviews - TripAdvisor.

    Sheppherds bush

    [TODO]{.todo .TODO} Caco & Co (Portuguese cafe). <2019-07-14 Sun>

    [TODO]{.todo .TODO} Chop chop (Noodle bar). <2019-07-14 Sun>

    Shoreditch

    [TODO]{.todo .TODO} Mast Brothers chocolate makers.

    [TODO]{.todo .TODO} Sagardi (basque).

    [TODO]{.todo .TODO} Look mum no hands (cofee, working).

    [TODO]{.todo .TODO} J+A (coffe, working).

    [TODO]{.todo .TODO} Good & Proper (coffee, tea, working).

    [TODO]{.todo .TODO} Smokestak (BBQ).

    [TODO]{.todo .TODO} Pho Viet 68 (Banh mi).

    Sloane Square

    [TODO]{.todo .TODO} Rasoi (Indian).

    Soho

    [TODO]{.todo .TODO} Le Hanoi (Vietnamese) <2018-12-02 Sun>

    [TODO]{.todo .TODO} Cay Tre (Vietnamese) <2018-12-02 Sun>

    [TODO]{.todo .TODO} Viet Food (Vietnamese) <2018-12-02 Sun>

    [TODO]{.todo .TODO} Tao Tao Ju (Dim sum) <2018-12-02 Sun>

    [TODO]{.todo .TODO} Lokhandwala London (Top Indian Tapas Restaurant & Bar in London) <2019-01-15 Tue>

    [TODO]{.todo .TODO} DUM biryani (Indian) <2019-01-15 Tue>

    [TODO]{.todo .TODO} Pastaio (Italian, fresh pasta) <2019-01-15 Tue>.

    [TODO]{.todo .TODO} Bun House (ie. pork buns).

    [TODO]{.todo .TODO} Temper restaurant (BBQ/tapas).

    [TODO]{.todo .TODO} Golden Union (fish bar).

    [TODO]{.todo .TODO} Melt Room (Cheese toasties).

    [TODO]{.todo .TODO} Shotgun (BBQ).

    [TODO]{.todo .TODO} Smack Lobster (Lobster rolls).

    [TODO]{.todo .TODO} Smoking Goat (Thai), highly recommended.

    [TODO]{.todo .TODO} Atari Ya (Sushi).

    [TODO]{.todo .TODO} Yumi Izakaya (Japanese).

    [TODO]{.todo .TODO} Jugemu (Japanese).

    [TODO]{.todo .TODO} Darjeeling Express (Indian).

    [TODO]{.todo .TODO} Hoppers Dosas, Rice, Roast, Kothu & Arrack (Sri Lanka and Tamil Nadu).

    [TODO]{.todo .TODO} Timber Yard (coffee, working).

    [DONE]{.done .DONE} Pizza Pilgrims.

    [DONE]{.done .DONE} Kiln (Thai), highly recommended.

    [DONE]{.done .DONE} BAO (Bao buns! enough said).

    [DONE]{.done .DONE} SAID (italian chocolate shop). Awesome hot chocolate.

    Southhall

    [DONE]{.done .DONE} Brilliant restaurant (healthier Indian). <2018-12-27 Thu>


    id: brilliant-restaurant-healthier-indian.-2018-12-27-thu

    Southbank

    [TODO]{.todo .TODO} Tonkotsu (ramen).

    South Kensington

    [TODO]{.todo .TODO} Hour Glass (Pub restaurant).

    Smithfield

    [TODO]{.todo .TODO} Bird of Smithfield (Sheppherd's pie, ox cheek, cheesecake).

    Spitafields

    [DONE]{.done .DONE} Som Saa (Thai), highly recommended. <2018-12-27 Thu>

    [TODO]{.todo .TODO} Lahpet (Burmese) <2018-12-02 Sun>

    Strand

    [TODO]{.todo .TODO} India Club (around for 50 years) <2019-05-21 Tue>

    Stoke Newingtom

    [TODO]{.todo .TODO} The Haberdashery (coffee, working).

    Tottenham Court Road.

    [DONE]{.done .DONE} Kanada-Ya (rammen): Not bad.

    Tower Hill

    [TODO]{.todo .TODO} M. Manze (pie and mash).

    [TODO]{.todo .TODO} Maltby street market.

    Tufnell Park

    [TODO]{.todo .TODO} Monsoon (Indian), try lamb naga.

    Turnham Green

    [TODO]{.todo .TODO} Chief Coffee.

    Victoria

    [TODO]{.todo .TODO} Dominique Ansel Bakery (Bakery) <2019-01-22 Tue>

    [TODO]{.todo .TODO} Dominique Ansel Bakery <2018-12-11 Tue>

    [TODO]{.todo .TODO} Bleeker (burger) <2019-01-22 Tue>

    Walthamstow

    [TODO]{.todo .TODO} Grillstock BBQ.

    Waterloo

    [TODO]{.todo .TODO} The Laughing Gravy.

    [TODO]{.todo .TODO} Zen China.

    West Hamstead

    [TODO]{.todo .TODO} Nautilus (fish and chips).

    [TODO]{.todo .TODO} Mamacita (Mexican).

    Whitechapel

    [TODO]{.todo .TODO} Lahore Kebab House, try seekh kebabs with roti.

    [TODO]{.todo .TODO} Sushinoen.

    Wimbledon

    [TODO]{.todo .TODO} Dalchini (Indian), try spicy cocunut fish curry.

    ]]>
    Sun, 08 Mar 2015 00:00:00 GMT
    UX bookmarks https://xenodium.com/ux-bookmarks https://xenodium.com/ux-bookmarks
  • 10 kerning tips for improving your typography.
  • 10 Usability Heuristics for User Interface Design.
  • 30 Flat Design Color Palettes That Just Work.
  • 4 Rules for Intuitive UX.
  • Animated SVG icons.
  • Apple's UI design Dos and Don'ts.
  • Applying white space in UI design: 8 practical tips, with examples..
  • Ask HN: Good books or articles on UI design? (Hacker News).
  • behance (Showcase & Discover Creative Work).
  • California magazine.
  • capptivate.co (features mobile UIs).
  • Creating badass users.
  • Death to Stock (stock photos).
  • Designer News.
  • Designing an Icon for Your App – Space and Meaning (planet gnome).
  • DIY UI Tips for Backend Developers.
  • Evil icons.
  • Font squirrel (free fonts for commercial use).
  • Freesound just reached 500K Creative Commons sounds | Hacker News.
  • How to Become a UX Designer (Hacker News).
  • How to Draw from Imagination: Beyond References.
  • Images and Sketch files of popular devices (Hacker News).
  • Images and Sketch files of popular devices.
  • iOS Typography: Stop Saying “No” to Designers on Vimeo.
  • Laws of UX | Hacker News.
  • Logo Modernism (Book).
  • Makerbook: A hand-picked directory of the best free resources for creatives.
  • Material Design icons.
  • mobile-patterns.com (UX mobile patterns).
  • pttrns.com (mobile UX patterns).
  • Refactoring UI: The Book.
  • Rules for Intuitive UX | Hacker News.
  • Selection controls — UI component series | by Taras Bakusevych | UX Collective.
  • Skins / Themes / Docs / TACHYONS.
  • Swissted (punk rock and Swiss Modernism drawings).
  • TACHYONS - Css Toolkit (Minimalistic Swiss-inspired).
  • Ten most popular webfonts of 2014.
  • The 100 Best Design Blogs to Follow.
  • The Foundations of a Good UI.
  • The Psycology of UX.
  • Typographica (type reviews, books, commentary).
  • Unsplash – Beautiful photos free to use under the Unsplash License (Hacker News).
  • UX Planet.
  • Visualizing Science: Illustration and Beyond - Scientific American Blog Network.
  • What are you working on? Dribbble is show and tell for designers.
  • Why Showing Your Process is So Important!.
  • ]]>
    Sat, 07 Mar 2015 00:00:00 GMT
    Recipes https://xenodium.com/recipes https://xenodium.com/recipes Jeera rice (cumin rice)

    Sizzle spices (40 seconds)

    • 1 tablespoon oil
    • 1 teaspoon cumin seeds
    • 4 cloves
    • 2 black cardamon pods
    • 1 cinnamon stick

    Sautee onion (2 mins or browned/opaque)

    • 1 small yellow onion (chopped)

    Sautee rice + salt (1 minute)

    • 2 cups of basmati rice
    • 1.2 teaspoon of salt

    Boil, then partially cover and simmer (8 minutes or water gone)

    • 4 cups water

    Rest 5 minutes (covered)

    Slow-cooked lamb

    1. Preheat oven: 240°C (no fan) 220°C (fan).
    2. Lamb face up in tray.
    3. Cook for 30 mins (or brown).
    4. Take lamb out.
    5. Add to tray: broth, onions, rosemary.
    6. Lamb face down (broth covers 1/3 or 1/4).
    7. Cover with lid (or baking/parchment paper then 2 layers of foil).
    8. Bake for 3.5 hours at 180°C (no fan).
    9. Take out.
    10. Turn lamb face up (over again). Check if liquid needs top-up.
    11. Cook for 2 more hours.
    12. Check if ready. Does meat fall off the bone with fork?
    13. If not, keep for another 30 mins. Check again.
    14. You are done ø/.

    Tom Kha Gai soup

    • Chicken or Prawns
    • 2 kaffir lime leaves
    • 1 lemongrass stalk
    • 1 1/2 cocunut milk
    • 3/4 sliced fresh galaghal
    • 1 1/2 chicken stock or water
    • 1/2 cup mushrooms
    • 3 1/2 tbsp sugar
    • 1/2 cup of cilantro
    • 1-4 thai chillies
    • 1-2 tbsp chili oil
    • 1 green onion

    Veg-Fruit juice

    • Lime
    • Ginger
    • Apple
    • Chilly
    • Celery
    • Fig
    • Blueberries

    Berry Hempster

    • Hemp milk
    • Hemp protein
    • Strawberry
    • Blueberry
    • Date

    How to cook Beef Chow Fun.

    Cavolo nero with anchovies, chilli and garlic.

    Vietnamese Pork Lettuce Wraps (my own versions)

    • Pork Mince.
    • Chopped garlic.
    • Chopped chillies.
    • Chopped ginger.
    • 4 tablespoons of soy sauce.
    • 2 tablespoons of apple cider vinegar.
    • Sesame oil (for cooking mince).
    • Half tablespoon of coconut sugar.
    • Lettuces (for wrapping).
    ]]>
    Sat, 07 Mar 2015 00:00:00 GMT
    Music backlog https://xenodium.com/music-backlog https://xenodium.com/music-backlog [TODO]{.todo .TODO} CatMeows: A Publicly-Available Dataset of Cat Vocalizations | Zenodo.

    [TODO]{.todo .TODO} Pay What You Want (bandcamp).

    [TODO]{.todo .TODO} Zontali on Twitter: "Name one of your most emotionally resonant songs, and I ….

    [TODO]{.todo .TODO} Generative.fm.

    [TODO]{.todo .TODO} Diminished Fifth.

    [TODO]{.todo .TODO} Archive of Indian music.

    [TODO]{.todo .TODO} Budhaditya Mukherjee.

    [TODO]{.todo .TODO} Debashish Bhattcharya.

    [TODO]{.todo .TODO} Halim Jafar Khan and his Disciples - Sitar Quintet - LP published in India in 1968.

    [TODO]{.todo .TODO} Harjinderpal Singh.

    [TODO]{.todo .TODO} Jayanthi Kumaresh.

    [TODO]{.todo .TODO} Kayhan Kalhor.

    [TODO]{.todo .TODO} Malaya Chalo.

    [TODO]{.todo .TODO} Mehboob Nadeem.

    [TODO]{.todo .TODO} Nirmalya Dey.

    [TODO]{.todo .TODO} Zia Mohiuddin.

    [TODO]{.todo .TODO} Music sites

    ]]>
    Sat, 07 Mar 2015 00:00:00 GMT
    UX scrapbook bookmarks https://xenodium.com/ux-scrapbook-bookmarks https://xenodium.com/ux-scrapbook-bookmarks
  • 27 fonts* (give or take) that explain your world.
  • 5 Years of Design (good for inspiration).
  • 60 FPS on mobile web (plus layouts).
  • Another minilimalistic one-pager.
  • Another minimalistic gallery.
  • Behance.
  • Compact & Powerful: Great Examples of Floating Action Buttons in Interfaces.
  • Flag of Planet Earth.
  • Generative Placeholders.
  • Graphic design from other cultures.
  • Kevin.is (Simple layout).
  • Meng To's I Love Food I.
  • Meng To's I Love Food II.
  • Minimalistic blog layout.
  • Minimalistic blog layout.
  • Minimalistic gallery.
  • Minimalistic one-pager.
  • Neue Haas Unica (reborn).
  • Neue Haas Unica.
  • Neumorphism in user interfaces - UX Collective.
  • Organizational Debt is Like Technical debt — But Worse.
  • Pierre-Yves Ritschard's minialistic blog.
  • Raleway Font.
  • Svbtle: A post on java developers. Enjoyed its minimalistic layout.
  • whereis-whoishiring-hiring.me (minimalistic categorization).
  • ]]>
    Fri, 06 Mar 2015 00:00:00 GMT
    Travel blog bookmarks https://xenodium.com/travel-blog-bookmarks https://xenodium.com/travel-blog-bookmarks
  • Hidden Travel Treasures.
  • One Step 4Ward.
  • Tigrest Travel Blog.
  • ]]>
    Fri, 09 Oct 2015 00:00:00 GMT
    Travel bookmarks https://xenodium.com/travel-bookmarks https://xenodium.com/travel-bookmarks
  • 21 Totally Breathtaking Trails.
  • 5 increíbles escapadas a islas que quizás nunca has considerado.
  • 52 Places to Go in 2016 (Hacker News).
  • 52 Places to Go in 2016.
  • A beginner's guide to the art of hiking.
  • abitofculture.net.
  • Alex in wanderland.
  • Amazing places around the world.
  • Backpacks and Bunkbeds.
  • Beyond blighty.
  • BLOUINARTINFO+TRAVEL.
  • Continental Breakfast travel.
  • Girl tweets world.
  • How does it feel to travel alone? (Quora).
  • How to pack light: tips from a master packer.
  • How to travel: 21 Contrarian rules.
  • International Railway Journal.
  • izi.TRAVEL: A tour guide in your pocket.
  • Joe's Trippin' A few tales from the road by a modern day nomad.
  • Legal nomads.
  • Need another holiday.
  • Never ending footsteps.
  • New in Travel: the best new openings of 2017 (11 to 20).
  • New in Travel: the best new openings of 2017 (21 to 35).
  • New in Travel: the best new openings of 2017 (one to 10).
  • On The Luce.
  • Paradise Lost: Tourists Are Destroying the Places They Love - SPIEGEL ONLINE.
  • pichette.org's travel blog.
  • Posters: Create travel gifts/posters and souvenirs (eliot).
  • Restless Jo.
  • See my travels.
  • The Crew Lounge.
  • The Grown-up gap year.
  • The Happy Talent. A Travel blog.
  • The Travel Hack.
  • The Travelbunny.
  • The Volunteer Journal | Swap Skills For Accommodation.
  • The world's best places to see autumn colours.
  • Thorn Tree travel forum (Lonely Planet's).
  • Travel with Kat.
  • Traveldudes.
  • Traveling Spoon.
  • Travelistly TV (high quality travel content).
  • Tried and tested tips for a trouble free road trip.
  • Two for the road.
  • Ultimate travel list: Lonely Planet's top 10 sights in the world.
  • Vagabond Baker.
  • What are common items that savvy travelers bring with them that less-savvy ones don't? (Quora).
  • What are some must-eat dishes in your country? - Quora.
  • What are your top 10 travel tips? (Quora).
  • World daily secret.
  • World food and drink.
  • X Days in Y.
  • ytravel.
  • ]]>
    Fri, 06 Mar 2015 00:00:00 GMT
    Startup bookmarks https://xenodium.com/startup-bookmarks https://xenodium.com/startup-bookmarks
  • 16 Startup Metrics (Hacker News).
  • 16 Startup Metrics.
  • 19 Amazing Sites To Get Free Stock Photos.
  • 301 Redirects Rules Change: What You Need to Know for SEO.
  • 6 ways to increase user engagement for product-led growth.
  • A Dashboard for your Code.
  • A guide to PR for startups (Hacker News).
  • A guide to PR for startups.
  • A Guide to Pricing Plans | Hacker News.
  • A two-person startup already uses twenty-eight other tools | Hacker News.
  • Airtable: cloud DB with a spreadsheet web UI.
  • All Things Sales: Mini-lessons for startup founders (Hacker News).
  • Amazingly Simple Graphic Design Software – Canva.
  • An email I will never open (Chris Sacca).
  • An iOS REST Client that is based on MVVM using ReactiveCocoa.
  • An iOS Weather app case study.
  • Answer these questions about potential digital platform.
  • aphyr/distsys-class: Class materials for a distributed systems lecture.
  • API pagination design | Hacker News.
  • AppFigures: App tracking platform.
  • Apple Edge Cache (CDNs) | Hacker News.
  • Application-Level Logging Best Practices (Hacker News).
  • AppScale, The Open Source Implementation of Google App Engine.
  • Arc (crowdfunded CDN).
  • Artisanal Web Hosting.
  • Ask HN: Best business advice for software developers (Hacker News).
  • Ask HN: How do you handle DDoS attacks? (Hacker News).
  • Ask HN: How does your company manage its encryption keys? | Hacker News.
  • Ask HN: How to effectively get feedback from users? | Hacker News.
  • Ask HN: Simple alternative to Google Analytics.
  • Ask HN: What tools do you use to build HTML emails?
  • Ask HN: What's your advice for someone who's raising capital for the first time? (Hacker News).
  • Authentication Cheet Sheet.
  • AXDRAFT (Free legal documents for startups).
  • BaaS comparison.
  • BaaS ecosystem map.
  • Barnacles.
  • Bayesian ranking of items with up and downvotes or 5 star ratings (Hacker News).
  • Bayesian ranking of items with up and downvotes or 5 star ratings.
  • BBC Sound Effects Archive Resource • Research & Education Space.
  • bcrypt: password hashing function alternative to md5 and sha1 (Wikipedia).
  • Building a small container for a golang service for kubernetes.
  • Building a Well-Rounded Website: Essentials (wonderful recommendations for your site).
  • Building Your Color Palette | Hacker News.
  • Carrd - Simple, free, fully responsive one-page sites for pretty much anything.
  • Check for word safety (wordsafety.com).
  • Choosing Your First Marketing Hire (Hacker News).
  • Clink78 hostel.
  • Common Startup Timing Mistakes and How to Avoid Them (Hacker News).
  • Compare Prices of All Top-Level Domains | TLD List.
  • Comparing five monitoring options for docker.
  • Compose.io.
  • Contentful: Like a CMS — except for the bad parts.
  • Create OpenStreetMaps with uMap.
  • curl online command line builder.
  • Daniel Vassallo - (quit Amazon story and advice).
  • Dashborads using ASCII and JS.
  • Detect iOS Device location in just one line.
  • Disposable chats in Go (more links here).
  • Do Things that Don't Scale.
  • Does anyone have recommendations for accounting software? : UKPersonalFinance.
  • Does it scale? Who cares (2011) (Hacker News).
  • Domains for the Rest of Us (domain name generator).
  • Done is better than perfect.
  • Don’t Take VC Funding - It Will Destroy Your Company | Oliver Eidel.
  • dynamic website/service with Redis leader and follower replicas.
  • Earnest Capital is live (Hacker News).
  • Edge Cloud Platform (Fastly).
  • Emergency Website Kit | Max Böck - Frontend Web Developer.
  • Encore • APIs made simple.
  • Ethical apps code of conduct - HackMD.
  • Everything you need to know about OAuth 2.0 | Hacker News.
  • Fathom Analytics - Simple, Privacy-focused Web Analytics.
  • Find words that match your pattern..
  • Find your competition.
  • Fiverr (logos, graphic design, etc).
  • Flag Theory: Freedom, Privacy and Wealth.
  • Fonts, Graphics, Themes and More ~ Creative Market.
  • Fonts, Logos & Icons from GraphicRiver.
  • For Static Sites, There’s No Excuse Not to Use a CDN (Hacker News).
  • Free HTML landing page templates for startups - Cruip.
  • Free tools for startups (Shyahi blog).
  • Free vectors.
  • Gain valuable, actionable feedback on your startup ideas.
  • Glyphish icon collection.
  • Go hosting (Reddit comments).
  • GoatCounter web analytics.
  • gofundme.
  • Gophish - Open Source Phishing Framework.
  • GraphQL, a query language and execution engine tied to any backend service.
  • grpcui: An interactive web UI for gRPC.
  • grpcurl: Like cURL, but for gRPC.
  • Gumroad. Helps creators sell, generate digital licenses, grow audiences, etc.
  • HN: Things to Know When Making a Web Application in 2015.
  • How I got to the app store top with a simple currency app.
  • How I Made $8,000 per Month Podcasting, and Why You Probably Don’t Want To.
  • How much does it cost to build an app? (Sentia Blog).
  • How Startup Options (and Ownership) Works.
  • How to Acquire Your First 100 Customers (Hacker News).
  • How to Be Prepared for Technical Due Diligence: What to Anticipate and How to Excel.
  • How to Build a Great Series A Pitch and Deck | Hacker News.
  • How to DIY a Product Launch Video with No Experience, and for Free.
  • How to get your money’s worth from your startup lawyer (Hacker News).
  • How to implement a multi-CDN strategy: everything you need to know.
  • How to Kickstart and Scale a Marketplace | Hacker News.
  • How to price anything: The psychology of why we’ll pay what we pay.
  • How to Send Email Like a Startup.
  • How to start a startup lectures.
  • Icon archive.
  • Icon finder.
  • ImageTragick (ImageMagick vulnerabilities and mitigations).
  • Irreal: Bad Password Policies (salt + hash with bcrypt).
  • Kaffeine pings your Heroku app every 30 minutes so it will never go to sleep.
  • Keycloak: Open-source identity and access management | Hacker News.
  • Launch HN: Axdraft (YC W19) - Legal documents for startups in minutes (Hacker News).
  • Launchaco - Name a business.
  • Layer, messaging platform.
  • Legal Letters—At a fraction of the cost.
  • Lessons I learned from Co-Founding a startup.
  • Lightweight Alternatives to Google Analytics | Hacker News.
  • List of Minimal frameworks.
  • Logo Maker & Logo Creator - Free Logo Generator Online.
  • Logo Maker - Create a Free Logo in Minutes - Namecheap.
  • Logodust: Free Logo Designs For Your Startup.
  • Logojoy: AI-powered logo creator (Hacker News).
  • Logoshi: Online Logo Maker.
  • Looker (Data analysis).
  • Lorem Picsum: Lorem Ipsum… but for photos.
  • Luis Abreu, iOS Design/UX Specialist.
  • Making Instagram.com faster: Part 3 – cache first (Hacker News).
  • Mapbox. Maps for iOS, Android and Web.
  • MAPS.ME (open sourced).
  • Messaging UI for iOS.
  • Metadata: My Distributed Systems Seminar's reading list for Spring 2020.
  • Migrating Away from Google Analytics | Hacker News.
  • Names to reserve for your own service.
  • Netflix's Mantis: a platform to build an ecosystem of realtime stream processing applications.
  • Netlify: All-in-one platform for automating modern web projects..
  • Netlify: Build, deploy, and manage modern web projects.
  • NGINX Config generator | DigitalOcean.
  • Nighthawk (Debug iOS apps remotely from your browser).
  • nimforum: Lightweight alternative to Discourse written in Nim.
  • No more tax surprises - Track.
  • Office Snapshots.
  • Onboarding engineers.
  • OneSignal.
  • Online investing, equity crowdfunding, business finance : Crowdcube.
  • Online Payroll Services, HR, and Benefits | Gusto.
  • Open Hunt: an open and community-run alternative to Product Hunt..
  • Open Startups: companies embracing transparency and openness.
  • Options to serve static content.
  • Organizational Debt is Like Technical debt — But Worse.
  • Origami for UI patterns and interactions.
  • PaintCode (drawings into ObjC code) - coupon.
  • Pair programming over code-reviews.
  • parse.com.
  • paymentfont.io (Payment icons).
  • People Who Like This Also Like
  • People Who Like This Also Like… (Hacker News).
  • Permutive (ad-server for sponsored content).
  • Pioneer - The network for ambitious outsiders.
  • porkbun.com | An oddly satisfying experience (domain registry).
  • Pragmatic app pricing (Hacker News).
  • Pragmatic app pricing .
  • Product and User Behavioral Analytics for Mobile, Web, & More | Mixpanel.
  • Product Hunt: a curation of the best new products, every day.
  • Psychological differences in price.
  • Questions to ask when joining a startup to help you understand the potential value of your equity.
  • Quora: What are the best productivity tools for entrepreneurs?
  • Real Time Web Analytics & Marketing Attribution Tools - Gauges.
  • RemoteMac.io – Dedicated Mac mini (Hacker News).
  • ResponseVault - Spreadsheet. Grid Form Builder..
  • RethinkDB FAQ.
  • RethinkDB HN comments.
  • Retool: Build internal tools fast.
  • Roll Your Own Analytics (Hacker News).
  • Roll Your Own Analytics.
  • Securing Intellectual Property Rights in a Software Development Contract.
  • Send email like a startup.
  • Share as image.
  • Show HN: How I made simple Geolocation service which handles 6m+ req/mo for $5.
  • Show HN: Profit Hunt - Get inspired by profitable online projects | Hacker News.
  • Simplescraper — Scrape Websites and turn them into APIs.
  • So you want your app/website to work in China.
  • space-cloud: Open source, high performance web service which provides instant Realtime APIs on the database of your choice..
  • Splunk: SIEM, AIOps, Application Management, Log Management, Machine Learning, and Compliance.
  • Squarespace Logo.
  • Startup advice, briefly.
  • Startup idea checklist | defmacro.
  • Startup Incorporation Checklist.
  • Striking off company - am I missing anything? : UKPersonalFinance.
  • Structuring JSON data in your Firebase database.
  • Submit.co: Press coverage for your startup.
  • submit.co: Where to get press coverage for your startup.
  • Swagger: Represent REST API.
  • Tailwind UI.
  • TaskJuggler - A Free and Open Source Project Management Software - About TaskJuggler.
  • Technically: what your developers are using (stacks, tools, and beyond).
  • Telephony, SMS, and MMS APIs (Hacker News).
  • TextBelt: A free, open source API for outgoing texts..
  • The Correct Way to Validate Email Addresses (Hacker News).
  • The first rule of pricing is: you do not talk about pricing.
  • The good parts of AWS: a visual summary | Hacker News.
  • The Psychology of Pricing: A Gigantic List of Strategies (HN comments).
  • The Psychology of Pricing: A Gigantic List of Strategies.
  • TheHungryJPEG.com (Premium Graphic Design Resources).
  • Things to Know When Making a Web Application in 2015.
  • TLDR Stock Options.
  • Tools for Developers (DEV Community).
  • ToroDB.
  • Traffic/en – Hetzner DokuWiki (CDN).
  • Twitter: Cheapest and reliable way of serving data over http.
  • Understanding OAuth2 and OpenID Connect | Hacker News.
  • Unsplash: Beautiful Free Images & Pictures.
  • Using BitTorrent with Amazon S3.
  • Valve employee handbook.
  • Wave Financial: Financial Software for Small Businesses.
  • We ditched Google Analytics | Hacker News.
  • We use RethinkDB at Workshape.io.
  • Web Analytics in Real Time (Clicky).
  • Web Analytics Made Easy - Statcounter.
  • Web Scraping, Data Extraction and Automation · Apify.
  • What are some of the things VCs listen for when hearing pitches that instill confidence in them about the startup founders pitching?.
  • What does the GDPR actually mean for startups? (Hacker News).
  • What hosting do you use? - DEV Community.
  • What I'd tell myself about startups if I could go back 5 years.
  • What is the best "payment processor" for a SME e-commerce company in the UK?.
  • What is your favorite domain registrar? (Twitter).
  • What's a good (mobile) app subscription price? - zerokspot.com.
  • What's the best financial package I could offer our employees?.
  • What’s the Second Job of a Startup CEO? (Hacker News).
  • Writing copy for landing pages (Hacker News).
  • YC Sales agreement.
  • You Need More than REST for API Success.
  • ]]>
    Fri, 06 Mar 2015 00:00:00 GMT
    Romania travel bookmarks https://xenodium.com/romania-travel-bookmarks https://xenodium.com/romania-travel-bookmarks
  • Abandoned Romania.
  • Bran Castle.
  • ]]>
    Fri, 06 Mar 2015 00:00:00 GMT
    Productivity tips backlog https://xenodium.com/productivity-tips-backlog https://xenodium.com/productivity-tips-backlog [TODO]{.todo .TODO} AnyBar: OS X menubar status indicator (color dot).

    [TODO]{.todo .TODO} mercury (fuzzy tab search).

    ]]>
    Fri, 06 Mar 2015 00:00:00 GMT
    Productivity bookmarks https://xenodium.com/productivity-bookmarks https://xenodium.com/productivity-bookmarks
  • 10 fast fingers (improve typing skills).
  • Day One Journal
  • Dotfiles for insane productivity in bash, git, and vim.
  • EricaJoy on Twitter: "so folks, what are your #1 tools for remote work?.
  • How to Get Things Done When You Don't Feel Like It (Hacker News).
  • How to return to the flow faster (Hacker News).
  • How to return to the flow faster | Code Jamming.
  • jrnl: Likely what I've been looking for journaling from command line.
  • Noisli - Improve Focus and Boost Productivity with Background Noise.
  • Pocket.
  • Reflecting On One Year of Remote Work - DEV Community.
  • The Ultimate Guide to Personal Productivity Methods.
  • Tricks to start working despite not feeling like it | Hacker News.
  • Yan's dot files: For peeking.
  • Yan's productivity tips: Also to try.
  • Zotero.
  • ]]>
    Fri, 06 Mar 2015 00:00:00 GMT
    Privacy bookmarks https://xenodium.com/privacy-bookmarks https://xenodium.com/privacy-bookmarks
  • #1 Password Manager, Vault, & Digital Wallet App (LastPass).
  • A Modest Privacy Protection Proposal.
  • Against an Increasingly User-Hostile Web - Neustadt.fr.
  • Alternatives to Google Products (Restore Privacy).
  • Am I unique?.
  • An Intensive Introduction to Cryptography (Hacker News).
  • asc-key-to-qr-code-gif: Convert ASCII-armored PGP keys to animated QR code.
  • Ask HN: A way to adblock “we're using cookies” popups? | Hacker News.
  • Awesome selfhosted (locally hosting and managing applications instead of renting from SaaS providers).
  • bellingcat - Guide To Using Reverse Image Search For Investigations - bellingcat.
  • Brute Force Incognito Browsing « null program.
  • Change your online habits - Guides | Mullvad VPN.
  • Countly | Product Analytics for Mobile, Web, Desktop and IoT.
  • Cryptee (Private, Secure, Encrypted Documents & Photos).
  • CryptPad: Collaboration suite, encrypted and open-source.
  • dbp.io: A Hacker's Replacement for GMail.
  • De-Googling My Life.
  • Deep links to opt-out of data sharing by 60+ companies – Simple Opt Out.
  • degoogle | A huge list of alternatives to Google products..
  • Digital Era.
  • DNS leak test.
  • Does my site need HTTPS?.
  • DuckDuckGo Traffic (Hacker News).
  • Etherpad (Open Source online editor).
  • Ethical Alternatives & Resources - ethical.net.
  • Fathom Analytics - Simple, Privacy-focused Web Analytics.
  • Getting Started with WireGuard » Miguel Mota | Software Developer.
  • git-crypt: Transparent file encryption in git.
  • GitHub - tycrek/degoogle: Repo for the r/privacy "degoogle" megathread.
  • Give Firefox A Chance For A Faster, Calmer And Distraction-Free Internet.
  • How to stay as private as possible on Apple's iPad and iPhone | Computerworld.
  • Ian M discusses what makes a good password (NCSC).
  • iOS - Platforms - PRISM Break (more privacy tools).
  • K-anonymity (Hacker News).
  • Kickball/awesome-selfhosted: Free Software network services and web applications which can be hosted locally..
  • Kill the Newsletter!.
  • Kolab (calendar).
  • mailbox.org (email + calendar host).
  • Migrating from Google Analytics (Hacker News).
  • mssun/passforios Wiki.
  • Mullvad VPN.
  • New privacy tools.
  • OpenPGP Best Practices - riseup.net.
  • Our Favorite Ad Blockers and Browser Extensions for Privacy.
  • Panopticlick (Is your browser safe against tracking?).
  • Pi-hole troubleshooting: An overview of my recent installation | Matthew Haffner.
  • Pi-Hole – A black hole for Internet advertisements (Hacker News).
  • Plausible · Simple, open-source web analytics.
  • Privacy Tools - Encryption Against Global Mass Surveillance.
  • Privacy – A curated list of services and alternatives that respect privacy.
  • Publishing A Public Key via Web Key Directory (WKD) - OpenPGP Keyserver.
  • Purelymail – cheap, no-nonsense email | Hacker News.
  • Qubes OS: A reasonably secure operating system.
  • Runaroo (metasearch engine).
  • Runnaroo | A Better Private Search Engine.
  • Searx search engine instances.
  • Setup ELK for NGINX logs with Elasticsearch, Logstash, and Kibana (analytics alternative).
  • Simple Analytics - Simple, clean, and privacy-friendly analytics.
  • smallstep - Everything you should know about certificates and PKI but are too afraid to ask.
  • Surveillance Self-Defense | Tips, Tools and How-tos for Safer Online Communications.
  • Temporary Containers – Get this Extension for Firefox (en-US).
  • That One Privacy Site.
  • The easiest way to remember passwords | RememBear.
  • TinEye Reverse Image Search.
  • Tools for people and groups working on liberatory social change (riseup.net).
  • Tor use - best practices.
  • Trying to Secure My Digital Life – Adam Hawkins – Medium.
  • twitter: YOUR RIGHTS!!! (this is a UK version, but i’m sure some things may apply!! ).
  • uBlock Origin review | Hacker News.
  • Virtual Private Networks (Reddit).
  • Webbkoll: How privacy-friendly is your site?.
  • Why Privacy Matters | Privacy is important. Here are some simple reasons why..
  • ]]>
    Fri, 06 Mar 2015 00:00:00 GMT
    Lifestyle/wellbeing/health bookmarks https://xenodium.com/lifestyle-bookmarks https://xenodium.com/lifestyle-bookmarks
  • "Do not spoil what you have by desiring what you have not; what you now have was once among the things you only hoped for." - Epicurus
  • 23 Weird Plants For Your Bedroom That Will Help You Sleep Like A Baby.
  • A simple guide to meditation.
  • Advice I needed when I was young.
  • Anxiety Culture.
  • Anxiety No More (Support and Help for a natural anxiety cure).
  • Ask HN: How did you decide what problems to solve in your lifetime? | Hacker News.
  • Better etiquette: Topical Etiquette Tips, Helpful Household Hints, International Travel Tips, Dine Like a Diplomat…
  • Blue Zone: Where some claim people live much longer than average.
  • Brain Pickings.
  • Caffeine-induced anxiety disorder - Wikipedia.
  • Calisthenics - Wikipedia.
  • Cameron Desautel on lifehacking.
  • Cameron Desautel on productivity.
  • Canadian Permanent Residency.
  • Curated list of falsehoods programmers believe in.
  • Dr. Hamilton Demonstrates "The Hold" - How To Calm A Crying Baby (YouTube).
  • Dream Homes from the Past Century | Hacker News.
  • Game Changer or Fame Gainer? — News & Features.
  • How to Configure Your iPhone to Work for You, Not Against You.
  • How to get six pack abs in one year - Quora.
  • ICEBREAKERS, via The Art of Noticing by Rob Walker.
  • Jon Brosio's answer to What is the best way to improve life? - Quora.
  • MAPA hides prefab Minimod Curucaca in Brazilian forest.
  • Melatonin: Much More Than You Wanted to Know (Hacker News).
  • Mind body green.
  • Most lives are lived by default (2012) | Hacker News.
  • Panic attacks and panic disorder - Symptoms and causes - Mayo Clinic.
  • Periodic fasting starves cisplatin‐resistant cancers to death (Hacker News).
  • Planning for My Kidnapping | Hacker News.
  • Posing for photos (all about the squinch).
  • Quiz: The 36 Questions That Lead to Love.
  • Quora on increasing energy levels.
  • Show HN: I made a community sourced fitness routine database | Hacker News.
  • Show Me the Science – When & How to Use Hand Sanitizer in Community Settings.
  • Side sleepers with neck problems ONLY (pillow thread).
  • Six Years With a Distraction-Free iPhone – Member Feature Stories – Medium.
  • The 101 Best Habits to Track in 2018 – Coach.me App – Medium.
  • The Best Indoor Plants to Clear the Air, Literally.
  • The military secret to falling asleep in two minutes (The Independent).
  • The Only New Year’s Resolutions You’ll Ever Need – John LeFevre – Medium.
  • The Path to Dijkstra’s Handwriting.
  • The Shocking Truth About Freshly Squeezed Orange Juice.
  • Travelling alone (Quora).
  • You should’ve asked | Emma.
  • Zero Waste Home.
  • ]]>
    Fri, 06 Mar 2015 00:00:00 GMT
    Graphics bookmarks https://xenodium.com/graphics-bookmarks https://xenodium.com/graphics-bookmarks
  • gif.js.
  • Icicles: Data viz.
  • inkpanther2 graphics or logo commissions.
  • List of best websites for downloading free SVGs.
  • Protoviz: Data viz.
  • Svg animation info: Potentially useful for some ideas in mind.
  • Svg within svg: Potentially useful for some ideas in mind.
  • where to find svgs.
  • ]]>
    Fri, 06 Mar 2015 00:00:00 GMT
    Nexus Q bookmarks https://xenodium.com/nexus-q-bookmarks https://xenodium.com/nexus-q-bookmarks
  • How to Install CyanogenMod on the Google Nexus Q ("steelhead").
  • Nexus Q troubleshooting.
  • Unlocking->insecure boot->root->flash cm10 with amplifier support your Q without apk.
  • ]]>
    Fri, 06 Mar 2015 00:00:00 GMT
    Golang bookmarks https://xenodium.com/golang-bookmarks https://xenodium.com/golang-bookmarks
  • 7 Common mistakes in Go.
  • A collection of common regular expressions for Go.
  • A curated list of awesome Go packages.
  • A curated list of awesome golang Security related resources.
  • A Drawer implement on SwiftUI.
  • A statistics package with common functions that are missing from the Golang standard library.
  • A whirlwind tour of Go’s runtime environment variables.
  • Attempting to Learn Go - Now Sending GET/POST REST Requests.
  • authentication - python gRPC equivalent of golang's PerRPCCredentials.
  • Avoiding Reflection (And Such) In Go.
  • BasicGoAPI (ie. REST).
  • Bazel Golang Hello World (Kubernetes musings by chrislovecnm).
  • Beego, platform for web apps.
  • Buffalo & Rapid Web Development in Go.
  • Building a RESTful API in Go Using Only the Standard Library (Episode 1).
  • Building an API with Golang, RethinkDB and wercker.
  • Building Small Containers for Kubernetes (golang http).
  • c2go: A tool for transpiling C to Go..
  • Command vet (reports suspicious constructs).
  • Complex json handling in Go.
  • Configr: abstraction on top of configuration sources.
  • Configuring emacs and evil mode for Go development (Part 1).
  • Creating an API Client in Go.
  • Cross compilation with Go 1.5.
  • Custom transports and timeouts.
  • Dancing with Go’s Mutexes.
  • Debug Go Like a Pro - Better Programming - Medium.
  • Debugging Go programs with Delve.
  • defaultproject (REST/web starter).
  • Defer, Panic, and Recover.
  • Emacs Go Mode (Isma details his Emacs Golang setup).
  • End-user authentication for Go web applications.
  • ent · An entity framework for Go.
  • Error handling in Go.
  • Executing commands in Go.
  • Exploring Error Handling Patterns in Go (Hacker News).
  • Exploring Go's runtime.
  • Face recognition with Go – Hacker Noon.
  • fasthttp: Fast HTTP implementation for Go.
  • GitHub - gorilla/mux: A powerful URL router and dispatcher for golang..
  • GitHub - montanaflynn/stats: A well tested and comprehensive Golang statistics library package with no dependencies..
  • GitHub - ndabAP/vue-go-example: Vue.js and Go example project.
  • GitHub - Nerzal/gocloak: golang keycloak client.
  • GitHub - sethgrid/multibar: Display multiple progress bars in Go (golang)..
  • Go best practices, six years in.
  • Go by Example.
  • Go Challenge 3 HN comments.
  • Go Code Review Comments.
  • Go command Line Flags.
  • Go Concurrency Patterns: Pipelines and cancellation.
  • Go grpc authentication.
  • Go interfaces, the tricky parts.
  • Go library for downloading YouTube videos.
  • Go Meta Linter.
  • Go Proverbs Illustrated.
  • Go Slice Gotcha.
  • Go Template Primer.
  • Go tooling essentials (useful flags in tooling).
  • Go Tooling in Action - YouTube.
  • Go Walkthrough: encoding/json package.
  • Go Walkthrough: fmt (formatting strings).
  • Go, gRPC and Docker.
  • go-bootstrap to generate a lean and mean Go web project.
  • go-fuzz github.com/arolek/ase tutorial.
  • Go-miniLock: The Minilock File Encryption System, Ported to Pure Go.
  • go-rename.
  • Go-restful.
  • GOCUI - Go Console User Interface.
  • Goji: A web microframework for Golang.
  • Golang concepts from an OOP point of view.
  • Golang landmines.
  • Golang toolbox (high quality Go packages).
  • Golang Tutorial (Xah Lee's).
  • Golang: Creating gRPC interceptors (David Bond).
  • Golang: Rune.
  • GopherCon 2015 videos.
  • GopherCon 2016: Jack Lindamood - Practical Advice for Go Library Authors (YouTube).
  • GopherCon 2016: Jack Lindamood - Practical Advice for Go Library Authors.
  • GopherCon 2018 - How to Write a Parser in Go.
  • Gopherjs: A compiler from Go to JavaScript.
  • GoQt: golang Qt bindings.
  • gorepl-mode.
  • gosec - Golang Security Checker.
  • Go’s Features of Last Resort | Hacker News.
  • Graceful shutdown of a TCP server in Go - Eli Bendersky's website.
  • GRequests: A Go "clone" of the great and famous Requests library.
  • gRPC authentication documentation.
  • GuardRails is a GitHub app that provides security feedback in your pull requests.
  • How to Hash and Verify Passwords With Argon2 in Go - Alex Edwards.
  • How to start a Go project in 2018 | Hacker News.
  • How to Write Go Code.
  • How we use gRPC to build a client/server system in Go (auth and TLS included).
  • HUGO: a static website engine in Go.
  • Interfaces and Composition for Effective Unit Testing in Golang.
  • Kubernetes godeps.
  • Less is exponentially more (Rob Pike's Go reasoning).
  • Let's Go! Learn to Build Professional Web Applications With Golang.
  • Let's talk about logging.
  • Making and Using HTTP Middleware in Go.
  • Match regular expressions into struct fields.
  • Monkey Patching in Go.
  • PanicAndRecover.
  • Parsing HTML with Go using stream processing.
  • Password authentication and storage in Go (Golang).
  • Peaceful Parent, Happy Kids: How to Stop Yelling and Start Connecting.
  • Peter Bourgon · Go best practices, six years in.
  • Practical Go: Real-world advice for writing maintainable Go programs (Hacker News).
  • Problems with Go net/http Client API.
  • Ran: a simple static web server written in Go.
  • Reducing boilerplate with go generate.
  • research!rsc: Go Data Structures: Interfaces.
  • RESTful Web API Basics in Go.
  • Restful webservice using golang with sqlite.
  • Revel: A high-productivity web framework for the Go language.
  • rules_go/core.rst at master · bazelbuild/rules_go.
  • runtime.pprof for profiling.
  • Sashay Go codegen.
  • Seven steps to 100x faster Go.
  • Simple password authentication example · Issue #106 · grpc/grpc-go.
  • Sling: Go REST client library for creating and sending API requests.
  • Small introduction to tags in Go.
  • So you want to expose Go on the Internet (Hacker News).
  • Survey of Rounding Implementations in Go | Cockroach Labs.
  • Swagger Go documentation generator.
  • Ten useful techniques in Go (HN comments).
  • Ten useful techniques in Go.
  • termui, Go terminal dashboard.
  • Testing in Go - DEV Community.
  • The 5 stages of learning Go.
  • The empty struct (Dave Cheney).
  • The Go Cookbook.
  • The Hunt for a Logger Interface.
  • There is no pass-by-reference in Go | Dave Cheney.
  • Things I wish someone told me about Go.
  • Time formatting in Go ❚ A Scripter's Notes.
  • Uber Go Style Guide (Hacker News).
  • Visualizing Concurrency in Go.
  • What's So Bad About Stdlib's Log Package? (Groups discussion).
  • Writing Unit Tests for your net/http Handlers.
  • ]]>
    Fri, 06 Mar 2015 00:00:00 GMT
    GitHub bookmarks https://xenodium.com/github-bookmarks https://xenodium.com/github-bookmarks
  • Adding a CNAME file to your repository.
  • Tips for configuring a CNAME record with your DNS provider.
  • Github pages basics.
  • SO DNS response.
  • ]]>
    Fri, 06 Mar 2015 00:00:00 GMT
    Courses bookmarks https://xenodium.com/courses-bookmarks https://xenodium.com/courses-bookmarks
  • Chessacademy.
  • Compilers (Stanford Lagunita).
  • Egghead.io.
  • Gravity Circus Centre.
  • Idler courses.
  • Learning How to Learn: Powerful mental tools to help you master tough subjects (Coursera).
  • lingua.ly.
  • The Science of Well-Being (Coursera).
  • Tuts+ courses.
  • ]]>
    Fri, 06 Mar 2015 00:00:00 GMT
    Reload inputrc https://xenodium.com/reload-inputrc https://xenodium.com/reload-inputrc Reload .iputrc from bash prompt: C-x C-r. More at bashref manual.

    ]]>
    Thu, 05 Mar 2015 00:00:00 GMT
    Learning Emacs lisp https://xenodium.com/learning-emacs-lisp https://xenodium.com/learning-emacs-lisp
  • Use nreverse and nconc to operate on lists in-place.
  • Set buffer local variables:
  • (setq-local my-clever-var)
    
    • Execute before saving buffer:
    (add-hook 'write-file-hooks
              (lambda ()
                (message "about to save!")))
    
    • Possibly use to start processes and send file content:
    (make-comint NAME PROGRAM &optional STARTFILE &rest SWITCHES)
    
    • Creating markers:
    (setq my-marker (copy-marker (point)))
      #<marker at 10251 in *ielm*>
    
    (marker-buffer my-marker)
      #<buffer *ielm*>
    
    (marker-position my-marker)
      10251 (#o24013, #x280b, ?⠋)
    
    • Get org heading at point:
    (org-get-heading 'no-tags 'no-todo)
    
    • Remove string text properties. From manual:

    (substring-no-properties STRING &optional FROM TO)

    Return a substring of STRING, without text properties. It starts at index FROM and ends before TO. TO may be nil or omitted; then the substring runs to the end of STRING. If FROM is nil or omitted, the substring starts at the beginning of STRING. If FROM or TO is negative, it counts from the end.

    • Skip org entry metadata/drawers:
    (org-end-of-meta-data-and-drawers)
    
    • Random access to org entry using id (or CUSTOM_ID):
    (org-open-link-from-string "[[#%exciting-custom-id]]")
    
    • Go to where the function is defined.
    • Press C-u C-M-x. Edebug breakpoint for function.
    • Invoke function in question.
    • n/c will get you around.
    • q when done.
    • Pretty printing objects:
    (let ((my-var (list "val1"
                        "val2"
                        "val3")))
      (pp-to-string my-var))
    
    • Search and/or replace in curent buffer:
    (re-search-forward "needle"
                       nil t)
    (match-beginning 0) ;; Start location of match from last search.
    (match-end 0) ;; End location of match from last search.
    (replace-match "love")
    
    ;; needle-in-haystack
    
    • Restrict buffer editing to a region:
    (narrow-to-region (point)
                      (point-max))
    
    • Restore restriction:
    (save-restriction (narrow-to-region (point)
                                        (point-max))
    
    • Restore point, mark, and current buffer:
    (save-excursion (goto-char (point-max))
                    (insert "Hello elisp."))
    
    • Concatenating strings:
    (concat "Hello " "elisp " "world.")
    
    • Grabbing thing at point:
    (thing-at-point 'word)
    (thing-at-point 'symbol)
    (thing-at-point 'line)
    
    • Unit test with ert.
    • Basic iteration with dolist:
    (dolist (v '("a" "b" "c"))
      (print v))
    
    • Output to other buffer:
    (with-current-buffer (get-buffer-create "*some buffer*")
      (princ '(some list to print)
             (current-buffer)))
    
    • For a temporary buffer, use with-temp-buffer:
    (with-temp-buffer
      (insert "abc")
      (point))
    
    • Cons cells bookmark.
    • Check for substring:
    (string-match-p REGEXP STRING &optional START)
    
    • Matching substrings and accessing groups:
    (setq haystack "Always click [[http://reddit.com/r/emacs][here]].")
    (setq needle-re "\\[\\[\\(.*\\)]\\[\\(.*\\)]]")
      "\\[\\[\\(.*\\)]\\[\\(.*\\)]]"
    
    (string-match needle-re haystack)
      13 (#o15, #xd, ?\C-m)
    
    (match-string 0 haystack)
      "[[http://reddit.com/r/emacs][here]]"
    
    (match-string 1 haystack)
      "http://reddit.com/r/emacs"
    
    (match-string 2 haystack)
      "here"
    
    • Return argument unchanged (noop):
    (identity ARG)
    
    • Org insert today's timestamp
    (org-insert-time-stamp (current-time))
    
    (car LIST)
    
    • All but first element
    (cdr LIST)
    
    • Add NEWELT to front of PLACE
    (push NEWELT PLACE)
    
    • Invoke 'FUNCTION for each in SEQUENCE
    (mapcar FUNCTION SEQUENCE)
    
    • Search/replace
    (while (search-forward "Hello")
      (replace-match "Bonjour"))
    
    • Save to kill ring = copy.
    • Point = cursor position.
    • Mark = a buffer position.
    • Kill = cut text.
    • Yank = paste.
    • Buffer:File = 1:1.
    • Window:Buffer = 1:1.
    • Frame:Window = 1:many.
    • Font lock = syntax highlighting.
    ]]>
    Thu, 05 Mar 2015 00:00:00 GMT
    Apple Watch bookmarks https://xenodium.com/apple-watch-bookmarks https://xenodium.com/apple-watch-bookmarks
  • Swift, Apple Watch, and Dynamic Graphs.
  • ]]>
    Fri, 06 Mar 2015 00:00:00 GMT
    iOS bookmarks https://xenodium.com/ios-bookmarks https://xenodium.com/ios-bookmarks
  • 11 Insanely Great iOS Developers Sites.
  • 30 great UI Kits for iOS engineers – Flawless App Stories – Medium.
  • A floating UIToolBar replacement as seen in the iOS 10 Maps app.
  • Access mobile Safari via web inspector.
  • Accessing Documents/Files (iOS).
  • Adding in-app purchase.
  • An @import-ant Change in Xcode.
  • An object that decodes GeoJSON objects into MapKit types.
  • Animated Gifs with CGAnimateImageAtURLWithBlock.
  • App IDs.
  • App review guidelines (comic book).
  • Apple docs.
  • Apple's coding guidelines for Cocoa.
  • Apple's Concepts in Objective-C programming.
  • Apple's mogile HIG guidelines.
  • Apple's PhotoScroller.
  • Attributed String Programming Guide.
  • Autolayout Visual Format Language – Objective C Sample Code.
  • AVCaptureSession.
  • AVCaptureVideoPreviewLayer.
  • Beginning Core Image in iOS 6.
  • Beta testing your app.
  • Capturing video on iOS.
  • Cartool (Inspect car files).
  • CLAFluxDispatcher: A port of Facebook's Flux Dispatcher to Objective-C.
  • Clang 3.7 documentation BLOCK IMPLEMENTATION SPECIFICATION.
  • Clean architecture for iOS.
  • Cocoa controls.
  • Cocoadocs.
  • Cocoapods under the hood.
  • Cocoapods.
  • Code pilot.
  • Code School iOS courses.
  • Codeschool iOS.
  • Color difference.
  • ComponentKit is an Objective-C++ view framework for iOS that is heavily inspired by React.
  • ComponentKit.
  • Composing NSAttributedString with SwiftUI-style syntax.
  • Compressing data with Foundation APIs.
  • Create a CMSampleBufferRef from CGImageRef.
  • Creating iTunes Connect Record.
  • css-layout: Facebook's layout transpiled to C, Java and C#.
  • Customizing Password AutoFill Rules.
  • DaveLots of iOS resources.
  • Developing iOS 7 Apps for iPhone and iPad (Standford lectures).
  • Displaying Text Content in iOS.
  • DJKFlipper.
  • Effective Objective-C.
  • Everything about bluetooth central (slideshare).
  • Finding iOS memory leaks with Xcode's Instruments.
  • Flux for iOS by Sergey Zenchenko.
  • FLUX implementation in Objective-C.
  • FormatterKit: a collection of well-crafted NSFormatter subclasses for things like units of information, distance, and relative time intervals.
  • Getting to know TextKit.
  • Getting up to speed with UICollectionView layouts.
  • Giorgio Calderolla.
  • GitHub - WeTransfer/WeScan: Document Scanning Made Easy for iOS.
  • Hacking UINavigationBar.
  • How (Not) to Write an iOS SDK.
  • How do I declare a block in Objcetive-C?
  • How to detect dark mode in iOS.
  • How to Integrate Your App with Files App in iOS 11 | Swift Tutorial.
  • How to launch your app from the iOS 8 Share Menu – updated for iOS 8.4.
  • How to make Auto Layout more convenient in iOS.
  • I created my first CocoaPods library!.
  • Icon Matrix.
  • Image Processing in iOS Part 1: Raw Bitmap Modification.
  • Image Processing in iOS Part 2: Core Graphics, Core Image, and GPUImage.
  • Image resizing techniques.
  • INDANCSClient: Objective-C Apple Notification Center Service Implementation (Bluetooth LE).
  • Info PList key reference.
  • Injection for Xcode.
  • Introducing CwlViews.
  • Introduction to color spaces.
  • Introduction to Xcode (Apple WWDC 2016).
  • ios - how to merge two video with transparency - Stack Overflow.
  • iOS 10 UI.
  • iOS 6 Programming Cookbook.
  • iOS 9 programming cookbook.
  • iOS Apprentice.
  • iOS Dev Tools.
  • iOS Dev Tools.
  • iOS dev weekly.
  • iOS Programming 101: How To Send Email in Your iPhone App.
  • iOS Programming.
  • iOS Programming: The Big Nerd Ranch Guide (4th Edition).
  • iOS Programming: The Big Nerd Ranch Guide.
  • iOS projects catalogues.
  • iOS ScrollView Example with Paging.
  • iOS Security.
  • ios-deploy: Install and debug iOS apps without using Xcode.
  • ios-goodies.com.
  • iosdevtips.co.
  • iso-8601-date-formatter: A Cocoa NSFormatter subclass converting to and from ISO-8601-formatted strings .
  • JCTiledScrollView.
  • joppar.com.
  • KZFileWatchers (observer file changes).
  • Lab color space.
  • Laurine: Localization code generator.
  • Maintaining profiles.
  • Many Controllers Make Light Work (Analytics).
  • Meerli.
  • Mike Ash.
  • Modality changes in iOS13 | Sarun.
  • More aggregation of awesomeness on github.
  • MUKContentRedux: provides a store for immutable data which can be updated only applying actions.
  • NSHipster's Xcode plugins post.
  • NSNotificationCenter part 2: Implementing the observer pattern with notifications.
  • NSScreencasts.
  • Objc-C Zen book.
  • Objc.io.
  • Objective-C linter.
  • Objective-C Programming: The Big Nerd Ranch Guide (Big Nerd Ranch Guides).
  • OSStatus: Lookup Apple API errors fast.
  • PaintCode - Turn your drawings into Objective-C or Swift drawing code.
  • phatblat's post on UISearchController.
  • Preserving Your App's UI Across Launches | Apple Developer Documentation.
  • Programatically send an email using CFNetwork and GMail.
  • Programming iOS Book examples.
  • Quick guide on supporting Dark Mode on iOS.
  • Ray Wendelich.
  • realm (mobile database), plus map view, search list view, and grid view.
  • Replace Xcode with Neovim.
  • ReSwift Redux-like implementation of the unidirectional data flow architecture in Swift.
  • Reveal.
  • Ry’s Objective-C Tutorial: Functions.
  • Save your next app from rebuilding from scratch - Alexey Naumov.
  • Scrollable UIStackView.
  • Setting up a CloudKit Project – Frozen Fire Studios.
  • Share data between iOS Apps & App Extensions across devices.
  • ShareSDK is the most comprehensive Social SDK.
  • Sharing data between iOS apps and app extensions.
  • Shimmer: Shimmer is an easy way to add a shimmering effect to any view in your app.
  • simctl: Control iOS Simulators from Command Line - XCBlog - Medium.
  • Simple Animation With SnapKit.
  • SliceTool.
  • Subduing CATiledLayer.
  • Subjective-C.
  • Syncing data on iOS devices with CoreData and CloudKit.
  • TETHR.
  • The Complete Tutorial on iOS/iPhone Custom URL Schemes.
  • The Ultimate Guide to Choosing Objective-C or Swift for Your Project.
  • Tile-Cutter.
  • Tools and tips to scale your iOS project along with your team.
  • Transitioning to ARC.
  • Translucid: Simple and light weight UIView that animate text with an image.
  • Twitter GIF composer.
  • UI Testing in Xcode 7.
  • UICollectionViewCompositionalLayout - UIKit | Apple Developer Documentation.
  • UIColor CMYK and Lab Values?.
  • UIImage has a new initializer, UIImage(systemName:) that takes a string and returns one of over 1500 different system icons..
  • UIImage-Conversion.
  • UIScrollView with Content Layout Guides.
  • UITableView and UICollectionView: update your data model inside the batch updates block.
  • Ultimate guide to resolutions.
  • Using Application Loader.
  • Using Text Kit to Draw and Manage Text.
  • VCTransitionsLibrary.
  • View Controller Presentation Changes in iOS 13 - Geoff Hackworth - Medium.
  • Visual Format laguange for Auto Layout.
  • Visual Format Language (Apple reference).
  • Weekly bite-sized screencasts on iOS dev.
  • What's the best way to average two colors that define a linear gradient?.
  • When to use App ID wildcards.
  • Working with blocks.
  • WWDC 2012 Xcode tips.
  • WWDC 2014.
  • WWDC 2015, 2014, 2013 and Tech-talks 2013 (videos and pdf downloader).
  • XCTest documentation.
  • YawImageViewer.
  • Yet another iOS Blog.
  • YouXianMing's animation collection.
  • Zero to BLE on iOS – Part Two.
  • ZHPopupView.
  • ]]>
    Thu, 05 Mar 2015 00:00:00 GMT
    Kerala travel bookmarks https://xenodium.com/kerala-travel-bookmarks https://xenodium.com/kerala-travel-bookmarks
  • Bagel Shop, 30 Pali Mala Road, off Carter Road, Bandra (W) (+91 22 2605-0178). Daily 9.00AM-10.00PM. Meal for two R500-R800.
  • Hotel Natraj, 22-24 City Station Road, Udaipur (near Bapu Bazaar), +91-294-2487488, +91-94147-57893,
  • Kala Ghoda Café,10 Ropewalk Lane, Kala Ghoda (+91 22 2263-3866). Daily 8.30AM-11.30PM. Meal for two R600.
  • Kochin (Fort Kochin) - old port town with Chinese, Portuguese, Dutch, British and Jewish heritage.
  • Munnar - hill station and centre of tea, coffee and spice growing. Great hiking and spectacular views.
  • Periyar Wildlife Sanctuary.
  • Suzette, Atlanta Building, Nariman Point (+91 22 2288-0055). Daily 9.00AM-11.00PM. Also at Bandra. Meal for two R600-R1,000.
  • Varkala - chilled out beach resort.
  • Yoga House, 53 Chimbai Road, behind St Andrew's Church, off Hill Road, Bandra (W)(+91 22 6554- 5001). Daily 7.00AM-10.30PM.
  • ]]>
    Thu, 05 Mar 2015 00:00:00 GMT
    India travel bookmarks https://xenodium.com/india-travel-bookmarks https://xenodium.com/india-travel-bookmarks
  • A Guide to the Breads of India (Hacker News).
  • A route: blore - pune - mumbai - ahmedabad - mt abu - udaipur - jaipur - amritsar - chandigarh - jammu - srinagar - kargil - leh.
  • Abandoned Bhangarh Fort, India | Grounds View.
  • Abandoned Bhangarh Fort, India | Temple Detail.
  • Abandoned Bundi Palace, India | Grand Wedge.
  • Abandoned Cannon Factory, India | Elephant Columns.
  • Abandoned Cannon Factory, India | Interior Room.
  • Abandoned Jahangir Mahal Palace, Orchha India | Lovely Symmetry.
  • Abandoned Laxminarayan Temple, Orchha India | Hallway View.
  • Abandoned Raniji Ki Baori Stepwell, Bundi India | Columns.
  • Akshardham (Delhi).
  • Archeological survey of india sites.
  • Belur temple mysore.
  • Bhaja caves, pune, maharashtra.
  • Bhang.
  • Bodh gaya.
  • Budbudyanchi tali (bubbling pond) at netravali, sanguem, goa.
  • Chand baori (Wikipedia).
  • Chand baori.
  • Chandipur Beach.
  • Chittorgarh.
  • Darjeeling Himalayan Railway Toy Train: Essential Guide.
  • Daulatabad fort.
  • dawnoflife07's India trip/pictures.
  • Descent of the Ganges (Mahabalipuram).
  • Dining with the Dead at the New Lucky Restaurant.
  • Dr. Bhau Daji Lad museum.
  • Emergencies: +1-650-253-5555.
  • Gaya, Bihar.
  • Gwalior.
  • Halibid temple.
  • Hampi.
  • India on zeef.
  • India's most beautiful stepwells and how to visit them - Lonely Planet.
  • IRCTC Tourism (A government of India enterprise).
  • Jil jil jigarthanda.
  • Jodhpur.
  • Kalyani/Pushkarini at Hulikere near Halebeedu,KA built by Hoysalas.
  • Karni Mata (rats temple).
  • Khajuraho.
  • Khandala.
  • Khotachi Wadi.
  • Kovalam beach.
  • Lonavala.
  • Mahabaleshwar.
  • Mahabalipuram.
  • Manali travel | India, Asia - Lonely Planet.
  • Manali, Himachal Pradesh.
  • Manali.
  • Mumbai - Bademita: chicken tikka.
  • Mumbai - Bagdadi restaurant.
  • Mumbai - Banaganga lake (Banganga cross lane).
  • Mumbai - Bhel puri (find in stalls).
  • Mumbai - Cafe Britannia (Kumtha St or Adi Murzaban Path with Shahid Bhaghat Singh Rd).
  • Mumbai - Crawford market: revivat Indian thali.
  • Mumbai - Eat Mumbai – make the most of India's foodie capital.
  • Mumbai - Elephanta caves.
  • Mumbai - Pali Market.
  • Mumbai - The times of India: masala dosa.
  • Mumbai - University of Mumbai.
  • Mumbai - Vada pav (find in stalls).
  • Mumbai - Victoria station: chai.
  • Mumbai- 10 of the best food in Mumbai.
  • My India travel Bucket List.
  • Nagpur.
  • New Taj Mahal cafe, Mangalore Buns (banana).
  • Orchha.
  • Panchgani.
  • Pandavleni caves, nashik, maharashtra.
  • Radhanagar beach.
  • Rishikesh.
  • Sabarmati Ashram.
  • Satyagraha Ashram (founded by Gandhi).
  • Shimla (forest/trees) - Lonely Planet.
  • Things to do in Pune (Quora).
  • Uttarakhand travel | India, Asia - Lonely Planet.
  • Varanasi.
  • Vijaya Nagara, India Centuries-old temples and statues surround Hampi, in southwest India, making up what’s left of the once-powerful city..
  • Vipassana pagoda.
  • Welcome Ajanta, India (Shishu's site).
  • Western Ghats.
  • ]]>
    Thu, 05 Mar 2015 00:00:00 GMT
    Git bookmarks https://xenodium.com/git-bookmarks https://xenodium.com/git-bookmarks
  • 10 Common Git Problems and How to Fix Them – citizen428.blog.
  • a hackers guide to git
  • Better Git configuration | Scott Nonnenberg.
  • delete last commit
  • Get up to speed with partial clone and shallow clone - The GitHub Blog.
  • Getting Started with Git & Github.
  • Git - Quickest Way to Resolve Most Merge Conflicts.
  • Git Common-Flow.
  • git course: another git online tutorial, by git-tower folks.
  • Git from the Bottom Up.
  • Git from the inside out.
  • git from the trenches.
  • Git Merging vs. Git Rebasing: The Beginner's Guide.
  • git recipes for common mistakes and mishaps.
  • Git Tips #6 - Using Git with Multiple Email Addresses.
  • GitHub - k88hudson/git-flight-rules: Flight rules for git.
  • GitHub - susam/gitpr: A quick reference guide on fork and pull request workflow.
  • GitLab Annex solves the problem of versioning large binaries with git.
  • Ignoring bulk change commits with git blame - Moxio.
  • kernel's git faq.
  • model git commit message
  • Multiple worktrees and triangular workflows (multiple branches checked out).
  • ndp software's git cheatsheet
  • Oh, shit, git!.
  • Renaming Your Default Git Branch (Harry R. Schwartz).
  • rerere: reuse recorded resolution.
  • things you didn't know about git.
  • TIL about git-subline-merge.
  • Understanding Git Conceptually.
  • Upcase's mastering Git course.
  • Using Askgit (sql interface to your git repository).
  • ]]>
    Thu, 05 Mar 2015 00:00:00 GMT
    Language learning bookmarks https://xenodium.com/language-learning-bookmarks https://xenodium.com/language-learning-bookmarks
  • Hacking Chinese: A Practical Guide to Learning Mandarin (Hacking Chinese).
  • HN's comments on learning laguages.
  • How it Works - Language Learning with The Michel Thomas Method.
  • How to learn (But Not Master) Any Language in 1 Hour (Plus: A Favor).
  • Manabi Reader – Learn Japanese by Reading on iOS.
  • Welcome - Woody Piano Shack.
  • ]]>
    Wed, 04 Mar 2015 00:00:00 GMT
    Git conflict resolution déjà vu? https://xenodium.com/git-conflict-resolution-deja-vu https://xenodium.com/git-conflict-resolution-deja-vu use git rerere. here's a post.

    ]]>
    Wed, 18 Feb 2015 00:00:00 GMT
    Graphics design tools bookmarks https://xenodium.com/graphics-design-tools-bookmarks https://xenodium.com/graphics-design-tools-bookmarks
  • Alternatives to Adobe products on Linux, macOS and Windows.
  • Aseprite.
  • Awesome-Design-Tools: The best design tools for everything.
  • Contrast ratio.
  • Design+code.
  • HTML5 animations.
  • Ios prototyping with flinto.
  • Krita.
  • Leonardo.
  • MakeAppIcon - Generate app icons of all sizes with a click!.
  • Mischief.
  • Mypaint.
  • Natron.
  • Ormr.
  • Screen Guru - Take clean screenshot of any websites.
  • Sketch for Mac.
  • Sketchup.
  • TVPaint.
  • ]]>
    Sat, 17 Jan 2015 00:00:00 GMT
    Emacs key bindings and maps https://xenodium.com/emacs-key-bindings-and-maps https://xenodium.com/emacs-key-bindings-and-maps based on masteringemacs.org.

    bonus tip

    prefix key, followed by c-h, lists keys in prefix.

    keymap

    maps key to action.

    keymap found in buffer and most major modes.

    keys

    • undefined: self explanatory.
    • prefix key: ie. c-x (part of complete key).
    • complete key: complete input executes associated command.

    mapping

    • (define-key keymap key def): add to current buffer map.
    • (local-set-key key command): add to active buffer (no map option).
    • (local-unset-key key)
    • (global-set-key key command): add to global keymap (all buffers).
    • (global-unset-key key)

    key codes

    • kbd: macro transaltes human-readable key to emacs readable.
    • function and navigation keys must be surrounded by <>.
    • example: (kbd "c-c p") or (kbd "<f8>") of (kbd "<down>").

    remapping

    • use remap to replace mapping (ie. kill-line with my/kill-line).
    • (define-key keymap [remap original-function] 'my-own-function).

    reserved keys

    • "c-c ?" generally reserved for you, but third party packages use it.
    • function keys (ie. f1-f12).
    • hyper and super (ancient).

    lookup order

    • in a nutshell: minor mode keys, local keys, global keys.
    • full order:
      1. overriding-terminal-local-map: terminal-specific key binds.
      2. overriding-local-map: override all other local keymaps (avoid if possible).
      3. char property at point: useful for yasnippet.
      4. emulation-mode-map-alists: advanced multi-mode keymap.
      5. minor-mode-overriding-map-alist: minor modes in major modes.
      6. minor-mode-map-alist: as previous (preferred for minor modes) <—–
      7. current-local-map: buffers current local map.
      8. current-global-map: last place to look (ie. global).

    mode hooks

    • (local-set-key (kbd "c-c q") 'my-awesome-method)) in hook-method.
    • for key-chord-define, use current-local-map.
    ]]>
    Thu, 23 Apr 2015 00:00:00 GMT
    Video backlog https://xenodium.com/online-video-backlog https://xenodium.com/online-video-backlog [TODO]{.todo .TODO} Frank Ostaseski: "Inviting the Wisdom of Death into Life".

    [TODO]{.todo .TODO} Adam Curtis HyperNormalisation HD - YouTube.

    [TODO]{.todo .TODO} YouTube’s top creators are burning out (Hacker News).

    [TODO]{.todo .TODO} Donald Knuth Lectures - YouTube.

    [TODO]{.todo .TODO} Rashomon by Akira Kurosawa.

    [TODO]{.todo .TODO} Seeing spaces.

    [TODO]{.todo .TODO} An exclusive seminar with Julian Assange.

    [TODO]{.todo .TODO} The (Secret) City of London, Part 1: History.

    [TODO]{.todo .TODO} The (Secret) City of London, Part 2: History.

    [TODO]{.todo .TODO} The UK Gold.

    [TODO]{.todo .TODO} Terra Plana - Learning the skill of barefoot running.

    [TODO]{.todo .TODO} The Science of Compassion ॐ Mata Amritanandamayi ॐ Documentary.

    [TODO]{.todo .TODO} Rich Hickey Talks (clojure).

    [TODO]{.todo .TODO} Redux: The Single Immutable State Tree screencast.

    [TODO]{.todo .TODO} Anders Hejlsberg and Lars Bak: TypeScript, JavaScript, and Dart.

    [TODO]{.todo .TODO} How To Travel… The Slow Hustle Way.

    [TODO]{.todo .TODO} 2015-12-10 Emacs Chat - John Wiegley.

    [TODO]{.todo .TODO} How To Order Salads From Inside Emacs.

    [TODO]{.todo .TODO} An introduction to Emacs Lisp.

    [TODO]{.todo .TODO} 12 Challenging Steps to Being a Better Interviewer – Cate Huston at The Lead Developer 2015.

    [TODO]{.todo .TODO} Born Rich: Children Of The Insanely Wealthy.

    [TODO]{.todo .TODO} Emacs for writers.

    [TODO]{.todo .TODO} Frugal fire 002: justin mccurry (rootofgood).

    [TODO]{.todo .TODO} Graham Hancock – The War on Consciousness.

    [TODO]{.todo .TODO} Griefwalker.

    [TODO]{.todo .TODO} How to win the loser's game.

    [TODO]{.todo .TODO} John Green's "Crash Course History" videos.

    [TODO]{.todo .TODO} Matthieu Ricard Leads a Meditation on Altruistic Love and Compassion.

    [TODO]{.todo .TODO} Matthieu Ricard: "Altruism" | Talks at Google.

    [TODO]{.todo .TODO} Nick Hanauer – Rich People Don’t Create Jobs.

    [TODO]{.todo .TODO} Programming is terrible — Lessons learned from a life wasted.

    [TODO]{.todo .TODO} Rupert Sheldrake – The Science of Delusion.

    [TODO]{.todo .TODO} Surya Namaskar stretches.

    [TODO]{.todo .TODO} The Emacs of distros.

    [TODO]{.todo .TODO} The Known Universe by AMNH.

    [DONE]{.done .DONE} Juliet Schor Iris Nights: Re-Thinking Materialism.

    [DONE]{.done .DONE} The Internets own boy.

    [DONE]{.done .DONE} BBC's secret of levitation.

    [DONE]{.done .DONE} Hold Fast.

    [DONE]{.done .DONE} This is water, commencement speech.

    [DONE]{.done .DONE} This is water.

    ]]>
    Tue, 30 Dec 2014 00:00:00 GMT
    Flight-booking bookmarks https://xenodium.com/flight-booking-bookmarks https://xenodium.com/flight-booking-bookmarks
  • Azair: Budget air tickets from low-cost airlines.
  • Google Flights.
  • Matrix - ITA Software by Google.
  • Travelzoo: Travel & entertainment deals: hotels, holidays, cruises, restaurants, shows.
  • ]]>
    Fri, 12 Sep 2014 00:00:00 GMT
    Frugal bookmarks https://xenodium.com/frugal-bookmarks https://xenodium.com/frugal-bookmarks
  • 9 Great Frugal Blogs in The UK - A Cornish Mum.
  • Any tips for buying Cheap Red Wine? : UKFrugal.
  • Asda Mobile | Pay as you go SIM (Order your free SIM).
  • Beating the latte factor: My quest for the best cheap coffee.
  • Big green smile (eco bulk buys).
  • Broadband.co.uk Dedicated to finding the best broadband for you.
  • Buy it for life: Durable, Quality, Practical (Reddit).
  • Check online store ratings and save money with deals at PriceGrabber.com.
  • Emergency Fund Before YOLO - Frugal Money Man.
  • FreeEBOOKS (subreddit).
  • Frugal Fun For Boys and Girls - Learning, Play, STEM Activities, and Thing to Do! (home experiments for kids).
  • Frugal Queen in France.
  • Global Online Shopping for Apparel, Phones, Computers, Electronics, Fashion and more on Aliexpress.
  • How to Adopt a Wayward Plant (The Telegraph).
  • How to find the best quality for less, but it for life, (Get Rich Slowly).
  • How to Make Your Own Sustainable Cleaning Products (ethical.net).
  • How To Shop On A Budget – from A Girl Called Jack (Jack Monroe).
  • iForce marketzone.
  • Keeping your house cooled (video).
  • Life After Money: My money saving tips.
  • Mole Country Stores: Agricultural and Rural Retailer (clothing).
  • The Humble Penny (Create Financial Joy).
  • Two together railcard.
  • UKFrugal: Health and Beauty list : UKFrugal.
  • Want To Buy It For Life? (lots of item suggestions).
  • What are the best bits about lidl? : UKPersonalFinance.
  • What should you not say when buying a car? - Quora.
  • ]]>
    Thu, 18 Sep 2014 00:00:00 GMT
    Charities bookmarks https://xenodium.com/charities-bookmarks https://xenodium.com/charities-bookmarks
  • Toilet paper that builds toilets (Who Gives A Crap UK).
  • ]]>
    Thu, 18 Sep 2014 00:00:00 GMT
    Origami bookmarks https://xenodium.com/origami-bookmarks https://xenodium.com/origami-bookmarks
  • Origami - How to make a WASTEBASKET.
  • Origami That's Fun And Easy.
  • ]]>
    Thu, 18 Sep 2014 00:00:00 GMT
    Movie backlog https://xenodium.com/movie-backlog https://xenodium.com/movie-backlog [TODO]{.todo .TODO} Watch The Åre Murders | Netflix Official Site.

    [TODO]{.todo .TODO} Watch SAKAMOTO DAYS | Netflix Official Site.

    [TODO]{.todo .TODO} Mishima: A Life in Four Chapters (1985) - IMDB.

    [TODO]{.todo .TODO} Drive My Car (2021) - IMDb.

    [TODO]{.todo .TODO} The Suicide Squad (2021) - IMDb.

    [TODO]{.todo .TODO} Movies that feel like you're watching an adaptation of the Cyberpunk RPG?.

    [TODO]{.todo .TODO} Movies that get better with more viewings.

    [TODO]{.todo .TODO} Zhang Yimou: China's Greatest Director | Part 2 .

    [TODO]{.todo .TODO} Take your pill.

    [TODO]{.todo .TODO} A handful of choices, but Hundreds of Beavers caught my attention.

    [TODO]{.todo .TODO} https://www.metacritic.com

    [TODO]{.todo .TODO} Chalk line.

    [TODO]{.todo .TODO} Anime Scene Search Engine - trace.moe.

    [TODO]{.todo .TODO} Poorly Drawn Lines.

    [TODO]{.todo .TODO} VHYes (2019) - Rotten Tomatoes.

    [TODO]{.todo .TODO} The Sandman (comic book) - Wikipedia

    [TODO]{.todo .TODO} The Sandman (TV Series 2021– ) - IMDb

    [TODO]{.todo .TODO} Korean films/shows to watch

    [TODO]{.todo .TODO} Gemini man.

    [TODO]{.todo .TODO} Tigertail (2020) - Rotten Tomatoes.

    [TODO]{.todo .TODO} Buffaloed (2019) - Rotten Tomatoes.

    [TODO]{.todo .TODO} 12 Hour Shift (2020) - Rotten Tomatoes.

    [TODO]{.todo .TODO} What's your favorite Kurosawa film?.

    [TODO]{.todo .TODO} Korean Pork Belly Rhapsody | Netflix.

    [TODO]{.todo .TODO} Back to Life | Netflix.

    [TODO]{.todo .TODO} The Best Movies of 2020 – Best New Films of the Year.

    [DONE]{.done .DONE} if something happens.

    [TODO]{.todo .TODO} The Essentials Movie Recs - Google Sheets.

    [TODO]{.todo .TODO} Hipsters (2008) - IMDb.

    [TODO]{.todo .TODO} Den radio (2008) - IMDb.

    [TODO]{.todo .TODO} Alyosha Popovich i Tugarin Zmey (2004) - IMDb.

    [TODO]{.todo .TODO} Brilliantovaya ruka (1969) - IMDb.

    [TODO]{.todo .TODO} Stalker (1979) - IMDb.

    [TODO]{.todo .TODO} Solaris (1972) - IMDb.

    [TODO]{.todo .TODO} Miss Hokusai (2015) - IMDb.

    [TODO]{.todo .TODO} The Hunt (2012) - IMDb.

    [TODO]{.todo .TODO} Attack the Block: Trailer #2.

    [TODO]{.todo .TODO} Upgrade (2018) - IMDb.

    [TODO]{.todo .TODO} The Way Back (2011) - Rotten Tomatoes.

    [TODO]{.todo .TODO} Big Nothing (2006) - IMDb.

    [TODO]{.todo .TODO} A Most Violent Year (2014) - IMDb.

    [TODO]{.todo .TODO} The Peanut Butter Falcon (2019) - IMDb.

    [TODO]{.todo .TODO} Technotise - Edit i ja (2009) - IMDb.

    [TODO]{.todo .TODO} Tetsuo: The Bullet Man (2009) - IMDb.

    [TODO]{.todo .TODO} Sleep Dealer.

    [TODO]{.todo .TODO} Sky Blue.

    [TODO]{.todo .TODO} Paycheck (2003) - IMDb.

    [TODO]{.todo .TODO} Returner (2002) - IMDb.

    [TODO]{.todo .TODO} Cypher (2002) - IMDb.

    [TODO]{.todo .TODO} The Little Shop of Horrors (1986) - IMDb.

    [TODO]{.todo .TODO} To the Lake.

    [TODO]{.todo .TODO} Throne of Blood (1957) - IMDb.

    [TODO]{.todo .TODO} Raised by Wolves (TV Series 2020– ) - IMDb.

    [TODO]{.todo .TODO} Untouchable (2011) - IMDb.

    [TODO]{.todo .TODO} Midnight in Paris (2011) - IMDb.

    [TODO]{.todo .TODO} Paris, je t'aime (2006) - IMDb.

    [TODO]{.todo .TODO} Watch Alice in Paris | Prime Video.

    [TODO]{.todo .TODO} Plan Coeur (TV Series 2018– ) - IMDb.

    [TODO]{.todo .TODO} what good shows are streaming rn?.

    [TODO]{.todo .TODO} First Cow | Where to Stream and Watch | Decider.

    [TODO]{.todo .TODO} 'She Dies Tomorrow' Movie Review: A Person-to-Person Paranoia Pandemic.

    [TODO]{.todo .TODO} ‘Palm Springs,’ 2020’s Most Fun Movie.

    [TODO]{.todo .TODO} 'Spaceship Earth': Why crazy new doc is must-watch quarantine viewing.

    [TODO]{.todo .TODO} 'Don't Breathe' is latest movie to use Detroit as its scary setting.

    [TODO]{.todo .TODO} Spaceship Earth (2020) - IMDb.

    [TODO]{.todo .TODO} Reviews - zerokspot.com.

    [TODO]{.todo .TODO} TSP2013: Only Lovers Left Alive – Random Thoughts.

    [TODO]{.todo .TODO} TSP2008: Burn After Reading – Random Thoughts.

    [TODO]{.todo .TODO} TSP2009: The Limits of Control – Random Thoughts.

    [TODO]{.todo .TODO} TSP2002: Adaptation. – Random Thoughts.

    [TODO]{.todo .TODO} TSP2015: Trainwreck – Random Thoughts.

    [TODO]{.todo .TODO} If you could wave a wand and instantly have more episodes of one TV series that has already concluded, which series would you pick?.

    [TODO]{.todo .TODO} The Advisors Alliance - Wikipedia.

    [TODO]{.todo .TODO} The 300 Coda: My Top 50 Movies of 2018 and My Top 40.

    [TODO]{.todo .TODO} Green Room (film) - Wikipedia.

    [TODO]{.todo .TODO} 'Relic' is a Masterclass in Independent Horror | MovieBabble.

    [TODO]{.todo .TODO} Hidden (Caché) (2005) - IMDb.

    [TODO]{.todo .TODO} OTB#1: Tokyo Story – Random Thoughts.

    [TODO]{.todo .TODO} Into the Night | Netflix Official Site.

    [TODO]{.todo .TODO} Undone (TV Series 2019– ) - IMDb.

    [TODO]{.todo .TODO} Quarantine Staff Picks: Part 7 | MovieBabble.

    [TODO]{.todo .TODO} Quarantine Staff Picks: Part 6 | MovieBabble.

    [TODO]{.todo .TODO} Quarantine Staff Picks: Part 5 | MovieBabble.

    [TODO]{.todo .TODO} Quarantine Staff Picks: Part 4 | MovieBabble.

    [TODO]{.todo .TODO} Quarantine Staff Picks: Part 3 | MovieBabble.

    [TODO]{.todo .TODO} Quarantine Staff Picks: Part 2 | MovieBabble.

    [TODO]{.todo .TODO} Quarantine Staff Picks: Part 1 | MovieBabble.

    [TODO]{.todo .TODO} Quarantine Staff Picks: Part 8 | MovieBabble.

    [TODO]{.todo .TODO} Gary Hustwit (filmography).

    [TODO]{.todo .TODO} Helvetica, a documentary on typography.

    [TODO]{.todo .TODO} twitter: black documentaries that assist in understanding racism, prejudice, police brutality, and more.

    [TODO]{.todo .TODO} MovieBabble - The Casual Way to Discuss Movies.

    [TODO]{.todo .TODO} bitdepth.

    [TODO]{.todo .TODO} Burning (2018) - IMDb.

    [TODO]{.todo .TODO} American Honey (2016) - Rotten Tomatoes.

    [TODO]{.todo .TODO} Undone.

    [TODO]{.todo .TODO} The Wire - Wikipedia.

    [TODO]{.todo .TODO} Ajin: Demi-Human - Wikipedia.

    [TODO]{.todo .TODO} Halt and Catch Fire.

    [TODO]{.todo .TODO} A Beginner's Guide To Afrofuturism: 7 Titles To Watch And Read.

    [TODO]{.todo .TODO} Sunbeam city wiki: Solarpunk.

    [TODO]{.todo .TODO} Goldmund on Twitter: Watched Fight Club, thought about it, and realized why ….

    [TODO]{.todo .TODO} Chance on Twitter: Post your favorite movie..

    [TODO]{.todo .TODO} NFLX2019 January 4th: Lionheart – Random Thoughts.

    [TODO]{.todo .TODO} NFLX2019 January 18th: Soni – Random Thoughts.

    [TODO]{.todo .TODO} NFLX2019 December 31st: Ghost Stories – Random Thoughts.

    [TODO]{.todo .TODO} NFLX2019 November 15th: Klaus – Random Thoughts.

    [TODO]{.todo .TODO} NFLX2019 October 18th: Seventeen – Random Thoughts.

    [TODO]{.todo .TODO} NFLX2019 August 2nd: Otherhood – Random Thoughts.

    [TODO]{.todo .TODO} NFLX2019 May 30th: Chopsticks – Random Thoughts.

    [TODO]{.todo .TODO} NFLX2019 May 24th: The Perfection – Random Thoughts.

    [TODO]{.todo .TODO} NFLX2019 July 31st: The Red Sea Diving Resort – Random Thoughts.

    [TODO]{.todo .TODO} Paris is Us.

    [TODO]{.todo .TODO} Directors’ top 100 | BFI.

    [TODO]{.todo .TODO} It Follows - Wikipedia.

    [TODO]{.todo .TODO} The 20 Best Cyberpunk Movies of All Time.

    [TODO]{.todo .TODO} Ragnarok | Netflix Official Site.

    [TODO]{.todo .TODO} Home – Neon Dystopia.

    [TODO]{.todo .TODO} Patriot (Amazon)

    [TODO]{.todo .TODO} The Expanse (Amazon)

    [TODO]{.todo .TODO} The Boys (Amazon)

    [TODO]{.todo .TODO} The Last Kingdom (Netflix)

    [TODO]{.todo .TODO} The Witcher (Netflix)

    [TODO]{.todo .TODO} Travelers (Netflix)

    [TODO]{.todo .TODO} If I Only Hadn’t Met You (Netflix)

    [TODO]{.todo .TODO} Peaky Blinders (Netflix)

    [TODO]{.todo .TODO} Catch-22 (Hulu)

    [TODO]{.todo .TODO} American Factory - Wikipedia.

    [TODO]{.todo .TODO} October Faction | Netflix Official Site.

    [TODO]{.todo .TODO} Transfers | Netflix.

    [TODO]{.todo .TODO} Ad Vitam | Netflix Official Site.

    [TODO]{.todo .TODO} On Children | Netflix Official Site.

    [TODO]{.todo .TODO} Perfume | Netflix Official Site.

    [TODO]{.todo .TODO} The Gift | Netflix Official Site.

    [TODO]{.todo .TODO} Ares | Netflix Official Site.

    [TODO]{.todo .TODO} Demon Slayer: Kimetsu no Yaiba - Wikipedia.

    [TODO]{.todo .TODO} Yuri on Ice.

    [TODO]{.todo .TODO} Twitter: "Has anyone here seen Parasite?".

    [TODO]{.todo .TODO} White House Down (2013) - IMDb.

    [TODO]{.todo .TODO} American Sniper (2014) - IMDb.

    [TODO]{.todo .TODO} Hannibal Burress, Hasan Minhaj, Neal Brennan, Dave Chappelle.

    [TODO]{.todo .TODO} The Insider (film) - Wikipedia.

    [TODO]{.todo .TODO} I need recommendations for shows/movies (preferably on Netflix).

    [TODO]{.todo .TODO} Taste of Tea.

    [TODO]{.todo .TODO} Japanology Episodes List.

    [TODO]{.todo .TODO} Japanology Plus - TV | NHK WORLD-JAPAN Live & Programs.

    [TODO]{.todo .TODO} David Attenborough's Our Planet.

    [TODO]{.todo .TODO} Infernal Affairs - Wikipedia.

    [TODO]{.todo .TODO} Victoria Aveyard on Twitter: "when your roommate asks for a Marvel watch list with commentary… ".

    [TODO]{.todo .TODO} ROMA.

    [TODO]{.todo .TODO} The Killing of a Sacred Deer (2017).

    [TODO]{.todo .TODO} Private Life.

    [TODO]{.todo .TODO} You Were Never Really Here.

    [TODO]{.todo .TODO} Sorry to Bother You.

    [TODO]{.todo .TODO} Game Night.

    [TODO]{.todo .TODO} Support the Girls.

    [TODO]{.todo .TODO} Steven Yeun, Burning.

    [TODO]{.todo .TODO} A Simple Favor.

    [TODO]{.todo .TODO} Ask HN: Mind blowing documentaries?.

    [TODO]{.todo .TODO} The 21st Century’s Most Acclaimed Films (including films from 2000).

    [TODO]{.todo .TODO} Koyaanisqatsi.

    [TODO]{.todo .TODO} Mifune: The Last Samurai (2015) - IMDb.

    [TODO]{.todo .TODO} Sunshine Superman (2014) - IMDb.

    [TODO]{.todo .TODO} Under the Sun (Netflix): "Under the Sun keeps forcing us to ponder why we watch representations of real life and what we think we’re learning about reality in the process".

    [TODO]{.todo .TODO} Peter and the Farm (Netflix).

    [TODO]{.todo .TODO} Lessons of Darkness - Wikipedia.

    [TODO]{.todo .TODO} The story of stuff.

    [TODO]{.todo .TODO} Immortality.

    [TODO]{.todo .TODO} Ichi the killer.

    [TODO]{.todo .TODO} Audition.

    [TODO]{.todo .TODO} The Happiness of the Katakuris.

    [TODO]{.todo .TODO} Agitator.

    [TODO]{.todo .TODO} Gozu.

    [TODO]{.todo .TODO} Outrage.

    [TODO]{.todo .TODO} Minbo.

    [TODO]{.todo .TODO} Blues harp.

    [TODO]{.todo .TODO} Goyokin.

    [TODO]{.todo .TODO} The hidden blade.

    [TODO]{.todo .TODO} Wild Tales.

    [TODO]{.todo .TODO} The Road.

    [TODO]{.todo .TODO} Moon.

    [TODO]{.todo .TODO} Who am I.

    [TODO]{.todo .TODO} Tarkovsky films.

    [TODO]{.todo .TODO} Snowpiercer.

    [TODO]{.todo .TODO} Kubo and the two strings.

    [TODO]{.todo .TODO} Spotlight.

    [TODO]{.todo .TODO} Creed.

    [TODO]{.todo .TODO} Innocence of memories.

    [TODO]{.todo .TODO} The revenant.

    [TODO]{.todo .TODO} Big short.

    [TODO]{.todo .TODO} Pressure Cooker.

    [TODO]{.todo .TODO} Bob and David.

    [TODO]{.todo .TODO} Akira kurosawa director.

    [TODO]{.todo .TODO} All About Eve.

    [TODO]{.todo .TODO} Babadook.

    [TODO]{.todo .TODO} Death to Smoochy.

    [TODO]{.todo .TODO} Enter the void, by gaspar noe.

    [TODO]{.todo .TODO} Four horsemen.

    [TODO]{.todo .TODO} Hirokazu koreeda director.

    [TODO]{.todo .TODO} Naomi kawaze director.

    [TODO]{.todo .TODO} Nostalghia.

    [TODO]{.todo .TODO} Sion sono director.

    [TODO]{.todo .TODO} Solyaris

    [TODO]{.todo .TODO} Stalker

    [TODO]{.todo .TODO} Takashi kitano director.

    [TODO]{.todo .TODO} Takashi miike director.

    [TODO]{.todo .TODO} The connection.

    [TODO]{.todo .TODO} The mirror

    [TODO]{.todo .TODO} The Silent Partner.

    [TODO]{.todo .TODO} Uncle boonmee who can recall his past lives, by apichatpong weerasethakul.

    [TODO]{.todo .TODO} Waking life, by rickard linklater.

    [TODO]{.todo .TODO} Xah Lee's movie list.

    [DONE]{.done .DONE} Halt and Catch Fire (TV Series 2014–2017) - IMDb.

    [DONE]{.done .DONE} Twinsters.

    [DONE]{.done .DONE} Mindhunter (Netflix)

    [DONE]{.done .DONE} Altered Carbon (Netflix)

    OBSOLETE Narcos (Netflix)

    [DONE]{.done .DONE} The Marvelous Mrs. Maisel (Amazon)

    [DONE]{.done .DONE} Sneaky Pete (Amazon)

    [DONE]{.done .DONE} Ozark (Netflix)

    [DONE]{.done .DONE} Midnight Diner: Tokyo Stories (Netflix)

    [DONE]{.done .DONE} Dark (Netflix)

    [DONE]{.done .DONE} Altered Carbon | Netflix Official Site.

    [DONE]{.done .DONE} The Men Who Made Us Spend - a really amazing 3 part documentary from the BBC on spending and consumerism.

    [DONE]{.done .DONE} Annihilation (film) - Wikipedia.

    [DONE]{.done .DONE} 13 Assasins <2018-12-27 Thu>.

    [DONE]{.done .DONE} 7 Samurai <2018-12-27 Thu>.

    [DONE]{.done .DONE} Dogs of Berlin (TV Series 2018– ) - IMDb.

    [DONE]{.done .DONE} Tidying Up with Marie Kondo.

    [DONE]{.done .DONE} The True cost.

    [DONE]{.done .DONE} Awake, the life of yogananda.

    [DONE]{.done .DONE} Birdman.

    [DONE]{.done .DONE} Boyhood.

    [DONE]{.done .DONE} She A Chinese.

    [DONE]{.done .DONE} Wet Hot American Summer.

    ]]>
    Tue, 30 Dec 2014 00:00:00 GMT
    Microservices bookmarks https://xenodium.com/microservices-bookmarks https://xenodium.com/microservices-bookmarks
  • Creating a Microservice? Answer these 10 Questions First.
  • How we ended up with microservices.
  • HTTPie – command line HTTP client.
  • ]]>
    Mon, 29 Dec 2014 00:00:00 GMT
    Books backlog https://xenodium.com/books-backlog https://xenodium.com/books-backlog [TODO]{.todo .TODO} Frank Bennett: "20 books that have had an impact on who you are. …" - Indiewe….

    [TODO]{.todo .TODO} ‎Swift Secrets on Apple Books.

    [TODO]{.todo .TODO} Island: Amazon.co.uk: Aldous Huxley: 9780099477778: Books.

    [TODO]{.todo .TODO} Amazon.com: Hieroglyph: Stories and Visions for a Better Future eBook.

    [TODO]{.todo .TODO} Meredith: The Future of Silicon Valley (fiction).

    [TODO]{.todo .TODO} Working in Public: The Making and Maintenance of Open Source Software eBook.

    [TODO]{.todo .TODO} No More Mr Nice Guy: A Proven Plan for Getting What You Want.

    [TODO]{.todo .TODO} Thread on Wask Factory (more titles).

    [TODO]{.todo .TODO} The Wasp Factory - Wikipedia.

    [TODO]{.todo .TODO} Book recommendation thread by Maris Kreizman.

    [TODO]{.todo .TODO} Extreme Privacy: What It Takes to Disappear: Bazzell, Michael: 9798643343707.

    [TODO]{.todo .TODO} 'You Are Not So Smart': Why We Can't Tell Good Wine From Bad - The Atlantic.

    [TODO]{.todo .TODO} The Deficit Myth - Stephanie Kelton.

    [TODO]{.todo .TODO} Metadata: Forty book recommendations.

    [TODO]{.todo .TODO} Solarpunk (62 books).

    [TODO]{.todo .TODO} Bolo’bolo | The Anarchist Library.

    [TODO]{.todo .TODO} The velvet monkey wrench : Muir, John, 1918-.

    [TODO]{.todo .TODO} Solarpunk Community Discord List (108 books).

    [TODO]{.todo .TODO} Launch: An Internet Millionaire's Secret Formula to Sell Almost anything online.

    [TODO]{.todo .TODO} The Psychology of Money: The Psychology of Money: Timeless lessons on wealth, greed, and happiness.

    [TODO]{.todo .TODO} Recommendations | The Quill to Live.

    [TODO]{.todo .TODO} My 2020 Reading List · FumbLing.

    [TODO]{.todo .TODO} Norse Mythology by Neil Gaiman.

    [TODO]{.todo .TODO} Auto by David Wailing.

    [TODO]{.todo .TODO} Ask HN: Book recommendations for understanding financial systems? | Hacker News.

    [TODO]{.todo .TODO} Andromeda (novel) - Wikipedia.

    [TODO]{.todo .TODO} SOLARPUNK : A REFERENCE GUIDE - Solarpunks - Medium.

    [TODO]{.todo .TODO} The Final Circle of Paradise - Wikipedia.

    [TODO]{.todo .TODO} Here's a visual of my 35 favorite books of the decade..

    [TODO]{.todo .TODO} Cyberpunk: Then and Now | Hacker News.

    [TODO]{.todo .TODO} Accelerate: The Science of Lean Software and Devops.

    [TODO]{.todo .TODO} Drive: The Surprising Truth About What Motivates Us | Hacker News Books.

    [TODO]{.todo .TODO} Pachinko (novel) - Wikipedia.

    [TODO]{.todo .TODO} Paul Hudson on Twitter: Can you recommend some manga?.

    [TODO]{.todo .TODO} Dan Abramov: Please point me to a book about programming that isn't boring.

    [TODO]{.todo .TODO} John's Amazon wishlist.

    [TODO]{.todo .TODO} Super Thinking: Upgrade Your Reasoning and Make Better Decisions with Mental Models.

    [TODO]{.todo .TODO} Gut: the inside story of our body's most under-rated organ.

    [TODO]{.todo .TODO} Evan Sandhoefner on Twitter: Which books/papers/talks/etc have blown your mind / changed your worldview significantly?.

    [TODO]{.todo .TODO} JOY ON DEMAND: The Art of Discovering the Happiness Within.

    [TODO]{.todo .TODO} 8 Minute Meditation Expanded : Quiet Your Mind. Change Your Life.

    [TODO]{.todo .TODO} Mindfulness in Plain English: 20th Anniversary Edition: Amazon.co.uk.

    [TODO]{.todo .TODO} Bettina Bauer: What is your favorite Science Fiction novel? (twitter).

    [TODO]{.todo .TODO} Altered Traits: Science Reveals How Meditation Changes Your Mind, Brain, and Body.

    [TODO]{.todo .TODO} Junk Food Japan: Addictive Food from Kurobuta.

    [TODO]{.todo .TODO} Ask HN: Recommend one book I need to read this summer?.

    [TODO]{.todo .TODO} I am a cat (Soseki Natsume).

    [TODO]{.todo .TODO} Thinking in Systems: A Primer: Amazon.co.uk: Diana Wright, Donella H. Meadows: 9781844077250: Books.

    [TODO]{.todo .TODO} Casting SPELs in Lisp (Emacs edition).

    [TODO]{.todo .TODO} Land of lisp.

    [TODO]{.todo .TODO} Juggling for the Complete Klutz by John Cassidy.

    [TODO]{.todo .TODO} Positioning: The Battle for Your Mind.

    [TODO]{.todo .TODO} Snow Crash - Wikipedia.

    [TODO]{.todo .TODO} The Little Book of Common Sense Investing, Updated and Revised.

    [TODO]{.todo .TODO} The Little LISPer, Third Edition: 9780023397639: Computer Science Books @ Amazon.com.

    [TODO]{.todo .TODO} The Anatomy of Peace: Resolving the Heart of Conflict.

    [TODO]{.todo .TODO} Superfast Lead at speed.

    [TODO]{.todo .TODO} A company of one.

    [TODO]{.todo .TODO} Shoe Dog: A Memoir by the Creator of NIKE.

    [TODO]{.todo .TODO} Caitlin Doughty's top 8 books from 2018.

    [TODO]{.todo .TODO} Global Economy as you've never seen it.

    [TODO]{.todo .TODO} Replay.

    [TODO]{.todo .TODO} Siddhartha: A Novel.

    [TODO]{.todo .TODO} Out (novel) by Natsuo Kirino.

    [TODO]{.todo .TODO} Folklore, Folktales, and Fairy Tales from Japan: A Digital Library.

    [TODO]{.todo .TODO} A Tale for the Time Being by Ruth Ozeki.

    [TODO]{.todo .TODO} Kitchen by Banan Yashimoto.

    [TODO]{.todo .TODO} The Overspent American: Why We Want What We Don't Need Paperback.

    [TODO]{.todo .TODO} Enough by Patrick Rhone.

    [TODO]{.todo .TODO} Hot Air has a nice selection.

    [TODO]{.todo .TODO} Domain-Driven Design: Tackling Complexity in the Heart of Software 1st Edition.

    [TODO]{.todo .TODO} Seeing like a State: How Certain Schemes to Improve the Human Condition Have Failed Paperback.

    [TODO]{.todo .TODO} Conquest of Abundance: A Tale of Abstraction versus the Richness of Being 2nd Edition.

    [TODO]{.todo .TODO} The Wisdom of No Escape: And the Path of Loving-Kindness.

    [TODO]{.todo .TODO} The Anatomy of Peace: Resolving the Heart of Conflict.

    [TODO]{.todo .TODO} The Millionaire Next Door.

    [TODO]{.todo .TODO} Refactoring: Improving the Design of Existing Code.

    [TODO]{.todo .TODO} Touched by the Goddess: On Ramanujan (Hacker News).

    [TODO]{.todo .TODO} Kundalini – An Untold Story: A Himalayan Mystic's Insight into the Power of Kundalini and Chakra Sadhana.

    [TODO]{.todo .TODO} Show HN: Top books mentioned in comments on Hacker News.

    [TODO]{.todo .TODO} The Prime of Miss Jean Brodie (novel).

    [TODO]{.todo .TODO} Plan B.

    [TODO]{.todo .TODO} Deskbound.

    [TODO]{.todo .TODO} The Way of Wanderlust: The Best Travel Writing of Don George (Travelers' Tales).

    [TODO]{.todo .TODO} We (novel).

    [TODO]{.todo .TODO} Top Books on Amazon Based on Links in Hacker News Comments (Hacker News).

    [TODO]{.todo .TODO} I'm OK, You're OK (Thomas A. Harris).

    [TODO]{.todo .TODO} Mistakes Were Made (but not by me) (Tavris/Aronson).

    [TODO]{.todo .TODO} Crucial Conversations (Patterson, Kelly…).

    [TODO]{.todo .TODO} When Prophecy Fails (Festinger).

    [TODO]{.todo .TODO} Influence (Robert Cialdini).

    [TODO]{.todo .TODO} The Seven Day Weekend (Ricardo Semler).

    [TODO]{.todo .TODO} Elements of Style (various).

    [TODO]{.todo .TODO} The Man Who Sold the Eiffel Tower (various).

    [TODO]{.todo .TODO} How to talk to anyone (Leil Lowndes).

    [TODO]{.todo .TODO} On Heroes, Hero-Worship, and the Heroic in History by Thomas Carlyle.

    [TODO]{.todo .TODO} Edwin Sir Arnold's The Light of Asia.

    [TODO]{.todo .TODO} Edwin Sir Arnold's The Song Celestial or Bhagavad-Gita.

    [TODO]{.todo .TODO} 50 great curries of india.

    [TODO]{.todo .TODO} 8 Week to optimum health.

    [TODO]{.todo .TODO} A Guide to the Good Life: The Ancient Art of Stoic Joy.

    [TODO]{.todo .TODO} Building Microservices.

    [TODO]{.todo .TODO} First Opium War essay.

    [TODO]{.todo .TODO} Full catastrophe living.

    [TODO]{.todo .TODO} goodreads.com.

    [TODO]{.todo .TODO} Leaving Microsoft to Change the world.

    [TODO]{.todo .TODO} Letters from a stoic.

    [TODO]{.todo .TODO} Michael's bookshelf.

    [TODO]{.todo .TODO} Neil degrasse tyson's reading list.

    [TODO]{.todo .TODO} On the Road, by Jack Kerouac.

    [TODO]{.todo .TODO} Public domain audio books.

    [TODO]{.todo .TODO} Royal horticultural society's organic Gardening.

    [TODO]{.todo .TODO} Salman Rushdie books.

    [TODO]{.todo .TODO} Technopoly: The Surrender of Culture to Technology.

    [TODO]{.todo .TODO} The Songlines, Bruce Chatwin.

    [TODO]{.todo .TODO} The Walker's Guide to Outdoor Clues and Signs.

    [TODO]{.todo .TODO} Thing Explainer: Complicated Stuff in Simple Words.

    [TODO]{.todo .TODO} Ultimate curry bible.

    [TODO]{.todo .TODO} Veg patch.

    [TODO]{.todo .TODO} What Every JavaScript Developer Should Know About ECMAScript 2015.

    [TODO]{.todo .TODO} Cameron Desautels's 2016 reading list.

    [TODO]{.todo .TODO} Thinking Fast and Slow (Kahneman).

    [DONE]{.done .DONE} Autonomous by Annalee Newitz.

    [DONE]{.done .DONE} This Book Is Full of Spiders by David Wong.

    [DONE]{.done .DONE} Why we sleep (twitter outline).

    [DONE]{.done .DONE} Flow: The Psychology of Optimal Experience.

    [DONE]{.done .DONE} Haruki Murakami.

    [DONE]{.done .DONE} Vagabonding: An Uncommon Guide to the Art of Long-Term World Travel.

    ]]>
    Tue, 30 Dec 2014 00:00:00 GMT
    Gardening bookmarks https://xenodium.com/gardening-bookmarks https://xenodium.com/gardening-bookmarks
  • Recommended times to plant vegetables in Santa Clara County.
  • We're the self-taught development team behind the #1 gardening app..
  • ]]>
    Mon, 29 Dec 2014 00:00:00 GMT
    Emacs tips backlog https://xenodium.com/emacs-tips-backlog https://xenodium.com/emacs-tips-backlog [TODO]{.todo .TODO} Typit: typing game for Emacs.

    [TODO]{.todo .TODO} pyimports.

    [TODO]{.todo .TODO} Sriram Krishnaswamy's init.

    [TODO]{.todo .TODO} Using a Node repl in Emacs with nvm and npm.

    [TODO]{.todo .TODO} arview.

    [TODO]{.todo .TODO} company-flx: fuzzy matching to company.

    [TODO]{.todo .TODO} Integration of the Go 'guru' analysis tool into Emacs.

    [TODO]{.todo .TODO} company-mode/company-statistics: Sort completion candidates by previous completion choices.

    [TODO]{.todo .TODO} Rewrite git history with Emacs, magit and git rebase.

    [TODO]{.todo .TODO} Code coverage highlighting for Emacs.

    [TODO]{.todo .TODO} tramp-theme.

    [TODO]{.todo .TODO} cstyle.

    [TODO]{.todo .TODO} A go Emacs config.

    [TODO]{.todo .TODO} Try out ox-twbs.

    [TODO]{.todo .TODO} Emacs Lisp function frequency.

    [TODO]{.todo .TODO} How to make yasnippet and company work nicer? (Stack Exchange).

    [TODO]{.todo .TODO} yasnippet-java-mode/java-snippets.el.

    [TODO]{.todo .TODO} font-lock-studio.

    [TODO]{.todo .TODO} buttercup.

    [TODO]{.todo .TODO} markdown-preview-eww.

    [TODO]{.todo .TODO} ediff-revision and magit-find-file to compare branches.

    [TODO]{.todo .TODO} Flycheck linter for sh using checkbashisms.

    [TODO]{.todo .TODO} El Kanban Org: parse org-mode todo-states to use org-tables as Kanban tables.

    [TODO]{.todo .TODO} Emacs iOS development (qiita).

    [TODO]{.todo .TODO} Emacs iOS development (fujimisakari).

    [TODO]{.todo .TODO} encrypting org files.

    [TODO]{.todo .TODO} flycheck-pos-tip.

    [TODO]{.todo .TODO} Writing Python Docstrings with Emacs.

    [TODO]{.todo .TODO} Try Completion for Objective-C (Github diff).

    [TODO]{.todo .TODO} Emacs fasd support.

    [TODO]{.todo .TODO} visual-regexp.

    [TODO]{.todo .TODO} Open large files.

    [TODO]{.todo .TODO} company-sourcekit (Swift completion): sample config.

    [TODO]{.todo .TODO} emacs-java-imports.

    [TODO]{.todo .TODO} append-to-buffer.

    [TODO]{.todo .TODO} python-x: extras for interactive evaluation.

    [TODO]{.todo .TODO} outlined-elisp-mode.

    [TODO]{.todo .TODO} outlien-magic.

    [TODO]{.todo .TODO} Gutter and linum+ config (see zvlex/dotfiles).

    [TODO]{.todo .TODO} kurecolor: Editing color.

    [TODO]{.todo .TODO} auto-insert-mode.

    [TODO]{.todo .TODO} Buffer local cursor color: ccc.

    [TODO]{.todo .TODO} clang indexing tool: clang-tags.

    [TODO]{.todo .TODO} Create custom theme: Trường's post.

    [TODO]{.todo .TODO} dired-hacks.

    [TODO]{.todo .TODO} gtd emacs workflow: Charles cave's notes.

    [DONE]{.done .DONE} emacs-index-search (lookup subject in Emacs manual).

    [DONE]{.done .DONE} info-apropos (lookup subject in all manuals).

    [TODO]{.todo .TODO} Jumping around tips: zerokspot.

    [TODO]{.todo .TODO} Mac OS clipboard support (from terminal): pbcopy.

    OBSOLETE Malabar mode: For Java.

    [TODO]{.todo .TODO} Melpa recipe format:format.

    OBSOLETE Naturaldocs for javascript: Vineet's post.

    [TODO]{.todo .TODO} Org protocol: see irreal's post and oremacs's part 1 and part 2.

    [TODO]{.todo .TODO} org-multiple-keymap. More at org-multiple-keymap.el.

    [TODO]{.todo .TODO} org-reveal: Export org to reveal.js.

    [TODO]{.todo .TODO} Practice touch/speed typing: speedtype.

    [TODO]{.todo .TODO} private configuration: private.

    [TODO]{.todo .TODO} project management for C/C++: malinka.

    [TODO]{.todo .TODO} Project templates: skeletor.

    [TODO]{.todo .TODO} Rewrite git logs. See emacs magit tutorial | rewrite older commit.

    [TODO]{.todo .TODO} Selective display: Hide lines longer than.

    [TODO]{.todo .TODO} shell-command-on-region: Print inline with C-u M-|.

    [TODO]{.todo .TODO} shell-command: Print output inline with C-u M-!.

    [TODO]{.todo .TODO} Simplify media file transformations: make-it-so.

    [TODO]{.todo .TODO} yatemplate.

    [TODO]{.todo .TODO} emacs-helm-xcdoc.

    OBSOLETE Drill down org files using orgnav (helm-based).

    OBSOLETE Prettier emacs. (use reformatter.el.)

    OBSOLETE Spaceline walkthrough.

    OBSOLETE Try out emacs Android debug (see this post).

    OBSOLETE quickrun.el.

    OBSOLETE Emacs for JavaScript.

    OBSOLETE go-gopath.

    OBSOLETE shift-number.el.

    OBSOLETE https://github.com/xuchunyang/DevDocs.el.

    OBSOLETE select-themes.

    OBSOLETE Emacs purpose.

    OBSOLETE Why are you changing gc-cons-threshold?.

    OBSOLETE Corral.

    OBSOLETE xcode-mode.

    OBSOLETE commenter.

    OBSOLETE Emacs JavaScript helpers.

    OBSOLETE yahoo-weather-mode.

    OBSOLETE Peek at peteyy's Javascript config.

    OBSOLETE import-js.

    OBSOLETE ES6 yasnippets.

    OBSOLETE swank-js.

    OBSOLETE TypeScript Interactive Development Environment for Emacs.

    [DONE]{.done .DONE} Try out cquery, emacs-lsp, and company-lsp.

    [DONE]{.done .DONE} (setq projectile-use-git-grep t). <2018-12-27 Thu>

    [DONE]{.done .DONE} Is there any easy way to make .org files password protected? (Reddit).

    [DONE]{.done .DONE} use-package binding to different maps

    (use-package term
      :bind
      (:map
       term-mode-map
       ("M-p" . term-send-up)
       ("M-n" . term-send-down)
       :map term-raw-map
       ("M-o" . other-window)
       ("M-p" . term-send-up)
       ("M-n" . term-send-down)))
    

    [DONE]{.done .DONE} Emacs qrencode.

    [DONE]{.done .DONE} Smartparens.

    [DONE]{.done .DONE} Hash region.

    [DONE]{.done .DONE} helm-ispell.

    [DONE]{.done .DONE} Pack/unpack files with atool on dired.

    [DONE]{.done .DONE} company-shell.

    [DONE]{.done .DONE} artbollocks-mode and writegood. More at Sacha's post.

    [DONE]{.done .DONE} comint-prompt-read-only for making shell prompts read-only.

    [DONE]{.done .DONE} org-page: Static blog.

    [DONE]{.done .DONE} I just realized Emacs has a fast infix calculator that's not calc or quick-calc… (Reddit).

    [DONE]{.done .DONE} How to get emacs key bindings in Ubuntu.

    [DONE]{.done .DONE} org-autolist.

    [DONE]{.done .DONE} Move up by parens: More at the manual.

    [DONE]{.done .DONE} sunrise-sunset.

    [DONE]{.done .DONE} ace-window.

    [DONE]{.done .DONE} Checkdoc.

    [DONE]{.done .DONE} Choose magit repo c-u c-x g (magit-status).

    [DONE]{.done .DONE} continue comment blocks: m-j (indent-new-comment-line).

    [DONE]{.done .DONE} Debug expanded elisp macros: See Wisdom and Wonder's post.

    [DONE]{.done .DONE} delete-duplicate-lines

    [DONE]{.done .DONE} Describe bindings: C-h b lists all bindings.

    [DONE]{.done .DONE} Disable furniture

    (menu-bar-mode -1)
    (toggle-scroll-bar -1)
    (tool-bar-mode -1)
    

    [DONE]{.done .DONE} elmacro shows keyboard as emacs lisp.

    [DONE]{.done .DONE} yasnippet mirrors with transformations more at snippet development.

    For example:

    - (${1:id})${2:foo}
    {
        return $2;
    }
    
    - (void)set${2:$(capitalize yas-text)}:($1)avalue
    {
        [$2 autorelease];
        $2 = [avalue retain];
    }
    $0
    

    [DONE]{.done .DONE} Emacs regex: Emacs: text pattern matching (regex) tutorial.

    [DONE]{.done .DONE} export ascii art: artist mode + ditaa for uml. demo video.

    [DONE]{.done .DONE} lispy.

    [DONE]{.done .DONE} minimal: minimalist appearance.

    [DONE]{.done .DONE} Narrowing regions

    • c-x n n (narrow-to-region).
    • c-x n w (Widen).

    [DONE]{.done .DONE} nxml-mode.

    [DONE]{.done .DONE} org-beautify-theme: a sub-theme to make org-mode more beautiful.

    [DONE]{.done .DONE} Recursive query/replace

    • M-x find-dired RET.
    • Navigate to location, RET.
    • Add find argument (omit for all files), RET.
    • t (select all).
    • Q (query-replace).
    • Enter search/replace terms.
    • y/n for each match.
    • C-x s ! (save all).

    [DONE]{.done .DONE} Repeat last command: C-x z (and just z threreafter).

    [DONE]{.done .DONE} Replace char with a newline

    • M-x replace-string RET ; RET C-q C-j.
    • C-q (quoted-insert).
    • C-j (newline).

    [DONE]{.done .DONE} smart-mode-line, sacha's sample usage.

    [DONE]{.done .DONE} Toggling key bingings: ode to the toggle.

    [DONE]{.done .DONE} unify-opening

    [DONE]{.done .DONE} use-package: lunaryorn.

    [DONE]{.done .DONE} sunshine.el.

    [DONE]{.done .DONE} youtube-dl: or emacs.

    ]]>
    Wed, 03 Dec 2014 00:00:00 GMT
    Installing Emacs 24.4 on Linux https://xenodium.com/installing-emacs--on-linux https://xenodium.com/installing-emacs--on-linux sudo apt-get install texinfo build-essential xorg-dev libgtk-3-dev libjpeg-dev libncurses5-dev libgif-dev libtiff-dev libm17n-dev libpng12-dev librsvg2-dev libotf-dev ]]> Wed, 09 Jul 2014 00:00:00 GMT Installing Emacs 24.4 on Mac OS X https://xenodium.com/installing-emacs-24-4-on-mac-os-x https://xenodium.com/installing-emacs-24-4-on-mac-os-x See Yamamoto's Mac OS X port. To install:

    $ brew tap railwaycat/emacsmacport
    $ brew install emacs-mac
    
    ]]>
    Wed, 09 Jul 2014 00:00:00 GMT
    Xcode6 tips https://xenodium.com/xcode6-tips https://xenodium.com/xcode6-tips From Ray Wenderlich's tech talk And supercharging Your Xcode Efficiency (by Jack Wu).

    Shortcuts

    • ⌘⇧o Fuzzy file search.
    • ⌘⌥j Fuzzy file search (showing in Xcode project hierarchy).
    • ⌘⇧j Show file in Xcode project hierarchy.
    • ⌘⌥0 Show/hide utility area (right panel).
    • ⌘0 Show/hide navigation area (left panel).
    • ⇧⌘Y Show/hide debug area (bottom panel).
    • Ctrli Indent selection.
    • ⌘\ Toggle breakpoint on line.
    • ⌘/ Toggle comment.
    • ⌘[1-8] Select tabs on left panel.
    • Ctrl[1-x] Select top file navigation menu items.

    Xcode features

    • Snippets.
    • Templates.
    • View debugging.
    • Simctl (send files to simulator).

    Plugins of interest

    • Fuzzy autocomplete.
    • Uncrustify for indentation.
    • xcs code switch expansion.
    • Org and order (for properties).
    ]]>
    Sun, 02 Nov 2014 00:00:00 GMT
    Simple ssh tunnel https://xenodium.com/simple-ssh-tunnel https://xenodium.com/simple-ssh-tunnel Via @climagic, connections to tcp localhost:9909 will be made to 192.168.1.1:80 via SSH tunnel to home.

    ssh -L 9909:192.168.1.1:80 home
    
    ]]>
    Sat, 12 Dec 2015 00:00:00 GMT
    gpg/pgp bookmarks https://xenodium.com/gpgpgp-bookmarks https://xenodium.com/gpgpgp-bookmarks
  • Backup or transfer your keys / GPG Keychain FAQ / Knowledge Base - GPGTools Support.
  • Creating the perfect GPG keypair - Alex Cabal.
  • Gmail, Gnus and GPG guide.
  • GnuPG2 snippets - emacsist.
  • NIST Special Publication: Recommendation for Key Management.
  • OpenPGP Best Practices - riseup.net.
  • Securing My Digital Life: GPG, Yubikey, & SSH on macOS.
  • The GNU Privacy handbook.
  • ]]>
    Sat, 20 Sep 2014 00:00:00 GMT
    Raspberry Pi bookmarks https://xenodium.com/raspberry-pi-bookmarks https://xenodium.com/raspberry-pi-bookmarks
  • Raspberry Pi 5: Getting Started - YouTubee.
  • ]]>
    Tue, 04 Feb 2025 00:00:00 GMT
    Emacs lisp bookmarks https://xenodium.com/emacs-lisp-bookmarks https://xenodium.com/emacs-lisp-bookmarks
  • (setq search-whitespace-regexp ".*?") isearch "abc ghi" matches "abcdefghi".
  • A quick guide to Emacs Lisp programming.
  • A snippet to try out fonts.
  • Abo abo's Emacs Lisp Guide.
  • Adding A New Language to Emacs (ie. writing a new major mode).
  • alphapapa's The Emacs Package Developer’s Handbook.
  • An Async / Await Library for Emacs Lisp « null program.
  • An introduction to emacs lisp.
  • An iterator for traversing a directory path.
  • Async autocompletion in Emacs – Kraken of Thought.
  • Caio Rordrigues's Elisp Snippets.
  • Caio's Emacs - Programming and Customization.
  • Category:Emacs Lisp - Rosetta Code.
  • Common Lisp Loops – Tony Ballantyne Tech.
  • Date and Time – Tony Ballantyne Tech.
  • eldoc-mode.
  • elexandria/elexandria.el's with-file-buffer macro.
  • ElispCheatSheet: Quick reference to the core language of Emacs —Editor MACroS..
  • Emacs - Elisp Programming and Customization.
  • Emacs Elisp Programming guide.
  • Emacs Lisp Guide, chrisdone/elisp-guide · GitHub.
  • Emacs sqlite binding of Emacs Lisp inspired by mruby-sqlite3.
  • Emacs symbol notation.
  • emacs-bencode: Bencode package for Emacs Lisp (encoding losely structured data).
  • Emacs: Pattern Matching with pcase.
  • Error Handling in Emacs Lisp.
  • Example showing how useful the ample-regexps package is : emacs.
  • find-library.
  • format-table: Parse and reformat tabular data in emacs (Looks great for converting between org, json, and other RDBMS).
  • GitHub - alphapapa/ts.el: Emacs date-time library.
  • GitHub - brandelune/nipel: New Introduction to Programming in Emacs Lisp.
  • GitHub - Lindydancer/face-explorer: Library and tools for faces and text properties.
  • GitHub - p3r7/awesome-elisp: A curated list of emacs-lisp development resources.
  • GitHub - Wilfred/ht.el: The missing hash table library for Emacs.
  • GitHub - xuchunyang/elisp-demos: Demonstrate Emacs Lisp APIs.
  • Good Style in modern Emacs Packages.
  • Harry R. Schwartz's An Introduction to Emacs Lisp.
  • How to choose Emacs Lisp package namespace prefix.
  • How to Make an Emacs Minor Mode.
  • How to read emacs lisp.
  • It's not hard to edit Lisp code.
  • Learn elisp the hard way.
  • Learn Emacs Lisp in 15 minutes - Bastien Guerry.
  • Learn emacs lisp in 15 minutes.
  • Links and exported HTML.
  • Living with Emacs Lisp.
  • LOOP for Black Belts.
  • Marcin Borkowski: 2018-12-03 looking-back-p.
  • Marcin Borkowski: 2019-03-25 Using benchmark to measure speed of Elisp code.
  • Nongnu elisp guidelines.
  • Pattern matching with pcase.
  • Pattern Matching: pcase – Tony Ballantyne Tech.
  • Read Lisp, Tweak Emacs.
  • Reading from stdin and writing to stdout with Emacs batch.
  • Refactoring “Beginning Emacs Lisp”: I: Adding Tests.
  • Selecting and trying out different fonts in Emacs.
  • Slime-style navigation for Emacs Lisp.
  • Split a List Into Batches Using Emacs Lisp - Hung-Yi’s Journal.
  • Testing Emacs code that modifies buffers.
  • Tips on Emacs Lisp programming.
  • Understanding letf and how it replaces flet · Endless Parentheses.
  • Variable Pitch Tables.
  • vpt.el: An Emacs package to display tabular data with variable pitch fonts.
  • Watch a directory using elisp (larsmagne).
  • watch-directory.el watches a directory for new files.
  • What's the best practice to write emacs-lisp (at 2016)? (Reddit).
  • What's wrong with `find-file-noselect`? (Emacs Stack Exchange).
  • Wikemacs's Emacs Lisp Cookbook.
  • with-emacs · (Almost) All You Need to Know About Variables.
  • with-suppressed-message macro.
  • Writing a Spotify Client.
  • Writing Web apps in Emacs Lisp (simple-httpd).
  • Xah Lee's Emacs Lisp Symbol (tutorial).
  • Xah's Common Emacs Lisp Functions.
  • Xah's Emacs Lisp idioms for Text Processing in Batch Style.
  • Xah's Emacs Lisp Tutorial.
  • XML utilities for Emacs lisp.
  • Xu Chunyang's Elisp demos/examples/snippets .
  • ]]>
    Sat, 20 Sep 2014 00:00:00 GMT
    Alzheimer bookmarks https://xenodium.com/alzheimer-bookmarks https://xenodium.com/alzheimer-bookmarks
  • #NYC #Alzheimer's Association hybrid event (in-person and Zoom).
  • Dementia Training Australia (DTA), Free online courses and resources.
  • Woman claims Alzheimer’s symptoms were reversed after five years | CNN.
  • ]]>
    Tue, 04 Feb 2025 00:00:00 GMT
    Emacs bookmarks https://xenodium.com/emacs-bookmarks https://xenodium.com/emacs-bookmarks
  • Multi-Monitor Compatible Code to Center Emacs Frames on Screen • Christian Tietze.
  • Bridging Islands in Emacs: re-builder and query-replace-regexp | Karthinks.
  • Colin Woodbury - Contributing to Emacs.
  • Configuring Emacs and Eglot to work with Astro language server | by Jayaram |….
  • Emacs Tramp tricks.
  • Export an environment variable to Emacs | Snippets and other bits.
  • GitHub - federicotdn/verb: HTTP client for Emacs (alternative to restclient).
  • How to Assign Copyright — Free Software Foundation.
  • Lesser known functionalities in core Emacs (see setq-mode-local).
  • Lesser known functionalities in core Emacs.
  • Modern Emacs Typescript Web (React) Config with lsp-mode, treesitter, tailwin….
  • Modern Emacs Typescript Web (React) Config with lsp-mode, treesitter, tailwind….
  • Save all mu4e attachments | Snippets and other bits.
  • Using Emacs for Container Development: Configuring Emacs for Podman and Docker.
  • ][Christian Tietze: Emacs: center window on current monitor]].

    ]]>
    Fri, 19 Sep 2014 00:00:00 GMT
    Resetting gnome-terminal preferences https://xenodium.com/resetting-gnome-terminal-preferences https://xenodium.com/resetting-gnome-terminal-preferences Resetting preferences
    gconftool --recursive-unset /apps/gnome-terminal
    

    Want 256 colors?

    Edit .bash_profile

    export TERM="screen-256color"
    

    Ensure .bash_profile is loaded

    From gnome-terminal window:

    gnome-terminal Edit Profiles… Edit Title and Command X Run command as login shell

    Solarized

    Bonus: See post to get solarized on gnome-terminal.

    ]]>
    Thu, 11 Sep 2014 00:00:00 GMT
    C++ bookmarks https://xenodium.com/cpp-bookmarks https://xenodium.com/cpp-bookmarks
  • Additional C/C++ Tooling.
  • C++ Best Practices.
  • C++ Core Guidelines.
  • cppreference.com.
  • Fast directory listing.
  • FunctionalPlus: helps you write concise and readable C++ code.
  • GitHub - mozilla/rr: Record and Replay Framework (debugging).
  • Modern C | Hacker News.
  • Modern C++: Variadic template parameters and tuples.
  • My favorite C compiler flags during development | Hacker News.
  • My Most Important C++ Aha! Moments…Ever.
  • Programming: Principles and Practice Using C++ Paperback.
  • Some CMake tips.
  • The ways to avoid complexity in modern C++.
  • ]]>
    Thu, 09 Oct 2014 00:00:00 GMT
    Java bookmarks https://xenodium.com/java-bookmarks https://xenodium.com/java-bookmarks
  • Better Java.
  • ExecutorService - 10 tips and tricks.
  • Java anti-patterns.
  • Java Generics FAQs.
  • Lanterna, a text GUI (a la ncurses) written in Java.
  • Modern Java - A Guide to Java 8.
  • ]]>
    Mon, 14 Jul 2014 00:00:00 GMT
    Browser bookmarks https://xenodium.com/browser-bookmarks https://xenodium.com/browser-bookmarks
  • Dillo.
  • Firefox: no window borders or other decoration.
  • NetSurf.
  • SingleFile | Save a page as a single HTML file.
  • ]]>
    Mon, 14 Jul 2014 00:00:00 GMT
    Node bookmarks https://xenodium.com/node-bookmarks https://xenodium.com/node-bookmarks
  • How to use npm as a Build Tool.
  • ]]>
    Mon, 14 Jul 2014 00:00:00 GMT
    JavaScript bookmarks https://xenodium.com/javascript-bookmarks https://xenodium.com/javascript-bookmarks
  • #javascript ES6 cheatsheet — Map & WeakMap – Mihai Serban – Medium.
  • A better way to lazy load responsive images.
  • Airbnb JavaScript Style Guide.
  • An overview of JavaScript reactive frameworks.
  • Babel Javascript compiler.
  • Bootstrap 3 grid.
  • Chrome DevTools.
  • Concise JavaScript intro.
  • DOMPurify: a DOM-only, super-fast, uber-tolerant XSS sanitizer for HTML, MathML and SVG.
  • ECMAScript parsing infrastructure for multipurpose analysis.
  • Eloquent JavaScript (Book).
  • ES6 Overview in Bullet Points (Hacker News).
  • ES6 Overview in Bullet Points.
  • ES6-cheatsheet.
  • Essential JavaScript Links.
  • Essential Reading List for Getting Started With Service Workers.
  • Exploring ES6: Upgrade to the next version of JavaScript (Book).
  • Famous Javascript library for animations & interfaces.
  • Flexbox Cheatsheet.
  • Front-End Developer Handbook.
  • Functional Programming Principles in Javascript - DEV Community.
  • Hidden gems in Chrome Developer Tools.
  • How do promises work.
  • Immutable collections for JavaScript.
  • Introducing Pokedex.org: a progressive webapp for Pokémon fans.
  • Introducing the Famous framework.
  • JavaScript: Data Structures (Part 1) - DEV Community.
  • JavaScript: Iterator (ES2015).
  • js.coach (Opinionated catalog of open source JS packages).
  • jscodeshift, a toolkit for running codemods over multiple JS files.
  • JSCS linter.
  • Learning the Web (mozilla.org).
  • Ludicrously Fast Page Loads - A Guide for Full-Stack Devs.
  • Mancy: JavaScript REPL application based on Electron and React.
  • Modern JavaScript: Develop and Design (book).
  • Modern Javascript: ​Learning the foundational concepts and build tools for modern web applications.
  • Must See JavaScript Dev Tools That Put Other Dev Tools to Shame.
  • new vs Object.create.
  • No, you don’t need semicolons (Medium).
  • npm-shrinkwrap.
  • Paged.js – Paged Media (book/blog publishing).
  • pleaserotate.js
  • PleaseWait.js
  • React - ES6 tricks in Classes - DEV Community.
  • Redux: The Single Immutable State Tree.
  • RxJS 5 Thinking Reactively | Ben Lesh - YouTube.
  • RxJS Observable interop with Promises and Async-Await.
  • Show HN: A visual guide to the most popular CSS properties (Hacker News).
  • Show HN: JavaScript books, free online (Hacker News).
  • Snap.svg: the JavaScript SVG library for the modern web.
  • The Hitchhiker's Guide to Modern JavaScript Tooling.
  • Tools for cleaning up messy Javascript.
  • Tools to keep a consistent coding style in JavaScript.
  • Two.js is a two-dimensional drawing api geared towards modern web browsers.
  • Vorlon.JS: remotely debugging and testing your JavaScript.
  • What you should know about JavaScript regular expressions.
  • Why we should stop using Grunt & Gulp.
  • Xah Lee's JavaScript in Depth.
  • ]]>
    Mon, 14 Jul 2014 00:00:00 GMT
    HTML bookmarks https://xenodium.com/html-bookmarks https://xenodium.com/html-bookmarks
  • A few HTML tips (Mozilla).
  • awesome-motherfucking-website: An awesome list of websites about minimal web design and copious swearing.
  • Better Motherfucking Website.
  • Chrome Devtools Tips & Tricks.
  • Chrome Devtools Tips and Tricks (Hacker News).
  • Chromium's web fundamentals and Web Starter Kit.
  • CSS Grid Areas.
  • CSS Layout cookbook - CSS: Cascading Style Sheets (MDN).
  • Facebook Relay: An Evil And/Or Incompetent Attack On REST.
  • HEAD - A free guide to <head> elements.
  • HEAD – A guide to <head> elements (Hacker News).
  • How to Become a Great JavaScript Developer.
  • How To Pick a Frontend Web Framework.
  • HTML Tips (2020) - Marko Denic - Web Developer.
  • Learning the Web (mozilla.org).
  • Motherfucking Website.
  • My Current HTML Boilerplate | Hacker News.
  • Perfect Motherfucking Website.
  • Solved by Flexbox.
  • The Best Motherfucking Website.
  • Ultimate Motherfucking Website.
  • WAVE Report (web accessiblity evaluation tool).
  • Web Design in 4 minutes.
  • What forces a layout / reflow.
  • What I’ve Learned From Working With HTML5 Video Over A Month.
  • Write HTML Like It's 1999.
  • ]]>
    Mon, 14 Jul 2014 00:00:00 GMT
    Networking bookmarks https://xenodium.com/networking-bookmarks https://xenodium.com/networking-bookmarks
  • Ask HN: Good books/courses to learn networking essentials for web development.
  • Command-line tools to look up DNS information.
  • Stanford CS 144: Introduction to Computer Networking | Hacker News.
  • ]]>
    Mon, 14 Jul 2014 00:00:00 GMT
    Python bookmarks https://xenodium.com/python-bookmarks https://xenodium.com/python-bookmarks
  • 12. Virtual Environments and Packages — Python 3.7.4 documentation (pipenv).
  • A python command-line tool which draws basic graphs/charts in the terminal.
  • Argparse cookbook: For simple python scripts.
  • Best 50 Python Books for Programmers with All Skill Sets.
  • Code Like a Pythonista: Idiomatic Python.
  • Dataset: databases for lazy people.
  • Dive Into Python 3 book.
  • Dive Into Python book.
  • Drawille: Python drawing in ascii/unicode braille characters.
  • Pandas visualization.
  • PEP 20 – The Zen of Python.
  • Pudb: A tui python debugger.
  • Pycoders weekly mailing list.
  • Python Algorithms book.
  • Python patterns, Take One (Hacker News).
  • Python patterns, Take One.
  • Python Tips and Traps.
  • Python tools for Emacs.
  • Python’s Innards: Hello, ceval.c!.
  • Read Excel sheet with Python/Pandas (Twitter).
  • Regular expressions in Python and Perl.
  • Reversing an MD5 hash (python).
  • Textract: Python util extracting text from a handful of document types.
  • The definitive guide on how to use static, class or abstract methods in Python.
  • The Hacker's guide to python.
  • The Little Book of Python Anti-Patterns.
  • Three Useful Python Libraries for Startups.
  • Understanding Python's "with" statement.
  • Watchdog (monitor filesystem in python).
  • ]]>
    Sun, 13 Jul 2014 00:00:00 GMT
    Development bookmarks https://xenodium.com/development-bookmarks https://xenodium.com/development-bookmarks
  • Hexagonal Grids.
  • Big O Notation – Explained as easily as possible | Hacker News.
  • Comprehensive Big O Notation Guide in Plain English, using Javascript.
  • Just Simply | Stop saying how simple things are in our docs.
  • Show HN: DevBooks – Help Developers find indy books | Hacker News.
  • Writing Well-Documented Code - Learn from Examples - Code Catalog.
  • (How to Write a (Lisp) Interpreter (in Python)): parse, tokenize, read from tokens, environments, eval, and repl .
  • 12 Signs You’re Working in a Feature Factory - 3 Years Later.
  • 15 Fundamental Laws of Software Development.
  • 3 books that will take you to the next level – Gui Froes.
  • 8 Tips To Get Started In An Existing Codebase.
  • 9 Anti-Patterns.
  • A composable pattern for pure state machines with effects.
  • A crash course in compilers – Increment: Programming Languages.
  • Algorithms, Part I - Princeton University (Coursera).
  • All the UML you need to know.
  • All You Need to Know About Big O Notation {Python Examples}.
  • An intro to compilers.
  • Apprentice Alf’s Blog: Everything you ever wanted to know about DRM and ebooks.
  • Ask HN: How do I choose the right resource to learn CS fundamentals?.
  • Ask HN: What is your favorite YouTube channel for developers? (Hacker News).
  • Ask HN: What's the most elegant piece of code you've seen? (Hacker News).
  • Automatic Language Bindings (via clang -ast-dump).
  • Awesome lists of everything (Github).
  • AWS in plain English.
  • Better Bash scripting in 15 Minutes.
  • Beware of cute optimizations bearing gifts (building fuzzy search) · wincent.com.
  • Big-O Notation: Beginners Guide - DEV Community.
  • Bozhidar Batsov's presentation (lots of great books listed).
  • Brain, refactored: lots of wonderful dev learning references (Murray's Blog).
  • Bytecode compilers and interpreters (Hacker News).
  • Catalog of Refactorings.
  • Clean code.
  • Code review best practices.
  • Code style rules that are actually useful (DEV Community).
  • Command line interface best practices (Hacker News).
  • Confessions of an Abstraction Hater (Hacker News).
  • Could ImGUI be the future of GUIs?.
  • Data structure visualization.
  • Database readings.
  • Designing and evaluating reusable components: Talk by Casey Muratori.
  • Designing Qt-Style C++ APIs.
  • Diverse podcasts in @ermmears's tweet comments.
  • Domain-driven design: Tackling Complexity in the Heart of Software (Book).
  • Donald Knuth Lectures - YouTube.
  • Font compare.
  • GitHub - fdiskyou/Zines: hacking Zines mirror for the lulz and nostalgy.
  • GitHub - kilimchoi/engineering-blogs: A curated list of engineering blogs.
  • Google shell style guide.
  • Hacker shelf: Free software dev books.
  • Hacking knowlege.
  • Happiness is… a freshly organized codebase - Several People Are Coding (aka feature-driven org).
  • Heap Exploitation Part 1: Understanding the Glibc Heap Implementation | Azeria Labs.
  • How to pass a programming interview.
  • How to Safely Implement Cryptography Features in Any Application.
  • How to write your own compiler.
  • Jeremy Mikkola - Rules for Autocomplete.
  • Joe Duffy - The Error Model.
  • LibHunt - Find The Software You Need.
  • Linux workstation security checklist.
  • Lost in Technopolis.
  • Migrating bajillions of database records at Stripe.
  • OAuth diagram/explanation (Quora).
  • Over 500 Top PDFs posted to Hacker News in 2018.
  • Please do not attempt to simplify this code: favors completeness, boilerplate, and documentation in the name of stability and long term maintenance (Hacker News).
  • README Love: Quick and easy tips.
  • Refactoring: Improving the design of existing code (Book).
  • Sarah Mei on livable coebases.
  • Semantic Versioning 2.0.0 (Semantic Versioning).
  • Show HN: I wrote a book on writing good developer resumes | Hacker News.
  • Signs you’re working in a feature factory | Hacker News.
  • Some REST best practices.
  • Structure and Interpretation of Computer Programs (videos).
  • Teach Yourself Programming in Ten Years.
  • TechnoSophos: Be Nice And Write Stable Code (versioning scheme).
  • The art of command line.
  • The Debugging Mindset (Hacker News).
  • The Hardest Program I've Ever Written (a code formatter).
  • The passionate programmer.
  • Things I’ve learned in 20 years of programming | Hacker News.
  • TIL: today I learned.
  • Tmux crash course: By Josh Clayton.
  • UI Engineering Questions.
  • Use long flags when scripting (2013) | Hacker News.
  • VisuAlgo.net: Visualising data structures and algorithms through animation.
  • When management tells you to build a specific thing (junior vs mid vs senior eng).
  • Wizard zines (programming by Julia Evans).
  • WTF Is Big O Notation? (Hacker News).
  • Your calendrical fallacy is thinking….
  • ]]>
    Sun, 13 Jul 2014 00:00:00 GMT
    Paswordless ssh with authorized keys https://xenodium.com/passwordless-ssh-with-authorized-keys https://xenodium.com/passwordless-ssh-with-authorized-keys On local host
    ssh-keygen
    cat ~/.ssh/id_dsa.pub | ssh user@remotehost 'cat >> ~/.ssh/authorized_keys'
    

    On remote host

    chmod 700 ~/.ssh
    chmod 600 ~/.ssh/authorized_keys
    

    UPDATE: Add "AddKeysToAgent yes" to .ssh/config and enter password only once.

    ]]>
    Sun, 13 Jul 2014 00:00:00 GMT
    Some python idioms https://xenodium.com/some-python-idioms https://xenodium.com/some-python-idioms
  • Prefer double quotes if escaping single quotes.
  • Prefer string interpolation over join. Eg. "'%s'" % member_default.
  • Prefer double underscore for privates.
  • Prefer with statement to implicitly close file.
  • with open(path, 'r') as text_file:
        text = text_file.read()
    
    • Prefer list comprehensions to filter.
    • Prefer using separate modules over classes if only using for separation.
    • Keep in mind: "eafp vs lbyl" (ie. just let it throw).
    • Prefer exceptions over assertions.
    • Throw ValueError for wrong input.
    • Return explicit False if remaining case is always false.

    [^1]: Been using powder milk since lockdown, end-result's been tasty.

    [^2]: The app's been fairly stable, but who knows… please backup your org file before feeding it to the lion.

    [^3]: The app's been fairly stable, but who knows… please backup your org file before feeding it to the lion.

    [^4]: The app's been fairly stable, but who knows… please backup your org file before feeding it to the lion.

    [^5]: Yes, this post was written in org mode.

    [^6]: Been using powder milk since lockdown, end-result's been tasty.

    [^7]: Only tried raw honey so far.

    [^8]: Can likely use ground cardamom. I enjoy the scents while crushing.

    ]]>
    Mon, 04 Nov 2013 00:00:00 GMT