Skip to content

Instantly share code, notes, and snippets.

View gist:534ce51a02ef067b32192f71269aefab
using UnityEngine;
public class VRCCamController : MonoBehaviour
{
[SerializeField]
private Sprite sprite;
[SerializeField]
[Range(.1f, 10f)]
@kmnk
kmnk / SampleBehaviour.cs
Created January 5, 2018 11:09
TwitterKit for Unity API test
View SampleBehaviour.cs
using UnityEngine;
using UnityEngine.UI;
using System.Collections.Generic;
using System.Linq;
using System.Security.Cryptography;
using System.Text;
public class SampleBehaviour : MonoBehaviour
{
View gist:f4997c7858634cc1105a7536cfed3895
using UnityEngine;
using System;
using UniRx;
using Zenject;
public class TapCounterInstaller : MonoInstaller<TapCounterInstaller>
{
public override void InstallBindings()
{
View gist:b88e4670bdedf7597fb12b4699f5657c
// TapCounterInstaller.cs
using UnityEngine;
using System;
using UniRx;
using Zenject;
public class TapCounterInstaller : MonoInstaller<TapCounterInstaller>
{
public override void InstallBindings()
@kmnk
kmnk / brook.part.js
Created December 11, 2012 08:10
brook.part.js (has no htmltemplate namespace)
View brook.part.js
Namespace('brook').define(function(ns){
var VERSION = "0.01";
var Promise = function(next){
this.next = next || function(next,val){ return next(val); };
};
(function(proto){
proto.concat = function(after){
var _before = this;
var next = function(n,val){
return _before.subscribe( after.ready(n),val);
@kmnk
kmnk / brook.js
Created December 11, 2012 08:08
brook.js by CoffeeScript
View brook.js
var __indexOf = Array.prototype.indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };
Namespace('brook').define(function(ns) {
var Promise, VERSION, promise;
VERSION = '0.01';
Promise = (function() {
function Promise(next) {
this.next = next || function(next, val) {
return next(val);
@kmnk
kmnk / brook.coffee
Created December 11, 2012 08:07
brook.coffee
View brook.coffee
Namespace('brook')
.define (ns) ->
VERSION = '0.01'
class Promise
constructor : (next) ->
@next = next or (next, val) -> next(val)
concat : (after) ->
_before = @
@kmnk
kmnk / namespace.js
Created December 11, 2012 05:03
namespace.js by CoffeeScript
View namespace.js
var Namespace;
Namespace = (function() {
var NamespaceDefinition, NamespaceObject, NamespaceObjectFactory, Procedure, createNamespace, createProcedure, merge, _assertValidFQN;
merge = function(target, source) {
var key, val;
for (key in source) {
val = source[key];
target[key] = val;
}
@kmnk
kmnk / namespace.coffee
Created December 11, 2012 05:02
namespace.coffee
View namespace.coffee
Namespace = ( ->
merge = (target, source) ->
for key, val of source
if source.hasOwnProperty key then target[key] = val
target
_assertValidFQN = (fqn) ->
unless ///^[a-z0-9_.]+///.test fqn then throw 'invalid namespace'
class Procedure
@kmnk
kmnk / compiledsample.js
Created December 9, 2012 17:36
Compiled Sample CoffeeScript
View compiledsample.js
Namespace('sample.widget').use('sample.rect.ui createRectModel').define(function(ns) {
var registerElement;
registerElement = function(element, dataset) {
var rectModel;
rectModel = ns.createRectModel(element, dataset.classOn, dataset.classOff);
return element.addEventListener('click', function(event) {
rectModel.notify('toggle').run();
return rectModel.notify('move').run();
});
};