Revelry engineering blog header image lightbulb twil this week i learned. Chalkboard style

#RevTWIL: A Week’s Worth of Slack Channel Sharing

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.

  • You can easily generate ecto schemas/migrations using binary id as the primary key by passing --binary-id to the mix phx.gen.schema command.
  • citext is a postgres type for case insensitive text… and mix phx.gen.auth uses it by default for user emails – https://www.postgresql.org/docs/current/citext.html
  • The custom keyboard firmware QMK has a new feature that lets you do what they call combos. They’re like chords. If you hit configured combinations of keys at the same time you can trigger a different key or command.
  • Git can help you rename files with the wrong case:
    *
    *git mv Foo.txt foo.txt *
    *
  • In Postgres, the timestamp with timezone or timestamptz type doesn’t actually contain data about the timezone. It simply specifies the behavior when being set or doing date math. All values are still stored in UTC and it is treated like a specific moment in time. If no timezone is supplied, postgres will assume the local time of the server.

    Timestamp without timezone or timestamp stores the same data, but is devoid of context and behaves as such. It’s like a picture of a calendar and clock on the wall instead of the exact moment in time – it’s up to the dev to know about and apply the context.

    According to official Postgres docs, it’s best to store a timestamptz unless you have a very specific use case, which is different from what is largely understood to be best practice, at least in MySQL 10+ years ago: https://www.postgresql.org/docs/current/datatype-datetime.html
  • TWIL about S3 select, a feature of s3 that lets you run queries against files in a bucket (json, csv, or parquet only): I tried to use it on ifp to get the row count of a csv without loading the whole file to memory, but it’s not available in ex_aws_s3 yet 
  • Two generally useful tips for folks who are using Elixir for the first time:

    iex -S mix phx.server' is far superior to just mix phx.server as it means you can recompile on the fly, use other IEX helpers like printing information about the previous value, etc. It’s so helpful that I just have it aliased in my .zshrc

    If you use VSCode, I’d suggest setting up this extension to make life more bearable. This also allows you to use the VSCode debugger** but YMMV and there’s some pitfalls here

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.