Skip to content

Instantly share code, notes, and snippets.

package org.robotlegs.extensions.mvcs
{
import flash.utils.Dictionary;
import org.robotlegs.base.EventMap;
import org.robotlegs.core.IEventMap;
import org.robotlegs.mvcs.Command;
public class AsyncCommand extends Command
{
package org.robotlegs.utilities.remote
{
import com.adobe.serializers.json.JSONDecoder;
import mx.collections.ArrayCollection;
public class JsonRemoteService extends RemoteServiceBase
{
public function JsonRemoteService(rootURL:String = "")
{
// before
mainWindow.menu("File", function(err, file) {
if(err) throw err;
file.openMenu(function(err, menu) {
if(err) throw err;
menu.item("Open", function(err, item) {
if(err) throw err;
item.click(function(err) {
if(err) throw err;
mainWindow.getChild(type('Window'), function(err, dialog) {
@hyakugei
hyakugei / exTextLayout.cs
Created September 17, 2012 13:31
Hacked "TextField" flow for ex2d's spriteFont
using UnityEngine;
using System.Text;
using System.Collections;
using System.Collections.Generic;
public class exTextLayout : MonoBehaviour {
public exSpriteFont textField;
@hyakugei
hyakugei / rot_classic.js
Created March 14, 2013 07:36
Following the rules (more or less) for the original Rogue map-generation algorithm, i made this addition to the rot.js lib. Please note, this is a early, ugly, bit of code. But it works. And makes cool dungeons!
ROT.Map.Classic = function(width, height, options) {
ROT.Map.call(this, width, height);
var getRoomSizes = function(size, cells)
{
var max = Math.floor((size/cells) * 0.8);
var min = Math.floor((size/cells) * 0.25);
if(min < 2) min = 2;
if(max < 2) min = 2;
return [min, max];
/**
* State names are described as a enum or string constants if language doesn't support them (as3 for example).
*/
private enum State {
A, B, C
}
/**
* Current state is always private. If previous state is needed add
* private State prevState;
@hyakugei
hyakugei / TaskHelper.cs
Created May 13, 2014 15:38
TaskHelper rewritten for Unity/Parse use.
// Copyright (c) 2012 Rizal Almashoor
// Licensed under the MIT license.
// http://gist.github.com/2818038#file_license.txt
//
// Additions as suggested by Mike Cann - http://www.mikecann.co.uk/personal-project/fixing-unitys-internal-compiler-error/
//
//
using System.Linq;

Keybase proof

I hereby claim:

  • I am hyakugei on github.
  • I am hyakugei (https://keybase.io/hyakugei) on keybase.
  • I have a public key whose fingerprint is 0092 2125 C88F E1E7 C2A3 8EC4 BC69 8501 84B2 D52D

To claim this, I am signing this object:

var body = document.getElementsByTagName("body")[0];
body.innerHTML = 'Hello, World!';
navigator.getMedia = (navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia);
navigator.getMedia(
// constraints
{video:true, audio:false},
// success callback
@hyakugei
hyakugei / RandomColor.cs
Last active November 9, 2015 01:03
Unity3D version of Nathan Jones' C# Port of David Merfield's javascript random color generator.
// C# Port - https://github.com/nathanpjones/randomColorSharped
// Javascript Original - https://github.com/davidmerfield/randomColor
using UnityEngine;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;