Skip to content

Instantly share code, notes, and snippets.

View codeadict's full-sized avatar
🕸️
λ: f(f(state)) = f(state)

Dairon M. codeadict

🕸️
λ: f(f(state)) = f(state)
View GitHub Profile
@mcrumm
mcrumm / phx_sqlite_fly_launch.md
Last active March 19, 2025 21:03
Phoenix + SQLite Deployment tips

Deploying to Fly.io with SQLite

Deploying a Phoenix app to Fly.io is a breeze...is what everyone kept telling me. In fairness, I imagine the process would have been breezier had I just used postgres, but all the sqlite and litestream talk has been far too intriguing to ignore. "Wait", you say. "It is just a flat file. How much harder can it be?"

It is easy to make something harder than it should be. It is hard to take something complex and make it truly simple. flyctl launch does an amazing job at providing a simple interface to the utterly complex task of generating deployment resources, especially now that we are living in a containerd (erm, firecracker) world.

This gist is for anyone who, like me, thinks they know better than to read all of the documentation and therefore necessari

Neural network from scratch in ... Elixir

Pure Elixir initial version test

inputs = [1, 2, 3, 2.5]
weights = [0.2, 0.8, -0.5, 1.0]
bias = 2.0
@gcauchon
gcauchon / !Protocol for external APIs
Last active September 8, 2023 15:47
Using protocol for external APIs
iex(1)> Foo.Correspondence.validate_number("234-555-6789")
{:ok, "Verizon Wireless", "mobile"}
@ctsrc
ctsrc / README.md
Last active July 2, 2025 14:28 — forked from niw/README.en.md
Guide: Run FreeBSD 13.1-RELEASE for ARM64 in QEMU on Apple Silicon Mac (MacBook Pro M1, etc) with HVF acceleration (Hypervisor.framework)
@rrichardsonv
rrichardsonv / udon_noodle_stir_fry.md
Created October 26, 2020 16:20
Tasty veggie udon noodles

Udon Noodle Stir-Fry

(Makes 4-5 servings)

Ingredients

Noodles

  • 1/2 lb Mushrooms (The larger grocery container)
  • Fresh Udon noodles (Not dried, See Sourcing)
  • 3 Tbs Roughly chopped peanuts (optional)
  • 1/2 lb Red Cabbage (little less than half a cabbage)
@evnu
evnu / funcs.escript
Last active November 9, 2023 01:45
Find all documented Erlang NIF functions and when they were introduced
#!/usr/bin/escript
%%%
%%% Output NIF functions and since when they are supported
%%%
%%% Usage:
%%%
%%% Run `funcs.escript` without any arguments to output all NIF functions.
%%% To filter NIFs by a specific version of OTP, use `funcs.escript <version>`,
%%% where matching versions must have the same prefix as the one supplied on
%%% the command line.
@gburd
gburd / sysctl.conf
Created January 5, 2019 02:43 — forked from voluntas/sysctl.conf
Sysctl configuration for high performance
### KERNEL TUNING ###
# Increase size of file handles and inode cache
fs.file-max = 2097152
# Do less swapping
vm.swappiness = 10
vm.dirty_ratio = 60
vm.dirty_background_ratio = 2
defmodule Mix.Tasks.PrintCode do
@shortdoc "Prints decompiled Erlang source for a module"
@moduledoc """
Pretty-prints the *Erlang-equivalent* source code of an *Elixir*
module. This is useful for understanding how particular Elixir
features (e.g. macros, protocols) operate under the covers.
*Erlang modules are not yet supported.*
@codeadict
codeadict / cookiecutter_requirements.txt
Last active December 29, 2017 21:42
Common packages needed for Cookecutter with Hooks
python-jenkins==0.4.15
PyGithub==1.35
cookiecutter==1.6.0