Skip to content

Instantly share code, notes, and snippets.

@omolina
omolina / gist:2021988
Created March 12, 2012 13:43
Cluster on nodeJS implementation with expressJS
//implementación multi-core
var cluster = require('cluster');
var numCPUs = require('os').cpus().length;
//Inicia la escucha en el puerto 3000 y cluster para el balanceo de cargas entre
//los núcleos.
if(cluster.isMaster) {
//for Workers
@omolina
omolina / MongoDB update all matching.js
Created September 6, 2012 22:17 — forked from sym3tri/MongoDB update all matching.js
How to update a single field in a MongoDB collection for all documents matching a specific criteria
// FROM: http://www.mongodb.org/display/DOCS/Updating#Updating-update%28%29
//
// db.collection.update( criteria, objNew, upsert, multi )
// criteria - query which selects the record to update;
// objNew - updated object or $ operators (e.g., $inc) which manipulate the object
// upsert - if this should be an "upsert"; that is, if the record does not exist, insert it
// multi - if all documents matching criteria should be updated
//
// SQL VERSION:
// UPDATE myTable SET dateField = '2011-01-01' WHERE condField = 'condValue'
@omolina
omolina / alfresco-taskModel.xml
Created September 4, 2013 15:17
Task Model Alfresco
<?xml version="1.0" encoding="UTF-8"?>
<model name="" xmlns="http://www.alfresco.org/model/dictionary/1.0">
<imports>
<import uri="http://www.alfresco.org/model/dictionary/1.0" prefix="d"/>
<import uri="http://www.alfresco.org/model/bpm/1.0" prefix="bpm"/>
</imports>
<namespaces>
<div class="collapse navbar-collapse" collapse="menuCollapsed">
<ul class="nav navbar-nav">
<li ui-sref-active="active">
<a href ui-sref="home">
<i class="fa fa-home"></i>
Home
</a>
</li>
<li ui-sref-active="active">
<a href ui-sref="about">
@omolina
omolina / 0_reuse_code.js
Last active August 29, 2015 14:07
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console