Skip to content

Instantly share code, notes, and snippets.

@bonsi
bonsi / gist:28faa641acd6135d26dc
Created November 26, 2015 15:58 — forked from adamjimenez/gist:5917897
Generate thumbnails from video files using HTML5's video tag and canvas
<?php
//where you want your thumbnails to go
$thumbs_dir = 'uploads/thumbs/';
//this should be an array of video paths
$videos = array();
if( $_POST["name"] ){
// Grab the MIME type and the data with a regex for convenience
if (!preg_match('/data:([^;]*);base64,(.*)/', $_POST['data'], $matches)) {
@bonsi
bonsi / Git push deployment in 7 easy steps.md
Created October 26, 2015 10:16 — forked from thomasfr/Git push deployment in 7 easy steps.md
7 easy steps to automated git push deployments. With small and configurable bash only post-receive hook