How do I execute ruby template files (ERB) without a web server from command line?

You should have everything you need in your ruby/bin directory. On my (WinXP, Ruby 1.8.6) system, I have ruby/bin/erb.bat erb.bat [switches] [inputfile] -x print ruby script -n print ruby script with line number -v enable verbose mode -d set $DEBUG to true -r [library] load a library -K [kcode] specify KANJI code-set -S [safe_level] set … Read more

What are the differences between the express-handlebars, express-hbs and hbs modules,

Looks like the comment above needs to be updated a bit. Updated list is here: Express-handlebars Seems to be the most popular package at the moment. There is live chat on gitter. Dependencies are up-to date and current npm version is 3.0.0. Last update 29 days ago (at the moment of this post) One important … Read more

Check if value in array in angular template?

You can use indexOf() to test whether a value is in an array and then use it inside your ngClass like this (to conditionally add “newclass”): <div ng-class=”{‘newclass’:([1,2,5].indexOf(2) > -1)}”>Yay</div> Or more likely you’ll want to test against an array on your scope: <div ng-class=”{‘newclass’:(tarray.indexOf(1) > -1)}”>Yay</div> Assuming, for instance, you have declared tarray in … Read more

Mako or Jinja2? [closed]

I personally prefer Jinja2’s syntax over Mako’s. Take this example from the Mako website <%inherit file=”base.html”/> <% rows = [[v for v in range(0,10)] for row in range(0,10)] %> <table> % for row in rows: ${makerow(row)} % endfor </table> <%def name=”makerow(row)”> <tr> % for name in row: <td>${name}</td>\ % endfor </tr> </%def> There are so … Read more

Handlebars Template rendering template as text

I assume that unescaping in Handlebars works the same as in vanilla Mustache. In that case use triple mustaches to unescape html, i,e: {{{unescapedhtml}}}, like: <script id=”quiz-result” type=”text/x-handlebars-template”> {{#each rounds}} {{{round_end_result}}} {{/each}} <div class=”clear”></div> for ref see: http://mustache.github.com/mustache.5.html

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)