This file contains hidden or 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'); | |
fs.writeFile("/tmp/test", "Hey there!", function(err) { | |
if(err) { | |
console.log(err); | |
} else { | |
console.log("The file was saved!"); | |
} | |
}); |
This file contains hidden or 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
//Simple prototype modifier to add console.time measure | |
// whenever a function is called. | |
//The hook will ignore any function starting with _ as treat | |
// as private. | |
Object.prototype.hookEvents = function (modifier) { | |
var obj = this; | |
var name, fn; | |
for (name in obj) { |
This file contains hidden or 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 path = require('path'); | |
var x = 'c:\\'; | |
var y = 'C:\\joola.io\\joola.io.config\\config' | |
console.log(x, y); | |
console.log(path.resolve(x)); | |
if (path.resolve(x) == path.join(__dirname, x)) |
This file contains hidden or 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
/** | |
* joola.io | |
* | |
* Copyright Joola Smart Solutions, Ltd. <[email protected]> | |
* | |
* Licensed under GNU General Public License 3.0 or later. | |
* Some rights reserved. See LICENSE, AUTHORS. | |
* | |
* @license GPL-3.0+ <http://spdx.org/licenses/GPL-3.0+> | |
*/ |
This file contains hidden or 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
<style type='text/css'> html, body { margin: 0; padding: 0; border: 0; } </style> |
This file contains hidden or 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 | |
nconf = require('nconf'); | |
require('nconf-redis'); | |
var options = { | |
host:'localhost', | |
port:80, | |
method:'GET' | |
} |
This file contains hidden or 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 net = require('net') | |
var sock = net.connect(1337) | |
process.stdin.pipe(sock) | |
sock.pipe(process.stdout) | |
sock.on('connect', function () { | |
process.stdin.resume(); | |
process.stdin.setRawMode(true) |
This file contains hidden or 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
For an intelligent IDE it is essential to be in the know about any external changes in files it working with - e.g. changes made by VCS, or build tools, or code generators etc. For that reason, IntelliJ platform spins background process to monitor such changes. The method it uses is platform-specific; and on Linux it is Inotify facility. | |
Inotify requires a "watch handle" to be set for each directory in the project. Unfortunately, the default limit of watch handles may not be enough for reasonably sized projects, and reaching the limit will force IntelliJ platform to fall back to recursive scans of directory trees. | |
To prevent this situation it is recommended to increase the watches limit (to, say, 512K). You can do it by adding following line to the /etc/sysctl.conf file: | |
fs.inotify.max_user_watches = 524288 | |
Then run this command to apply the change: | |
sudo sysctl -p |
OlderNewer