Skip to content

Instantly share code, notes, and snippets.

@ric03uec
ric03uec / htmlform.html
Created January 27, 2012 11:21
html form
<html>
<body>
<form name="input" action="/submit/form" method="post">
First name: <input type="text" name="FirstName" /><br />
Last name: <input type="text" name="LastName" /><br />
Password : <input type="password" name="password"/><br />
<input type="submit" value="Submit" />
</form>
@ric03uec
ric03uec / jadeform.jade
Created January 27, 2012 11:32
jade form
html
body
form(name="input", action="/submit/form", method="post")
input(type="text", name="FirstName") First Name
input(type="text", name="LastName") Last Name
input(type="password", name="password") Password
input(type="submit", value="submit")
@ric03uec
ric03uec / topbar.jade
Created January 27, 2012 12:36
nodeblox topbar code
div.topbar
div.fill
div.container
a.brand(href='#') #{title}
ul.nav
li.active
a(href='#') Home
li
a(href='#about') About
li
@ric03uec
ric03uec / layout.jade
Created January 27, 2012 12:43
layout.jade
!!!
html
head
title= title
link(rel='stylesheet', href='/lib/bootstrap/bootstrap.min.css')
link(rel='stylesheet', href='/stylesheets/custom.css')
body!= body
@ric03uec
ric03uec / body.jade
Created January 27, 2012 12:46
body content
div.container
div.content
div.page-header
h1 Main Page
small Welcome to #{title}
div.row
div.span10
h2 Page Content
div.span4
h3 Secondary Content
@ric03uec
ric03uec / inde.jade
Created February 21, 2012 18:11
index.jade after removing layout
body
include topbar
div.container
div.content
div.page-header
h1 Main Page
small Welcome to #{title}
div.row-fluid
div.span9
div.hero-unit
@ric03uec
ric03uec / signupModalJs.js
Created February 26, 2012 19:40
modal example js component
$('#signup-modal').modal({
backdrop:'static',
keyboard: 'true'
});
$('#signup-modal').modal('toggle');
@ric03uec
ric03uec / index.jade
Created February 26, 2012 20:03
index.jade includes
!!!
html
head
title= title
link(rel='stylesheet', href='/stylesheets/bootstrap/bootstrap.min.css')
link(rel='stylesheet', href='/stylesheets/bootstrap/bootstrap-responsive.min.css')
link(rel='stylesheet', href='/stylesheets/custom.css')
script(type='text/javascript', src='/js/lib/jquery/jquery-1.7.1.js')
script(type='text/javascript', src='/js/lib/bootstrap/bootstrap-modal.js')
@ric03uec
ric03uec / login.js
Created March 30, 2012 15:09
login route handler
app.post('/login', function(req, res){
logger.log('Serving request for url [POST] ' + req.route.path);
var username = req.body.User;
var password = req.body.Password;
/**
* The following can be replaced by any other form
* of authentication
*/
User.validateUser(username, password, function(err, user){
@ric03uec
ric03uec / usersession.js
Created March 30, 2012 15:24
setting user in session
req.session.user = user;