Skip to content

Instantly share code, notes, and snippets.

View gogl92's full-sized avatar
🎣
Florida

Luis Gonzalez gogl92

🎣
Florida
View GitHub Profile
@gogl92
gogl92 / ssl.sh
Last active September 27, 2018 07:01
Automate Lets Encrypt
#!/bin/bash
sudo add-apt-repository ppa:certbot/certbot -y
sudo apt-get update -y
sudo apt-get upgrade -y
sudo apt-get install -y python-certbot-nginx
sudo certbot --nginx -d $1 --email $2 --non-interactive --agree-tos --redirect
@gogl92
gogl92 / woocommerce.sh
Last active December 5, 2018 19:45
Bitnami Wordpress with SSL certificate automation
#!/bin/bash
sudo /opt/bitnami/apps/wordpress/bnconfig --disable_banner 1
sudo /opt/bitnami/letsencrypt/scripts/generate-certificate.sh -m $2 -d $1 -d $1
cd /home/luisarmando1234/apps/wordpress/htdocs/wp-content/plugins/
sudo wget https://downloads.wordpress.org/plugin/woocommerce.3.4.5.zip
sudo unzip woocommerce.3.4.5.zip
sudo rm woocommerce.3.4.5.zip
@gogl92
gogl92 / index.html
Created August 25, 2018 02:10
Pure-CSS Netflix Show Carousel
<div class="contain">
<h1>Pure CSS Netflix Video Carousel</h1>
<p>
Inspired by <a href="https://twitter.com/Eli_White">Eli White's</a> article <a href="http://eng.wealthfront.com/2015/06/implementing-netflix-redesign.html">Performant CSS Animations: Netflix Case Study</a>, his <a href="https://codepen.io/TheSavior/pen/LVeYBp">example pen</a>, and <a href="http://matthewjamestaylor.com/">Matt Taylor's</a> <a href="https://codepen.io/mattjamestaylor/pen/dodYPr">CSS-only version.</a>
</p>
<div class="row">
<div class="row__inner">
@gogl92
gogl92 / lamp.sh
Last active June 4, 2018 17:04 — forked from aamnah/lamp.sh
Bash script to install Apache, MySQL and PHP as well as PHPMyAdmin and some tweaks. For Debian and Ubuntu. To run, copy the script to the server and run ``bash lamp.sh``
#!/bin/sh
#######################################
# Bash script to install an AMP stack and PHPMyAdmin plus tweaks. For Debian based systems.
# Written by @AamnahAkram from http://aamnah.com
# In case of any errors (e.g. MySQL) just re-run the script. Nothing will be re-installed except for the packages with errors.
#######################################
#COLORS
@gogl92
gogl92 / AppAsset.php
Last active March 31, 2018 09:26
Yii2 + redis + node + vue / JQuery
<?php
/**
* @link http://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license http://www.yiiframework.com/license/
*/
namespace app\assets;
use yii\web\AssetBundle;
@gogl92
gogl92 / index.php
Created March 21, 2018 05:17
Read and Show a File with Javascript in Yii2
<?php
$this->registerJsFile('https://unpkg.com/xlsx/dist/xlsx.full.min.js');
$this->registerJs('$(\'#input-excel\').change(function(e){
var reader = new FileReader();
reader.readAsArrayBuffer(e.target.files[0]);
reader.onload = function(e) {
var data = new Uint8Array(reader.result);
var wb = XLSX.read(data,{type:\'array\'});
var htmlstr = XLSX.write(wb,{sheet:"Ejemplo Semanal", type:\'binary\',bookType:\'html\'});
$(\'#wrapper\')[0].innerHTML += htmlstr;
@gogl92
gogl92 / README.md
Last active February 22, 2018 15:27
PHPStorm Yii2 Live Templates

Install

Just put it under your templates folder inside your

@gogl92
gogl92 / update_table.sql
Created January 8, 2018 17:15
Service Columns
SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;
SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;
SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='TRADITIONAL,ALLOW_INVALID_DATES';
ALTER TABLE `database`.`table`
ADD COLUMN `deleted_at` DATETIME NULL DEFAULT NULL AFTER `observaciones`,
ADD COLUMN `created_at` DATETIME NULL DEFAULT NULL AFTER `deleted_at`,
ADD COLUMN `updated_at` DATETIME NULL DEFAULT NULL AFTER `created_at`,
ADD COLUMN `deleted_by` INT(11) NULL DEFAULT NULL AFTER `updated_at`,
ADD COLUMN `created_by` INT(11) NULL DEFAULT NULL AFTER `deleted_by`,
@gogl92
gogl92 / index.haml
Created January 7, 2018 16:28
Radial Menu - Pure CSS
%input#check{:type => "checkbox"}
%label.main{:for => 'check'}
.title
%i.fa.fa-bars
.container
%a.plate{:href => 'https://codepen.io/Oka/'}
%i.fa.fa-codepen
%a.plate{:href => 'https://github.com/Oka-'}
%i.fa.fa-github
%a.plate{:href => 'http://stackoverflow.com/users/2505965/oka'}
@gogl92
gogl92 / gist:88254e60cd4bc24091c71d08dd3261cb
Created December 31, 2017 20:20 — forked from johnballantyne/gist:4089627
GetMultiCellHeight() script for FPDF
function GetMultiCellHeight($w, $h, $txt, $border=null, $align='J') {
// Calculate MultiCell with automatic or explicit line breaks height
// $border is un-used, but I kept it in the parameters to keep the call
// to this function consistent with MultiCell()
$cw = &$this->CurrentFont['cw'];
if($w==0)
$w = $this->w-$this->rMargin-$this->x;
$wmax = ($w-2*$this->cMargin)*1000/$this->FontSize;
$s = str_replace("\r",'',$txt);
$nb = strlen($s);