Skip to content

Instantly share code, notes, and snippets.

@danielmahal
Created October 28, 2012 17:36
Show Gist options
  • Save danielmahal/3969241 to your computer and use it in GitHub Desktop.
Save danielmahal/3969241 to your computer and use it in GitHub Desktop.
Olav example
var config = {
url: 'http://...'
};
var loadXML = function(url) {
}
var getXML = (function() {
var cache = {};
return function(url) {
cache[url] = cache[url] || loadXML(url);
}
})();
getXML(config.url);
var Connection = function(options) {
this.url = options.url;
this.user = options.user;
this.pass = options.pass;
}
_.extend(Connection.prototype, {
put: function() {
},
get: function() {
}
});
var connection = new Connection({
url: 'http://',
user: 'dsa',
pass: 'dsa'
});
connection.put('lolz');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment