Skip to content

Instantly share code, notes, and snippets.

### Keybase proof
I hereby claim:
* I am pmav on github.
* I am pmav (https://keybase.io/pmav) on keybase.
* I have a public key whose fingerprint is 4CD3 65BD A558 6C15 4258 2322 5442 2E83 2517 AC59
To claim this, I am signing this object:
@pmav
pmav / gist:5941693
Created July 6, 2013 23:48
Uploading to imgur API from Javascript canvas
function upload() {
var img = document.getElementById("avatar").toDataURL("image/png").split(',')[1];
$.ajax({
url: 'https://api.imgur.com/3/image',
type: 'POST',
headers: { "Authorization": "Client-ID ***YOUR CLIENT ID***" },
dataType: 'json',
data: {
image: img
@pmav
pmav / javascript-webworkers-v1.3.1.js
Created October 17, 2009 16:03
Firefox web workers example
/**
* Firefox Web Workers Example v1.3.1
*
* http://pmav.eu/stuff/javascript-webworkers
*
* This example uses N Web Workers for generating LCG pseudorandom numbers, each Worker starts a new stream.
*
* pmav, 2009-2010
*/
(function () {