Skip to content

Instantly share code, notes, and snippets.

View juliocapuano's full-sized avatar
🏠
Working from home

Julio Alberto Capuano juliocapuano

🏠
Working from home
  • Lima, Perú
View GitHub Profile
@juliocapuano
juliocapuano / install-php-tools.sh
Created January 28, 2018 14:05 — forked from agarzon/install-php-tools.sh
Install globally popular PHP dev tools like composer, phpunit, phpcs, phpmd, phpcpd, deployer, robo, codeception, etc.
#!/bin/bash
#To execute it directly: sudo bash <(curl -s https://gist.githubusercontent.com/agarzon/ecb0b92d4c8e1bbde126534c76721a58/raw/install-php-tools.sh)
BIN_PATH=/usr/local/bin/
#COMPOSER
sudo curl -LsS https://getcomposer.org/composer.phar -o ${BIN_PATH}composer
sudo chmod a+x ${BIN_PATH}composer
@juliocapuano
juliocapuano / VideoStream.php
Created May 14, 2018 20:27 — forked from ranacseruet/VideoStream.php
PHP VideoStream class for HTML5 video streaming
<?php
/**
* Description of VideoStream
*
* @author Rana
* @link http://codesamplez.com/programming/php-html5-video-streaming-tutorial
*/
class VideoStream
{
private $path = "";
@juliocapuano
juliocapuano / README.md
Created June 25, 2018 21:28 — forked from hubgit/README.md
A5 printed card with HTML + CSS
  1. Clone this Gist.
  2. For card sizes other than A5, edit the size value in @page, and the height and width properties of body.
  3. Add contents to each face. The simplest approach is to add an image called front.png of the same dimensions as the card.
  4. Generate a PDF from the HTML + CSS. If using Prince, it's as simple as prince index.html card.pdf.
  5. Take the PDF to a printer, and ask them to print as many copies as you need.
@juliocapuano
juliocapuano / email.php
Created July 4, 2018 15:34 — forked from nicolechung/email.php
Codeigniter: Email config for gmail/google apps mail
<?php if (! defined('BASEPATH')) exit ('No direct access allowed');
/*
| -------------------------------------------------------------------
| EMAIL CONFING
| -------------------------------------------------------------------
| Configuration of outgoing mail server.
| */
$config['protocol'] = 'smtp';
$config['smtp_host'] = 'ssl://smtp.googlemail.com';
@juliocapuano
juliocapuano / create-thumbnail.php
Created August 1, 2018 16:19 — forked from pqina/create-thumbnail.php
Create thumbnails with PHP
<?
// Link image type to correct image loader and saver
// - makes it easier to add additional types later on
// - makes the function easier to read
const IMAGE_HANDLERS = [
IMAGETYPE_JPEG => [
'load' => 'imagecreatefromjpeg',
'save' => 'imagejpeg',
'quality' => 100
@juliocapuano
juliocapuano / validate-email.php
Created October 11, 2018 15:16 — forked from marcelstoer/validate-email.php
How to validate email with PHP
<?php
// inspired by a note at http://php.net/manual/en/function.getmxrr.php
// further inspiration from https://github.com/webdigi/SMTP-Based-Email-Validation
function validateEmail($email)
{
$emailValid = false;
$domain = extractFullyQualifiedDomainFromEmail($email);
$mxHost = findPreferredMxHostForDomain($domain);
@juliocapuano
juliocapuano / bootstrap-4-sass-mixins-cheat-sheet.scss
Created June 27, 2019 21:59 — forked from anschaef/bootstrap-4-sass-mixins-cheat-sheet.scss
Bootstrap 4 Sass Mixins [Cheat sheet with examples]
/* -------------------------------------------------------------------------- */
// All Bootstrap 4 Sass Mixins [Cheat sheet]
// Updated to Bootstrap v4.1.x
// @author https://anschaef.de
// @see https://github.com/twbs/bootstrap/tree/v4-dev/scss/mixins
/* -------------------------------------------------------------------------- */
// Grid variables
$grid-columns: 12 !default;
$grid-gutter-width: 30px !default;
@juliocapuano
juliocapuano / DataTable.vue
Created November 4, 2019 18:47 — forked from yajra/DataTable.vue
VueJS DataTables Snippets with Delete Button Component
<template>
<table>
<thead>
<tr>
<th v-for="column in parameters.columns" v-html="title(column)"></th>
</tr>
</thead>
<tfoot v-if="footer">
<tr>
<th v-for="column in parameters.columns" v-html="column.footer"></th>
@juliocapuano
juliocapuano / file0.txt
Created November 8, 2019 16:32 — forked from giwa/file0.txt
Install g++/gcc 4.8.2 in CentOS 6.6 ref: http://qiita.com/giwa/items/28c754d8fc2936c0f6d2
$ wget http://people.centos.org/tru/devtools-2/devtools-2.repo -O /etc/yum.repos.d/devtools-2.repo
$ yum install devtoolset-2-gcc devtoolset-2-binutils
$ yum install devtoolset-2-gcc-c++ devtoolset-2-gcc-gfortran
@juliocapuano
juliocapuano / php_array_table.php
Created November 24, 2019 02:41 — forked from jasondavis/php_array_table.php
PHP Array to HTML Table
<?php
function html_table($data = array())
{
$rows = array();
foreach ($data as $row) {
$cells = array();
foreach ($row as $cell) {
$cells[] = "<td>{$cell}</td>";
}