Skip to content

Instantly share code, notes, and snippets.

@PossiblyAShrub
PossiblyAShrub / dbman
Last active August 16, 2023 03:56
A partial implementation of dbmate in YSH
This is a partial implementation of dbmate [1] in YSH [0].
This is more of a example of what YSH looks like for larger and more realistic
programs. It's not very well tested, lacks many features, could use some
cleaning up, and probably has a few bugs. But I think it's a good proof of
concept and is functional enough to be worth it's salt.
> I want to run it
You will want to make sure you have sqlite3 and YSH [0] installed. Then run the
@PossiblyAShrub
PossiblyAShrub / dock_builder_example.cpp
Created August 12, 2020 15:13
Simple example, of how to use the dock builder API. (Adapted from the dock space example in the demo window) You need to use the docking branch and set the ImGuiConfigFlags_DockingEnable config flag. Learn more about Dear ImGui here: https://github.com/ocornut/imgui
static ImGuiDockNodeFlags dockspace_flags = ImGuiDockNodeFlags_PassthruCentralNode;
// We are using the ImGuiWindowFlags_NoDocking flag to make the parent window not dockable into,
// because it would be confusing to have two docking targets within each others.
ImGuiWindowFlags window_flags = ImGuiWindowFlags_MenuBar | ImGuiWindowFlags_NoDocking;
ImGuiViewport* viewport = ImGui::GetMainViewport();
ImGui::SetNextWindowPos(viewport->Pos);
ImGui::SetNextWindowSize(viewport->Size);
ImGui::SetNextWindowViewport(viewport->ID);
@PossiblyAShrub
PossiblyAShrub / tree.txt
Created July 18, 2020 20:50
A procedural tree shader, instructions are in the comments (WARNING: this shader may crash your magicavoxel, backup/save you file before using, and limit the size of you 'chunk' when using. - If your app crashes and you forgot to save, magicavoxel has a backup.vox file, file that and use it to recover your project. And if you want to risk it, yo…
// Instructions
// 1. Download into the folder 'shader' in your MagicaVoxel install folder
// 2. Open the shaders panel on the right
// 3. Place down a 'seed' color (make this unique) this is where your trees will grow
// 4. Congifure your tree properties in the 'ARG' panel
// 5. Click the shader and press play!
//
// !!!!! WARNING: this shader doesn't support: SDF brush, or areas larger then 64^3 at a time
// !!!!! NOTICE: as this shader can crash magicavoxel, it's recommended to make a backup of your
// project BEFORE running the shader
// Instructions
// 1. Download into the folder 'shader' in your MagicaVoxel install folder
// 2. Open the shaders panel on the right
// 3. Cick the cake shader and press play! Your model insides are now cake! (Colors not included)
// Copyright 2020 Aidan (@PossiblyAShrub)
// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
// associated documentation files (the "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
@PossiblyAShrub
PossiblyAShrub / donut.txt
Created June 16, 2020 23:40
Donut Shader for MagicaVoxel
// Made By @PossiblyAShrub
// Icing Ratio ----------------- controls how much of the donut has icing on it
// Wavy-ness ------------------- controls how wavy the edges of the donut is
// Replace Exisitng Voxels ---- if 0, then the donut SDF brush will replace voxels in it's select area with air
// xs_begin
// author : '@PossiblyAShrub'
// arg : {id = '0' name = 'Icing Ratio' value = '0.4' range = '0 1' step = '0.1' decimal = '2' }
// arg : {id = '1' name = 'Wavy-ness' value = '4' range = '0 8' step = '0.5' decimal = '1' }
// arg : {id = '2' name = 'Replace Existing Voxels' value = '1' range = '0 1' step = '1' decimal = '0' }