Skip to content

Instantly share code, notes, and snippets.

View AlexZeitler's full-sized avatar
👷‍♂️
Building stuff

Alexander Zeitler AlexZeitler

👷‍♂️
Building stuff
View GitHub Profile
@AlexZeitler
AlexZeitler / check-aur-infected.sh
Last active June 15, 2026 14:45
Check for infected AUR packages
#!/usr/bin/env bash
#
# check-aur-infected.sh
# Checks the locally installed AUR / foreign packages against the published
# list of compromised AUR packages.
#
# Options:
# -v | --verbose Enable debug output (written to stderr)
# (alternatively: DEBUG=1 as an environment variable)
#
@AlexZeitler
AlexZeitler / .tmux.conf
Last active March 23, 2026 14:56
tmux config
# /home/terrywang/.tmux.conf
# Based on tmux book written by Brian P. Hogan
# c-a o to switch to another panel
# c-d to close shell
# c-a ! to close panel
# c-a w to list windows
# c-a " split pane horizontally
# c-a % split pane vertically
# Setting the prefix from C-b to ALT+M
@AlexZeitler
AlexZeitler / schema.sql
Created July 30, 2025 19:44 — forked from barbinbrad/schema.sql
Structured Raw Material Schema
CREATE TABLE "material" (
"id" TEXT NOT NULL PRIMARY KEY DEFAULT xid(),
"materialFormId" TEXT,
"materialSubstanceId" TEXT,
"materialTypeId" TEXT,
"finishId" TEXT,
"gradeId" TEXT,
"dimensionId" TEXT,
"companyId" TEXT,
"customFields" JSONB,
@AlexZeitler
AlexZeitler / typeahead_result.gohtml
Created September 4, 2024 21:31 — forked from Howard3/typeahead_result.gohtml
HTMX/AlpineJS TypeAhead.
{{define "content"}}
<div id="results">
{{if or .Notice .Error}}
{{if .Error}}
<div
class="alert flex rounded-lg border border-error px-4 py-4 text-error sm:px-5"
>
{{.Error}}
</div>
{{else}}
@AlexZeitler
AlexZeitler / passwordless-token-provider.md
Created June 19, 2024 09:19 — forked from ebicoglu/passwordless-token-provider.md
Implementing Passwordless Authentication in ASP NET Core Identity

Implementing Passwordless Authentication in ASP.NET Core Identity

To allow a user login with a magic URL, you need to implement a custom token provider. I'll show you how to add a custom token provider to authenticate a user with a link.

Step-1

Create a class named PasswordlessLoginProvider in your *.Web project.

PasswordlessLoginProvider.cs

@AlexZeitler
AlexZeitler / MartenTestDatabase.cs
Created May 3, 2024 13:07
Marten Test database setup
public class PostgresAdministration
{
private readonly string _connectionString;
public PostgresAdministration(
string connectionString
)
{
_connectionString = connectionString;
}
@AlexZeitler
AlexZeitler / FanOutSample.cs
Created April 12, 2024 14:41 — forked from flew2bits/FanOutSample.cs
FanOut sample for Dates
using Marten;
using Marten.Events.Projections;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
var builder = Host.CreateApplicationBuilder();
builder.Services.AddMarten(opt => {
opt.Connection(builder.Configuration.GetConnectionString("Marten") ?? "Host=localhost; Port=5433; User Id=postgres; Password=pgsql");
opt.Projections.Add<WorkByDayProjection>(ProjectionLifecycle.Inline);
@AlexZeitler
AlexZeitler / fetch-disposable-email-domains-and-write-to-postgres.sh
Last active November 24, 2023 07:27
Throw away / disposable email domain list with Postgres import
#!/bin/bash
# download the files
curl -o file1.txt https://gist.githubusercontent.com/ammarshah/f5c2624d767f91a7cbdc4e54db8dd0bf/raw/660fd949eba09c0b86574d9d3aa0f2137161fc7c/all_email_provider_domains.txt
curl -o file2.js.txt https://gist.githubusercontent.com/Evavic44/8348e357935d09f79d4c1616b0c20408/raw/72996e053cbaf39de9cf16d304d2c237184f96d2/domain.js
curl -o file3.txt https://raw.githubusercontent.com/disposable/disposable-email-domains/master/domains.txt
# remove first and last line, remove quotes, commas and spaces
sed -e '1d;$d' file2.js.txt | awk '{ gsub(/["\, ]/, ""); print }' > file2.txt
@AlexZeitler
AlexZeitler / brevo.ts
Created July 14, 2023 15:03 — forked from marentdev/brevo.ts
[Node.JS] [TypeScript] [Axios] Brevo Class API using swagger-typescript-api
/* eslint-disable */
/* tslint:disable */
/*
* ---------------------------------------------------------------
* ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ##
* ## ##
* ## AUTHOR: acacode ##
* ## SOURCE: https://github.com/acacode/swagger-typescript-api ##
* ---------------------------------------------------------------
*/
@AlexZeitler
AlexZeitler / MartenProjections.cs
Last active October 13, 2022 07:14
MartenDb projections
public abstract class AppUser
{
public Guid Id { get; set; }
}
public class RegisteredUser : AppUser
{
public void Apply(Registered registered)
{
Username = registered.Username;