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
<?php namespace App\Providers;
use Illuminate\Support\ServiceProvider;
/**
* If the incoming request is an OPTIONS request
* we will register a handler for the requested route
*/
class CatchAllOptionsRequestsProvider extends ServiceProvider {
@mariano-aguero
mariano-aguero / .eslintrc
Created October 23, 2015 13:03 — forked from cletusw/.eslintrc
ESLint Reset - A starter .eslintrc file that resets all rules to off and includes a description of what each rule does. From here, enable the rules that you care about by changing the 0 to a 1 or 2. 1 means warning (will not affect exit code) and 2 means error (will affect exit code).
{
// http://eslint.org/docs/rules/
"ecmaFeatures": {
"binaryLiterals": false, // enable binary literals
"blockBindings": false, // enable let and const (aka block bindings)
"defaultParams": false, // enable default function parameters
"forOf": false, // enable for-of loops
"generators": false, // enable generators
"objectLiteralComputedProperties": false, // enable computed object literal property names
@mariano-aguero
mariano-aguero / monitrc
Created October 30, 2015 12:51 — forked from franck/monitrc
monit config file (nginx, mysql, redis, tomcat)
###############################################################################
## Monit control file
###############################################################################
##
## Comments begin with a '#' and extend through the end of the line. Keywords
## are case insensitive. All path's MUST BE FULLY QUALIFIED, starting with '/'.
##
## Below you will find examples of some frequently used statements. For
## information about the control file, a complete list of statements and
## options please have a look in the monit manual.
@mariano-aguero
mariano-aguero / fileUpload.php
Created December 14, 2015 17:46
Phonegap File Upload
<?php
# replace PATH_TO_BUILD, USERNAME, PASSWORD and TITLE_EXAMPLE
$zipname = 'PATH_TO_BUILD/build.zip';
$data = ['file' => new CurlFile($zipname),
'data' => json_encode(['title' => 'TITLE_EXAMPLE' ,'create_method' => 'file'])
];
$myusername = 'USERNAME';
@mariano-aguero
mariano-aguero / generator.php
Created December 14, 2015 18:52
Script de generación de proyectos
<?php
# CONSTANTS
$bitbucketUsername = 'BITBUCKET_USERNAME';
$bitbucketPassword = 'BITBUCKET_PASSWORD';
$zipname = "build.zip";
$homeDirectory = "/Users/development2/";
$phonegapUsername = 'PHONEGAP_USERNAME';
$phonegapPassword = 'PHONEGAP_PASSWORD';
<preference name="android-build-tool" value="gradle" />
<plugin name="cordova-plugin-whitelist" source="npm" spec="1.2.1" />
<plugin name="cordova-plugin-device" source="npm" spec="1.1.1" />
<plugin name="cordova-plugin-inappbrowser" source="npm" spec="1.3.0" />
<plugin name="cordova-plugin-network-information" source="npm" spec="1.2.0" />
<plugin name="cordova-plugin-splashscreen" source="npm" spec="3.2.0"/>
<plugin name="cordova-plugin-camera" source="npm" spec="2.1.0" />
<plugin name="pushwoosh-cordova-plugin" source="npm" spec="4.2.0" />
<plugin name="cordova-plugin-geolocation" source="npm" spec="2.1.0" />
@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',
@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 / 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 / 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);