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
/** | |
* The first commented line is your dabblet’s title | |
*/ | |
background: #f06; | |
background: linear-gradient(45deg, #f06, yellow); | |
min-height: 100%; |
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
#arrow { | |
.left ( @color : blue, @size: 20px, @position : center, @alt : 150px ){ | |
content: ""; | |
position: absolute; | |
right: 100%; | |
border-top: @size solid transparent; | |
border-bottom: @size solid transparent; | |
border-right: @size solid @color; | |
z-index : 200; | |
top: @position; |
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 cluster = require('cluster'); | |
var http = require('http'); | |
var free = 250000000; | |
var sizeWoker = 157286400; | |
var NumberWorkers = Math.round( ( os.freemem() - free ) / sizeWoker ); | |
if (cluster.isMaster) { | |
for (var i = 0; i < NumberWorkers; i++) { | |
cluster.fork(); | |
} |
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
module.exports = exports = function (mongo){ | |
var mng = mongo || require('mongoose'); | |
var Query = mng.Query; | |
Query.prototype.random = function ( query, func ){ | |
var q = typeof query === 'object' ? query : this.query; | |
var f = typeof query === 'function' ? query : func; | |
if(!( typeof f === 'function' )) retrun new Error("Is not a function"); | |
this.count(q, function (err, count) { |
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 see = require('mongose-watch'); | |
var Player = new Schema({ }); | |
var Game = new Schema({ }); | |
Player.plugin(watch() ); | |
var watchingPlayer = Plaver.findById( MyID ).watch( "_id" ); | |
watchingPlayer.start( function (err, doc){ |
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 fs = require('fs') | |
var events = require('events') | |
var util = require('util') | |
var path = require('path') | |
var FsPool = function (dir) { | |
events.EventEmitter.call(this) | |
this.dir = dir; | |
this.files = []; | |
this.active = []; |
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
const cluster = require('cluster'); | |
const http = require('http'); | |
const httpProxy = require('http-proxy'); | |
const _ = require('underscore'); | |
var numCPUs = 10; | |
var isPort = 8080; | |
function estimatePi() { | |
var n = 10000000, inside = 0, i, x, y; |
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 connect = function ( config ){ | |
this.db = mongo.createConnection( config.url ); | |
}; | |
// Mis metodos.. | |
// y mas funciones necesarias | |
exports.Connect = connect; | |
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
+ Proyectos/Mis Proyectos | |
+ node_modules | |
| + express | |
| + mongodb | |
| .... | |
| | |
+ Parte/Proyecto A | |
| + index.js | |
| ... | |
+ Parte/Proyecto B |
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
/// Cuando solo carpetas | |
var z = fs.readdirSync(__dirname); | |
for (var i = 0; i < z.length; i++) | |
if( z[i] != 'index.js' ) | |
exports[ z[i] ] = require(path.join( __dirname, z[i] ) ); | |
// Cuando solo archivos | |
var z = fs.readdirSync(__dirname); |
OlderNewer