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
Installation | |
Install it using npm: | |
npm install ab-trolley --save | |
Pass you base Express.js application to trolley. | |
var trolley = require('ab-trolley'); | |
trolley.use(app, '$', '/yourbackend') | |
Include the following locals in your template. Make sure you don't escape the values. |
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
// Main.jade | |
block vars | |
h1=hey | |
// child.jade | |
block vars | |
-var hey = 'oh, hi'; |
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
for sport in voetbal rugby handbal vollybal basket tchouckball hockey | |
.{sport} | |
background: url(/images/bg_{sport}.jpg |
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
var http = require('http'); | |
var express = require('express'); | |
var app = express(); | |
app.get('/my-form', function (req, res, next) { | |
var form_data = req.flash('form_data'); | |
res.locals.form_data = form_data; | |
var validation_errors = req.flash('validation_errors'); | |
res.locals.validation_errors = validation_errors; |
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
<?php | |
# WRITE TO FILE | |
function write_to_file ($file, $str) { |
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
var controllers = { | |
GrowsIndexCtrl: function ($scope, data) { | |
$scope.grows = data.grows.many(); // Returns an array | |
$scope.remove = function (grow) { | |
data.grows.remove(grow); // Deletes from that same array | |
}; | |
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
%lex | |
%% | |
\n+ { process.stdout.write('[ENDLINE(S)]\n'); return 'ENDLINE'; } | |
<<EOF>> { process.stdout.write('[EOF]'); return 'EOF'; } |
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
app.configure(function(){ | |
app.use(express.cookieParser()); | |
app.use(express.session({ secret: 'keyboard cat' })); | |
app.use(function (req, res, next) { res.locals.session = req.session; next();}); | |
app.set('views', __dirname + '/views'); | |
app.set('view engine', 'ejs'); | |
//app.use(express.logger()); | |
app.use(express.bodyParser()); |
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
include nodejs | |
package { 'serve': | |
ensure => latest, | |
provider => 'npm', | |
} |
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
<asp:GridView ID="GridView1" runat="server" AllowPaging="True" | |
AllowSorting="True" AutoGenerateColumns="False" DataKeyNames="CustomerID" | |
DataSourceID="SqlDataSource1"> | |
<Columns> | |
<asp:BoundField DataField="CustomerID" HeaderText="CustomerID" ReadOnly="True" | |
SortExpression="CustomerID" /> | |
<asp:BoundField DataField="CompanyName" HeaderText="CompanyName" | |
SortExpression="CompanyName" /> | |
<asp:BoundField DataField="ContactName" HeaderText="ContactName" | |
SortExpression="ContactName" /> |