Skip to content

Instantly share code, notes, and snippets.

View Axlefublr's full-sized avatar

Axlefublr Axlefublr

View GitHub Profile

What I value most in a language is functionality — what and how easily the language lets me do things.

No wonder! That's what programming is kinda for: doing cool things more easily.

And here's lua, that doesn't even have an abstraction over something as simple as .split(). Ridiculous.

Lua has a very weak standard library. You'll find yourself reimplementing functionality that you'll be flabbergasted isn't there to begin with. Sure, some of that functionality might be simple to implement, but it shouldn't be my job. Imagine doing the equivalent of implementing the print function in every new project you create. It's disheartening.

Not only is the standard library weak, but it's also not ergonomic.

Remap keys on the xkb level

  1. xev will show you output like this:
KeyRelease event, serial 36, synthetic NO, window 0x3200001,
    root 0x530, subw 0x0, time 4335057, (943,136), root:(943,694),
    state 0x0, keycode 78 (keysym 0xff14, Scroll_Lock), same_screen YES,
    XLookupString gives 0 bytes:
    XFilterEvent returns: False

You may sometimes want to set a bunch of multicursors on a lot of lines, where just holding C and letting key repeat do the job is a bit bothersome.
So you mip to select inside paragraph, and use s to set cursors how you usually would with C, but with far less keystrokes

rec.mp4

Doing this feels illegal fwiw, but it's actually super valid for this usecase, where you want to act on a certain column, rather than anything that you can regex match by text.
If you know exactly how many columns you need to match, you could also just ^.{30} or something, but I generally don't know.
Regex is really powerful in theory, really fun to learn how to use it more creatively.

I say "god I hate kitty" a lot, but I usually can't think of examples for why on the spot.
I just encountered yet another "god I hate" about kitty, so I'm gonna write it down while it's hot to transfer why I hate this terminal emulator so much.

I wanted a certain feature: in the tab bar, usually I want tabs to just have their number displayed, and nothing else. But optionally, I should be able to add a title to an individual tab.

You might reasonably think "oh that sure sounds like a job for a plugin" and in any other app, something this specific would require a plugin, yes. Kitty, however, picks to be between a rock and a hard place.

Usually when configuring things, ideas come to mind because I already have a very vague idea of how to do it / assume it's doable.
It was the case here too: there's an option called tab_title_template that lets you define the text displayed in each individual tab in the tab bar. Aside from feeling a bit wonky ([have a look](https://sw.kovidgoyal.net/kitty/conf/index.h

Add the ttf of the font you want into ~/.local/share/Anki2/User 1/collection.media.
Rename it so it has the underscore before the name (this ensures "check empty media" doesn't delete it).
Put this in the CSS of the note where you want to use this font:

@font-face {
  font-family: InputMonoGrafted;
  src: url("_InputMono-Regular.ttf");
}

It should be at the bottom; apparently as the absolute last thing in your CSS. \

When considering switching to helix master, I went through all the commits after stable. Here are the new features I discovered:

There's a picker refactor: most pickers now have columns, that you can search directly.
Here's how the bindings picker looks like now:

image

And thanks to columns, it's much nicer to use!
You can type in %column_name to start searching in that column.
So you can search by specifically documentation by using %doc:

I've been using neovim for around two years.
I've rewritten my config three times: for the first time, when I switched to astronvim, and when I switched back from astronvim.
I've gotten into the habit of reading nvim help pages in their entirety, for fun.
I have also written seven!! plugins.
And usually spent multiple hours every day configuring nvim.

I'm glazing myself here to point out: I have obviously given nvim a good try; matter of fact the try was unreasonably good! And the reason why I switched off nvim is not due to the lack of knowledge about nvim.

Considering my two [other](https://gist.github.com/Axlefublr/6880d17221b303

ctrl+shift+i → … → settings →

  1. Enable browser chrome and add-on debugging toolboxes
  2. Enable remote debugging

Enable toolkit.legacyUserProfileCustomizations.stylesheets in about:config

Navigate to about:support to figure out your profile directory.

Go to it, create directory called chrome.

I recently finally figured out how booleans work in fish shell, and turns out they're very elegant!

You can use set to set variables to values; you can set them to true or false too.
If your editor supports fish shell as a language, it will probably highlight them as booleans.

What are they? Some special types, or special syntax introduced by the shell?

Not at all actually, they're just strings, like asdf and the would be.

You usually use test to check for various common equality comparisons, in shell scripting.

I came up with a concept that completely revolutionized a lot of my workflow.

I introduce to you: magazines™!

Each magazine is just a normal file that has a one letter file name, from a to z, from A to Z, and from 1 to 9.
All magazines are located in a single directory called magazines.

Note

The name doesn't really have meaning, I just happened to be obsessed with guns at the time of coming up the concept