Skip to content

Instantly share code, notes, and snippets.

View greven's full-sized avatar
💧
Living the Elixir Life!

Nuno Moço greven

💧
Living the Elixir Life!
View GitHub Profile
@greven
greven / core_components.ex
Last active April 14, 2025 19:57
Phoenix CSS Icons
@doc """
Renders an icon.
Supports three icon libraries:
- [Heroicons](https://heroicons.com) - prefixed with "hero-"
- [Lucide](https://lucide.dev) - prefixed with "lucide-"
- [Simple Icons](https://simpleicons.org) - prefixed with "si-"
You can customize the size and colors of the icons by setting
width, height, and background color classes.
@greven
greven / create_skills.exs
Last active October 22, 2022 13:40
Ecto Migration add Full Text Search
add_searchable_column("skills", "searchable", "english", [
{:string, "name"},
{:array, "alt_names"},
{:array, "hidden_labels"}
])
add_translated_searchable_column(
"skills",
"searchable_pt",
"portuguese",
@greven
greven / cache.ex
Last active October 21, 2021 17:49
Elixir Simple Cache
defmodule Elixir.Cache do
@moduledoc """
Author: Nuno M.
Warning: This is exploratory, not tested at all.
A simple Cache system implement using ETS as a way to
create in-memory cache named tables.
In order to keep concurrent access to the cache tables, methods