Skip to content

Instantly share code, notes, and snippets.

View Sythelux's full-sized avatar
🐻
Always Beary ready

Sythelux Rikd Sythelux

🐻
Always Beary ready
View GitHub Profile
@Sythelux
Sythelux / Terrain3DGeneratedAPI.cs
Created June 26, 2024 20:35
Manual C# Wrapper for Godot Terrain3D Generator GDExtension until it is automated. For Version 0.9.1
/// <summary>
/// for Version: 0.9.1
/// this API is actually not generated at all. Until this is a thing this file is a placeholder with specific functions implemented as needed.
/// https://github.com/j20001970/GDMP-demo/discussions/6#discussioncomment-7008945
/// </summary>
using System;
using System.Linq;
using Godot;
using Godot.Collections;
@Sythelux
Sythelux / Array3D.cs
Created May 30, 2024 22:10
Godot 4 C# Array3D
using System.Linq;
using Godot;
using Godot.Collections;
public class Array3D<[MustBeVariant] T>
{
public readonly Array<T> Array;
public readonly int Width;
public readonly int Height;
public readonly int Depth;
@Sythelux
Sythelux / Array2D.cs
Last active May 26, 2024 14:14
Godot 4 C# Array2D
using System.Linq;
using Godot;
using Godot.Collections;
public class Array2D<[MustBeVariant] T>
{
public readonly Array<T> Array;
public readonly int Width;
public readonly int Height;
public readonly int Length; // Width * Height
@Sythelux
Sythelux / folder-thumbnailer
Created January 25, 2024 14:35
Cinnamon Folder Thumbnailer
#!/bin/bash
# LICENSE: BSD3-Clause
# made by Sythelux Rikd
# DESC: this script creates a montage of images within a folder to create a folder icon for nemo
# it respects folder.jpg and .folder.jpg being set
# it is rather imperformant, maybe someone will improve it.
# needs to be put into /usr/bin/folder-thumbnailer
@Sythelux
Sythelux / WaitOnTask.cs
Created August 5, 2020 08:34
A CustomYieldInstruction for Unity that just wraps waiting on a task.
///<author email="dersyth@gmail.com">Sythelux Rikd</author>
public class WaitOnTask : CustomYieldInstruction
{
private Task _task;
private bool _taskDone;
public override bool keepWaiting => !_taskDone;
public WaitOnTask(Task task)
{
@Sythelux
Sythelux / move
Last active August 15, 2018 20:05
my move is supposed to copy source to target recursively. if target already exists it checks file size. if size is the same delete old one. if size is different keep old and new
#!/bin/bash
# my move is supposed to copy source to target recursively. if target already exists it checks file size
#if size is the same delete old one
#if size is different keep old and new
source=$1
target=$2
IFS=$'\n'
if [ -d "$source" ]; then
@Sythelux
Sythelux / Serie3.java
Last active April 27, 2017 13:28
Example implementation of ADS Exercise
package ads;
import java.text.MessageFormat;
import java.util.*;
/**
* Created by sythelux on 25.04.17.
*/
public class Serie3 {
private static Random random = new Random();
@Sythelux
Sythelux / base.skin
Created September 29, 2016 15:29
basic skin template for plantuml skins
skinparam Activity {
ArrowColor
ArrowFontColor
ArrowFontName
ArrowFontSize
ArrowFontStyle
BackgroundColor
BarColor
BorderColor
BorderThickness
@Sythelux
Sythelux / ReusableIDGenerator.java
Created May 13, 2016 13:05
Little ID Generator, that makes ids reusable after freeing
public class ReusableIDGenerator {
private static Map<Integer, Boolean> map = Collections.synchronizedMap(new HashMap<Integer, Boolean>());
private ReusableIDGenerator() {}
public static int get() {
for (int i = 0; i < Integer.MAX_VALUE; i++) {
if (map.containsKey(i)) {
if (!map.get(i)) {
map.put(i, true);
@Sythelux
Sythelux / TimeFlowParser.java
Created March 9, 2016 15:52
converts time on format like: "1d14h5min5sec40ms" to millis or vice versa
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Map.Entry;
import java.util.concurrent.TimeUnit;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
/**
*
* @author Sythelux Rikd