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
Checking for program g++,c++ : ok /usr/bin/g++ | |
Checking for program cpp : ok /usr/bin/cpp | |
Checking for program ar : ok /usr/bin/ar | |
Checking for program ranlib : ok /usr/bin/ranlib | |
Checking for g++ : ok | |
Checking for program gcc,cc : ok /usr/bin/gcc | |
Checking for gcc : ok | |
Checking for library dl : ok | |
Checking for library execinfo : not found | |
Checking for gnutls >= 2.5.0 : ok |
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
client = require("http").createClient(443, "twitter.com"); | |
client.setSecure("X509_PEM"); | |
client.request("GET", "/statuses/public_timeline.xml", { host: "twitter.com" }).finish(function(response){ | |
var chunks = []; | |
response.setBodyEncoding("utf8"); | |
response.addListener("body", function(c){ chunks.push(c); }); | |
response.addListener("complete", function(){ | |
require("sys").puts(chunks.join("")); | |
}); | |
}); |
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
/*===== | |
eqmx._base.__decoratorArgs = function(){ | |
// $decorator: Function? | |
// Called just before the decorator is applied. May return `false`, | |
// in which case the decoration is aborted. | |
this.$decorator = $decorator; | |
}; | |
=====*/ | |
eqmx.decorate = function(/*Function*/constructor, /*eqmx._base.__decoratorArgs*/decorator){ |
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 Observer = dojo.extend(function(){}, { | |
observe: function(promise){ | |
this.onStart(promise); | |
promise.then(dojo.hitch(this, "onEnd")); | |
return promise; | |
}, | |
onStart: function(promise){}, | |
onEnd: function(result){} | |
}); |
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 s = "string"; | |
String.prototype.testEqual = function(){ return this == s; }; | |
String.prototype.testStrict = function(){ return this === s; }; | |
s.testEqual(); // true | |
s.testStrict(); // false | |
s = new String(s); | |
s.testEqual(); // true |
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 results = []; | |
for(var i = 0; i < 10; i++){ | |
// Bad: | |
// results.push(function(i){ return i; }); | |
// 'Good': | |
results.push((function(i){ | |
return function(){ return i; }; | |
})(i)); | |
} | |
console.log(results.map(function(f){ return f(); })); |
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
require("net").createServer(function(stream){ | |
stream.end("INVALID\r\n\r\nhttp"); | |
}).listen(8080, "127.0.0.1"); | |
require("http").createClient(8080, "127.0.0.1") | |
.on("error", function(err){ | |
console.error("Client error\n%s", err.stack); | |
}) | |
.request("GET", "/", {}).on("response", function(){ console.log("Got response"); }); |
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
#!/usr/bin/env node | |
require("child_process").exec("pbpaste", function(_, stdout){ | |
process.stdout.write(JSON.stringify(stdout.trim())); | |
}); |
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
tell application "Terminal" | |
activate | |
set hasWindow to false | |
try | |
repeat with theWindow in windows | |
if (frontmost of theWindow) then | |
set hasWindow to true | |
end if | |
end repeat | |
end try |
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
// Supported modes: | |
// * non-modal (like dijit/popup, default) | |
// * modal (like dijit/Dialog) | |
// * underlay (like dijit/Dialog, off by default, specify underlay widget) | |
// * allowTab (TAB goes through the widget, off by default) | |
// * lockFocus (prevent TAB from going out of widget, by default on for modal, off for non-modal) | |
// * cancelOnEsc (close when ESC is hit, on by default) | |
// * cancelOnBlur (close when widget is blurred, on by default) | |
// Also supports `around`, `orient`, `x` and `y` and `padding` args from dijit/popup |
OlderNewer