Skip to content

Instantly share code, notes, and snippets.

View ryanzidago's full-sized avatar

Ryan Zidago ryanzidago

View GitHub Profile
@ryanzidago
ryanzidago / qa.run.ex
Created July 24, 2026 06:00
Parallel Mix quality checks with readable output and aggregated failures
defmodule Mix.Tasks.Qa.Run do
@shortdoc "Run the server quality checks in parallel"
use Mix.Task
@mix_runner_prefix ["--erl", "-elixir ansi_enabled true", "-S", "mix"]
@checks [
{"format", ["format", "--check-formatted"]},
{"credo", ["credo", "--strict"]},
@ryanzidago
ryanzidago / benchmark_fast_elixir_worktrees.exs
Last active July 17, 2026 17:22
Reproducible benchmark for relocating Elixir Mix build caches across Git worktrees
#!/usr/bin/env elixir
defmodule FastWorktreeBenchmark do
@repo_url "https://github.com/phoenixframework/phoenix.git"
@commit "0d9c79ebfc0f2065b41e268551638bd8b767eda9"
@default_trials 5
def run do
require_commands!(["git", "mix", "cp"])
@ryanzidago
ryanzidago / fastbook_chapter_4-customer_learner.py
Last active September 19, 2021 18:10
Fastbook Chapter 4 - Custom Learner
def mnist_loss(predictions, targets):
predictions = predictions.sigmoid()
return torch.where(targets == 1, 1 - predictions, predictions).mean()
class BasicOptim:
def __init__(self, params, learning_rate):
self.params = params
self.learning_rate = learning_rate
def step(self, *args, **kwargs):
@ryanzidago
ryanzidago / roman_numerals.exs
Created April 11, 2020 20:47
Here is my solution to Exercism's Roman Numerals exercise.
defmodule RomanNumerals do
import IO, only: [iodata_to_binary: 1]
@doc """
Convert the number to a roman number.
"""
@spec numeral(pos_integer) :: String.t()
def numeral(0), do: ""
def numeral(1), do: "I"
def numeral(2), do: "II"