Skip to content

Instantly share code, notes, and snippets.

View aercolino's full-sized avatar

Andrea Ercolino aercolino

View GitHub Profile
@aercolino
aercolino / $.proxyGet.js
Last active August 29, 2015 14:02
A jQuery plugin for accessing any URL, using YQL or another proxy.
$.proxyGet = function ( url, callback, options ) {
// reject anything that doesn't resemble a "plain" URL or a null (see below)
if (! (url === null || /^(https?:|\/\/)/.test(url))) {
throw new SyntaxError('Expected a URL.');
}
// allow detection of current SSL mode by starting the url with '//'
if (url && url.indexOf('//') === 0) {
url = window.location.protocol + url;
@aercolino
aercolino / gist:5301378
Created April 3, 2013 13:53
Shuffle option added to the Flickr Feed plugin.
//...
'date_format' => get_option('date_format'),
'count' => 10,
'shuffle' => 0,
'sort' => null,
//...
else
return garees_flickr_feed_error("please enter your flickr-api-key in the settings!");
$amount = $shuffle >= $count ? $shuffle : $count;