Skip to content

Instantly share code, notes, and snippets.

View BenMcLean's full-sized avatar

Benjamin McLean BenMcLean

View GitHub Profile
@BenMcLean
BenMcLean / update-google-dyndns.sh
Last active March 3, 2024 12:32 — forked from drewchapin/update-google-dyndns.sh
A shell script to update the public IP address of a Google DynDNS hostname.
#!/bin/bash
# Google Domains provides an API to update a DNS "Synthetic record". This script
# updates a record with the script-runner's public IP, as resolved using a DNS
# lookup.
#
# Google Dynamic DNS: https://support.google.com/domains/answer/6147083
# Synthetic Records: https://support.google.com/domains/answer/6069273
# Original script: https://gist.github.com/cyrusboadway/5a7b715665f33c237996
# Original modified script: https://gist.github.com/drewchapin/57d7039e30e8cc49e30bdc56a194f5bf
// Pixelated font shader by lox9973
// It is a cutout shader, using alpha blending for 1 pixel antialiasing on the edges.
// Intended use is "3D Text" on an opaque object like a sign.
Shader "UI/PixelFont" {
Properties {
_MainTex ("Font Texture", 2D) = "white" {}
_Color ("Text Color", Color) = (1,1,1,1)
}
SubShader {
// Below Transparent queue. Renders after the skybox, but writes to depth.
private void initialize() {
Coord.expandPoolTo(WIDTH+3, HEIGHT+3);
// Initialize the heightmap generator
ModuleFractal heightFractal = new ModuleFractal (ModuleFractal.FractalType.FBM,
ModuleBasisFunction.BasisType.GRADIENT,
ModuleBasisFunction.InterpolationType.QUINTIC);
heightFractal.setNumOctaves(terrainOctaves);
heightFractal.setFrequency(terrainFrequency);
heightFractal.setSeed(CommonRNG.getRng().between(0, Integer.MAX_VALUE));
ModuleFractal ridgedHeightFractal = new ModuleFractal (ModuleFractal.FractalType.RIDGEMULTI,