Skip to content

Instantly share code, notes, and snippets.

View thorbenziemek's full-sized avatar

Thorben Ziemek thorbenziemek

View GitHub Profile
@thorbenziemek
thorbenziemek / debug.js
Created February 18, 2013 21:13
debug.js: some JS debugging tools
define({
haltOnModification : function(obj, property) {
Object.defineProperty(obj, property, {
set : function(value) {
debugger;
}
}
},
window.arglogger = function (prefix) {
return function() {
if (prefix) {
console.log(prefix, arguments);
} else {
console.log(arguments);
}
}
};
@thorbenziemek
thorbenziemek / SingleRecordJsonReader.js
Created November 26, 2011 17:40
Ext.data.SingleRecordJsonReader demonstrates how to modify the Ext JS JsonReader (see http://thorben.ziemek.de/blog/2011/07/singlerecordjsonreader/)
Ext.ns('Ext.data');
Ext.data.SingleRecordJsonReader = Ext.extend(Ext.data.JsonReader, {
readRecords: function(data) {
var root = this.root;
data[root] = [data[root]];
return Ext.data.SingleRecordJsonReader.superclass.readRecords.call(this, data);
}