Skip to content

Instantly share code, notes, and snippets.

View brunovianarezende's full-sized avatar

Bruno Rezende brunovianarezende

View GitHub Profile
@brunovianarezende
brunovianarezende / MyIcon.js
Created June 23, 2017 17:59
How to create a custom Icon component based on NativeBase.Icon that accepts a 'iconFamily' parameter
import React from 'react'
import PropTypes from 'prop-types'
import {Icon, StyleProvider, getTheme } from 'native-base';
class MyIcon extends React.Component {
render() {
if(this.props.iconFamily) {
return (
<StyleProvider style={getTheme({iconFamily: this.props.iconFamily})}>
{this._renderIcon()}
@brunovianarezende
brunovianarezende / ng-really.js
Last active February 11, 2018 13:35 — forked from asafge/ng-really.js
ng-confirm - An AngularJS directive that creates a confirmation dialog for an action. Forked from https://gist.github.com/asafge/7430497
/**
* A generic confirmation for risky actions.
* Usage: Add attributes:
* * ng-confirm-message="Are you sure?"
* * ng-confirm-click="takeAction()" function
* * ng-confirm-condition="mustBeEvaluatedToTrueForTheConfirmBoxBeShown" expression
*/
angular.module('app').directive('ngConfirmClick', [function() {
return {
restrict: 'A',
import sys, csv, time
from collections import defaultdict
from itertools import islice
import orig_slopeone, slopeone #,slsparse
classes = [
orig_slopeone.SlopeOne,
#orig_slopeone.SlopeOneNumpy, # XXX: dog slow
slopeone.SlopeOne,