Skip to content

Instantly share code, notes, and snippets.

View austinmao's full-sized avatar

Austin Mao austinmao

View GitHub Profile
@austinmao
austinmao / nuget.sh
Created December 28, 2016 10:26 — forked from andypiper/nuget.sh
nuget for OS X
#!/bin/sh
# add a simple 'nuget' command to Mac OS X under Mono
# get NuGet.exe binary from http://nuget.codeplex.com/releases/view/58939
# get Microsoft.Build.dll from a Windows .NET 4.0 installation
# copy to /usr/local/bin and Robert is your father's brother....
#
PATH=/usr/local/bin:$PATH
mono --runtime=v4.0 /usr/local/bin/NuGet.exe $*
@austinmao
austinmao / MoveReducer.cs
Last active June 11, 2017 00:45
Redux.NET with Unity
using UnityEngine;
using Redux;
public static class Move {
// actions must have a type and may include a payload
public class Action {
public class Move: IAction {
public Vector2 inputVelocity { get; set; }
public Transform playerTransform { get; set; } // curent transform
@austinmao
austinmao / MoveReducer.cs
Last active December 21, 2016 10:24
Unidux + UniRx for character movement
using UnityEngine;
public static class Move {
// specify the possible types of actions
public enum ActionType {
Move,
Stop
}
@austinmao
austinmao / StareButton.cs
Created December 15, 2016 08:29 — forked from flarb/StareButton.cs
This is a 'stare button' for Google Cardboard apps where you just want to stare at a button over time to select it.
using System;
using System.Reflection;
using UnityEngine;
using System.Collections;
using UnityEngine.EventSystems;
using UnityEngine.Events;
using UnityEngine.UI;
public class StareButton : MonoBehaviour, IEventSystemHandler, IPointerExitHandler, IPointerEnterHandler, ISelectHandler {
@austinmao
austinmao / SDKSwap.cs
Created December 15, 2016 08:26 — forked from flarb/SDKSwap.cs
Swap between Unity3D Google Cardboard and Gear VR / OVR Mobile SDKs. It swaps out the Android manifest files when you switch platforms--pretty much all you need (aside from wrapping the APIs) to switch platforms.
using UnityEngine;
using System.Collections;
using UnityEditor;
using System.IO;
public class SDKSwap : EditorWindow {
static string _cardboardPath;
static string _OVRPath;
@austinmao
austinmao / apis.js
Last active February 24, 2016 04:23
connects to server api specified in helpers/apis, loads, normalizes (flattens) the data, and then stores in redux
/**
* @name apis.js
* @fileOverview api endpoints and schemas
* @exports {endpoint, schema, entity} for each api
*/
import _ from 'lodash'; // eslint-disable-line id-length
import schema, {entities} from 'helpers/normalize';
const singularEndpoints = {
@austinmao
austinmao / App.js
Created February 18, 2016 02:54
Attempt at adding Progress bar for loading
/**
* App.js
* parent component of app
*/
/* global $ */ // spec jquery global
/* boilerplate */
import React, {Component, PropTypes} from 'react';
import {connect} from 'react-redux';
import {routeActions} from 'react-router-redux';
@austinmao
austinmao / error.txt
Created December 3, 2015 01:45
css-to-radium conversion error
Module parse failed: /Users/austinmao/Sites/aditive-frontend/src/components/Global/LeftMenu/navbar.style.js Line 2: Unexpected token :
[0] You may need an appropriate loader to handle this file type.
[0] | {
[0] | '.nav-bar-container:before, .nav-bar-container:after': {
[0] | content: '" "',
[0] | display: 'table'
@austinmao
austinmao / 1.gallery.js
Last active January 13, 2016 05:04
Higher Order Component and Higher Order Reducer example that creates a reusable, redux-connected photo gallery that will store a `selected` state in a unique, nested name + key object in the redux store. This differs from https://gist.github.com/austinmao/b2da974571d11e3f24f3 by allowing the key to be passed in via props from one component to an…
@austinmao
austinmao / 1.reducers_gallery.js
Last active November 26, 2015 03:03
Higher Order Component and Higher Order Reducer example that creates a reusable, redux-connected photo gallery that will store a `selected` state in a unique, nested name + key object in the redux store. Follow this order: reducers/gallery.js -> components/reduxGallery.js -> components/PhotoItems.js -> components/Gallery.js