At Revelry, we believe in sharing and learning from one another (beliefs that are rooted in our Core Values). Among the many things we do to encourage internal knowledge exchange is to have a different team member present at each week’s Engineering Meeting. These presentations don’t have to be lengthy, formal, or complicated; in fact, many are brief, but also powerful in that they teach our Revelers something new, inspire conversation, and encourage collaboration.
In the spirit of sharing, we share our This Week I Learned presentations (aka RevTWILs”) here. We hope you find them helpful.
THIS WEEK: We offer an assortment of shared learnings from our engineering team.
- Regex syntax for matching unicode code points belonging to certain categories below. Not only is it language-agnostic, but the categories are super useful! https://www.regular-expressions.info/unicode.html#category
- Git has an
--autostash
flag onpull/merge/rebase
commands that will automatically stash changes before the operation and reapply them afterwards. eg:git pull --autostash
. You can even make it the default:git config --global rebase.autostash true
. Task.Supervisor.async_stream()
provides a lot more control thanTask.Supervisor.async()
… The thing I needed was to kill the task instead of crashing the linked process on timeout. You can also set a concurrency limit! https://hexdocs.pm/elixir/1.14/Task.Supervisor.html#async_stream/6- Google Lighthouse is an awesome tool for understanding SEO, accessibility, and performance of websites.
- A great resource for learning about Elixir async processing: https://github.com/whatyouhide/guide_async_processing_in_elixir?tab=readme-ov-file
- The usefulness of ranges in Elixir! Some examples include slicing strings or enumerables:
*
*String.slice("elixir", 1..4) *
*"lixi" *
*Enum.slice([0, 1, 2, 3, 4, 5], 1..4) *
*[1, 2, 3, 4] *
*
Or the fact that ranges are actually structs and have first
, last
and step
fields that can be accessed with the dot syntax!
7. I didn’t just learn this, but I still want to say the “Hide whitespace changes” button in Github PRs makes my life so much easier!
8. The magic and frustration of charlists can be overcome with some iex helpers, eg:
inspect(~c"abc", charlists: :as_list)
"[97, 98, 99]"
or
*
*iex(6)> i(~c"R+V#") *
*Term *
*~c"R+V#" *
*Data type *
*List *
*Description *
*This is a list of integers that is printed using the `~c` sigil syntax, *
*defined by the `Kernel.sigil_c/2` macro, because all the integers in it *
*represent printable ASCII characters. Conventionally, a list of Unicode *
*code points is known as a charlist and a list of ASCII characters is a *
*subset of it. *
*Raw representation *
*[82, 43, 86, 35] *
*Reference modules *
*List *
*Implemented protocols *
*Collectable, Enumerable, IEx.Info, Inspect, List.Chars, String.Chars *
*
Want to learn more about Revelry and our collaborative approach to building custom software? Connect with our team.
We're building an AI-powered Product Operations Cloud, leveraging AI in almost every aspect of the software delivery lifecycle. Want to test drive it with us? Join the ProdOps party at ProdOps.ai.