Skip to content

Instantly share code, notes, and snippets.

View juandaveth's full-sized avatar

juandavid juandaveth

View GitHub Profile
@juandaveth
juandaveth / 3box
Last active August 31, 2020 15:58
This post links my 3Box profile to my Github account! Web3 social profiles by 3Box.
✅ did:3:bafyreic2qynnt73hdcoteta37zccpmkga6e2vajmgvxk33oqkjoxmpw7qa ✅
Create your profile today to start building social connection and trust online at https://3Box.io/
import React, { Component } from 'react';
import {Router, Route, browserHistory, IndexRoute} from 'react-router';
import Root from './components/Root';
import Inicio from './components/Inicio';
import Departamento from './components/Departamento';
import Provincia from './components/Provincia';
import Distrito from './components/Distrito';
class App extends Component {
newArray.forEach(element => {
const lineArray = element.split("/");
lineArray.forEach((code, index) => {
// Distrito code:
const first = code.split(" ");
// Distrito name, using function for cases with two words:
function add(isUndefined) {
return lineArray[2].split(" ")[3] || '';
}
listDistName = `${lineArray[2].split(" ")[2]} ${add(true)}`;
const fs = require("fs");
const callback = (err, data) => {
try {
const toString = JSON.stringify(data);
const parsed = JSON.parse(toString);
const cleaned = parsed.replace(/“|”/g, "");
const newArray = cleaned.split("\n");
console.log(newArray);
“01 Lima / / ”
“01 Lima / 50 Lima / ”
“01 Lima / 51 Barranca / ”
“01 Lima / 50 Lima / 202 La Molina”
“01 Lima / 50 Lima / 203 San Isidro”
“02 Arequipa / / ”
“02 Arequipa / 63 Arequipa / ”
“02 Arequipa / 64 Caylloma / ”
“02 Arequipa / 63 Arequipa / 267 Cercado”
@juandaveth
juandaveth / redux_egghead_notes_ES.md
Last active June 6, 2016 08:52
Traducción a español de las notas de Diego Concha (@diegoconcha). Ver el original en inglés aquí: https://gist.github.com/diegoconcha/8918294bb9df69876b22

##Redux Egghead Notas##

####Introducción:#### Manejar el estado de la aplicación es una tarea fundalmental, la cual usualmente se hace de forma desordenada. Redux ofrece una manera de manejar ordenadamente el estado (state) de una aplicación en JavaScript que ayudará a la aplicacion a ser más consistente.

Redux es la evolución de Flux, pero que no tiene la complejidad propia de ésta arquitectura presentada por Facebook. Simplifica la forma de trabajar inspirado en el lenguaje Elm.

#####¿Por qué nació Redux?##### Ayuda a pensar dos conceptos que son abstractos para la mente humana: mutabilidad y funciones asíncronas.

###Redux Egghead Video Notes###
####Introduction:####
Managing state in an application is critical, and is often done haphazardly. Redux provides a state container for JavaScript applications that will help your applications behave consistently.
Redux is an evolution of the ideas presented by Facebook's Flux, avoiding the complexity found in Flux by looking to how applications are built with the Elm language.
####1st principle of Redux:####
Everything that changes in your application including the data and ui options is contained in a single object called the state tree
@juandaveth
juandaveth / SimpleList.js
Last active March 28, 2020 22:12
Primer paso para crear una lista, usando como base el capítulo 4 sección "Working With Organizational Components" de @bonniee
'use strict';
import React from 'react';
import {
StyleSheet,
Text,
View,
ListView,
} from 'react-native';
import React from 'react';
import {
View,
Text,
StyleSheet,
Image
} from 'react-native';
import ButtonSignin from '../common/buttonSignin';
import ButtonSignup from '../common/buttonSignup';