Skip to content

Instantly share code, notes, and snippets.

using System;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
using GetCondFunc = System.Func<UnityEditor.SerializedProperty, ConditionalDisableInInspectorAttribute, bool>;
[CustomPropertyDrawer(typeof(ConditionalDisableInInspectorAttribute))]
internal sealed class ConditionalDisableDrawer : PropertyDrawer
{
using UnityEngine;
using UnityEditor;
[CustomPropertyDrawer(typeof(FlagConditionalDisableInInspectorAttribute))]
internal sealed class FlagConditionalDisableDrawer : PropertyDrawer
{
public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
{
var attr = base.attribute as FlagConditionalDisableInInspectorAttribute;
var prop = property.serializedObject.FindProperty(attr.FlagVariableName);
#!/bin/bash
function usage () {
cat << EOS
Usage:
$(basename ${0}) [OPTIONS]... MUST_ARG
Options:
--help, -h print this
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.ticker as ticker
import colorsys
import matplotlib.animation as animation
from matplotlib.offsetbox import OffsetImage, AnnotationBbox
def binlen(i):
return len(bin(i)) - 2
@mu-777
mu-777 / AndroidManifest.xml
Created February 21, 2021 02:42
Realsense in Android
<?xml version="1.0" encoding="utf-8"?>
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
package="com.unity3d.player"
xmlns:tools="http://schemas.android.com/tools">
<application>
<activity android:name="com.unity3d.player.UnityPlayerActivity"
android:theme="@style/UnityThemeSelector">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
@mu-777
mu-777 / DeviceConnect.cs
Last active February 23, 2021 08:38
Realsense In Android
using System.Collections;
using UnityEngine;
#if PLATFORM_ANDROID
using UnityEngine.Android;
#endif
public class DeviceConnect : MonoBehaviour
{
private static AndroidJavaObject _deviceConnect;
private bool _isRequesting = false;
@mu-777
mu-777 / DeviceConnect.java
Last active February 21, 2021 01:54
RealsenseInAndroid
package com.intel.realsense.librealsense;
import android.content.Context;
import com.unity3d.player.UnityPlayer;
public class DeviceConnect {
private static DeviceWatcher mDeviceWatcher;
DeviceConnect() {
Context context = UnityPlayer.currentActivity;
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
if [ "$color_prompt" = yes ]; then
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u:\[\033[01;34m\]\w\[\033[30m\]$(__git_ps1)\[\033[00m\] \$ '
else
PS1='${debian_chroot:+($debian_chroot)}\u:\w$(__git_ps1) \$ '
fi
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import sympy as sym
# Not necessary but gives nice-looking latex output
# More info at: http://docs.sympy.org/latest/tutorial/printing.html
sym.init_printing()
x1, y1, x2, y2, x3, y3, x4, y4 = sym.symbols('x_1 y_1 x_2 y_2 x_3 y_3 x_4 y_4')