Skip to content

Instantly share code, notes, and snippets.

View terokorp's full-sized avatar

Tero Korpela terokorp

View GitHub Profile
@terokorp
terokorp / GpxImporter.cs
Last active November 14, 2023 05:12
Gpx importer for Unity (Mapbox EditorLocationProviderLocationLog)
using System;
using System.Globalization;
using System.IO;
using System.Xml;
using UnityEditor.AssetImporters;
using UnityEngine;
[ScriptedImporter(1, "gpx")]
public class GpxImporter : ScriptedImporter
{
@terokorp
terokorp / MoveParentObjectEditor.cs
Created July 30, 2023 16:50
Move current object to its parents position
using UnityEditor;
using UnityEngine;
[CustomEditor(typeof(Transform))]
public class MoveParentObjectEditor : Editor
{
public override void OnInspectorGUI()
{
DrawDefaultInspector();
using System.IO;
using UnityEditor;
using UnityEngine;
// Unity editor script that adds .txt to asset creation list
public class CreateTxt : Editor
{
private static string filename = "NewTextAsset";
[MenuItem("Assets/Create/Text/.txt", priority = 1000, secondaryPriority = 10000)]
using System;
using System.Collections.Generic;
using System.Text.RegularExpressions;
internal class SemVer : IComparable<SemVer>
{
// https://semver.org/spec/v2.0.0.html
public int Major { get; set; }
public int Minor { get; set; }
public int Patch { get; set; }
# https://blender.stackexchange.com/questions/56795/script-outdated-shape-keys-and-applying-subdivision-surface-modifier
import bpy
def reset_shape_keys ():
for name, shape_key in get_active_block().items():
shape_key.value = 0
def get_active_block ():
if bpy.context.object.active_shape_key is None or bpy.context.object.active_shape_key.id_data is None:
bpy.context.object.active_shape_key_index = 0
@terokorp
terokorp / docker-compose.yml
Created November 21, 2022 00:53
docker-compse.yml for minecraft
version: "3.3"
services:
mc:
image: itzg/minecraft-server
network_mode: bridge
ports:
- 25565:25565
environment:
EULA: "TRUE"

Keybase proof

I hereby claim:

  • I am terokorp on github.
  • I am thasan (https://keybase.io/thasan) on keybase.
  • I have a public key whose fingerprint is AF62 F1D5 3D08 919B 7A43 88AB F12E 1260 5478 90D8

To claim this, I am signing this object:

Keybase proof

I hereby claim:

  • I am terokorp on github.
  • I am thasan (https://keybase.io/thasan) on keybase.
  • I have a public key whose fingerprint is 3C7E 278C 9FD9 55D7 62D8 26D6 286A D7CB 6F38 CD8D

To claim this, I am signing this object: