Skip to content

Instantly share code, notes, and snippets.

View benemmaofficial's full-sized avatar

Ben Emma benemmaofficial

View GitHub Profile
@bgolus
bgolus / PristineMajorMinorGrid.shader
Last active April 24, 2025 05:25
Pristine Grid applied to a grid that has support for major and minor lines and colored axis lines
Shader "Pristine Major Minor Grid"
{
Properties
{
[KeywordEnum(X, Y, Z)] _Axis ("Plane Axis", Float) = 1.0
[IntRange] _MajorGridDiv ("Major Grid Divisions", Range(2,25)) = 10.0
_AxisLineWidth ("Axis Line Width", Range(0,1.0)) = 0.04
_MajorLineWidth ("Major Line Width", Range(0,1.0)) = 0.02
_MinorLineWidth ("Minor Line Width", Range(0,1.0)) = 0.01
@bgolus
bgolus / PristineRadialGrid.shader
Last active April 10, 2025 08:14
An application of the Pristine Grid technique onto radial grid with atan derivative discontinuity fixes applied. https://bgolus.medium.com/the-best-darn-grid-shader-yet-727f9278b9d8 https://bgolus.medium.com/distinctive-derivative-differences-cce38d36797b
Shader "Pristine Radial Grid"
{
Properties
{
[Toggle] _WorldUV ("Use World Space UV", Float) = 1.0
_GridScale ("Grid Scale", Float) = 1.0
[Toggle] _UseAdaptiveAngularSegments ("Use Adaptive Angular Segment Count", Float) = 0.0
[IntRange] _AngularSegments ("Angular Segments", Range(1,360)) = 4.0
@bgolus
bgolus / InfiniteGrid.shader
Last active November 20, 2024 01:20
Infinite Grid shader with procedural grid with configurable divisions and major and minor lines markings.
Shader "Unlit/InfiniteGrid"
{
Properties
{
[Toggle] _WorldUV ("Use World Space UV", Float) = 1.0
_GridScale ("Grid Scale", Float) = 1.0
_GridBias ("Grid Bias", Float) = 0.5
_GridDiv ("Grid Divisions", Float) = 10.0
_BaseColor ("Base Color", Color) = (0,0,0,1)
_LineColor ("Line Color", Color) = (1,1,1,1)
@Meldiron
Meldiron / backup.sh
Last active May 2, 2025 07:45
Backup and Restore Appwrite, the lazy way 🐌
# Make sure to stop Appwrite before this backup,
# and make sure you have enough space on the machine.
# After backing up, make sure there is a file in 'backups/backup-___.tar.gz'.
# Also please check size of this file, it should be at least 5kb, even for small instances.
docker run --rm \
-v appwrite_appwrite-mariadb:/backup/appwrite-mariadb \
-v appwrite_appwrite-redis:/backup/appwrite-redis \
-v appwrite_appwrite-cache:/backup/appwrite-cache \
@ibndawood
ibndawood / style.css
Last active May 29, 2020 03:24
Electro v2 - Adding png as icon for menus
.ci-icon {
width: 28px;
height: 28px;
display: inline-block;
background-position: center;
background-size: cover;
margin-bottom: 0 !important;
}
.mobile-handheld-department ul.nav li a i {
@ibndawood
ibndawood / functions.php
Created March 2, 2019 06:40
Electro v2 - Enqueue latest fontawesome from CDN
add_action( 'wp_enqueue_scripts', 'ec_enqueue_latest_fa', 30 );
add_filter( 'style_loader_tag', 'ec_child_add_fa_cdn_attributes', 10, 2 );
function ec_enqueue_latest_fa() {
wp_dequeue_style( 'fontawesome' );
wp_dequeue_style( 'ec-fontawesome' );
wp_enqueue_style( 'latest-fontawesome', 'https://use.fontawesome.com/releases/v5.7.2/css/all.css', array(), null );
}
function ec_child_add_fa_cdn_attributes( $html, $handle ) {