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
| /*! | |
| * @version 1.0 | |
| * @see ORFON | |
| * A setInterval which is pausable and does not trigger | |
| * when the current document doesn't have focus. | |
| * | |
| * Must explictely be `start()`ed. | |
| * | |
| * Optionally, the callback can return `false` in which case the | |
| * `interval` duration is increased in `intervalStep` up to `maxInterval` until a later callback |
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 {Variable} = require('reinhardt/variable'); | |
| var {Context} = require('reinhardt'); | |
| var profiler = require('ringo/profiler'); | |
| var {Broadcast} = require("radimeta/model/all"); | |
| var {renderResponse, Template} = require('reinhardt'); | |
| var {Loader} = require("reinhardt/loaders/filesystem"); | |
| var fs = require('fs'); |
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
| /* call with file to be cleaned | |
| write result into file with postfix ".cleaned" | |
| */ | |
| var fs = require('fs'); | |
| var system = require('system'); | |
| var text = fs.read(system.args[1]); | |
| var cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g; |
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
| /** | |
| * When you see a `postMessage()` it's clear your passing data into | |
| * a different module space. This fact can be obfuscated if you | |
| * use a Singleton. | |
| * | |
| */ | |
| var {Worker} = require("ringo/worker"); | |
| var Foo = function() { return this;} |
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 {Worker} = require("ringo/worker"); | |
| var Foo = function() { return this;} | |
| function main() { | |
| var w = new Worker(module.id); | |
| w.postMessage(new Foo()); | |
| } | |
| function onmessage(e) { |
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
| // I never remember which one is the mixin and which one is the class. | |
| // And I find `mixin({mixin:..})` too verbose | |
| mixin(fooMixin, fooBar) | |
| // what I rather want: | |
| mix(fooMixin).into(fooBar); | |
| // so... | |
| var mix = function(mixin) { | |
| return { |
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
| /** | |
| * Continuesly mrts a host and logs errors if packet loss to host | |
| * or on route. | |
| */ | |
| var {command} = require('ringo/subprocess'); | |
| var {setInterval} = require('ringo/scheduler'); | |
| var log = require('ringo/logging').getLogger('mtr'); | |
| var $d = require('ringo/utils/dates'); | |
| //var MTR_PATH = '/root/mtr-0.82/mtr'; |
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
| build/lib/process.js: // IE croaks with "syntax error" on code like this: | |
| speed/jquery-basis.js: // Handle the case where IE and Opera return items | |
| speed/jquery-basis.js: // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443). | |
| speed/jquery-basis.js: // If IE event model is used | |
| speed/jquery-basis.js: // If IE and not a frame | |
| speed/jquery-basis.js: // aren't supported. They return false on IE (#2968). | |
| speed/jquery-basis.js: // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443). | |
| speed/jquery-basis.js: // If IE is used, use the trick by Diego Perini | |
| speed/jquery-basis.js: // IE strips leading whitespace when .innerHTML is used | |
| speed/jquery-basis.js: // IE will insert them into empty tables |
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
| #!/bin/bash | |
| # The application will work only if it binds to | |
| # $OPENSHIFT_INTERNAL_IP:8080 | |
| RUN_CMD="${OPENSHIFT_REPO_DIR}ringojs/bin/ringo" | |
| RUN_ARGS="${OPENSHIFT_REPO_DIR}nocms/main.js serve ${OPENSHIFT_REPO_DIR}foo/" | |
| RINGO_PID="${OPENSHIFT_DATA_DIR}ringo.pid" | |
| RINGO_LOG="${OPENSHIFT_LOG_DIR}ringo.log" |
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() { | |
| "use strict"; | |
| function fooBar(arg) { | |
| console.log("first arg is ", arg); | |
| } | |
| function main() { | |
| fooBar(this); | |
| }; |