Skip to content

Instantly share code, notes, and snippets.

View matteusbarbosa's full-sized avatar
🦜
Always learning

Matteus matteusbarbosa

🦜
Always learning
View GitHub Profile
@matteusbarbosa
matteusbarbosa / gist:028e44e67865d3e2e2e3664fa709d05d
Created April 25, 2021 18:38 — forked from benshimmin/gist:4088493
Scale to fit and centre-align an image with FPDF
<?php
/* Caveat: I'm not a PHP programmer, so this may or may
* not be the most idiomatic code...
*
* FPDF is a free PHP library for creating PDFs:
* http://www.fpdf.org/
*/
require("fpdf.php");
class PDF extends FPDF {
@matteusbarbosa
matteusbarbosa / img_resize.js
Created October 17, 2018 21:17 — forked from makevoid/img_resize.js
Resize Images with Canvas on the clientside
var settings = {
max_width: 600,
max_height: 200
}
resize_image = function(img){
var ctx = canvas.getContext("2d")
var canvasCopy = document.createElement("canvas")
var copyContext = canvasCopy.getContext("2d")