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 / 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 / DownloadManager.cs
Created April 25, 2012 14:32
Unity DownloadManager
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
/**
DownloadManager
@author koki ibukuro
*/
public class DownloadManager : MonoBehaviour , System.IDisposable {
// using classes
@asus4
asus4 / BarcodeScanner.cs
Last active November 21, 2022 09:44
USB BarcodeScanner input on Unity3D
using System;
using System.Collections.Generic;
using System.Text;
using UnityEngine;
namespace AppKit
{
/// <summary>
/// Barcode Scanner Input
///
@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 / JsonNode.cs
Last active November 8, 2021 12:41
Simple json accessibility for Unity.
/**
Copyright (c) 2017 Koki Ibukuro
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 permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@asus4
asus4 / checkSocialWebview.coffee
Created March 21, 2016 19:24
ブラウザが、facebookか、twitterアプリのwebviewで開かれたか判定!
checkSocialWebview = ()->
if document.referrer
if /m.facebook.com/.test(document.referrer)
return 'facebook'
if /t.co./.test(document.referrer)
return 'twitter'
return ''
@asus4
asus4 / websocket_osc_bridge.py
Created December 18, 2015 05:36
WebSocket to OSC bridge
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import argparse
import json
from pyOSC import OSC
from SimpleWebSocketServer import WebSocket, SimpleWebSocketServer
# arguments
@asus4
asus4 / apcmini_display.py
Last active August 9, 2020 19:47
Show message on APC mini.
#!/usr/bin/env python
# coding: UTF-8
'''
Setup apc mini colors without Ablton Live
----------
> brew install portmidi
@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 / 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.