Skip to content

Instantly share code, notes, and snippets.

View lihaochen910's full-sized avatar
🏠
Working from home

Kanbaru lihaochen910

🏠
Working from home
View GitHub Profile
@lihaochen910
lihaochen910 / EaseUtils.cs
Created October 23, 2019 02:48
Useful Ease Function for Unity GameDev.
using UnityEngine;
public class EaseUtils
{
public enum EaseType
{
easeInQuad,
easeOutQuad,
easeInOutQuad,
easeInCubic,
@lihaochen910
lihaochen910 / gen_color_sketch.rb
Created April 27, 2021 08:38
使用这个脚本来快速生成随机的V大的临摹单个颜色练习(4x5)
# 使用这个脚本来快速生成随机的V大的临摹单个颜色练习(4x5)
require 'RMagick'
def gen_color_sketch( input, output )
img = Magick::Image.read( input ).first
columns = 4
rows = 5
r = 200
@lihaochen910
lihaochen910 / gen_line_sketch.rb
Created April 28, 2021 07:15
使用这个脚本来快速生成随机的V大的复制单根线条练习(4x5)
# 使用这个脚本来快速生成随机的V大的复制单根线条练习(4x5)
require 'RMagick'
DEBUG = false
FONT_PATH = '/Users/Kanbaru/Downloads/FOT-NewRodinPro-L.otf'
FONT_SIZE = 25
def gen_line_sketch( input, output )
@lihaochen910
lihaochen910 / mruby.nim
Last active January 5, 2022 14:06
The bindings for mruby(3.0.0) to Nim.
#
#* mruby - An embeddable Ruby implementation
#*
#* Copyright (c) mruby developers 2010-2021
#*
#* Permission is hereby granted, free of charge, to any person obtaining
#* a copy of this software and associated documentation files (the
#* "Software"), to deal in the Software without restriction, including
#* without limitation the rights to use, copy, modify, merge, publish,
#* distribute, sublicense, and/or sell copies of the Software, and to
@lihaochen910
lihaochen910 / BMFontImporter.cs
Created March 25, 2024 02:29
BMFontImporter for muder.
using System;
using System.Collections.Generic;
using Murder.Assets.Graphics;
using Murder.Core.Geometry;
using Murder.Core.Graphics;
using Murder.Serialization;
using System.Collections.Immutable;
using System.IO;
using System.Xml;
using Murder;
@lihaochen910
lihaochen910 / UndoBuffer.cs
Last active April 8, 2024 02:52
Implements an undo/redo buffer. Source from DigitalRune.
// DigitalRune Engine - Copyright (C) DigitalRune GmbH
// This file is subject to the terms and conditions defined in
// file 'LICENSE.TXT', which is part of this source code package.
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Diagnostics;
@lihaochen910
lihaochen910 / MyMemoryOffsetExpressionGrammar.cs
Created May 20, 2024 07:27
Grammar for Memory Offset Expr.
using Irony.Ast;
using Irony.Interpreter;
using Irony.Parsing;
using Irony.Interpreter.Ast;
namespace EWCommandLineTools;
public class MyMoeLanguageRuntime : LanguageRuntime {