Skip to content

Instantly share code, notes, and snippets.

@zikes
zikes / fly.toml
Created February 9, 2023 14:35
Gitea fly.toml config
# fly.toml file generated for gitea-zikes-services on 2022-09-04T16:49:56-05:00
app = "gitea-zikes-services"
kill_signal = "SIGINT"
kill_timeout = 5
processes = []
[build]
image = "gitea/gitea:1.18.3"
@zikes
zikes / .zshrc
Last active November 14, 2022 03:45
Using kube-ps1 with P9K
# Enable the kube-ps1 oh-my-zsh plugin
plugins = (
git
kube-ps1
)
# The output of the kube_ps1 function is text, so it can be used
# directly as a custom p9k segment
POWERLEVEL9K_CUSTOM_KUBE_PS1='kube_ps1'
GRAB 300
REPL AZIMUTH
SEEK 1
COPY F M
COPY M T
REPL ELEVATION
SEEK 1
COPY F M
@zikes
zikes / spherical_cap.scad
Created May 22, 2020 00:26
OpenSCAD Spherical Cap
module spherical_cap(height,diameter) {
R=(pow(diameter/2,2)+pow(height,2))/(height*2);
translate([0,0,-R+height])difference() {
sphere(r=R,$fn=100);
translate([0,0,-height])cube(size=[R*2,R*2,R*2], center=true);
}
}
@zikes
zikes / index.html
Created May 4, 2020 18:13
Force-Directed Graph
<!doctype html>
<html lang="en">
<head>
<title>Force-Directed Graph</title>
<script src="https://d3js.org/d3.v5.min.js"></script>
</head>
<body>
<script>
var height = 600;
var width = 600;
@zikes
zikes / generate.c
Created March 5, 2019 16:50 — forked from munificent/generate.c
A random dungeon generator that fits on a business card
#include <time.h> // Robert Nystrom
#include <stdio.h> // @munificentbob
#include <stdlib.h> // for Ginny
#define r return // 2008-2019
#define l(a, b, c, d) for (i y=a;y\
<b; y++) for (int x = c; x < d; x++)
typedef int i;const i H=40;const i W
=80;i m[40][80];i g(i x){r rand()%x;
}void cave(i s){i w=g(10)+5;i h=g(6)
+3;i t=g(W-w-2)+1;i u=g(H-h-2)+1;l(u
@zikes
zikes / .zshrc
Created July 6, 2018 19:21
Powerlevel9k + Google Play Music Desktop Player Custom Segment
zsh_gpmdp_now_playing(){
local json_file="$HOME/.config/Google Play Music Desktop Player/json_store/playback.json"
local is_playing=$(cat "$json_file" | jq '.playing')
local artist=$(cat "$json_file" | jq -r '.song.artist')
local title=$(cat "$json_file" | jq -r '.song.title')
if [[ "$is_playing" == "true" ]]; then
echo -n "\ufc58 $artist - $title"
fi
}
<!DOCTYPE html>
<html>
<head><title>Fizzlefade</title></head>
<body>
<canvas id="framebuffer" width="320" height="200"></canvas>
<script type="text/javascript">
/* Fizzlefade using a Feistel network.
@zikes
zikes / index.html
Created December 13, 2012 19:38
Exponential Regression Line Using numbers.js & d3.js
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Exponential Regression Line Using numbers.js & d3.js</title>
<script src="http://d3js.org/d3.v3.min.js"></script>
<script src="numbers.js"></script>
<style>
body {font: 10px sans-serif;}
@zikes
zikes / .vimrc
Created May 31, 2017 23:14
vim files
set nocompatible
filetype off
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')
" let Vundle manage Vundle, required