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
(function($){ | |
$.fn.writeFrom = function(callback){ | |
var $that = this; | |
setTimeout(function(){ | |
document.write = function(){ | |
try{ | |
$.fn.append.apply($that, arguments); | |
}catch(e){ | |
console.log('INVALID APPEND', e.message); | |
}; |
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 connect = require("connect"); | |
var server = require("serve-static"); | |
var app = connect(); | |
app.use(server(__dirname + '/public')); | |
app.listen(8000); |
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 path = require("path"); | |
var fs = require("fs"); | |
var extensions = { | |
".html":"text/html", | |
".css":"text/css", | |
".js":"text/javascript", | |
".png":"image/png", | |
".gif":"image/gif", | |
".jpg":"image/jpeg", |
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 connect = require("connect"); | |
var server = require("serve-static"); | |
var router = require("connect-route"); | |
var app = connect(); | |
app.use(router(route)); | |
app.use(server(__dirname + '/public')); |
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 connect = require("connect"); | |
var server = require("serve-static"); | |
var router = require("connect-route"); | |
var io = require("socket.io").listen(1337); | |
var app = connect(); | |
app.use(router(route)); | |
app.use(server(__dirname + '/public')); |
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
<html> | |
<body> | |
<h1>Socket.io Test!!! :)</h1> | |
<form id="myForm"> | |
<input id="firstname" type="text"> | |
<input id="lastname" type="text"> | |
<input id="submit" type="submit"> | |
</form> | |
<script src="http://localhost:1337/socket.io/socket.io.js"></script> | |
<script> |
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 connect = require("connect"); | |
var server = require("serve-static"); | |
var router = require("connect-route"); | |
var qs = require("querystring"); | |
var path = require("path"); | |
var fs = require("fs"); | |
var mustache = require("mustache"); | |
var app = connect(); |
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
<!doctype html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>Node.js template test with mustache</title> | |
</head> | |
<body> | |
<h1>Enter your information</h1> | |
<form action="/tmpl/:myTemplate.html" method="POST"> | |
<label>First Name: <input name="firstname" type="text" value="{{firstname}}"></label> |
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
(function(){ | |
var words={}, | |
html = "", | |
writer = function(inx,ele){ | |
html += (inx > 0 ? "<h"+inx+">"+ele+"</h"+inx+">" : "<span>"+ele+"</span>"); | |
}; | |
document.body.textContent.split(" ") | |
.filter(function(ele){ return !/\d/.test(ele) && ele.length > 3 }) | |
.map(function(ele){ |
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 cache = require("./cache-service"); | |
var http = require("./http-monitor"); | |
var NOT_READY = { statusCode:202, data:"" }; | |
function doRequest(serviceID, httpReq, serviceResults){ | |
var httpRes = { //overrides httpRes.json() dispatches data without blocking the browser | |
json:function(statusCode, data){ | |
if (arguments.length === 1){ | |
data = statusCode; |
OlderNewer