Skip to content

Instantly share code, notes, and snippets.

View PabloAlexandre's full-sized avatar

Pablo Nascimento PabloAlexandre

View GitHub Profile
@PabloAlexandre
PabloAlexandre / connect.js
Last active March 9, 2018 06:44
Connect to bind actions with component state.
import React from 'react';
class Connect extends React.Component {
constructor(props){
super(props);
this.actions = this.getActions(this.props.actions);
this.state = this.props.state || {};
}
getActions(actions){
@PabloAlexandre
PabloAlexandre / compose.js
Last active March 9, 2018 01:32
Functional Programming Composition that accepts Promise
export default (...args) => {
return args.reduce((a, it) => (...params) => {
const d = it(...params);
if(d.then) return d.then(a);
else return a(d);
});
}
using UnityEngine;
public class IsometricMap : MonoBehaviour {
public Texture2D pattern;
public int pixelToUnit = 100;
public Vector2 pixelSize = new Vector2(64, 64);
public Vector2 markerPosition;
void OnDrawGizmosSelected() {
drawIcon(markerPosition, pixelSize, pixelToUnit);
using UnityEngine;
using UnityEditor;
[CustomEditor(typeof(IsometricMap))]
public class IsometricMapEditor : Editor {
private IsometricMap map;
void OnEnable() {
map = (IsometricMap) target;
}