Skip to content

Instantly share code, notes, and snippets.

View carlgleisner's full-sized avatar

Carl Gleisner carlgleisner

View GitHub Profile
@by-nari
by-nari / readme.md
Last active May 6, 2025 18:16
1Password commit signing inside devcontainers

Comparing usage of Ash & Ecto

# https://gist.github.com/Gazler/b4e92e9ab7527c7e326f19856f8a974a

Application.put_env(:phoenix, :json_library, Jason)

Application.put_env(:sample, SamplePhoenix.Endpoint,
  http: [ip: {127, 0, 0, 1}, port: 5001],
  server: true,
@brainlid
brainlid / .iex.exs
Created April 2, 2024 12:52
My .iex.exs file that lives in my Home directory. Gets loaded and used in every IEx session on my machines. I borrowed and stole all the great ideas from others an tweaked them over the years.
Application.put_env(:elixir, :ansi_enabled, true)
# IEx shell customization for color
# - Added as a comment: https://thinkingelixir.com/course/code-flow/module-1/pipe-operator/
# - Original source: https://samuelmullen.com/articles/customizing_elixirs_iex/
# - Can add to a specific project or can put in the User home folder as a global config.
# Updates from:
# - https://github.com/am-kantox/finitomata/blob/48e1b41b21f878e9720e6562ca34f1ce7238d810/examples/ecto_intergation/.iex.exs
timestamp = fn ->
{_date, {hour, minute, _second}} = :calendar.local_time
Application.put_env(:example, Example.Endpoint,
server: true,
http: [ip: {127, 0, 0, 1}, port: 4001],
adapter: Bandit.PhoenixAdapter,
render_errors: [formats: [html: Example.ErrorHTML], layout: false],
live_view: [signing_salt: "aaaaaaaa"],
secret_key_base: String.duplicate("a", 64)
)
Application.put_env(:ex_money, :default_cldr_backend, Example.Cldr)
@c0m4r
c0m4r / freebsd_ovh_vps.md
Last active July 9, 2025 17:09
FreeBSD installation on OVH VPS
@caspg
caspg / 1_searchbar_live.ex
Last active August 6, 2025 06:09
Example of real-time search bar implementation in Phoenix LiveView and Tailwind. Working example on https://travelermap.net/parks/usa
defmodule TravelerWeb.SearchbarLive do
use TravelerWeb, :live_view
alias Phoenix.LiveView.JS
alias Traveler.Places
def mount(_params, _session, socket) do
socket = assign(socket, places: [])
{:ok, socket, layout: false}
end
@zblanco
zblanco / getting_lazy_with_dataflow_graphs_in_elixir.livemd
Last active July 17, 2025 00:43
Getting Lazy with Dataflow Graphs in Elixir

Getting Lazy with Dataflow Graphs in Elixir

Intro

What do Tensorflow, Apache Airflow, Rule Engines, and Excel have in common?

Under the hood they all use DAGs to model data-flow dependencies of the program. Using graphs to model programs is great because you can modify the program at runtime. Lets talk about doing this in Elixir for great good.

@theodorosploumis
theodorosploumis / Nework_throttling_profiles.md
Last active July 8, 2025 12:48
Web development - Custom network throttling profiles
Profile download (kb/s) upload (kb/s) latency (ms)
Native 0 0 0
GPRS 50 20 500
56K Dial-up 50 30 120
Mobile EDGE 240 200 840
2G Regular 250 50 300
2G Good 450 150 150
3G Slow 780 330 200
@qpre
qpre / elixir.yml
Created January 28, 2020 15:07
GitHub Actions for Elixir/Phoenix test/build/release + release on GitHub
name: Elixir CI
on: push
jobs:
test:
runs-on: ${{ matrix.os }}
name: OTP ${{ matrix.otp }} | Elixir ${{ matrix.elixir }} | Node ${{ matrix.node }} | OS ${{ matrix.os }}
strategy:
matrix:
@ausfestivus
ausfestivus / AzureRegionData.md
Last active August 7, 2025 08:11
A list of the Azure regions

List of Azure Regions

A list of all the region names and locations for Azure

Creating the list

You can recreate the list anytime using this command:

az account list-locations -o table