Skip to content

Instantly share code, notes, and snippets.

View GOROman's full-sized avatar
😀
Good

GOROman GOROman

😀
Good
  • XVI Inc.
  • Japan
  • 09:48 (UTC +09:00)
  • X @GOROman
View GitHub Profile
@GOROman
GOROman / gist:6248503
Last active October 7, 2018 22:06
OpenCVでWifi接続したGo Pro HERO3のライブ表示する
#include <opencv2/opencv.hpp>
int main()
{
cv::VideoCapture cap( "http://10.5.5.9:8080/live/amba.m3u8" );
cv::namedWindow( "GoPro" );
cv::Mat frame;
do {
cap >> frame;
@GOROman
GOROman / ThetaTest.rb
Last active January 13, 2016 05:18
PCからTHETAのシャッターを切る最小限のサンプルプログラム
#!ruby
#
# THETAのシャッターをPCから遠隔で切るだけの例 by GOROman
#
# 参考にしたページ
# http://mobilehackerz.jp/contents/Review/RICOH_THETA
require 'socket'
@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
@GOROman
GOROman / UniTwi.cs
Last active March 3, 2018 16:29
Unityから画像付きツイート(update_with_media)をする。WWWクラスでは multipart/form-data が使えないのでTCPを直接叩く
// 断片
TcpClient tc = new TcpClient();
tc.Connect("api.twitter.com", 80);
using (NetworkStream ns = tc.GetStream())
{
System.IO.StreamWriter sw = new System.IO.StreamWriter(ns);
System.IO.StreamReader sr = new System.IO.StreamReader(ns);
@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 / Kamaitachi.shader
Last active August 24, 2017 10:50
かまいたちの夜シェーダー
Shader "Custom/Kamaitachi" {
Properties {
_MainTex ("Base (RGB)", 2D) = "white" {}
}
SubShader {
Tags { "Queue" = "Transparent" }
Stencil {
Ref 1
Comp always