Skip to content

Instantly share code, notes, and snippets.

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

Keith Mitchell xkisu

🏳️‍⚧️
View GitHub Profile
@xkisu
xkisu / tailwind.config.js
Created February 2, 2024 09:58 — forked from jonshipman/tailwind.config.js
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
@xkisu
xkisu / memberlist-serf-raft.go
Created June 17, 2023 20:12 — forked from mjpitz/memberlist-serf-raft.go
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"
@xkisu
xkisu / smokebg.tsx
Created March 3, 2023 09:19
PixiJS smoke effect in React
import {BlurFilter, Filter, RENDERER_TYPE, TextStyle} from 'pixi.js';
import {Container, Sprite, Stage, Text, useApp, useTick} from '@pixi/react';
import {PropsWithChildren, useMemo} from 'react';
// Adapted from https://gist.github.com/OmarShehata/9650b8ee419db3696ce555f10712d499
// ref: https://codepen.io/omarshe7ta/pen/xVeWWy
// debugging ref: https://www.html5gamedevs.com/topic/44542-need-help-of-migrating-shader-from-v4-to-v5/
// https://www.pixiplayground.com/#/edit/6ThqOOz-SVJe3AyvkbnaU
// https://github.com/pixijs/pixijs/wiki/v5-Creating-filters
const fragShader = `#ifdef GL_ES
@xkisu
xkisu / Button.tsx
Created February 28, 2023 14:34
Typescript React component with as prop to set wrapper component
import {Fragment, PropsWithChildren} from 'react';
import * as React from 'react';
type ButtonWithAsProps<T> = {
[K in keyof T]: T[K]
}
export interface ButtonProps<TComponent extends React.ComponentType<any> | keyof JSX.IntrinsicElements> {
as: TComponent
icon?: (props: any) => JSX.Element
@xkisu
xkisu / pdf_embeddings.py
Created February 28, 2023 08:57
Query a PDF outline for info with GPT3
import logging
from pypdf import PdfReader
import os.path
import camelot
import pandas as pd
import openai
@xkisu
xkisu / main.go
Created February 18, 2023 11:30
Generate matrix combinations from a source set of maps
package main
import (
"fmt"
"sort"
"strings"
"github.com/zclconf/go-cty/cty"
"github.com/zclconf/go-cty/cty/json"
)
@xkisu
xkisu / main.go
Last active August 25, 2022 08:51
Golang Audio Autocorrelation
package main
import (
"errors"
"math/cmplx"
"fmt"
"log"
"math"
"math/rand"
"os"
@xkisu
xkisu / group-name.sh
Created July 31, 2022 08:12
Alternative Netdata group-name.sh script to detect Nomad info for containers via the Docker REST API
#!/usr/bin/env bash
#shellcheck disable=SC2001
# netdata
# real-time performance and health monitoring, done right!
# (C) 2016 Costa Tsaousis <costa@tsaousis.gr>
# SPDX-License-Identifier: GPL-3.0-or-later
#
# Script to find a better name for cgroups
#
@xkisu
xkisu / linux.hcl
Created April 20, 2022 01:41
Run Ubuntu Cloud image under QEMU and KVM with Nomad
# https://powersj.io/posts/ubuntu-qemu-cli/
# https://github.com/hashicorp/nomad/issues/5688
job "linux-vm" {
region = "global"
datacenters = ["dc1"]
type = "service"
group "vm" {