Skip to content

Instantly share code, notes, and snippets.

View prodriguezval's full-sized avatar

Pablo Rodriguez Valenzuela prodriguezval

View GitHub Profile
@prodriguezval
prodriguezval / settings.xml
Last active August 21, 2017 21:08
The maven in the developer machine will connect with the internal artifact repository
<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
<profiles>
<profile>
<id>Repository Proxy</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
@prodriguezval
prodriguezval / LambdaRequestHandler.java
Created July 3, 2017 20:15
Lambda function to connect AWS API gateway with Lambda
public class LambdaRequestHandler {
private PostTextRequest request = new PostTextRequest();
public PostTextResult handleRequest(Map<String,Object> input, Context context) {
AmazonLexRuntimeClientBuilder builder = AmazonLexRuntimeClient.builder();
AmazonLexRuntime client = builder.build();
//Extract the querystring parameters from the API
Map<String, Object> params = (Map<String, Object>) input.get("params");
Map<String, String> queryVars = (Map<String, String>) params.get("querystring");
@prodriguezval
prodriguezval / .tmux.conf
Last active August 28, 2016 17:30
A better tmux config
#Please install first the tmux plugin support following this instructios:
#https://github.com/tmux-plugins/tpm
#Install the plugins on fisrt run using CTRL + A + I (capital)
#Based on http://www.hamvocke.com/blog/a-guide-to-customizing-your-tmux-conf/
#Set the prefix combinatio to CTRL + A
unbind C-b
set -g prefix C-a
# split panes using | and -
@prodriguezval
prodriguezval / InstallOnPostMergeCommand.php
Last active June 14, 2016 15:00
This command check if the files composer.json and bower.json was modified in the previous pull and execute composer install and bower install to update the system dependencies
<?php
namespace App\Command;
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
class InstallOnPostMergeCommand extends ContainerAwareCommand
{
const COMPOSER_JSON_FILE = 'composer.json';
@prodriguezval
prodriguezval / Operaciones-Git
Last active June 2, 2016 13:49 — forked from jelcaf/Operaciones-Git
Git Tips - Mini-trucos de Git para facilitarme la tarea
#############################################
# Push de la rama actual
git push origin $rama_actual
#############################################
# Volver a un commit anterior, descartando los cambios
git reset --HARD $SHA1
#############################################
# Ver y descargar Ramas remotas
@prodriguezval
prodriguezval / readFolderExcelFiles.php
Last active February 17, 2016 14:29
Read a folder with Excel files (.xlsx) and put the content in an Array
require '../../vendor/autoload.php';
$filesArray = [];
foreach (glob("myFolder/*.xlsx") as $file) {
$type = PHPExcel_IOFactory::identify($file);
$reader = PHPExcel_IOFactory::createReader($type);
$reader->setReadDataOnly(true);
$excel = $reader->load($file);
$worksheet = $excel->getSheet();
$toArrayFile = ($worksheet) ? $worksheet->toArray() : array();