When using external services (usually via an api call) I sometimes want to cache the results for a period of time. Here’s a technique that works for me
In this example I have a cached version of a lookup_function
called lookup_function_cached
that takes a key and returns a result
Here’s a script I wrote to backup my MySQL database and upload to S3. It’s. based on a Ruby version I’ve been using for years.
Mix.env/0 works correctly in mix phoenix.server, but it fails to call in a production environment which is built with distillery.
It makes sense because mix isn’t included in the release build. Here is an equivalent
One of the ways I keep up with projects and what things do is to keep code in locations that logically represent the functionality they perform.
From libs, tasks, database schemas, and domain logic all have their place. Here is how I organize my code