Skip to content

Instantly share code, notes, and snippets.

View rodrigocnascimento's full-sized avatar
🐯
i'm a turtle

Rodrigo Nascimento rodrigocnascimento

🐯
i'm a turtle
View GitHub Profile

Basics

Creating a new PHPExcel Object.

    $this->PHPExcel = new PHPExcel();

Working with sheets

Creating a new sheet:

/*****************************************************************************
* __ __ _ _ ___ _
* \ \/ _\ /\/\ (_)_ __ | |_ _ _ / __\ __ ___ ___| |__
* \ \ \ / \| | '_ \| __| | | | / _\| '__/ _ \/ __| '_ \
* /\_/ /\ \ / /\/\ \ | | | | |_| |_| | / / | | | __/\__ \ | | |
* \___/\__/ \/ \/_|_| |_|\__|\__, | \/ |_| \___||___/_| |_|
* |___/
*
* Identifying and Eliminating Code Smells
*
function imageToBase64(URL) {
var imagem = new Image();
imagem.src = URL;
imagem.onload = function () {
var canvas = document.createElement("canvas");
canvas.width = this.width;
canvas.height = this.height;
var cvx = canvas.getContext("2d");
cvx.drawImage(this, 0, 0);
var dataURL = canvas.toDataURL("image/png");