DanHulton

joined 1 year ago
[–] DanHulton 2 points 1 year ago

Not a big, fancy project, but over the past couple days, I put together a configuration file for Karibiner Elements (Mac software that lets you rebind your keys at the OS level) to allow you to type with just your left hand, using spacebar, caps lock, and the touchpad as modifier keys: https://github.com/DanHulton/Karibiner-Carpal-Tunnel-Right

I've been experiencing some carpal tunnel in my right hand, and wanted to avoid using it. That's hard when you have to type all day, but with this config file, I can! (albeit much, much slower.) Since Karibiner config files are just json, editing them directly can get heinous, so I wrote a small Typescript program to take a simple mapping and turn it into a config file in the correct format.

(Why no right-hand config? There's already an alternative keyboard layout that just mirrors the keyboard, and right right side has more keys -- so you can use that mirror config just fine if you want to avoid using your left hand, but trying to avoid using your right hand means you need more modifiers to get even just the basic keys correct.)

[–] DanHulton 1 points 1 year ago* (last edited 1 year ago) (1 children)

If you're not married to functional code, for searching a keyed object by property for the key, you can always write:

for (const key in data) {
  if (data[key].firstName === 'Frederic') {
    console.log(key);
  }
}

No need to transform the whole object with Object.entries, and you could turn that into a function reasonably easy, something like findKey(object, property, value) or some such.

[–] DanHulton 1 points 1 year ago

Came here to write this, so you get my upvote instead.

I don't actually use Hurl, I use Jest (since I'm usually writing in TS) so that I can prep state before and confirm it afterwards and fully ensure that the request did what it was supposed to do, but if you're already just using Postman, you're likely not testing your state, and Hurl is a SIGNIFICANT improvement.

Edit text files in any editor. Run it from the command line. Include it in your CICD with ease. It's an incredible tool and it deseres to be far, far more popular than it is.