Einenlum.

This Week I Learned: 2023W11

Wed Mar 22 2023

Python

This article shows how someone tried to implement a for loop in c style in Python. It’s obviously a bad idea, but Tushar is definitely super creative. A really interesting read.

Vim

I wondered how to sort alphabetically lines in vim. Turns out it’s super simple. Just select the lines you want to sort, and then type :sort. That’s it. If you want to sort in reverse order, just type :sort!.

PHP

After 10 years of PHP I realized you can actually increment a string.

$input = 'aa';
$input++; // 'ab'

$input = 'zz';
$input++; // 'aaa'

$input = 'string001';
$input++; // 'string002'

$input = 'string999';
$input++; // 'strinh000'

Found on twitter here.