Skip to content

Instantly share code, notes, and snippets.

View lovrin's full-sized avatar

Brian Lovrin lovrin

View GitHub Profile
@lovrin
lovrin / gist:28eaa24f3f5ac46f5db0
Last active August 29, 2015 14:16
In-browser image resize and upload
var createAndUploadThumbnailImg = function (fileObj) { // i.e., <input type=file>
console.log('making thumbnail for...');
console.log(fileObj);
var reader = new FileReader();
reader.onload = function (e) {
// create canvas obj (<canvas>, not added to DOM)
// then give it a reference the URL (not on server; on page) made available by FileReader.readAsDataURL()
// then use canvas to draw that image at smaller dimensions, effectively copying and resizing it
@lovrin
lovrin / gist:11168092
Created April 22, 2014 07:08
keybase.io identity proof
### Keybase proof
I hereby claim:
* I am lovrin on github.
* I am lovrin (https://keybase.io/lovrin) on keybase.
* I have a public key whose fingerprint is 496B 9893 B20B 3F15 E10F C6D8 74DD 1072 0CC5 AEAE
To claim this, I am signing this object: