Skip to content

Instantly share code, notes, and snippets.

View GOROman's full-sized avatar
👽
Damn I'm looking good.

GOROman GOROman

👽
Damn I'm looking good.
View GitHub Profile
@GOROman
GOROman / JoyY.cs
Last active August 29, 2015 13:56
Unity+OculusSDKでXboxコントローラの右アナログスティックの上下で高さを変えるサンプル
using UnityEngine;
using System.Collections;
public class JoyY : MonoBehaviour {
public float power = 0.02f;
public Vector3 targetPos;
// Use this for initialization
void Start () {
@GOROman
GOROman / Zaoriku.cs
Last active August 29, 2015 14:04
おお ゆにてい よ、しんでしまうとはなにごとだ!
#if UNITY_EDITOR
using UnityEngine;
using UnityEditor;
// Unity にザオリク機能を追加します
[InitializeOnLoad]
static class Zaoriku
{
static Zaoriku() {
EditorApplication.playmodeStateChanged += OnPlaymodeChanged;
@GOROman
GOROman / DK2TrackingState.cs
Last active August 29, 2015 14:04
[Unity] Oculus Rift DK2(SDK 0.4.0) でポジショントラッキング有効範囲か?判別
// Tracking State を得る
OVR.ovrTrackingState ts = OVRDevice.HMD.GetTrackingState();
// ポジショントラッキング されているか?
if ( (ts.StatusFlags & (uint)OVR.ovrStatusBits.ovrStatus_PositionTracked ) != 0 ) {
// ポジショントラッキング範囲内
print( "Tracking!" );
}
@GOROman
GOROman / SetPositionY
Created September 14, 2014 15:37
配管工のオッサンをスタート時にTerrainに合わせよう
using UnityEngine;
using System.Collections;
public class SetPositionY : MonoBehaviour {
void Start () {
// スタート時のワールド座標での位置を取得
Vector3 pos = transform.position;
// 位置からTerrain上の高さを取得
@GOROman
GOROman / GoogleGlassMirrorAPI.rb
Created January 24, 2015 14:37
Google Glass へ好きなメッセージ通知する (Mirror API使用)
#!ruby -Ku
# Google Glass へメッセージ通知 (Mirror API)
# by GOROman
require 'net/http'
require 'json'
# OAuthで得たトークン
TOKEN = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
API = 'https://www.googleapis.com/mirror/v1/timeline'
@GOROman
GOROman / wlan.bat
Created January 25, 2015 08:25
WindowsのコマンドプロンプトからWLANの接続先を変更する
echo off
netsh WLAN connect name="GoProHero1" ssid="GoProHero1"
pause
netsh WLAN connect name="GoProHero2" ssid="GoProHero2"
pause
netsh WLAN connect name="GoProHero3" ssid="GoProHero3"
@GOROman
GOROman / SetAndroidVolume
Created July 31, 2015 05:26
UnityのC#からAndroidのボリュームを変更する
void SetAndroidVolume( int volume )
{
#if (UNITY_ANDROID && !UNITY_EDITOR)
int STREAM_MUSIC = 3; // Constant Value: 3 (0x00000003)
AndroidJavaClass jc = new AndroidJavaClass("com.unity3d.player.UnityPlayer");
AndroidJavaObject ac = jc.GetStatic<AndroidJavaObject>("currentActivity");
AndroidJavaObject am = ac.Call<AndroidJavaObject>("getSystemService", "audio");
am.Call("setStreamVolume", STREAM_MUSIC, volume, 0);
@GOROman
GOROman / WWWWWWWWWWWWWW.cs
Created December 15, 2013 03:03
Unity の C# でフィールドに草を生やすサンプルスクリプト
using UnityEngine;
using System.Collections;
// 草原クラス
class WWWWWWWWWWWWWWWWWWWWWWWW : MonoBehaviour {
public void wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww() {
Debug.Log ( "wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww");
}
}
@GOROman
GOROman / SuperHacker.rb
Last active January 1, 2016 22:59
スーパーハカー用プログラム
# スーパーハカー用プログラム
require 'socket'
# 開くポート
PORT = 5656 # 適当なポート
# TCPサーバーになっちゃう
TCPServer.open( PORT ) do |server|
loop do
@GOROman
GOROman / KIRESOU
Last active January 1, 2016 23:09
環境: Windows7 64bit twurlでTwitterに画像を添付したいだけなのに ”403 Forbidden” でどうにも出来ないのでキレそう。。。  ⇒ 解決
Cygwinにしたら解決しました・・・
$ ruby -v
ruby 1.9.3p448 (2013-06-27) [x86_64-cygwin]
$ twurl -v
0.9.1
$ twurl -d 'status=HELLO KARAAGE!' -X POST "/1.1/statuses/update_with_media.json" --file "TEST.png" --file-field "media[]" -t