Deja Vu Random notes on coding and stuff..

Today I Learned : PostgreSQL - obtain records that were inserted in the last 5 minutes

select * from my_table where inserted_at > now() - interval '5 minute'...

Today I Learned : Elixir - How to pretty print a struct

Use the pretty option with inspect() as below. inspect(data, pretty: true)...

Today I Learned : Elixir - How to get a map from a struct

Use the Map.from_struct function. struct = %User{first_name: "Jose", last_name: "Valim"} map = Map.form_struct(struct)...

gitlab-cli : Interact with Gitlab from the command line, currently focusing on issues

gitlab-cli a cli tool that I have written for interacting with Gitlab. Currently the tool focuses on working with issues for a project. It is written in Go and works...

Poor man's generics in Golang (Go) [or pick your poison]

Golang does not have generics. Period. With that in mind, I just wish to share how I am thinking of implementing generic code. For this example, I am going to...