Skip to content

Instantly share code, notes, and snippets.

View Unitech's full-sized avatar

Alexandre Strzelewicz Unitech

View GitHub Profile
@Unitech
Unitech / index.js
Created January 29, 2013 03:18
test
// web+api: application
app.namespace('/app', require('./apps/App'));
@Unitech
Unitech / index.js
Created January 29, 2013 03:23
aweqw
var express = require('express')
, namespace = require('express-namespace')
@Unitech
Unitech / index.js
Created February 6, 2013 07:08
JS : ForEach () tricks
(data || []).forEach(function(config, index)
@Unitech
Unitech / user.js
Created February 6, 2013 07:43
JS : Add methods to object with .call
(function() {
this.updateKey = function(msg, block, callback) {
var self = this;
[.....]
});
};
}).call(User.prototype);
@Unitech
Unitech / user.js
Created February 6, 2013 07:45
JS : Add methods to Object with .call
(function() {
this.updateKey = function(msg, block, callback) {
var self = this;
[.....]
});
};
}).call(User.prototype);
Rickshaw.keys(this.defaults).forEach( function(k) {
this[k] = args[k] || this.defaults[k];
}, this );
var bind = (function(addr) {
var hostport = String(addr).split(':');
if (hostport.length < 2) {
hostport = [undefined, hostport[0]];
}
if (hostport[0] == null) {
hostport[0] = 'localhost';
}
return {
rpcuser=alex
rpcpassword=alexo
rpcallowip=127.0.0.1
rcpallowip=192.168.*.*
rpcport=5587
daemon=1
gen=1
server=1
maxconnections=100
// partie express
var articles = [];
var id = 0;
app.post('/article/new', function(req, res) {
var article = req.body;
article.id = id;
id++;
worker_processes auto;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;