Skip to content

Instantly share code, notes, and snippets.

Avatar
💙
reacting

Eduardo P. Rivero eperedo

💙
reacting
View GitHub Profile
@eperedo
eperedo / example.json
Created Sep 12, 2018
google place autocomplete example
View example.json
{
"address_components": [
{
"long_name": "Avenida Arequipa",
"short_name": "Av. Arequipa",
"types": [
"route"
]
},
{
@eperedo
eperedo / questions.md
Created Sep 4, 2017
Ejercicio vue-resource
View questions.md
@eperedo
eperedo / about.vue
Created Aug 23, 2017
meta tags in single page application
View about.vue
<template>
<div>
About Page {{message}}
</div>
</template>
<script>
function metaInfo() {
return {
@eperedo
eperedo / about.vue
Created Aug 23, 2017
meta tags in single page application
View about.vue
<template>
<div>
About Page {{message}}
</div>
</template>
<script>
function metaInfo() {
return {
@eperedo
eperedo / fromObjectToQueryParams.js
Last active Jul 16, 2017
Convert object to query parameters
View fromObjectToQueryParams.js
function objectToQuery(obj, notInclude = []){
const keys = Object.keys(obj);
const keysToConvert = keys.filter((kf) => {
return notInclude.indexOf(kf) === -1;
})
const qs = keysToConvert.map((key) => {
const currentKey = obj[key];
return `&${key}=${currentKey}`;
});
return qs.join('');
@eperedo
eperedo / transformArrayToObject.js
Last active Jun 15, 2017
Convert an array of json objects to an object. I KNOW!
View transformArrayToObject.js
var a = [{"id": 42, "name": "TALLA", "companyId": 40, "createdAt": "2017-02-13T21:51:15.000Z", "updatedAt": "2017-02-13T21:51:15.000Z", "flagActive": 1}, {"id": 37, "name": "TELA", "companyId": 40, "createdAt": "2017-02-13T21:23:11.000Z", "updatedAt": "2017-02-13T21:23:11.000Z", "flagActive": 1}, {"id": 38, "name": "TIPO DE PRENDA", "filterable": true}, {"id": 39, "name": "MODELO", "filterable": true}, {"id": 41, "name": "COLOR", "filterable": true}, {"id": 40, "name": "MANGA", "filterable": true}]
function transformArrayToObject(array) {
var b = {};
array.forEach((item, index) => {
var keys = Object.keys(item);
b[item.id] = {};
keys.forEach((key) => {
b[item.id][key] = item[key];
});
@eperedo
eperedo / refactor.MD
Last active Jun 15, 2017
Chut quiz javascriptero
View refactor.MD
@eperedo
eperedo / Preguntas 24-03-2017.md
Last active Mar 24, 2017
Quiz Semanal APPRUN
View Preguntas 24-03-2017.md

Instrucciones para resolver las preguntas de jsbin

  1. Abrir link de pregunta
  2. Click en File -> Save Snapshot
  3. Se recargará la pagina con la misma pregunta, pero con otro link.
  4. Ese link representará su solución a dicha pregunta, guardalo.
  5. Repetir escenario para las demás preguntas.
  6. Al terminar enviar todos los links al correo jrperedo@gmail.com

Ejercicios

@eperedo
eperedo / login.test.js
Created Oct 4, 2016
Nightwatch testing
View login.test.js
browser
.url(`${browser.launch_url}/login`)
.waitForElementVisible('body', 1000)
.setValue('input[type=email]', 'mail@gmail.com')
.setValue('input[type=password]', '123456')
.submitForm('form')
.getTitle(function (title) {
browser.assert.equal(title, 'Home Page');
})
.end();
You can’t perform that action at this time.