Skip to content

Instantly share code, notes, and snippets.

@koturn
koturn / MenuHelper.cs
Created September 2, 2023 00:48
https://qiita.com/Swanman/items/279b3b679f3f96a5f925 のリフレクション結果をキャッシュするようにしたやつ
using System;
using System.Linq.Expressions;
using System.Reflection;
using UnityEditor;
namespace Koturn
{
/// <summary>
/// Menu helper
@koturn
koturn / LiltoonCustomShaderMemo.md
Last active August 23, 2023 05:33
lilToonのカスタムシェーダーで躓いたり本体コード読んだときのメモ
<style> details { /* font: 16px "Open Sans", Calibri, sans-serif; */ /* width: 620px; */ } details > summary { padding: 2px 6px; /* width: 15em; */ background-color: #ddd;
@koturn
koturn / LifeGameHSVRotation.shader
Last active January 13, 2021 23:31
ゲーミングライフゲーム
Shader "koturn/GameOfLife"
{
// セルの生存をアルファ値で管理する
// 座標(0, 0)は更新間隔管理に用いており,描画セルかどうかの座標値の判定は省いているので,
// (0, 0)に影響を及ぼさない安定したパターンを初期値として与える必要がある.
Properties
{
_Color ("Cell Color", Color) = (0.0, 1.0, 0.0, 1.0)
_TimeScale ("Time multiplier for HSV rotation", Float) = 0.1
@koturn
koturn / MoveFileByTimestamp.cs
Created November 30, 2020 19:41
VRChatの写真をタイムスタンプで整理するやつ
using System;
using System.IO;
using System.Linq;
namespace MoveFileByTimestamp
{
public class Program
{
private static readonly TimeSpan DefaultOffsetTs;
@koturn
koturn / SingletonTest.cs
Created June 15, 2020 21:11
様々なシングルトンの実装
using System;
namespace Wandbox
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine(Foo.Instance.Name);
Console.WriteLine(Bar.Instance.Name);
@koturn
koturn / dein.toml
Created June 7, 2020 09:36
dein.vimの設定ファイル
[[plugins]]
repo = 'Shougo/dein.vim'
[[plugins]]
repo = 'fsharp/vim-fsharp'
[[plugins]]
repo = 'neovim/pynvim'
[[plugins]]
@koturn
koturn / test.cpp
Created May 26, 2020 09:53
ラムダのオーバーロードのテスト(一時オブジェクトがmoveされるかどうか)
#include <algorithm>
#include <iostream>
#include <vector>
#if 0
template<class... Ts> struct overloaded : Ts... { using Ts::operator()...; };
template<class... Ts> overloaded(Ts&&...) -> overloaded<std::decay_t<Ts>...>;
#else
template <typename... Fs>
@koturn
koturn / OverloadedRecursiveLambda.cpp
Last active May 26, 2020 05:05
再帰ラムダのオーバーロード
#include <iostream>
#include <type_traits>
#include <utility>
#if defined(__cpp_variadic_using) && defined(__cpp_deduction_guides)
template <typename... Fs>
class
#if defined(__has_cpp_attribute) && __has_cpp_attribute(nodiscard)
[[nodiscard]]
@koturn
koturn / version.rc
Created July 2, 2019 20:31
exeファイルのバージョン番号付与用のリソースファイル
VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,2,3,4
PRODUCTVERSION 1,2,3,4
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
#else
FILEFLAGS 0x0L
#endif
FILEOS 0x40004L
@koturn
koturn / .vsvimrc
Created June 23, 2019 06:15
Visual Studioの拡張VSVIMの設定ファイル
set clipboard=unnamed
set hlsearch
set incsearch
set virtualedit=block
set whichwrap=b,s,h,l,<,>,[,]
set ignorecase smartcase
set scrolloff=5
nnoremap c "_c
nnoremap x "_x
nnoremap n nzz