Skip to content

Instantly share code, notes, and snippets.

View xkisu's full-sized avatar
🏳️‍⚧️

Keith Mitchell xkisu

🏳️‍⚧️
View GitHub Profile
@jonshipman
jonshipman / tailwind.config.js
Created February 2, 2024 02:07
120 Crayola Crayons Tailwind Config
module.exports = {
theme: {
extend: {
colors: {
'almond': { DEFAULT: '#EFDBC5' },
'antique-brass': { DEFAULT: '#CD9575' },
'apricot': { DEFAULT: '#FDD9B5' },
'aquamarine': { DEFAULT: '#78DBE2' },
'asparagus': { DEFAULT: '#87A96B' },
'atomic-tangerine': { DEFAULT: '#FFA474' },
@xkisu
xkisu / README.md
Created November 2, 2023 04:41 — forked from mosquito/README.md
Add doker-compose as a systemd unit

Docker compose as a systemd unit

Create file /etc/systemd/system/docker-compose@.service. SystemD calling binaries using an absolute path. In my case is prefixed by /usr/local/bin, you should use paths specific for your environment.

[Unit]
Description=%i service with docker compose
PartOf=docker.service
After=docker.service
@wiseman
wiseman / agent.py
Last active June 27, 2024 14:32
Langchain example: self-debugging
from io import StringIO
import sys
from typing import Dict, Optional
from langchain.agents import load_tools
from langchain.agents import initialize_agent
from langchain.agents.tools import Tool
from langchain.llms import OpenAI
@jtiai
jtiai / starfield.gdshader
Created September 26, 2022 20:16
Conversion of Art of Code starfield shader to Godot shader
shader_type canvas_item;
#define NUM_LAYERS 4.
mat2 rotate(float a) {
float s = sin(a), c = cos(a);
return mat2(vec2(c, -s), vec2(s, c));
}
float star(vec2 uv, float flare) {
@globulus
globulus / Weighted.swift
Created December 11, 2021 13:05
Weighted HStack and VStack in SwiftUI
// Full recipe at https://swiftuirecipes.com/blog/weighted-layout-hstack-and-vstack-in-swiftui
import SwiftUI
class WeightedProxy {
let kind: Kind
var geo: GeometryProxy? = nil
private(set) var totalWeight: CGFloat = 0
init(kind: Kind) {
@apollo13
apollo13 / traefik.nomad
Last active April 15, 2024 14:46
Traefik 2.5 with Consul Connect on Nomad
# Simple example to deploy traefik with consul connect enabled.
# For simplicity the job includes traefik as well as the backend service.
# Please note that traefik currently only supports connect for HTTP.
job "traefik-consul-connect-demo" {
datacenters = ["dc1"]
group "edge" {
network {
mode = "bridge"
@mjpitz
mjpitz / _README.md
Last active May 31, 2024 12:22
comparison of embedded databases for raft

As an exercise, I started to design and implement a database in some of my free time. As I started working through some of the details, there were a few things that I knew I wanted to work with and a few things I wanted to evaluate. Since I'm looking at more of a CP system, my mind immediately jumped to Raft. But which implemenation to use? And what storage mechanism? Since I had more familiarity with Hashicorps implemenation, I started there.

The first thing I wanted to do was consider the performance characteristics of the underlying data stores. One of the nice features of the hashicorp implementation is it allows callers to plugin in different stores for logs, stable, and snapshots. There's a whole slew of community implementations.

@spuder
spuder / redash.job
Last active January 6, 2021 01:58
ReDash Nomad job #nomad
# Based on this documentation
# https://redash.io/help/open-source/setup#-Docker
# https://github.com/getredash/setup/blob/master/data/docker-compose.yml
job "redash" {
# region = ""
datacenters = ["dc1"]
type = "service"
@mjpitz
mjpitz / memberlist-serf-raft.go
Created May 8, 2020 15:00
Basic idea on how to use memberlist, serf, and raft all together. Last example I found had a few bugs to work out.
package main
import (
"fmt"
"github.com/hashicorp/memberlist"
"github.com/hashicorp/raft"
"github.com/hashicorp/raft-boltdb"
"github.com/hashicorp/serf/serf"
"io"
"log"
@Adam-Clrk
Adam-Clrk / cloud-init.yaml
Last active February 6, 2024 20:12
Minecraft server cloud-init
#cloud-config
users:
- default
- name: minecraft
ssh_import_id: gh:adam-clrk
gecos: Minecraft server user
lock_passwd: true
#sudo: ALL=(ALL) NOPASSWD:ALL
package_update: true
package_upgrade: true