Skip to content

Instantly share code, notes, and snippets.

View asus4's full-sized avatar
:octocat:
Working from home

Koki Ibukuro asus4

:octocat:
Working from home
View GitHub Profile
@asus4
asus4 / ListAllReverbPresetSettings.cs
Created November 30, 2023 14:52
List All Reverb Preset Parameters
using System;
using System.Text;
using UnityEngine;
public class ListAllReverbPresetSettings : MonoBehaviour
{
[SerializeField]
AudioReverbFilter filter;
private void Start()
@asus4
asus4 / tsv2localizable.py
Last active July 17, 2022 06:07
Converts a TSV file into Xcode Localizable strings
#!/usr/bin/python3
import argparse
import csv
import datetime
# A simple script that converts a TSV file into Xcode Localizable strings
# TSV format:
'''
id, comment, en, ja
@asus4
asus4 / tf-lite-unity-sample-Resize.shader
Created June 14, 2020 07:46
tf-lite-unity-sample Resize.shader
Shader "Hidden/TFLite/Resize"
{
Properties
{
_MainTex ("Texture", 2D) = "white" {}
}
SubShader
{
Cull Off
ZWrite Off
@asus4
asus4 / checkaudioloudness.ipynb
Created March 18, 2020 11:40
CheckAudioLoudness.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@asus4
asus4 / pickdominantcolor.ipynb
Created March 3, 2020 14:21
PickDominantColor.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
void Start()
{
// Option
var options = new Interpreter.Options()
{
// Multithread
threads = 2,
// Metal option
gpuDelegate = new MetalDelegate(new MetalDelegate.Options()
{
// the image 28 * 28 grayscale
float[,] inputs = new float[28, 28];
// the array of probability
float[] outputs = new float[10];
void Start()
{
// Read bytes from model and make Interpreter
interpreter = new Interpreter(File.ReadAllBytes(path));
@asus4
asus4 / NativeArrayExtension.cs
Last active February 2, 2023 16:12
NativeArray -> byte[] , byte[] -> NativeArray
using Unity.Collections;
using Unity.Collections.LowLevel.Unsafe;
namespace ARKitStream.Internal
{
public static class NativeArrayExtension
{
public static byte[] ToRawBytes<T>(this NativeArray<T> arr) where T : struct
{
var slice = new NativeSlice<T>(arr).SliceConvert<byte>();
@asus4
asus4 / NativeArrayExtension.cs
Last active May 10, 2023 12:12
Safe Conversion of NativeArray <-> byte[] in Unity
using Unity.Collections;
public static class NativeArrayExtension
{
public static byte[] ToRawBytes<T>(this NativeArray<T> arr) where T : struct
{
var slice = new NativeSlice<T>(arr).SliceConvert<byte>();
var bytes = new byte[slice.Length];
slice.CopyTo(bytes);
return bytes;
@asus4
asus4 / Vimeo.vue
Created April 26, 2019 07:26
No cookie Youtube.vue and Vimeo.vue for website in EU
<template lang="pug">
.vimeo
.player(ref="player")
</template>
<script lang="ts">
import { Component, Prop, Vue } from 'vue-property-decorator'
import Player, { Options } from '@vimeo/player'
// Vue wrapper for