This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
setInterval(function(){jQuery.ajax('YOUR-URL-TO-THE-THEME-FILE',{cache:false}).success(function(html){var btn=jQuery("div[data-action='update_preview']").first();if(html!=ace.edit('editor').getValue()){ace.edit('editor').setValue(html);if(!btn.hasClass('disabled'))btn.click()}});},1000); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Hey! Just to let you know there is a much better version of this script that doesn't require jQuery here: | |
https://gist.github.com/edadams/5ce1ec3d0b1f69e80724af7eb3b606f4 | |
For posterity, and because this Gist got unexpectedly popular for a random code snippet, I will preserve the original below. Please do know that I've figured out a much better way to do this, which is above. | |
$(function(){ // shorthand document.ready() | |
$('.make_lightbox').each(function(){ // this is just an element I let them click, it carries a series of data- attributes. | |
$(this).on('click',function(){ // when clicked. this is the newer jQuery click() handler that's only in v1.8+ so that may be something to note. | |
var lbArray = []; // create blank array. | |
var arrayContents = {"width":$(this).data('width'), "height":$(this).data('height'), "low_res":$(this).data("lowres"), "high_res":$(this).data('highres')}; // make set of the data- attributes. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import itertools | |
import json | |
import logging | |
import sys | |
import time | |
import traceback | |
# oauth2 is available at https://github.com/simplegeo/python-oauth2 | |
import oauth2 |