Gotta remember the difference between the z-shell config files. The .zshenv
loads first, and is sourced by all zsh instances, so keep it small and enter only environment variables that are needed by any shell, whether interactive or non-interactive, like $PATH. Next .zprofile
is sourced just before .zshrc
and is read only at login, and can be used for variables that do not change frequently, like flags for compilation. Then comes .zshrc
which is executed at the start of an interactive session, and is used to define aliases, functions, shell options (e.g. for history, or your prompt) and any key bindings. The .zlogin
file is sourced after the shell is fully set up, and usually compiles completions and maybe shows a “fortune”, or starts X on linux systems. At last comes .zlogout
, which might be used to clear settings or release resources.
Welcome
Rick’s short, technical tip microblog built with Hugo, powered by Deno Deploy. See also my fabulous repository at Github for this site.
24 Feb 2019
23 Feb 2019
You can elect to decrypt your macOS FileVault via your Apple ID, but that implies keys stored in iCloud. Good security means less convenience, generally, so since I could not find my recovery key, I decrypted and re-encrypted my MBP overnight. Decryption took 4 hours, then I woke up and did the re-encryption, which took at least 6 hours. Now my key is stored safely. π
RC Logr 20190223 065350 - You can elect to decrypt your β¦22 Feb 2019
Creating responsive email templates that are viewable on any device is full of pitfalls. Zurb had a decent sass framework for it, now unmaintained, and there are a few services for this, some eye-wateringly expensive (c.f. litmus, bee, coffeecup). Going to try mjml.io and see how it goes. π
RC Logr 20190222 121056 - Creating responsive email β¦I am a MailMate user myself for email, MailMate being the fantastic IMAP-centric feature-rich mailer for macOS. But if you are an Exchange user, you might check out Hiri for Win, macOS and even Linux. β
RC Logr 20190222 091004 - I am a MailMate user myself β¦By creating a situation where so many companies developed websites that only worked in IE, Microsoft kinda shot themselves in the foot. Now even MS are telling ppl to stop using IE as default, echoing the sentiment that most of the web design community has strongly held for years. π€
RC Logr 20190222 075557 - By creating a situation where β¦20 Feb 2019
If your system is EFI or UEFI, you can make use of a utility called rEFInd, which looks like it really covers the bases for various and flexible configurations for booting, on Mac, Linux or PC.
RC Logr 20190220 111843 - If your system is EFI or UEFI, β¦I have tried various bulk email services, and now I will try the self-hosted sendy, which like others uses Amazon AWS SES to do the bulk sending. SES is uber inexpensive and in my experience, works well with a good delivery rate.
RC Logr 20190220 093453 - I have tried various bulk β¦19 Feb 2019
Got asked by a client to add a second URL to a block on a seminar page, but they wanted to add a counter for seminars with two URLs, so the page would show “seminar URL 01” and “seminar URL 02”. I’m pulling json from a db, then using Hugo to build the site, ranging over the json to build the seminar page. I added a field in the db to contain the second URL, and some conditional code to display the counter. The challenge was to add the counter only for seminars with two URLs, but not for those with one. For the first URL I used a with
clause, and added the counter only in the case that the second URL was set.
|
|
It is easy to think that you must use javascript to do something like a collapsible menu, but that is not the case; it can be done in pure css using Β«inputΒ». See an example. ππ»
RC Logr 20190219 074932 - It is easy to think that you β¦18 Feb 2019
A Google engineer stated at FOSDEM that the 8.8.8.8 DNS service is about generally faster internet leading to more Google searches, and consequently more ad revenue for them. But you have to wonder, why are orgs like Cloudflare or Quad9 offering their 1.1.1.1 and 9.9.9.9 services? Anything like that costs money, so if you use it for “free”, what are you offering in exchange? π§
RC Logr 20190218 112009 - A Google engineer stated at β¦17 Feb 2019
Linus Torvalds, the creator of Linux, tells us how to pronounce it. π
RC Logr 20190217 195345 - Linus Torvalds, the creator of β¦Window managers for macOS, for your tiling pleasure: Hammerspoon, Moom, Veeer.io, DIVVY, Better Snap Tool, Amethyst, Spectacle, Magnet, Max Snap, SizeUp, ChunkWM, Mosaic, Flexiglass and Total Spaces. Hammerspoon and chunkwm are DIY, but you might also like the convenience of one of the commercial offerings. π»πΌ
RC Logr 20190217 115331 - Window managers for macOS, for β¦Hammerspoon hackers, you can get display names dynamically by doing this: local first_monitor = hs.screen.allScreens()[1]:name()
, incrementing the index number for your second or third monitor variable. The challenge remains regarding refreshing the lua config when you move to a site with another monitor setup. π€«
16 Feb 2019
I looked at various window tiling managers for macOS, but I think I will stick with hammerspoon. To use it, you write a lua program in your $HOME
(similar to awesomewm for linux), and bind macOS APIs to keyboard shortcuts. It is a “bridge between the operating system and a Lua scripting engine”. Not only can you tile your windows, but also do things like trigger events when you arrive home, or, plug in a USB device, for example. π€
I programmed my Elgato Stream Deck to trigger some macOS Services, namely the WordService from DevonTechnologies (freeware), and the ones that come with OpenPGP. Useful! π€© Get the key images here to save a little time. The green-grey T is meant to go on a folder type button, which then changes layers to a panel with all of these services.
Update:
- 20200514 - Thanks to Goran Milinkov for the dead link notification re Devon’s Text Services. Updated!
On macOS you can get the number of words in text on the clipboard, by doing pbpaste | wc -w
, and even use osascript
to use AppleScript to post it as a notification. If you put your script in an Automator “quick action” you can assign a keyboard shortcut to it: wordcount=$(pbpaste | wc -w) && osascript -e 'display notification '${wordcount}' with title "Word Count"'
π€
15 Feb 2019
In shell scripting, you need to keep in mind that single quotes preserve the literal value of characters in a string, whereas double quotes allow interpolation of the characters. Plenty of pitfalls with this.
RC Logr 20190215 123805 - In shell scripting, you need β¦Check out the keybow, a mini DIY mechanical keyboard that is a solderless design, meaning you can swap in replacement switches if you want to tinker with the feel. Also, it is programmable and has LEDs, so the potential to set it up as a cool macro pad is tempting. π€
RC Logr 20190215 112132 - Check out the keybow, a mini β¦I have been using linux on servers only, but idea of using a minimalist window manager alone for a daily UI, is appealing. i3 wm, awesome wm, and suckless dwm are three popular examples. The big question is, can I give up certain beloved apps?
RC Logr 20190215 064223 - I have been using linux on β¦14 Feb 2019
Ever need to download a website for offline viewing? You can use the wget
utility to do it, like so:
wget --mirror -e robots=off -U mozilla --recursive --page-requisites --html-extension --convert-links --restrict-file-names=windows --random-wait --domains mine.jp,another.jp --no-parent http://mine.jp
It works pretty well, but is not perfect.