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 / 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 / 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 / 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
{
"code": 200,
"status": "success",
"data": [
{
"id": "384",
"identifier": "SSF",
"ticket_type": "transit",
"status": "active",
"status_media": "complete",
@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.
@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 / script.sql
Created June 16, 2016 13:04
Postgresql Update serial sequence
SELECT MAX(id) FROM "Tags";
SELECT nextval('"Tags_id_seq"');
SELECT setval('"Tags_id_seq"', COALESCE((SELECT MAX(id)+1 FROM "Tags"), 1), false);
@mariano-aguero
mariano-aguero / remove-accents.js
Created June 6, 2016 19:36 — forked from monkeymonk/remove-accents.js
AngularJS `removeAccents` filter
angular.module('utils.filters', [])
.filter('removeAccents', removeAccents);
function removeAccents() {
return function (source) {
var accent = [
/[\300-\306]/g, /[\340-\346]/g, // A, a
/[\310-\313]/g, /[\350-\353]/g, // E, e
/[\314-\317]/g, /[\354-\357]/g, // I, i
/[\322-\330]/g, /[\362-\370]/g, // O, o
@mariano-aguero
mariano-aguero / config.nginx
Created April 20, 2016 18:59
Cors on nginx
#
# Wide-open CORS config for nginx
#
location / {
if ($request_method = 'OPTIONS') {
add_header 'Access-Control-Allow-Origin' '*';
#
# Om nom nom cookies
#
add_header 'Access-Control-Allow-Credentials' 'true';
@mariano-aguero
mariano-aguero / flightplan.js
Created April 19, 2016 22:16
Deploy with flightplan
// flightplan.js
var plan = require('flightplan');
/**
* Remote configuration for "production"
*/
plan.target('production', {
host: 'example.com',
username: 'someuser',
password: 'somepassword',