Skip to content

Instantly share code, notes, and snippets.

View gmile's full-sized avatar
🦆
Poco a poco cresc.

Ievgen Pyrogov gmile

🦆
Poco a poco cresc.
View GitHub Profile
@woylie
woylie / email_validation.ex
Last active October 15, 2024 10:32
Email validation according to RFC 5322 with Elixir and gen_smtp
import Ecto.Changeset
@spec validate_email(Ecto.Changeset.t(), atom) :: Ecto.Changeset.t()
def validate_email(changeset, field) when is_atom(field) do
changeset
|> validate_length(field, max: 160)
|> validate_change(field, &validate_email_rfc5322/2)
end
defp validate_email_rfc5322(field, email) do
@dhh
dhh / linux-setup.sh
Last active April 19, 2025 20:44
linux-setup.sh
# THIS LINUX SETUP SCRIPT HAS MORPHED INTO A WHOLE PROJECT: HTTPS://OMAKUB.ORG
# PLEASE CHECKOUT THAT PROJECT INSTEAD OF THIS OUTDATED SETUP SCRIPT.
#
#
# Libraries and infrastructure
sudo apt update -y
sudo apt install -y \
docker.io docker-buildx \
build-essential pkg-config autoconf bison rustc cargo clang \
@rameerez
rameerez / exit_the_cloud.md
Last active April 22, 2025 22:12
☁️ How I got off the cloud and migrated everything from AWS to a VPS in Hetzner

☁️ How I got off the cloud and migrated everything from AWS to a VPS in Hetzner

This is an opinionated handbook on how I migrated all my Rails apps off the cloud and into VPS.

This is how I manage real production loads for my Rails apps. It assumes:

  • Rails 7+
  • Ruby 3+
  • PostgreSQL
  • Ubuntu Server 24.04
  • Capistrano, Puma, Nginx
@stevendborrelli
stevendborrelli / crossplane-1.14.md
Last active January 8, 2024 08:29
Crossplane 1.14 Overview

A Tour of Crossplane 1.14

Crossplane is an Open-Source project that enables management of almost anything in the Cloud via the Kubernetes API.

Crossplane version 1.14 released November 1, 2023, is one of the most consequential releases in the project's history.

While Composition Functions and Provider performance improvements are headline features, there are substantial updates across the project: from a focus on developer and operator experience, Upbound's code donation to the CNCF, to API maturation.

This Document was updated November 7, 2023.

@kconner
kconner / macOS Internals.md
Last active April 24, 2025 10:08
macOS Internals

macOS Internals

Understand your Mac and iPhone more deeply by tracing the evolution of Mac OS X from prelease to Swift. John Siracusa delivers the details.

Starting Points

How to use this gist

You've got two main options:

LiveView Native Livebook

Mix.install(
  [
    {:plug_cowboy, "~> 2.5"},
    {:jason, "~> 1.0"},
    {:phoenix, "~> 1.7.2", override: true},
    {:phoenix_live_view, "~> 0.18.2"},
    {:phoenix_live_reload, "~> 1.4.1", override: true},
@LostKobrakai
LostKobrakai / form_live.ex
Last active April 16, 2025 10:08
Phoenix LiveView form with nested embeds and add/delete buttons
defmodule NestedWeb.FormLive do
use NestedWeb, :live_view
require Logger
defmodule Form do
use Ecto.Schema
import Ecto.Changeset
embedded_schema do
field :name, :string
@sts10
sts10 / rust-command-line-utilities.markdown
Last active April 23, 2025 06:26
A curated list of command-line utilities written in Rust

A curated list of command-line utilities written in Rust

Note: I have moved this list to a proper repository. I'll leave this gist up, but it won't be updated. To submit an idea, open a PR on the repo.

Note that I have not tried all of these personally, and cannot and do not vouch for all of the tools listed here. In most cases, the descriptions here are copied directly from their code repos. Some may have been abandoned. Investigate before installing/using.

The ones I use regularly include: bat, dust, fd, fend, hyperfine, miniserve, ripgrep, just, cargo-audit and cargo-wipe.

  • atuin: "Magical shell history"
  • bandwhich: Terminal bandwidth utilization tool
@otherjoel
otherjoel / spf-fail.rkt
Last active July 2, 2024 06:35
Generate a form email to explain to someone at another company that their SPF is broken
#lang racket/base
;; Generate a form email to let someone know their SPF records are misconfigured for their current email provider.
;;
;; Run (fill-report "domain.com" "1.2.3.4") where the 2nd arg is the sending email server's IP address.
;; It will copy the completed report to the clipboard for you.
;; Only works on Windows for now.
(require net/dns
@tomdaley92
tomdaley92 / README.md
Last active April 23, 2025 03:28
Proxmox - SPICE Client setup for MacOS

Proxmox - SPICE client setup for MacOS

  1. Install a working (and compiled) version of virt-viewer. You may view the homebrew package's upstream source on GitHub.

    brew tap jeffreywildman/homebrew-virt-manager
    brew install virt-viewer
  2. Once that's installed should be able make a call remote-viewer with a pve-spice.vv file downloaded from proxmox web interface