Skip to content

Instantly share code, notes, and snippets.

View jsanbae's full-sized avatar

Javier Sánchez Baeza jsanbae

View GitHub Profile
@jsanbae
jsanbae / gist:b3351fde0e02af5da92d51ee555221e8
Created November 21, 2024 11:50
Install ssh2 on PHP7.4
- sudo apt-get install php7.4-dev
- sudo update-alternatives --config php-config (seleccionar la versión 7.4)
- sudo apt install php7.4-ssh2 ó sudo pecl install -f ssh2
- echo extension=ssh2.so > /etc/php/7.4/mods_available/ssh2.ini
- crear link simbólico de la extensión sudo ln -s /etc/php/7.4/mods-available/ssh2.ini /etc/php/7.4/cli/conf.d/20-ssh2.ini
- reiniciar el php-fpm sudo /etc/init.d/php7.4-fpm restart
- verificar que esté instalada con php -m
@jsanbae
jsanbae / duplicate-table-grid-form.html
Last active November 26, 2021 13:57
agregar y quitar filas dinamicamente a una tabla con inputs (ideal para datagrids)
<html>
<body>
<!-- btn requiere la clase 'js-duplicate-line' y atributo 'data-table-id' con el id de la tabla al cual duplicará sus filas -->
<a class="js-duplicate-line" data-table-id="t-contactos" role="button">+ Nueva linea</a>
<!-- table layout-->
<table class="table" id="t-contactos">
<thead>
<tr>
<?php
/**
* A view Helper from CSRF
*
* Prints the Token
*
* @author Javier Sanchez
*/
class Zend_View_Helper_Csrf extends Zend_View_Helper_Abstract {
@jsanbae
jsanbae / CsrfProtect.php
Last active January 3, 2020 15:48 — forked from luismayta/CsrfProtect.php
CsrfProtect by zend framework
<?php
/**
* A controller plugin for protecting forms from CSRF
*
* Works by looking at the response and adding a hidden element to every
* form, which contains an automatically generated key that is checked
* on the next request against a key stored in the session
*
* @author Jani Hartikainen <firstname at codeutopia net>
*/
@jsanbae
jsanbae / Zend_Mail_InlineImages.php
Created December 18, 2019 17:37 — forked from basvandorst/Zend_Mail_InlineImages.php
Zend_Mail inline images in e-mail: CID attachment (tested in Gmail, Outlook.com, Outlook 2010)
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd