Skip to content

Instantly share code, notes, and snippets.

@stanpalatnik
stanpalatnik / gist:2287475
Created April 2, 2012 21:49
csrf example
<form id="form" name="form" method="post" action="/signin">
<h1>Sign-in form</h1>
<div><label>Username
</label>
<input type="text" name="user[username]" class="required" id="username"/></div>
<div>
<input type="password" name="user[password]" class="required" id="password"/></div>
@stanpalatnik
stanpalatnik / index.html
Created March 3, 2012 22:56
Dust.js Client side
<html>
<head>
<script src="dust-full-0.3.0.min.js"></script>
<script type="text/javascript">
//example showing client-side compiling and rendering
var compiled = dust.compile("Hello {name}!", "index");
dust.loadSource(compiled);
dust.render("index", {name: "David"}, function(err, out) {
if(err != null)
@stanpalatnik
stanpalatnik / index.html
Created March 3, 2012 22:40
Dust.js Client side
<html>
<head>
<script src="dust-full-0.3.0.min.js"></script>
<script type="text/javascript">
//example showing client-side compiling and rendering
var compiled = dust.compile("Hello {name}!", "index");
dust.loadSource(compiled);
dust.render("index", {name: "David"}, function(err, out) {
if(err!= null)
{?username}
{username}
{:else}
Please Log-In!
@stanpalatnik
stanpalatnik / app.js
Created March 3, 2012 21:28
Setting up Dust.js
// Module dependencies.
var express = require('express')
, routes = require('./routes')
, http = require('http')
, fs = require('fs')
, path = require('path')
, cons = require('consolidate')
var app = express();
@stanpalatnik
stanpalatnik / gist:1967577
Created March 3, 2012 19:08
Index source
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>{+title}7th-Degree{/title}</title>
<script type="text/javascript" src='/javascripts/utils.js'></script>
<link rel="stylesheet" type="text/css" href="/stylesheets/style.css">
{+http_header/}
</head>
<body>
<div id="wrapper">