Skip to content

Instantly share code, notes, and snippets.

View aosteraas's full-sized avatar

Aaron Osteraas aosteraas

  • Melbourne, Australia
View GitHub Profile
@torgeir
torgeir / react-scaled-file-upload.js
Created March 25, 2015 12:16
React scaled file upload
function resize (file, maxWidth, maxHeight, fn) {
var reader = new FileReader();
reader.readAsDataURL(file);
reader.onload = function (event) {
var dataUrl = event.target.result;
var image = new Image();
image.src = dataUrl;
image.onload = function () {
@mauryaratan
mauryaratan / htaccess-tweaks
Created May 7, 2012 13:43
htaccess Gzip Compression and expires to speed up page load time
<IfModule mod_deflate.c>
#The following line is enough for .js and .css
AddOutputFilter DEFLATE js css
AddOutputFilterByType DEFLATE text/plain text/xml application/xhtml+xml text/css application/xml application/rss+xml application/atom_xml application/x-javascript application/x-httpd-php application/x-httpd-fastphp text/html
#The following lines are to avoid bugs with some browsers
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
</IfModule>