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
count@bokonon:~/foobar/foo$ ls .git/MERGE_* | |
.git/MERGE_HEAD .git/MERGE_MODE .git/MERGE_MSG | |
count@bokonon:~/foobar/foo$ git pull | |
Already up-to-date. | |
count@bokonon:~/foobar/foo$ ls .git/MERGE_* | |
ls: cannot access .git/MERGE_*: No such file or directory |
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
(master) | |
A---B---C---E---F | |
\ | |
D---G---H | |
(feature) | |
git rebase --onto master D feature | |
(master) | |
D---G---H |
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 domain = require('domain'); | |
var d = domain.create(); | |
d.on('error', function() { | |
console.log('caught'); | |
}); | |
d.run(function() { | |
throw new Error('meh'); | |
}); |
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 d = require("domain"); | |
setTimeout(function() { | |
console.log('domain stack length is now ' + d._stack.length); | |
}, 100); | |
d.create().run(function() { | |
d.create().run(function() { | |
d.create().run(function() { | |
d.create().on("error", function(e) { |
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
diff --git a/lib/repl.js b/lib/repl.js | |
index ba334cf..1191e9f 100644 | |
--- a/lib/repl.js | |
+++ b/lib/repl.js | |
@@ -113,7 +113,12 @@ function REPLServer(prompt, stream, eval_, useGlobal, ignoreUndefined) { | |
} catch (e) { | |
err = e; | |
} | |
- cb(err, result); | |
+ if (err && process.domain) { |
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
diff --git a/src/switch.c b/src/switch.c | |
index f86b080..71abcd8 100644 | |
--- a/src/switch.c | |
+++ b/src/switch.c | |
@@ -415,7 +415,7 @@ int main(int argc, char *argv[]) | |
char *local_argv[1024] = { 0 }; | |
int local_argc = argc; | |
char *arg_argv[128] = { 0 }; | |
- int alt_dirs = 0, log_set = 0, run_set = 0, do_kill = 0; | |
+ int alt_dirs = 0, alt_base = 0, log_set = 0, run_set = 0, do_kill = 0; |
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 async = require('async'); | |
function one(cb) { | |
console.log("one"); | |
cb(); | |
} | |
function two(cb) { | |
function three(callback){ | |
var a = []; |
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
// == test code == | |
var redis = require('redis'); | |
var domain = require('domain'); | |
var c = redis.createClient(); | |
for (var n = 0; n < 10; n++) { | |
var d = domain.create(); | |
d.on('error', function() { |
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
fs.readFile('/proc/meminfo', 'utf8', function (err, str) { | |
var fields = {}; | |
str.split('\n').forEach(function (line) { | |
var parts = line.split(':'); | |
if (parts.length === 2) { | |
fields[parts[0]] = parts[1].trim().split(' ', 1)[0]; | |
} | |
}); | |
cb(fields['MemTotal'] + fields['Buffers'] + fields['Cached']); |
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
perl -wle ' | |
use JSON::XS; | |
use Data::Dumper; | |
my $json = JSON::XS->new(); | |
$json->utf8(1); | |
print Dumper(wtf(q(["abc"]))); | |
print Dumper(wtf(undef)); | |
sub wtf { |
OlderNewer