Skip to content

Instantly share code, notes, and snippets.

View palermomarco's full-sized avatar

Marco Palermo palermomarco

View GitHub Profile
@palermomarco
palermomarco / wordpress debug functions
Created August 5, 2014 10:44
I use this functions to help me debugging wordpress
/* debug functions */
error_reporting(E_ALL);
ini_set("display_errors", 1);
function debug_wp_rewrite_rules() {
global $wp_rewrite;
echo '<div>';
if (!empty($wp_rewrite->rules)) {

About

This class allows you to preload all of your images, sounds, videos, JSON, JavaScript and CSS files with one call. It provides you with progress reports and lets you know when everything is done.

It requires MooTools and MooTools More with the Assets and Request.JSONP boxes ticked. I have attached a copy of the required MooTools More version to this gist.

Example

You can find an example here on jsFiddle.

@palermomarco
palermomarco / jsonp.js
Created August 23, 2012 18:13 — forked from tobie/jsonp.js
/* jsonp.js for Protototype
*
* Copyright (c) 2009 Tobie Langel (http://tobielangel.com)
*
* jsonp.js is freely distributable under the terms of an MIT-style license.
*--------------------------------------------------------------------------
Requires: Prototype >= 1.6
Usage:
new Ajax.JSONRequest('http://api.flickr.com/services/feeds/photos_public.gne', {
onComplete: function(json) {
@palermomarco
palermomarco / JSON-P for Prototype.js
Created August 23, 2012 16:55 — forked from dandean/JSON-P for Prototype.js
JSONP for PrototypeJS
// See an updated version of this in it's own git repo:
// http://github.com/dandean/Ajax.JSONRequest
/* JSON-P implementation for Prototype.js somewhat by Dan Dean (http://www.dandean.com)
*
* *HEAVILY* based on Tobie Langel's version: http://gist.github.com/145466.
* Might as well just call this an iteration.
*
* This version introduces:
* - onCreate and onFailure callback options.