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
alert('hoi'); | |
alert(1+1); |
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
// hello this is a test | |
/// <reference path="jquery-1.4.1.js" /> | |
/* | |
* jQuery plugin: zoekbox - v1.0.0 | |
* (c) 2010-2011 funda real estate <[email protected]> - http://www.funda.nl | |
* | |
* This is the core library for EVERYTHING that uses the zoekbox; | |
* either geo, nieuwbouw-projects, or even the names of all funda employees | |
* therefore NEVER EVER add anything that is implementation-specific to this code. | |
* |
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
Hoi not authenticated |
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 fileNo = 2; | |
if (fileNo === 2) { | |
console.log('oh noes, its numero deux!'); | |
} |
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
HOST = null; // localhost | |
PORT = 8001; | |
// when the daemon started | |
var starttime = (new Date()).getTime(); | |
var mem = process.memoryUsage(); | |
// every 10 seconds poll for the memory. | |
setInterval(function () { | |
mem = process.memoryUsage(); |
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 sys = require("sys"); | |
var pg = require("pg"); | |
var connStr = "tcp://postgres:admin@localhost:5432/c9_businessrules"; // @todo: to config | |
var entities = { | |
product: require("./entities/product"), | |
contract: require("./entities/contract"), | |
delivery: require("./entities/delivery"), | |
contractType: require("./entities/contracttype"), | |
log_contract: require("./entities/log_contract"), |
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
function MyObject () { | |
// do stuff | |
} | |
// now to export this as a nodejs module do | |
module.exports = MyObject; | |
// ===== | |
// in another file (in the same folder) you can now do |
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
"use strict"; | |
var Search = require("c9/dispatcher/search"); | |
module.exports.hotfix = function(config, infraredis, searchredis) { | |
Search.setDatabases(infraredis, searchredis); | |
var start = 0, end = 106000; | |
var aids = [] | |
for (var i = start; i <= end; i++) { |
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
// efficient isEven function | |
// you can insert a number or a string, doesn't matter | |
// it doesn't take numbers after the dot into account because noone uses them anyways | |
// it's also very handy for shopping websites because you can do | |
// isEven("$ 31.00") and it will say 'not even'. | |
// or isEven("32.00 $") and will say 'even' | |
function isEven(a) { | |
a = a.toString().replace(/[^0-9.]/g, ""); | |
var stack = []; | |
var rev = a.split('').reverse(); |
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
"no use strict"; | |
var console = { | |
log: function(msg) { | |
postMessage({type: "log", data: msg}); | |
} | |
}; | |
var window = { | |
console: console | |
}; |
OlderNewer