Skip to content

Instantly share code, notes, and snippets.

View shiena's full-sized avatar

KOGA Mitsuhiro shiena

View GitHub Profile
using System;
using System.Net;
using System.Net.Http;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using UnityEngine;
using UnityEngine.Networking;
import SwiftUI
struct ContentView: View {
@State var theta: Double = 0
let radius: Double = 60
let colors: [Color] = [.purple, .red, .yellow, .blue, .green]
var body: some View {
ZStack {
ForEach(Array(colors.enumerated()), id: \.offset) { offset, style in
@TakaakiIchijo
TakaakiIchijo / UnityNetcodeForGameObjectsObservableTriggerExtensions.cs
Last active February 14, 2024 05:38
A piece of R3 extensions for Netcode for GameObjects
using Unity.Netcode;
namespace R3.Trigger
{
public static class UnityNetcodeR3Extensions
{
public static Observable<(T previousValue, T newValue)> AsObservable<T>(this NetworkVariable<T> networkVariable)
{
return Observable.FromEvent<NetworkVariable<T>.OnValueChangedDelegate, (T, T)>(
h => (previousValue, newValue) => h((previousValue, newValue)),
@reduz
reduz / godot_vision_pro.md
Last active March 14, 2024 08:48
Godot on Vision Pro and similar devices

Vision Pro style API on Godot

Overview

Apple recently unveiled the Vision Pro. This type of device is mostly designed for augmented reality (AR), in the sense that it should be able to throw 3D models and rendering combined into a camera.

Normally with pass-through AR, one would expect to get the camera feed as an image and maybe some environment cubemap generated from the camera to apply proper lighting into the objects.

@ymmt2005
ymmt2005 / howto-tech-docs.md
Last active May 10, 2024 03:46
技術文書の書き方

技術文書の書き方

このメモは、私(@ymmt2005)が長年にわたってソフトウェアプロダクト開発に関わってきて 2022年現在こうしたほうが良いと考えているベストプラクティスです。

科学的な分析等に基づくわけではない経験則であるため、今後も随時見直すことがありますし、 ここに書いてあることが常に正しいわけでもあらゆるソフトウェア開発に適するわけでもありません。

しかしながら、実務経験が豊富で、モダンな技術スタックに明るいエンジニアの経験則は一定の 役に立つのではないかと考えて記します。

@ityonemo
ityonemo / test.md
Last active June 13, 2024 09:10
Zig in 30 minutes

A half-hour to learn Zig

This is inspired by https://fasterthanli.me/blog/2020/a-half-hour-to-learn-rust/

Basics

the command zig run my_code.zig will compile and immediately run your Zig program. Each of these cells contains a zig program that you can try to run (some of them contain compile-time errors that you can comment out to play with)

@richlander
richlander / modernizing-csharp9.md
Last active April 26, 2024 17:14
Modernizing a codebase for C# 9

Modernizing a codebase for C# 9

There are lots of cases that you can improve. The examples use nullable reference types, but only the WhenNotNull example requires it.

Use the property pattern to replace IsNullorEmpty

Consider adopting the new property pattern, wherever you use IsNullOrEmpty.

string? hello = "hello world";
@Refsa
Refsa / GrabScreenFeature.cs
Last active May 21, 2024 09:01
Unity URP custom grab pass
using System;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Rendering;
using UnityEngine.Rendering.Universal;
public class GrabScreenFeature : ScriptableRendererFeature
{
[System.Serializable]
public class Settings
@decoc
decoc / CompileLocker.cs
Last active February 11, 2023 08:48
This editor utility can lock/unlock unity script compile from menu item. See more https://raspberly.hateblo.jp/entry/InvalidateUnityCompile
using UnityEngine;
using UnityEditor;
/// <summary>
/// This editor utility can lock/unlock unity script compile from menu item.
/// See more https://raspberly.hateblo.jp/entry/InvalidateUnityCompile
/// </summary>
public static class CompileLocker
{
[MenuItem("Compile/Lock", false, 1)]