This file contains hidden or 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
"use strict"; | |
var User = require('./User.js').User; | |
var Message = require('./Message.js').Message; | |
var PrivateMessage = require('./Message.js').PrivateMessage; | |
var Command = require('./Message.js').Command; | |
var SessionHandler = require('./SessionHandler.js').SessionHandler; | |
module.exports.ChatServer = function (port, debug) { | |
var http = require('http'); | |
var qs = require('querystring'); |
This file contains hidden or 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
module.exports.Session = function () { | |
var getRandom = function () { | |
return Math.floor(Math.random() * 1e16).toString(36); | |
} | |
this.sessionId = getRandom() + '-' + new Date().getTime().toString(36) + '-' + getRandom(); | |
this.doDestroy = false; | |
this.toString = function () { | |
return this.sessionId; |
This file contains hidden or 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
/* | |
* A minimalistic http server for serving static files with Node.js. | |
* Don't use this in a production enviroment, this http server is not fast or secure! | |
* | |
* Autor: Guido Krömer <[email protected]> | |
* Page: www.cacodaemon.de | |
* Date: 2012-11-07 | |
*/ | |
module.exports.MiniHttp = function (path, port, ip, indexPage) { | |
var path = path; |
This file contains hidden or 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
module.exports.Client = function (name, socket) { | |
this.name = name | |
this.socket = socket | |
this.send = function (msg) { | |
this.socket.send(msg) | |
} | |
this.toString = function (msg) { | |
return this.name |
This file contains hidden or 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
#!/bin/bash | |
for num in {1..1000}; do | |
netcat localhost 1337 & | |
done |
This file contains hidden or 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'); | |
function Clients () { | |
var clients = new Array() | |
var clientCounter = 0 | |
var Client = function (socket, name) { | |
this.send = function(msg) { | |
this.socket.write(msg + '\n') | |
} |
This file contains hidden or 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
<%@ Page Title="" Language="C#" MasterPageFile="/Views/Shared/Site.master" Inherits="System.Web.Mvc.ViewPage<MongoDB.Driver.MongoCursor>" %> | |
<asp:Content ID="Content" ContentPlaceHolderID="MainContent" runat="server"> | |
<% foreach (Blog.Article article in this.ViewData.Model) { %> | |
<article> | |
<h2><a href="<%= Url.Action("ShowArticle", "Blog", new RouteValueDictionary(new { id = article.Id })) %>"><%= article.Title %></a></h2> | |
<span><%= article.Date %></span> | |
<p><%= article.Text %></p> | |
<p></p> | |
<% if (article.Comments == null) { %> | |
<p>Comments: <a href="<%= Url.Action("ShowArticle", "Blog", new RouteValueDictionary(new { id = article.Id })) %>#comments">[0]</a></p> |
This file contains hidden or 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 lang="en"> | |
<head> | |
<meta charset="utf-8" /> | |
<title>MVC Test Blog</title> | |
</head> | |
<body> | |
<header> | |
<h1>MVC Test Blog</h1> | |
</header> |
This file contains hidden or 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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Web; | |
using System.Web.Mvc; | |
using System.Web.Mvc.Ajax; | |
using System.Web.Routing; | |
using MongoDB.Driver; | |
using MongoDB.Bson; |
This file contains hidden or 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 | |
class BlogController extends Zend_Controller_Action | |
{ | |
public function indexAction() | |
{ | |
try { | |
$model = new Application_Model_Article; | |
$this->view->articles = $model->fetchAll(); | |
} |