ozzie.shQuerying raw SQL with Elixir and EctoTL;DR: alias MyApp.{Repo, Animal} sql = "SELECT * FROM animals WHERE legs > $1" params = [2] %{rows: rows, columns: columns} = Repo.query!(sql, params) Enum.map(rows, fn row -> Repo.load(Animal, {columns, row}) end) It was surprisingly difficult ...Mar 9, 2023·1 min read
ozzie.shUsing React with Laravel JetstreamLaravel Jetstream is a Laravel starter kit that gives you a codebase ready to go with things like user management, teams, and two-factor login. Officially, Jetstream only supports two stacks: Inertia (which uses Vue) or Livewire. Both are great but p...Aug 10, 2021·1 min read
ozzie.shBuilding a nested routes function - a fun exerciseI was reading the Remix documentation and saw a function that they use to programatically define routes. It's pretty cool in that you are given a single function to build your routes, but you can nest these function calls to build and group relative ...Jun 6, 2021·2 min read
ozzie.shStart verifying your commits on GitHub in ~5 minutesThe typical story when you're setting up git on your new computer goes: Make sure git is installed Tell git who you are (via git config) Make commits Push to GitHub Which up until a few weeks ago this is how I would go about it too. Then one day I ...Mar 15, 2021·9 min read
ozzie.shDon't wait until the end of the interview to ask questionsWe all know the typical wrap up for an interview goes along the lines of: Company: Do you have any questions for us? Which is your opportunity to find out more about the position, culture, company, etc. Most people leave all of their questions for ...Mar 11, 2021·4 min read