Skip to content

Instantly share code, notes, and snippets.

View andrejpavlovic's full-sized avatar

Andrej Pavlovic andrejpavlovic

View GitHub Profile
#!/bin/bash
# for more info @see http://www.pokret.org/2017/02/how-to-build-and-install-subversion-on-shared-hosting/
set -e # exit on error
set -x # echo on
MYPREFIX=$HOME/apps # Target build directory
MYSRC=$HOME/src # Target directory for storing source files
# Ensure directories are created
mkdir -p $MYPREFIX $MYSRC
@andrejpavlovic
andrejpavlovic / renderImagesFromFrames.js
Created October 3, 2018 23:55
Sample conversion of gifuct-js frames to <img> elements.
function renderImagesFromFrames(frames, width, height) {
// gif patch canvas
const tempCanvas = document.createElement('canvas');
const tempCtx = tempCanvas.getContext('2d');
// full gif canvas
const gifCanvas = document.createElement('canvas');
gifCanvas.width = width || frames[0].dims.width;
gifCanvas.height = height || frames[0].dims.height;
const gifCtx = gifCanvas.getContext('2d');