Skip to content

Instantly share code, notes, and snippets.

View robertzibert's full-sized avatar
⛩️

Robert Zibert robertzibert

⛩️
View GitHub Profile
@robertzibert
robertzibert / responses.js
Created June 29, 2020 15:13
Coding Dojo Responses
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 => {
@robertzibert
robertzibert / crud.js
Last active July 26, 2017 01:51
[Mongo Basic Crud with Meteor]
// Setting Element
Tasks.update(this._id, {
$set: { checked: ! this.checked }
})
// Setting an array
Documents.update(documentId, {
$set: {recipients: recipients}
@robertzibert
robertzibert / autbind.js
Last active July 26, 2017 01:11
[Binding on React] #js #react
class Component {
@autobind
pushReferral (event, isInputChecked) {
console.log(isInputChecked)
}
getFirstFields () {
return [
{
title: '',
@robertzibert
robertzibert / Main.js
Created June 29, 2017 15:19
[Paginated with autorefetch] #graphQl #react #js
// Todo
@robertzibert
robertzibert / Comunas.js
Created December 30, 2016 15:11
Objeto con Comunas y Regiones
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'},
@robertzibert
robertzibert / chile.json
Created November 15, 2016 00:45
Json de chile
{
 
    "regiones": [{
            "region": "Arica y Parinacota",
            "comunas": ["Arica", "Camarones", "Putre", "General Lagos"]
    },
        {
            "region": "Tarapacá",
            "comunas": ["Iquique", "Alto Hospicio", "Pozo Almonte", "Camiña", "Colchane", "Huara", "Pica"]
    },
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
/**
* 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
*/
@robertzibert
robertzibert / posts.js
Last active September 7, 2016 14:08
Meteor Tutorial
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
@robertzibert
robertzibert / index.js
Last active September 1, 2016 16:27
React Router
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}/>