Skip to content

Instantly share code, notes, and snippets.

View moro-programmer's full-sized avatar

moro-programmer moro-programmer

View GitHub Profile
@moro-programmer
moro-programmer / blob2img
Created February 7, 2014 13:22
blob to img
socket.onmessage = function(event) { if (event.data instanceof Blob) { // 1. Get the raw data. var blob = event.data; // 2. Create a new URL for the blob object. window.URL = window.URL || window.webkitURL; var source = window.URL.createObjectURL(blob); // 3. Create an image tag programmatically. var image = document.createElement("img"); image.src = source; image.alt = "Image generated from blob"; // 4. Insert the new image at the end of the document. document.body.appendChild(image); }
@moro-programmer
moro-programmer / dabblet.css
Created December 1, 2013 17:49
The first commented line is your dabblet’s title
/**
* The first commented line is your dabblet’s title
*/
background: #f06;
background: linear-gradient(45deg, #f06, yellow);
min-height: 100%;