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 qtd = process.argv[2] || 1; | |
for (var i = 0; i < qtd; i++) { | |
http.get({host:'zonetti.jit.su', port:80, path:'/', agent:false}, function(res){ | |
res.on('data', function(d){ | |
}).on('end', function(){ | |
console.log('respondeu ao cliente #'+i); | |
}); | |
}); | |
} |
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
<?php | |
class AppController extends Controller { | |
public $permissions = array( | |
'Admin' => '*', | |
'Student'=>array( | |
array('controller'=>'pages', 'action'=>'display'), | |
array('controller'=>'books', 'action'=>'*') | |
) | |
); |
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
// Inspired by https://github.com/logicalparadox/backbone.iobind/blob/master/lib/sync.js | |
// Overwrite Backbone.sync method | |
Backbone.sync = function(method, model, options){ | |
// create a connection to the server | |
var ws = new WebSocket('ws://127.0.0.1:1234'); | |
// send the command in url only if the connection is opened | |
// command attribute is used in server-side. | |
ws.onopen = function(){ |