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 sys = require('sys'), | |
http = require('http'); | |
http.createServer(function(req, res) { | |
res.writeHead(200, {'Content-Type': 'text/html'}); | |
res.write('<p>Hello World</p>'); | |
res.end(); | |
}).listen(8080); |
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
$.get('ajax/test.html', function(data) { | |
$('.result').html(data); | |
alert('Load was performed.'); | |
}); |
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 fs = require('fs'); | |
fs.readdir('.', function (err, files) { | |
if (err) throw err; | |
for (var index in files) { | |
console.log(files[index]); | |
} | |
}); |
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 PI = Math.PI; | |
exports.area = function (r) { | |
return PI * r * r; | |
}; | |
exports.circumference = function (r) { | |
return 2 * PI * r; | |
}; |
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
// Routes | |
// General routes | |
app.all( '/remote(/*)?', Security.simple_auth ); | |
app.all( '/presenter(/*)?', Security.simple_auth ); | |
// General User | |
app.get( '/', function( req, res ) { | |
res.render( 'presentation/node', { | |
title: 'Node - PEEEYYYAAAAAHHH' | |
}); |
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 circle = require( './maths' ) | |
var area = circle.area( 4 ); | |
var circumference = circle.circumference( 4 ); |
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
define([ | |
"namespace", | |
// Libs | |
"use!jquery", | |
"use!backbone" | |
// Modules | |
// Plugins | |
], | |
function( namespace, $, Backbone ) { |
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
.pulse, .btn:hover { | |
-webkit-animation-name: tada; | |
-moz-animation-name: tada; | |
-o-animation-name: tada; | |
animation-name: tada; | |
} | |
.tada, .btn:active { | |
-webkit-animation-name: tada; | |
-moz-animation-name: tada; |
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 net = require('net'), server, s; | |
// socket events | |
s = { | |
onStart: function(){ | |
console.log('server started') | |
}, | |
onClientConnect: function(conn){ |
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
#!/usr/bin/env node | |
// | |
// BeautifulFaces.js | |
// https://gist.github.com/joelongstreet/5052198 | |
// | |
// Dependencies: | |
// imagesnap (npm install -g imagesnap) | |
// Description: | |
// Save this script as a post-commit hook to snap a photo of yourself and | |
// save it with your commit message |
OlderNewer