Skip to content

Instantly share code, notes, and snippets.

View NelsonBrandao's full-sized avatar

Nelson Brandão NelsonBrandao

View GitHub Profile
### Keybase proof
I hereby claim:
* I am nelsonbrandao on github.
* I am nelsonbrandao (https://keybase.io/nelsonbrandao) on keybase.
* I have a public key ASAQsY1USsDxW9WMYFj9J93Ulp1CMPqpE5dohl6l8Vuarwo
To claim this, I am signing this object:
@NelsonBrandao
NelsonBrandao / Button.js
Created September 10, 2016 16:29
React Native Example (Login Screen + Session Service + OAuth)
import React, { Component, PropTypes } from 'react';
import {
View,
Text,
Platform,
StyleSheet,
TouchableHighlight,
TouchableNativeFeedback
} from 'react-native';
@NelsonBrandao
NelsonBrandao / parallel.js
Created March 28, 2016 11:04
Promise Collections
var q = require('q');
// Parallel
q.all(array.map(function (elem) {
return processElem(elem);
}));
// Or simply
@NelsonBrandao
NelsonBrandao / app.js
Created November 20, 2015 14:54
Signature Demo
var canvas = document.getElementById("myCanvas");
tool.minDistance = 10;
var path;
function onMouseDown(event) {
// Create a new path and select it:
path = new Path();
path.strokeColor = '#00000';
@NelsonBrandao
NelsonBrandao / CurrentUserService.coffee
Created April 16, 2015 10:47
Service for sharing the current user logged user between multiple controllers
angular.module('app')
.factory('CurrentUserService', [
'$q', '$rootScope', 'UserService',
($q, $rootScope, UserService)->
myService = {}
myService._initialized = false
myService.refresh = ->
# Create the defer to promise data
deferred = $q.defer()
# Get the data from the API