Skip to content

Instantly share code, notes, and snippets.

@m4nuC
m4nuC / custom.js
Last active July 1, 2018 02:40
jupyter-vim-binding: Enable Ctrl-C to escape insert mode
// Bind <C-c> to exit insert mode
require([
'nbextensions/vim_binding/vim_binding',
], function(nb) {
CodeMirror.Vim.map("<C-c>", "<Esc>", "insert");
nb.attach = (function() {
var cached_function = nb.attach;
return function(){
var result = cached_function.apply(this, arguments);
var cm_config = require("notebook/js/cell").Cell.options_default.cm_config;
@m4nuC
m4nuC / gist:4052863
Created November 10, 2012 22:56
Jasmine Object instance Matchers and typeof matcher
beforeEach(function() {
this.addMatchers({
toBeInstanceOf : function( expected ) {
return this.actual instanceof expected && this.actual.length > 0;
},
toBeA: function( expected ) {
return typeof this.actual === expected;
}
});