Skip to content

Instantly share code, notes, and snippets.

💙
reacting

Eduardo P. Rivero eperedo

💙
reacting
Block or report user

Report or block eperedo

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
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"
]
},
{
View .bash_aliases
myip='print '\''wifi:'\''; ipconfig getifaddr en1;print '\''ethernet: '\''; ipconfig getifaddr en0';
mywp="cd $HOME/workspace"
ec2="ssh -i $HOME/pems/ec2-personal.pem ubuntu@ec2-ip"
deploy-dev="pm2 deploy ecosystem.config.js dev update --force"
deploy-prod="pm2 deploy ecosystem.config.js production update --force"
tanos="cd $HOME/node/tanos-api/source"
View resolvers.js
// products resolvers
products: (_, args, context) => {
console.log('Products Resolver', context.user);
// this will verify first on redis if the array of products exists
// otherwise goes to the sql database
return context.request.server.methods.productsList(
context.user.companyId
);
},
@eperedo
eperedo / questions.md
Last active Jan 31, 2018
php - laravel questions
View questions.md

Preguntas Laravel

  1. Usando el framework Laravel, Asumiendo se tiene una tabla usuarios y se requiere agregar dos campos mas a la tabla: code y document_number. Explicar que cambios se deben realizar para poder lograr dicha tarea.

  2. Se tiene un endpoint POST /users en laravel que recibe email, age y password y crea un nuevo usuario en una base de datos. Se desea agregar las siguientes validaciones:

email: Campo requerido y debe tener formato de email
@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];
});
You can’t perform that action at this time.