Skip to content

Instantly share code, notes, and snippets.

View mysticfall's full-sized avatar

Xavier Cho mysticfall

  • Green Cat Software
  • Seoul, South Korea
View GitHub Profile
from datetime import datetime, timedelta
from enum import Enum
from queue import PriorityQueue
from time import mktime
from typing import Optional
import bge
from rx.core.typing import AbsoluteTime, RelativeTime, ScheduledAction, TState
from rx.disposable import Disposable
from rx.scheduler import ScheduledItem
@mysticfall
mysticfall / patch.diff
Created January 1, 2021 07:04
Expanding supported component property types in UPBGE
diff --git a/source/blender/blenkernel/intern/python_component.c b/source/blender/blenkernel/intern/python_component.c
index f288f091f8f..d66de7ae3ed 100644
--- a/source/blender/blenkernel/intern/python_component.c
+++ b/source/blender/blenkernel/intern/python_component.c
@@ -43,6 +43,7 @@
#ifdef WITH_PYTHON
# include "Python.h"
+# include "../../python/intern/bpy_rna.h"
# include "generic/bpy_internal_import.h"
class Fixture:
value = rv.from_value(1)
doubled = rv.map(value)(ops.map(lambda v: v * 2))
numbers = rv.combine(value, doubled)(lambda o: rx.combine_latest(*o))
combined = rv.combine_latest(value, doubled)(ops.map(lambda v: f"value = {v[0]}, doubled = {v[1]}"))
zipped = rv.zip(value, doubled)(ops.map(lambda v: f"{v[0]} * 2 = {v[1]}"))
@mysticfall
mysticfall / BlendmapTest.cs
Created July 22, 2019 22:57
WIP converting generate_map.gd in C#
using System;
using System.Collections.Generic;
using static System.Linq.Enumerable;
using System.Linq;
using AlleyCat.Common;
using AlleyCat.Event;
using Godot;
using Godot.Collections;
using JetBrains.Annotations;
using LanguageExt;
@mysticfall
mysticfall / PairedEyeSight.cs
Created March 25, 2019 02:51
Snippet from initial attempt to implement the eye tracking
protected virtual void OnAnimation(float delta)
{
if (!Skeleton.FindClosestAncestor<INamed>().Exists(n => n.DisplayName == "Player"))
{
LookAt(Skeleton.FindPlayer<IHumanoid>().Map(p => p.Vision.Viewpoint));
}
EyeTrackingTarget.Iter(target =>
{
Range<float> AddRange(Range<float> range1, Range<float> range2) =>
var loader = ResourceUtils
.Load<PackedScene>("res://Data/Scenes/Character Creator.tscn")
.ToObservable(this.GetScheduler());
var progress = loader.SelectMany(v => v.LeftAsEnumerable().ToObservable());
var scene = loader.SelectMany(v => v.RightAsEnumerable().ToObservable());
progress.Subscribe(e => GD.Print($"- Progress: {e.Done} of {e.Total}"));
scene.Subscribe(s => GD.Print($"- Finished loading: {s}"));
using System;
using System.IO;
using System.Threading.Tasks;
using AlleyCat.Autowire;
using AlleyCat.Common;
using Godot;
namespace AlleyCat.IO
{
[Singleton(typeof(IResourceMonitor))]
@mysticfall
mysticfall / po.ko
Last active December 14, 2015 14:18
Saiku translation for Korean language.
{
"locale" : "ko",
"translator_name" : "Xavier Cho",
"Loading datasources...." : "데이터 원본을 읽어오는 중입니다...",
"New query" : "새 질의",
"Open query": "질의 열기",
"Logout" : "로그아웃",
"About" : "정보",
"Issue Tracker" : "문제점 보고",
"lt" : "한국어",
@mysticfall
mysticfall / gist:4721323
Last active December 12, 2015 05:28
Test case for a very experimental expression language support planned for Pivot4J 0.7 release. The purpose of the feature is to provide non-vendor specific alternative to Mondrian's Parameter() and ParamRef() pseudo-functions. The "fm:" prefix means it uses FreeMarker template engine for EL translation. The expression parameters is preserved whe…
/*
* ====================================================================
* This software is subject to the terms of the Common Public License
* Agreement, available at the following URL:
* http://www.opensource.org/licenses/cpl.html .
* You must accept the terms of that agreement to use this software.
* ====================================================================
*/
package com.eyeq.pivot4j.el;
package com.greencatsoft.greenlight.grammar
import scala.language.implicitConversions
import com.greencatsoft.greenlight.{ TestRegistry, TestReporter }
import com.greencatsoft.greenlight.grammar.ModalVerb.{ Can, Must, Should }
import com.greencatsoft.greenlight.grammar.Specification.{ CaseDescription, WhatIsExpected }
import com.greencatsoft.greenlight.grammar.Statement.{ Assertation, CaseDefinition }
import com.greencatsoft.greenlight.grammar.Verb.FollowedByNegation
import com.greencatsoft.greenlight.matcher.Matcher