Skip to content

Instantly share code, notes, and snippets.

View franzenzenhofer's full-sized avatar

Franz Enzenhofer franzenzenhofer

  • http://www.fullstackoptimization.com/
  • Vienna, Austria
View GitHub Profile
@franzenzenhofer
franzenzenhofer / get_barcode_from_image.js
Created September 2, 2012 16:00 — forked from tdegrunt/get_barcode_from_image.js
Barcode recognition with JavaScript - Demo: http://bit.ly/djvUoy
/*
* Copyright (c) 2010 Tobias Schneider
* This script is freely distributable under the terms of the MIT license.
*/
(function(){
var UPC_SET = {
"3211": '0',
"2221": '1',
"2122": '2',
@franzenzenhofer
franzenzenhofer / gist:1881270
Created February 22, 2012 04:10 — forked from endtwist/gist:1630834
Paste event in Google Chrome
$( 'body' ).bind( 'paste', function( evt ) {
var items = evt.originalEvent.clipboardData.items
, paste;
// Items have a "kind" (string, file) and a MIME type
console.log( 'First item "kind":', items[0].kind );
console.log( 'First item MIME type:', items[0].type );
// If a user pastes image data, there are 2 items: the file name (at index 0) and the file (at index 1)
// but if the user pastes plain text or HTML, index 0 is the data with markup and index 1 is the plain, unadorned text.