This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const reverseArray = arr => { | |
const arraySize = arr.length - 1 | |
return arr.map((val, index) => { | |
return arr[arraySize - index] | |
}) | |
} | |
const removeDuplicates = arr => arr.filter((val, index) => val !== arr[index-1]) | |
const removeDuplicatesUnsorted = arr => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Setting Element | |
Tasks.update(this._id, { | |
$set: { checked: ! this.checked } | |
}) | |
// Setting an array | |
Documents.update(documentId, { | |
$set: {recipients: recipients} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Component { | |
@autobind | |
pushReferral (event, isInputChecked) { | |
console.log(isInputChecked) | |
} | |
getFirstFields () { | |
return [ | |
{ | |
title: '', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Todo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import _ from 'underscore' | |
const comunasNoOrder = [ | |
{label: 'Iquique', value: 'Iquique'}, | |
{label: 'Alto Hospicio', value: 'Alto Hospicio'}, | |
{label: 'Pozo Almonte', value: 'Pozo Almonte'}, | |
{label: 'Camiña', value: 'Camiña'}, | |
{label: 'Colchane', value: 'Colchane'}, | |
{label: 'Huara', value: 'Huara'}, | |
{label: 'Pica', value: 'Pica'}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"regiones": [{ | |
"region": "Arica y Parinacota", | |
"comunas": ["Arica", "Camarones", "Putre", "General Lagos"] | |
}, | |
{ | |
"region": "Tarapacá", | |
"comunas": ["Iquique", "Alto Hospicio", "Pozo Almonte", "Camiña", "Colchane", "Huara", "Pica"] | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {SimpleSchema} from 'meteor/aldeed:simple-schema' | |
// We are importing an element from react-simple-form | |
import Text from 'simple-react-form-material-ui/lib/text' | |
const PostSchema = new SimpleSchema({ | |
title: { | |
type: String, | |
label: 'title', | |
max: 40, | |
srf: { | |
type: Text |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* We need to register the material ui fields | |
*/ | |
import { SimpleSchema } from 'meteor/aldeed:simple-schema' | |
import { Match } from 'meteor/check' | |
/** | |
* This allows you to define simple-react-form options in the schemas | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Meteor } from 'meteor/meteor' | |
import PostSchema from './schema' | |
// Here you have a collection | |
const Posts = new Meteor.Collection('machines') | |
Posts.attachSchema(PostSchema) | |
export default Posts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react' | |
import {Route, IndexRoute} from 'react-router' | |
import Home from './home' | |
import Component from './component' | |
import CreateForm from './CreateForm' | |
export default ( | |
<Route path='module'> | |
<IndexRoute component={Home} /> | |
<Route path='crear' component={CreateForm}/> |
NewerOlder