Skip to content

Instantly share code, notes, and snippets.

View japsuu's full-sized avatar

Jasper Honkasalo japsuu

View GitHub Profile
@japsuu
japsuu / gimp_fu_layer_pipeline_export.py
Created November 1, 2023 08:32
Gimp-Fu -plugin pipeline to automatically create colored variant layers for each layer in the current image, and export them to target folder.
#!/usr/bin/env python
# Type: Python-Fu
# Title: Export layers to PNG files
# Description: Automatically export each layer in the current image as a separate PNG file.
# Author: Jasper Honkasalo
# Version: 2023.1
# Menu-Path: File/Export layers to PNG files
from gimpfu import *
@japsuu
japsuu / Config.cs
Created March 24, 2023 08:58
Super simple WinForms config manager. TextBox saving support.
using System.Configuration;
public static class Config
{
private static Configuration configManager;
private static KeyValueConfigurationCollection configuration;
// Support lazy loading initialization.
private static bool hasInitialized;
@japsuu
japsuu / BresenhamLineAlgorithm.cs
Created January 10, 2023 07:01
C# comparison of two different implementations of the Bresenham's Line Algorithm.
// Compares the speed of two different implementations of Bresenham's Line Algorithm.
// Draws the resulting lines on a user defined canvas.
using System.Diagnostics;
// Size of the drawn canvas.
const int canvasWidth = 128;
const int canvasHeight = 128;
// First point.
@japsuu
japsuu / EventChannel.cs
Last active December 5, 2022 18:37
Radio event system for Unity
using System.Collections.Generic;
using UnityEngine;
namespace Framework.EventSystem
{
[CreateAssetMenu(menuName="EventChannel", fileName="EventChannel_")]
public class EventChannel : ScriptableObject
{
[SerializeField] private List<EventListener> listeners = new();
@japsuu
japsuu / LightFlickerEffect.cs
Last active January 10, 2023 07:08
Simple state based light flicker effect for Unity, with states for 100%-, 50%-, 25%-, and Flickering-states.
using System;
using System.Collections;
using UnityEngine;
/// <summary>
///
/// State based flickering light implementation by Jasper Honkasalo (japsu.honkasalo@gmail.com).
///
/// This piece of code is free. It comes without any warranty, to
/// the extent permitted by applicable law. You can redistribute it