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 fs = require('fs'); | |
JSLINT(fs.read(require('system').args[1]), { | |
passfail: false, | |
undef: true, | |
vars: true, | |
bitwise: true, | |
sloppy: true, | |
white: true, | |
devel: true, | |
plusplus: 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
#!/bin/bash | |
REVISIONS=`svn log -q --stop-on-copy |grep "^r" | cut -d"r" -f2 | cut -d" " -f1` | |
for rev in $REVISIONS; do | |
prevRev=$(($rev-1)) | |
difftext=`svn diff --old=$file@$prevRev --new=$file@$rev | tr -s " " | grep -v " -\ \- " | grep -e "$1"` | |
if [ -n "$difftext" ]; then | |
echo "$rev: $difftext" | |
fi | |
done |
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
$.fn.listHandlers = function(events, outputFunction) { | |
return this.each(function(i){ | |
var elem = this, | |
dEvents = $(this).data('events'); | |
if (!dEvents) {return;} | |
$.each(dEvents, function(name, handler){ | |
if((new RegExp('^(' + (events === '*' ? '.+' : events.replace(',','|').replace(/^on/i,'')) + ')$' ,'i')).test(name)) { | |
$.each(handler, function(i,handler){ | |
outputFunction(elem, '\n' + i + ': [' + name + '] : ' + handler ); | |
}); |
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
#!/bin/sh | |
# | |
# /etc/init.d/ringojs -- startup script for the Ringo JavaScript runtime | |
# | |
# Written by Miquel van Smoorenburg <[email protected]>. | |
# Modified for Debian GNU/Linux by Ian Murdock <[email protected]>. | |
# Modified for Tomcat by Stefan Gybas <[email protected]>. | |
# Modified for Tomcat6 by Thierry Carrez <[email protected]>. | |
# Modified for RingoJS by Hannes Wallnoefer <[email protected]>. | |
# |
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 {Application} = require('stick'); | |
var app = exports.app = new Application(); | |
app.configure('route'); | |
app.configure('session'); | |
app.get('/', function(req) { | |
console.dir(req.session.data); | |
}); |
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 myObject = { | |
"foo": true, | |
"author": "simon", | |
"env": 123 | |
} | |
var myProxy = new JavaAdapter(org.mozilla.javascript.NativeObject, { | |
// The "start" argument is here for setters and getters living | |
// on a prototype, so they know what to use as "this"-object. | |
put: function(name, start, value) { |
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 gamejs = require('gamejs'); | |
var $v = require('gamejs/utils/vectors'); | |
/* | |
* · Each tile can hold a "block" property detailing its desired | |
* blocking behaviour. Possible blocking data values are: | |
* - "none" -> Tile does not block. | |
* - "always" -> Tile blocks. | |
* - "north" -> Tile does not allow to go through its north border. | |
* - "east" -> Tile does not allow to go through its east border. |
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
/*! | |
* @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 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 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; |