Skip to content

Instantly share code, notes, and snippets.

View voodootikigod's full-sized avatar
🚀
Changing the world

Chris Williams voodootikigod

🚀
Changing the world
View GitHub Profile
http://fluentconf.com/fluent2014
http://2013.jsconf.us/
http://cssconf.com/
http://events.jquery.org/2013/austin/
http://backboneconf.com/
http://www.ng-conf.org/
http://aneventapart.com/
http://2013.cascadiajs.com/
http://2013.texasjavascript.com/
http://edgeconf.com/2013-nyc/live.html
var template = "<div><h3><a>{{Title}}</a></h3><div id='{{Title}}'><ul>{{#items}}<li><a href='{{href]}}'>{{title}}</a><li>{{/items}}</ul></div>";
//.href doesn't work, not sure how to access the members of {{.}} in the enumerable section.
var tutorials = { Title: "Tutorials", items: [ {href: "http://foo", title: "foo"},{href:"http://bar", title: "bar"}];
Mustache.to_html(template, tutorials);
/*
should output
<div><h3><a>Tutorials</a></h3><div id='Tutorials'><ul><li><a href='http://foo'>foo</a><li><li><a href='http://bar'>bar</a><li></ul></div>
(define (print x)
(cond ((= (remainder x 15) 0) 'fizzbuzz)
((= (remainder x 3) 0) 'fizz)
((= (remainder x 5) 0) 'buzz)
(else x)))
(define (makelist n)
(if (= n 101)
'()
(cons (print n)
(makelist (+ n 1)))))
%% ``The contents of this file are subject to the Erlang Public License,
%% Version 1.1, (the "License"); you may not use this file except in
%% compliance with the License. You should have received a copy of the
%% Erlang Public License along with this software. If not, it can be
%% retrieved via the world wide web at http://www.erlang.org/.
%%
%% Software distributed under the License is distributed on an "AS IS"
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
%% the License for the specific language governing rights and limitations
%% under the License.