Skip to content

Instantly share code, notes, and snippets.

View Enome's full-sized avatar

Geert Pasteels Enome

View GitHub Profile
var directives = {
upload: function ($compile) {
return {
restrict: 'E',
require: 'ngModel',
controller: 'UploadCtrl',
link: function (scope, element, attr, model) {
scope.url = element.attr('url');
function (req, res, next) {
res.locals.flash = req.session.flash;
delete req.session.flash;
}
<div ng-controller='ProductsCtrl'>
<div ng-repeat='product in products' ng-controller='ProductCtrl' >
</div>
</div>
var controllers = {
UploadCtrl: function ($scope) {
$scope.images = [];
$scope.files = [];
$scope.upload = function (element) {
$scope.$apply(function ($scope) {
$scope.files = element.files;

Details

Test

Benchmarked with ApacheBench. The test is 10 concurrent request 10 times so 100 requests. I wanted to do 1000 requests but the pure Umbraco test would put to much presure on my server. I am using my production server for this so the tests can be taken with a grain of salt.

Server

I am using a medium Azure virtual machine (Medium VM (2 x 1.6GHz CPU, 3.5GB RAM)

app.post('/instances/create',
types.getType(function () { return { name: this.req.body.type }; }),
instances.saveFiles,
types.validate,
instances.saveData,
general.redirect('/jungles'));
var render = function (mobile, normal) {
return function (req, res) {
if (mobile) {
res.render(mobile);
} else {
res.render(normal);
}
};
app.use(function (req, res, next) {
if (req.session.flash) {
extend(res.locals, req.session.flash);
delete req.session.flash;
}
next();
});
Tue Aug 28 2012 10:39:33 GMT+0000 (UTC)
{
"type": "http",
"error": 404
}
code: 404
url: /w00tw00t.at.blackhats.romanian.anti-sec:)
--------------------------------------------------
Tue Aug 28 2012 10:39:34 GMT+0000 (UTC)
{
# Helpers
( require './apps/general/helpers' ).init( app )
( require './apps/website/helpers' ).init( app )
( require './apps/users/helpers' ).init( app )
( require './apps/validation/src/helpers' ).init( app )
( require './apps/transactions/helpers' ).init( app )
( require './apps/conversations/helpers' ).init( app )
( require './apps/products/helpers' ).init( app )