Skip to content

Instantly share code, notes, and snippets.

View lubien's full-sized avatar
💭
Teaching people 🔥🦩 LiveView 🔥🦩

Lubien lubien

💭
Teaching people 🔥🦩 LiveView 🔥🦩
View GitHub Profile
Application.put_env(:sample, Example.Endpoint,
http: [ip: {127, 0, 0, 1}, port: 5001],
server: true,
live_view: [signing_salt: "aaaaaaaa"],
secret_key_base: String.duplicate("a", 64)
)
Mix.install([
{:plug_cowboy, "~> 2.5"},
{:jason, "~> 1.0"},
@lubien
lubien / stickers-downloader.js
Last active March 26, 2026 17:50
Download all visible telegram stickers images
// How to download telegram sticker images
/*
1. Go to Telegram Web;
2. Open console (F12);
3. Paste the code below in the console and press Enter;
4. Open your stickers menu and make sure you see the sticker pack you want to download (so Telegram will load it).
5. At the console paste and run "downloadStickers()" any time you want to download a pack.
6. [Convert .webm to another format](http://www.freewaregenius.com/convert-webp-image-format-jpg-png-format/);
7. Happy hacking.
#!/bin/bash
# Function to install VSCode
install_vscode() {
echo "Installing Visual Studio Code..."
# Update package index
sudo apt update
# Install required dependencies
@lubien
lubien / fontes-de-vagas.md
Last active November 18, 2025 18:53
Fontes de vagas (Atualizado 2024-01-18 17:41)
@lubien
lubien / purger.livemd
Created October 3, 2024 14:39
flyio org purger

Fly Org Cleaner

Mix.install([
  {:req, "~> 0.5.6"},
  {:kino, "~> 0.14.1"}
])

Section

defmodule AlchemistWeb.Endpoint do
use Phoenix.Endpoint, otp_app: :alchemist
def call(conn, opts) do
conn
|> AlchemistWeb.ReplayPlug.call(AlchemistWeb.ReplayPlug.init(nil))
|> case do
%{halted: true} = conn -> conn
conn -> super(conn, opts)
end
@lubien
lubien / ecto_sqlite.livemd
Created April 5, 2024 12:18
ecto_sqlite livebook

Untitled notebook

Mix.install([
  {:liveview_playground, "~> 0.1.8"},
  {:phoenix_ecto, "~> 4.5"},
  {:ecto, "~> 3.11"},
  {:ecto_sqlite3, "~> 0.13"}
])
#!/bin/bash
cleanup() {
echo "destroy your machine"
fly m destroy --force
exit 0
}
trap 'cleanup' SIGINT
Mix.install([
{:liveview_playground, "~> 0.1.1"}
])
defmodule PageLive do
use LiveviewPlaygroundWeb, :live_view
def mount(_params, _session, socket) do
socket = assign(socket, tab: "home")
{:ok, socket}
defmodule MarkdownConverter do
import Phoenix.Component
def convert(filepath, body, _attrs, opts) do
convert_body(Path.extname(filepath), body, opts)
end
defp convert_body(extname, body, opts) when extname in [".md", ".markdown", ".livemd"] do
html =
Earmark.as_ast!(body, annotations: "%%")