Skip to content

Instantly share code, notes, and snippets.

View BenMcLean's full-sized avatar

Benjamin McLean BenMcLean

View GitHub Profile
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,
@BenMcLean
BenMcLean / powershell.bat
Last active October 30, 2022 22:57
Launch Powershell script .ps1 from identically named batch script .bat
@ECHO OFF
cd %~dp0
PowerShell.exe -NoProfile -ExecutionPolicy Bypass -Command "& '%~dpn0.ps1' %1 %2 %3 %4 %5 %6 %7 %8"
@PAUSE
@willnationsdev
willnationsdev / gdnative_guide_windows64debug.md
Last active June 16, 2022 14:41
A quick guide on building a GDNative C++ project

Creating a GDNative Library (Windows)

This guide specifically shows how to get a Windows 10 x64 OS compiled for a Windows x64 Debug dynamic library and integrate it into a Godot project.

To begin, make sure you are running the appropriate command line tool as an administrator.

Create a SimpleLibrary directory and enter it. This is where our Godot and GDNative projects will exist. For later use, we will also create subdirectories for libraries (lib) and source code (src). Once inside, we get a copy of each necessary repository for C++ NativeScript bindings generation and enter into the cpp_bindings directory.

mkdir SimpleLibrary

@BenMcLean
BenMcLean / movegit.bat
Last active May 27, 2022 15:19
Batch file to transfer a Git repository to a different remote repo
cd %~dp0
for %%g in ("%1") do set "Folder=%%~ng"
mkdir %Folder%
cd %Folder%
git clone --mirror %1
cd %Folder%.git
git config --unset core.bare
git remote remove origin
git remote add origin %2
git push -u origin --all
@BenMcLean
BenMcLean / .gitconfig
Created February 14, 2019 22:53
apply-gitignore alias for Git
[alias]
                apply-gitignore = !git ls-files -ci --exclude-standard -z | xargs -0r git rm --cached
@BenMcLean
BenMcLean / VirtualBoyGo.ps1
Last active July 12, 2019 01:19
VirtualBoyGo powershell
<#
.SYNOPSIS
Downloads VirtualBoyGo source code
.DESCRIPTION
Gathers all dependencies and places them in the correct folders!
.NOTES
Author : Benjamin McLean [email protected]
.LINK
https://github.com/CidVonHighwind/VirtualBoyGo
#>
@BenMcLean
BenMcLean / 3dify-REDHydrogenOneDownmix.bat
Last active May 27, 2022 15:18
Uses https://ffmpeg.org/ to tag a video file as being SBS 3D. Just drag+drop the video file onto this batch file in same folder with ffmpeg.exe
@ECHO OFF
cd %~dp0
ffmpeg.exe -i "%~1" -c:v copy -c:a aac -af "pan=stereo|FL=0.5*FC+0.707*FL+0.707*BL+0.5*LFE|FR=0.5*FC+0.707*FR+0.707*BR+0.5*LFE,volume=1.660156" -metadata:s:v:0 stereo_mode=1 "%~n1_half_2x1.mp4"
echo Output file is: "%~n1_half_2x1.mp4"
@PAUSE
// 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.
$set(_year,$left($if2(%originaldate%,%date%),4))
$replace(
$replace(
$if(_year,%_year% )
%album%
$if($and(%releasetype%,$not($find(%releasetype%,album))), \(%releasetype%\))
\($if2(%albumartist%,%artist%)\)
$if($eq($upper(%_extension%),MP3),, $upper(%_extension%))
/
$if($gt(%totaldiscs%,1),$if(%discsubtitle%,CD$num(%discnumber%,$len(%totaldiscs%)) %discsubtitle%/)$num(%discnumber%,$len(%totaldiscs%))-,)
version: "3"
services:
sftpgo:
image: "drakkan/sftpgo:v2-alpine"
# default user id
user: 1026
restart: always
expose:
# HTTP
- "8080"