Skip to content

Instantly share code, notes, and snippets.

View BunHouth's full-sized avatar
🎯
Focusing

Bunhouth BunHouth

🎯
Focusing
  • Remote Work
  • Phnom Penh
  • 07:01 (UTC +07:00)
  • X @bunhouth
View GitHub Profile
// transform cropper dataURI output to a Blob which Dropzone accepts
function dataURItoBlob(dataURI) {
var byteString = atob(dataURI.split(',')[1]);
var ab = new ArrayBuffer(byteString.length);
var ia = new Uint8Array(ab);
for (var i = 0; i < byteString.length; i++) {
ia[i] = byteString.charCodeAt(i);
}
return new Blob([ab], { type: 'image/jpeg' });
}
<!doctype html>
<html>
<head>
<meta name="viewport" content="width=device-width">
<script type="text/javascript" src="jquery-1.8.1.min.js"></script>
<script type="text/javascript" src="http://www.parsecdn.com/js/parse-1.0.23.min.js"></script>
<script>
var SightingObject;
var db;