I hereby claim:
- I am froots on github.
- I am froots (https://keybase.io/froots) on keybase.
- I have a public key whose fingerprint is 8C86 3E94 ECF6 E978 9020 18FD 8E09 E8E2 E366 3297
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE keyboard PUBLIC "" "file://localhost/System/Library/DTDs/KeyboardLayout.dtd"> | |
<!--Created by Ukelele version 2.2.7 on 2014-01-18 at 17:44 (GMT)--> | |
<!--Last edited by Ukelele version 2.2.7 on 2014-01-18 at 17:59 (GMT)--> | |
<keyboard group="0" id="9190" name="UK Filco Majestouch-2 Tenkeyless" maxout="1"> | |
<layouts> | |
<layout first="0" last="17" modifiers="30" mapSet="a8"/> | |
</layouts> | |
<modifierMap id="30" defaultIndex="7"> | |
<keyMapSelect mapIndex="0"> |
var myModule = (function(w) { | |
var internal = "I'm hidden", | |
privateMethod = function() { | |
return "Message is " + internal; | |
}, | |
publicMethod = function() { | |
return privateMethod().replace('hidden', 'visible'); |
it("should call the callback", function() { | |
var spy = sinon.spy(); | |
doSomethingThenCallback(spy); | |
expect(spy.called).toBeTruthy(); | |
}); |
it("should call the callback", function() { | |
var spy = sinon.spy(); | |
doSomethingThenCallback(spy); | |
expect(spy).toHaveBeenCalled(); | |
}); |
var AppView = Backbone.View.extend({ | |
display: function(text) { | |
$('#app').text(text); | |
} | |
}); | |
var AppController = Backbone.Controller.extend({ |
I can only comment on Backbone.js, which as part of a 10-person team I'm currently using for a medium-sized single-page ('enterprisey') web application on the front-end. I would also say that the app is pretty much a read-only experience in that 99% of server requests are simple GET requests. There is a fair amount of data filtering and a bit of complexity in the view (dragging, scrolling, etc) which made us realise that using jQuery and a bunch of plugins alone would result in a big sloppy mess.
We were looking for something that could handle JavaScript routing and history management, as well providing a structure for separating data from the DOM and jQuery. In the future, we are also hoping to create versions for modern mobile browsers without having to re-write the entire application, for example by swapping out jQuery for Zepto.js on iOS devices. On top of all this we wanted something that would stand up to unit and functional testing without being a major pain in the backside (or backbone).
We looked a
// ---------------------------------------- | |
// /path/to/dependency.js | |
define(function() { | |
return { | |
doSomethingWithIt: function() { | |
// blah | |
} | |
}; | |
}); |
define([ | |
"modules/todo", | |
"modules/todos" | |
], function(Todo, Todos) { | |
describe("Todo", function() { | |
it("should set an attribute", function() { | |
var todo = new Todo({ title: "Do washing" }); | |
expect(todo.get("title")).toEqual("Do washing"); | |
}); |
beforeEach(function() { | |
global.fs = require('fs'); | |
sinon.stub(fs, 'readFileSync').onlyWithArgs('my-file.txt').returns('Contents of file'); | |
// Then require the module under test, which uses fs.readFileSync() internally | |
// require() uses original method with correct calling context | |
global.myModule = require('../src/my-module'); | |
}); | |
it('does something with the file', function() { |