Skip to content

Instantly share code, notes, and snippets.

@sandinist
sandinist / DefaultInput.ini
Last active December 30, 2019 05:52
XR Inputs for UE4.24
[/Script/Engine.InputSettings]
+AxisConfig=(AxisKeyName="MixedReality_Right_Trackpad_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
+AxisConfig=(AxisKeyName="OculusGo_Left_Trackpad_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
+AxisConfig=(AxisKeyName="OculusGo_Left_Trackpad_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
+AxisConfig=(AxisKeyName="OculusGo_Right_Trackpad_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
+AxisConfig=(AxisKeyName="OculusGo_Right_Trackpad_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
+AxisConfig=(AxisKeyName="OculusTouch_Left_Grip_Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
+AxisConfig=(AxisKeyName="OculusTouch_Left_Trigger_Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert
@sandinist
sandinist / SummonEqui.cs
Last active November 27, 2016 22:11
SummonEquiFromVRDesktopExplorer
using UnityEngine;
using System.Collections;
using System;
using System.IO;
public class SummonEqui : MonoBehaviour {
private GameObject theta;
void Update ()
{
@sandinist
sandinist / CallTest.cs
Created November 6, 2016 17:57
Screen fullpath to PasteBoard in Unity
using UnityEngine;
using System.IO;
using System.Collections;
public class CallTest : MonoBehaviour
{
private GameObject theta;
void Update()
{
if (Input.GetKeyDown(KeyCode.C))
@sandinist
sandinist / dprint.swift
Last active April 6, 2016 08:34
debug print for swift
func dprint(object: Any?, function: StaticString = #function, file: StaticString = #file, line: UInt = #line) {
#if DEBUG
let format = NSDateFormatter()
format.dateFormat = "yyyy/MM/dd HH:mm:ss.SSS"
let encodedFilePath = NSString(string: String(file)).stringByAddingPercentEncodingWithAllowedCharacters(NSCharacterSet.alphanumericCharacterSet())!
let fileName = NSURL(string: String(encodedFilePath))!.lastPathComponent!
Swift.print("\(format.stringFromDate(NSDate())) \(fileName) [\(line)] \(function): \(object ?? "nil")", terminator: "\n")
#endif
}
@sandinist
sandinist / Zundoko.swift
Created April 5, 2016 06:51
ZundokoSwift
import UIKit
var a = UInt32.max
while a&0x1f != 1{
a = (a<<1)|arc4random_uniform(2)
print(a&1==1 ?"ズン":"ドコ")
}
print("キ・ヨ・シ!")
var b = Array<Int>()
@sandinist
sandinist / VendingMachine.swift
Last active March 20, 2016 20:53
DogTeam自動販売機@dddニセコ合宿
import Darwin
class うちら {
var だらせん : 硬貨
init () {
だらせん = 硬貨()
}
func 所持金() -> Int {
return だらせん.おいくら()
}
@sandinist
sandinist / UE4極め19.1.4
Created January 24, 2016 19:43
警告ログとエラーログ
LogActor:Warning: GameSession /Game/Maps/Stage01/UEDPIE_0_PNStage01_Top.PNStage01_Top:PersistentLevel.GameSession_5 has natively added scene component(s), but none of them were set as the actor's RootComponent - picking one arbitrarily
LogActor:Warning: GameNetworkManager /Game/Maps/Stage01/UEDPIE_0_PNStage01_Top.PNStage01_Top:PersistentLevel.GameNetworkManager_7 has natively added scene component(s), but none of them were set as the actor's RootComponent - picking one arbitrarily
LogTick:Error: Could not tick newly spawned in 100 iterations; runaway recursive spawing. Tick is PNPlayerPawn_C /Game/Maps/Stage01/UEDPIE_0_PNStage01_Top.PNStage01_Top:PersistentLevel.PNPlayerPawn_C_29870[TickActor].
LogTick:Error: Could not tick newly spawned in 100 iterations; runaway recursive spawing. Tick is CharacterMovementComponent /Game/Maps/Stage01/UEDPIE_0_PNStage01_Top.PNStage01_Top:PersistentLevel.PNPlayerPawn_C_29870.CharMoveComp[TickComponent].
LogTick:Error: Could not tick newly spawned in 100 iterations; runaway r
// 231 byte
$=0;setInterval('for(j=0,o="";j<5;j++,document.body.innerHTML=o+="<br>")for(k=0;k<30;k++){i=($+k)%60+j*60;o+="_H"[parseInt("e77js2ufno52h8ka02h0k852g8kbt2ufk85uh8ka12g84842e77jssgfno42".substr((i/10|0)*2,2),32)>>9-i%10&1]}$++',300)
@sandinist
sandinist / fibcalc.exs
Created April 4, 2014 08:22
るびまのElrangサンプルコードにあがっていたmodule(fibcalc)をElixirにしてみた(等価ではない) http://magazine.rubyist.net/?0017-Legwork
defmodule Fibcalc do
def calc_fibs(list) do
list
|>
Enum.map(fn (elem) ->
spawn fn -> IO.puts "fib(#{elem}) = #{Fibcalc.fib(elem)}" end
end)
end
def fib(0), do: 1
def fib(1), do: 1
@sandinist
sandinist / mruby_sample.c
Last active December 12, 2015 06:38
今日のmruby遊び
#include <stdio.h>
#include <mruby.h>
#include <mruby/compile.h>
#include <mruby/string.h>
int main(int argc, char * argv[]) {
mrb_state *mrb;
mrb_value value;
char *code;