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
// Helps with this problem: | |
// http://stackoverflow.com/questions/8059914/express-js-hbs-module-register-partials-from-hbs-file | |
var hbs = require('hbs'); | |
var fs = require('fs'); | |
var partialsDir = __dirname + '/../views/partials'; | |
var filenames = fs.readdirSync(partialsDir); |
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
.PHONY: compile | |
time=/usr/bin/time | |
compile: dart typescript coffeescript haxe jsx | |
dart: | |
$(time) dart2js -ooutput/dart.js source/simple.dart | |
typescript: |
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
(function (doT) { | |
var templates = {}; | |
var scripts = Array.prototype.slice.call(document.getElementsByTagName('script')); // load all scripts | |
for (var i = 0; i < scripts.length; i++) { // filter out template script tags | |
var script = scripts[i]; | |
if (script.type == "text/dot-template") { | |
var name = script.id || script.getAttribute('name') || script.getAttribute('data-name'); | |
templates[name] = script.innerHTML; // store template for later use | |
script.parentNode.removeChild(script); // remove template from DOM | |
} |