1. The Best Regex Trick[1], where you want to match Tarzan but not "Tarzan": use the regex "Tarzan"|(Tarzan) and ignore matches where the capturing group is empty.<p>2. When making UI adjustments of color, speed, position, or any other continuous value, find a way to map them to the mouse position (could be a slider, or simply reading the mouse position on a loop). It's a lot easier to find the right value when you can make 60 adjustments per second.<p>3. When creating a cache, think hard about what errors are temporary and what errors are permanent. Then make sure the permanent ones are also cached.<p>4. Always include a version number in your output, be it a field in your persisted data structures or your CLI stdout. Greatly helps troubleshooting deployments and the inevitable schema migrations.<p>5. Creating a concise Domain Specific Language to represent your inputs and outputs makes writing tests a breeze. For example, if you're writing a calculator, assertResult(FIVE+PLUS+THREE+EQUALS, "8").<p>6. The more you avoid strings, the more reliable will be your program. Trailing spaces, empty strings, wrong case, homoglyphs, smart quotes, typos, escape characters, ambiguous parsing, CRLF vs LF, tabs vs spaces, legacy encodings, NFC/NFD normalization, BIDI... If it was not typed on a keyboard by a human, there's probably a better data structure.<p>7. On a more practical note, Bash brace expansion[2]:<p><pre><code> echo word{1,2,3}
# word1 word2 word3
cp my_file.txt{,.bkp}
# cp my_file.txt my_file.txt.bkp
curl https://example.com/page/{1..100}
touch file_{001..100}.txt
# Zero-padded!
rm {file_a,file_b}{.c,.h}
# rm file_a.c file_a.h file_b.c file_b.h
</code></pre>
[1]: <a href="https://www.rexegg.com/regex-best-trick.html" rel="nofollow">https://www.rexegg.com/regex-best-trick.html</a><p>[2]: <a href="https://wiki.bash-hackers.org/syntax/expansion/brace" rel="nofollow">https://wiki.bash-hackers.org/syntax/expansion/brace</a>