Skip to content

Instantly share code, notes, and snippets.

@hermantolim
hermantolim / quantize.js
Created January 9, 2023 00:39 — forked from nrabinowitz/quantize.js
Javascript module for color quantization, based on Leptonica
/*!
* quantize.js Copyright 2008 Nick Rabinowitz.
* Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php
*/
// fill out a couple protovis dependencies
/*!
* Block below copied from Protovis: http://mbostock.github.com/protovis/
* Copyright 2010 Stanford Visualization Group
* Licensed under the BSD License: http://www.opensource.org/licenses/bsd-license.php
@hermantolim
hermantolim / QR Code Scanner
Created March 22, 2022 12:50 — forked from DeadlySystem/QR Code Scanner
This is code that provides an interface to let you select the camera to be used with jsqrcode ( https://github.com/LazarSoft/jsqrcode ). To make it work, you will have to include said library and have elements with the IDs in the loadCommonHTMLElements method on your page. You may want to provide appropriate styling as well. This source code is …
"use strict";
define(["require", "exports"], function (require, exports) {
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Browser compatibility definitions
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
navigator.getUserMedia = navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia;
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Private state
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
var qrcodescanner = null;