Skip to content

Instantly share code, notes, and snippets.

@csainty
csainty / app.js
Created January 10, 2012 05:26
Blog Post: node-webkit-twitter
var nwebkit = require('node-webkit');
nwebkit.init({
'url' : 'index.html',
'width' : 800,
'height' : 600
});
@csainty
csainty / app.js
Created January 16, 2012 07:42
Blog Post - node-webkit onclose
var nwebkit = require('node-webkit'),
http = require('http');
var server = http.createServer(function(request, response) {
response.writeHead(200, { 'Content-Type': 'text/plain'});
response.end('Hello');
}).listen(3000, '127.0.0.1');
nwebkit.init({
'url' : 'views/index.html',
@csainty
csainty / RavenProfilingHandler.cs
Created February 2, 2012 01:08
BlogPost : Bugs
public void AddStore(IDocumentStore store)
{
var documentStore = store as DocumentStore;
if (documentStore == null)
return;
if (documentStore.WasDisposed)
return;
object _;
(function () {
// some code
})();
if (true) {
var x = 1;
}
console.log(x); // Prints 1
(function() {
var x = 1;
})();
console.log(x); // throws "x" is not defined
// helpers.js
function add(x,y) {
return x + y;
}
// page.js
console.log(add(1,1)); // prints 2
// helpers.js
(function() {
function add(x,y) {
return x + y;
}
})();
// page.js
console.log(add(1,1)); // throws add is not defined
// helpers.js
(function() {
function add(x,y) {
return x + y;
}
})();
// page.js
(function() {
console.log(add(1,1)); // throws add is not defined
// helpers.js
(function() {
WinJS.Namespace.define("MyApp.Functions", {
add: function (x,y) {
return x + y;
}
});
})();
// page.js