Skip to content

Instantly share code, notes, and snippets.

View mariano-aguero's full-sized avatar
:octocat:
Focusing

Mariano Aguero mariano-aguero

:octocat:
Focusing
View GitHub Profile
@mariano-aguero
mariano-aguero / jobs-queue-migration.js
Last active June 30, 2016 17:41
Sequelize Migration
'use strict';
var fs = require('fs');
module.exports = {
up: function (queryInterface, Sequelize, done) {
return fs.readFile('./node_modules/pg-job-queue/lib/schema.sql', 'utf-8', function (err, data) {
return queryInterface.sequelize.query(data)
.then(function (response) {
done();
}).catch(function (err) {
@mariano-aguero
mariano-aguero / Offline.txt
Created August 18, 2016 17:06
Multeo - Offline
Problema:
- Como usuario, quiero que la aplicacion multeo me permita utilizarla sin conexion a internet para que su utilizacion sea mas fluida en lugares sin acceso a wifi
- Como usuario, quiero que la aplicacion multeo ciudadano me permita utilizarla sin conexion a internet para que su utilizacion sea mas fluida en lugares sin acceso a wifi
Soluciones:
- Modo offline Multeo:
- Refactorizar codigo existente, y quitar el "modo offlline" actual, y que quede de modo funcional online para aplicar la nueva solucion offline.
- Autenticacion con conexion a internet.
- Deberia existir un boton de modo offline/online? PREGUNTA: el dev team sugirio que SI exista y que este en el slide menu como un toggle.
{
"code": 200,
"status": "success",
"data": [
{
"id": "384",
"identifier": "SSF",
"ticket_type": "transit",
"status": "active",
"status_media": "complete",
@mariano-aguero
mariano-aguero / homestead_extras.sh
Created September 18, 2016 13:09 — forked from kuroski/homestead_extras.sh
Script for the installation of MSSQL in Laravel Homestead (read the comments)
#!/bin/bash
#Install Laravel Homestead (http://laravel.com/docs/5.0/homestead)
#ssh into Homestead "homestead ssh"
#Run the script using "sudo bash homestead_extras.sh"
#Leave all the default options sugested during the installation, and do not modify any files!!
apt-get update
#Additional Packages
apt-get install -y php5-ldap php5-mssql
@mariano-aguero
mariano-aguero / CloudinaryHelper.php
Created October 13, 2016 18:20
Cloudinary - Lumen - Helper
<?php
namespace App\V1\Helpers;
use Cloudinary;
use Cloudinary\Uploader;
/* @see http://cloudinary.com/documentation/php_image_upload#text_creation **/
/**
@mariano-aguero
mariano-aguero / KeystoneApiExample.md
Created January 10, 2017 18:14 — forked from JedWatson/KeystoneApiExample.md
Example of how to scaffold API endpoints for Posts in a Keystone project (based on the yo keystone example).

This is an example of how to scaffold API endpoints to list / get / create / update / delete Posts in a Keystone website.

It's a modification of the default project created with the yo keystone generator (see https://github.com/JedWatson/generator-keystone)

Gists don't let you specify full paths, so in the project structure the files would be:

routes-index.js        -->    /routes/index.js         // modified to add the api endpoints
routes-api-posts.js    -->    /routes/api/posts.js     // new file containing the Post API route controllers
@mariano-aguero
mariano-aguero / better-nodejs-require-paths.md
Created January 11, 2017 16:34 — forked from branneman/better-nodejs-require-paths.md
Better local require() paths for Node.js

Better local require() paths for Node.js

Problem

When the directory structure of your Node.js application (not library!) has some depth, you end up with a lot of annoying relative paths in your require calls like:

var Article = require('../../../models/article');

Those suck for maintenance and they're ugly.

Possible solutions

@mariano-aguero
mariano-aguero / event_bus.js
Created September 13, 2017 12:42
Event bus
// Definition
const EventEmitter = require('events');
const emitter = new EventEmitter();
emitter.on('uncaughtException', function (err) {
console.error(err);
});
module.exports = emitter;
0x8F08C3C24107F2dBDe78D44cB9262012166b99b0
@mariano-aguero
mariano-aguero / gist:cf4be684d86e843071957598eaaac922
Created October 31, 2017 17:18 — forked from elamperti/gist:3111691
RegEx para teléfonos de Argentina
/(?<=\s|:)\(?(?:(0?[1-3]\d{1,2})\)?(?:\s|-)?)?((?:\d[\d-]{5}|15[\s\d-]{7})\d+)/