[-] gamma@programming.dev 2 points 2 years ago

Just make sure you read the news (restart sshd)

[-] gamma@programming.dev 2 points 2 years ago

Move the keyboard to the floor

[-] gamma@programming.dev 2 points 2 years ago

If you use EndeavourOS, know that you shouldn't ask for support on the Arch forums, its a policy they have.

[-] gamma@programming.dev 2 points 2 years ago* (last edited 2 years ago)

The upside of not changing the I/O is accessory compatibility.

[-] gamma@programming.dev 2 points 3 years ago* (last edited 3 years ago)

I've written multiple Zsh plugins, so I've gotten familiar with a lot of Zsh's features. I've probably read every line in man zshexpn twice by now having referenced it so much.

Zsh expansions can look gnarly because parameter expansion forms can be nested. Where Bash has to do:

tmp=${foo%$suffix}
len=${#tmp}

Zsh can do it in one:

len=${#${foo%$suffix}}

Once you add PE forms which don't exist in Bash, parameter expansion flags, array subscript flags, globbing qualifiers and modifiers, you can get something which looks absolutely unreadable.

[-] gamma@programming.dev 2 points 3 years ago

Nice work! I've definitely had some fun with convert recently, as you might tell from the community banner.

spoilerIt is an image showing the script I used to create it 😛.

[-] gamma@programming.dev 2 points 3 years ago

I used to write Bash more than anything, but now the things I write are either simple enough to keep POSIX or complex enough that I miss the extra niceties Zsh provides.

[-] gamma@programming.dev 2 points 3 years ago* (last edited 3 years ago)

I have never gotten into Pokemon save for the Mystery Dungeon series, but I find it really engaging. Things I like:

  • instead of move selection gated by limiting to 4 moves and limiting PP, there's AP. You gain 2 AP per turn, and can spend more of it to do more powerful moves.
  • Instead of types doing double/half damage, types give buffs/debuffs which are apropos to that type interaction. (Water "extinguishes" fire, lowering attack)
  • All buffs/debuffs are on a turn timer (attack is lowered for 3 turns)
  • Buffs/debuffs transfer when you switch beasts
  • Stacking the same effect adds turns to the timer rather then strengthening the effect.
  • All timers are visible onscreen under the HP bar
  • Before you confirm an attack, the effect icons show under the highlighted enemy.
[-] gamma@programming.dev 2 points 3 years ago* (last edited 3 years ago)

Lunistice, Waveland, Cassette Beasts, and Dungeons of Aether.

I got all the enjoyment I can out of Dungeons, so I'm probably going to swap back to Into the Breach for my puzzle fix. Cassette Beasts is finished, unless I want to finish the postgame or hunt bootlegs.

[-] gamma@programming.dev 2 points 3 years ago* (last edited 3 years ago)

Nice! This one was probably the most likely to be found, I actually got this trick from somewhere else online before I understood what it was doing. If you're curious, I've got a few other lines of nested Zsh expansions I picked out but didn't post.

[-] gamma@programming.dev 2 points 3 years ago
reply=( ${(M)dirs:#*/$~pattern}(Noe['REPLY=${(l[3][0])#REPLY:t}'][1]) )

Literal explanation

  • $~pattern interpret globbing characters (like *, ?, or [a-z]) in the parameter $pattern,
  • ${(M)dirs:#*/$~pattern} filter the array $dirs to those matching */$~pattern.
  • ${...}(...) everything in (...) are globbing qualifiers
  • (N) enable nullglob
  • (oe[...]) sort by the result of the shell snippet, where $REPLY is used as input and output
  • ${...REPLY:t} remove all leading path components from $REPLY
  • ${...#REPLY:t} substitute the length of that string
  • ${(l[3][0])#REPLY:t} left-pad with zeroes to a length of 3
  • reply=( ... ) save as $reply

Full contextThis line is in a function which dynamically expands ~[g:abc] to one of my git repos, choosing the shortest directory matching path/to/abc*, or if no match is found, the shortest matching *abc*. So between /long/path/to/abcdef and /short/abcdefg, it would choose the first one (provided both of those were in the search paths I configured).

[-] gamma@programming.dev 2 points 3 years ago

I found it soon after my comment, thanks though!

view more: ‹ prev next ›

gamma

0 post score
0 comment score
joined 3 years ago
MODERATOR OF