Skip to content

Instantly share code, notes, and snippets.

@madrobby
Created March 9, 2011 14:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save madrobby/862250 to your computer and use it in GitHub Desktop.
Save madrobby/862250 to your computer and use it in GitHub Desktop.
function t(s,d){
for(var p in d)
s=s.replace(new RegExp('{'+p+'}','g'),typeof d[p][1]=='f'?d[p]():d[p]);
return s;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment