Skip to content

Instantly share code, notes, and snippets.

View av01d's full-sized avatar

Arjan Haverkamp av01d

View GitHub Profile
@av01d
av01d / file2bitmap.js
Created July 23, 2020 07:46
File to Bitmap (on canvas)
/* HTML:
<input type="file" id="filepicker">
<canvas id="outCanvas"></canvas>
*/
filepicker.addEventListener("change", () => {
createImageBitmap(filepicker.files[0])
.then(response => {
outCanvas.width = response.width;
outCanvas.height = response.height;
@av01d
av01d / jquery.draggable.js
Last active July 23, 2020 14:26
Super simple jQuery plugin for making DOM elements draggable. Touch compatible.
// Plugin: jQuery.draggable
// Author: Arjan Haverkamp - webgear.nl
// Version: 1.0
// Date: 2019-01-30
(function($) {
$.fn.draggable = function(options) {
var $document = $(document), settings = $.extend({
// These are the defaults.