Skip to content

Instantly share code, notes, and snippets.

View adoublef's full-sized avatar

Kristopher adoublef

  • 16:13 (UTC +01:00)
View GitHub Profile
# Ignore everything
*
*/
# But not these files...
!.gitignore
!profile/README.md
# optional
# !.devcontainer/
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
// https://github.com/microsoft/vscode-dev-containers/tree/v0.238.0/containers/typescript-node
{
"name": "Node.js & TypeScript",
"build": {
"dockerfile": "Dockerfile",
// Update 'VARIANT' to pick a Node version: 18, 16, 14.
// Append -bullseye or -buster to pin to an OS version.
// Use -bullseye variants on local on arm64/Apple Silicon.
"args": {
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
// https://github.com/microsoft/vscode-dev-containers/tree/v0.238.0/containers/go-postgres
{
"name": "Go & PostgreSQL",
"dockerComposeFile": "docker-compose.yml",
"service": "app",
"workspaceFolder": "/workspace",
// Configure tool-specific properties.
"customizations": {
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
// https://github.com/microsoft/vscode-dev-containers/tree/v0.238.0/containers/rust
{
"name": "Rust",
"build": {
"dockerfile": "Dockerfile",
"args": {
// Use the VARIANT arg to pick a Debian OS version: buster, bullseye
// Use bullseye when on local on arm64/Apple Silicon.
"VARIANT": "buster"
@adoublef
adoublef / jsx.d.ts
Last active May 15, 2024 11:29
JSX for HTMX
type Booleanish = boolean | "true" | "false";
type CrossOrigin = "anonymous" | "use-credentials" | "" | undefined;
// export = JSX;
// export as namespace JSX;
declare namespace JSX {
interface HTMLProps<T> extends AllHTMLAttributes<T> {}
// type DetailedHTMLProps<E extends HTMLAttributes<T>, T> = E;
@adoublef
adoublef / subcommands.sh
Created January 6, 2024 01:12
Updated Bash CLI
#!/usr/bin/env bash
# Treat unset variables and parameters other than the special parameters ‘@’ or
# ‘*’ as an error when performing parameter expansion. An 'unbound variable'
# error message will be written to the standard error, and a non-interactive
# shell will exit.
set -o nounset
# Exit immediately if a pipeline returns non-zero.
set -o errexit
@adoublef
adoublef / keto.go
Last active February 1, 2024 12:04
Keto Testcontainers
package keto
import (
"context"
"fmt"
"net"
"github.com/testcontainers/testcontainers-go"
)
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH=$HOME/.oh-my-zsh
# Set name of the theme to load --- if set to "random", it will
# load a random theme each time oh-my-zsh is loaded, in which case,
# to know which specific one was loaded, run: echo $RANDOM_THEME
# See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes
# syntax=docker/dockerfile:1
ARG GO_VERSION=1.21
ARG DISTROLESS=static-debian11:nonroot-amd64
FROM golang:${GO_VERSION} AS base
WORKDIR /usr/src
COPY go.* .
@adoublef
adoublef / client.go
Created March 17, 2024 20:05
Golang SMTP
package smtp
import (
"crypto/tls"
"fmt"
"net/smtp"
"net/url"
"strings"
)