Let Google cache and resize your images.
Resized and Cached:
Original:
// http://paulirish.com/2011/requestanimationframe-for-smart-animating/ | |
// http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating | |
// requestAnimationFrame polyfill by Erik Möller | |
// fixes from Paul Irish and Tino Zijdel | |
(function() { | |
var lastTime = 0; | |
var vendors = ['ms', 'moz', 'webkit', 'o']; | |
for(var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) { |
var http = require("http"); | |
/* | |
add following to your hosts config to test: | |
10.11.12.8 www.vhost1.net | |
10.11.12.8 www.vhost2.com | |
10.11.12.8 www.vhost3.test.com | |
10.11.12.8 static.vhost1.net |
// Based on ICanHaz (http://github.com/andyet/ICanHaz.js/blob/master/ICanHaz.js) | |
// This version supports Mustache and Handlebars | |
// By M@ McCray | |
;var render = (function($, engine){ | |
var cache = {}, | |
methods = {}; | |
$(function(){ | |
$('script[type="text/html"]').each(function () { | |
var name = $(this).attr('id'), |
Let Google cache and resize your images.
Resized and Cached:
Original:
// url_to_drive.gs | |
// Google Apps Script | |
// Allows uploading a URL directly to Google Drive. | |
// | |
// Live link: | |
// https://script.google.com/macros/s/AKfycbzvhbHS4hnWPVBDHjQzZHA0qWq0GR-6hY7TbYsNto6hZ0MeAFZt/exec | |
// | |
// Source-code: | |
// https://gist.github.com/denilsonsa/8134679 | |
// https://script.google.com/d/1Ye-OEn1bDPcmeKSe4gb0YSK83RPMc4sZJt79SRt-GRY653gm2qVUptoE/edit |
This is an extension of DJ Adams' excellent SheetAsJSON Google Apps Script, which provides a way to GET a published Google Spreadsheet as a JSON feed. This version allows generic filtering for terms, more specific control over which rows to parse, and correct MIME type for JSONP output.
The following parameters are required for the script to work.
https://script.google.com/macros/s/AKfycbzGvKKUIaqsMuCj7-A2YRhR-f7GZjl4kSxSN1YyLkS01_CfiyE/exec?
+ id=<spreadsheet key>
+ sheet=<sheet name on spreadsheet>
function upload(file) { | |
var imageLink =""; | |
/* Is the file an image? */ | |
if (!file || !file.type.match(/image.*/)) return; | |
var fd = new FormData(); | |
fd.append("image", file); // Append the file | |
fd.append("key", "<Imgur API key>"); |
function get_avatar_from_service(service, userid, size) { | |
// this return the url that redirects to the according user image/avatar/profile picture | |
// implemented services: google profiles, facebook, gravatar, twitter, tumblr, default fallback | |
// for google use get_avatar_from_service('google', profile-name or user-id , size-in-px ) | |
// for facebook use get_avatar_from_service('facebook', vanity url or user-id , size-in-px or size-as-word ) | |
// for gravatar use get_avatar_from_service('gravatar', md5 hash email@adress, size-in-px ) | |
// for twitter use get_avatar_from_service('twitter', username, size-in-px or size-as-word ) | |
// for tumblr use get_avatar_from_service('tumblr', blog-url, size-in-px ) | |
// everything else will go to the fallback | |
// google and gravatar scale the avatar to any site, others will guided to the next best version |