Skip to content

Instantly share code, notes, and snippets.

@jakobmattsson
Created May 29, 2011 15:15
Show Gist options
  • Save jakobmattsson/997850 to your computer and use it in GitHub Desktop.
Save jakobmattsson/997850 to your computer and use it in GitHub Desktop.
(function(c){var a={};var b=function(d,e,f){if(a[d]){fn=a[d]}else{if(typeof e=="undefined"){return false}fn=a[d]=new Function("obj",'var p=[],print=function(){p.push.apply(p,arguments);};with(obj){p.push("'+e.replace(/[\r\t\n]/g," ").replace(/\"/g,'\\"').split("<%").join("\t").replace(/((^|%>)[^\t]*)/g,"$1\r").replace(/\t=(.*?)%>/g,'",$1,"').split("\t").join('");').split("%>").join('p.push("').split("\r").join("")+"\");}return p.join('');")}if(typeof f!="undefined"){return fn(f)}else{return fn}};Sammy=Sammy||{};Sammy.Template=function(f,d){var e=function(h,i,g){if(typeof g=="undefined"){g=h}return b(g,h,c.extend({},this,i))};if(!d){d="template"}f.helper(d,e)}})(jQuery);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment