This file contains hidden or 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
codeMirror.setOption('onDragEvent', function(cm, e) { | |
// Move the cursor as they drag. | |
var pos = codeMirror.coordsChar({left: e.x, top: e.y }); | |
codeMirror.setCursor(pos); | |
codeMirror.focus(); | |
var isImageDrop = e.type == 'drop' && e.dataTransfer.files && e.dataTransfer.files.length > 0 && e.dataTransfer.files[0].type && e.dataTransfer.files[0].type.indexOf('image/') > -1; | |
if (!isImageDrop) return; | |
event.preventDefault(); |
This file contains hidden or 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
describe ReportsController do | |
describe :create do | |
before do | |
@payload = { :version => "1.0.0" } | |
end | |
it "succeeds with present serial" do | |
@payload[:serial] = "123abc" | |
post reports_path, @payload.to_json |
This file contains hidden or 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
function func(a, f) { | |
return function(args) { | |
args = args || {}; | |
args.__proto__ = a; | |
f.call(this, args); | |
}; | |
}; | |
var f = func({ foo: 10, bar: 20 }, function(args) { |
This file contains hidden or 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
this.$().animate({ | |
scale: 1, | |
translateX: 0, | |
translateY: 0, | |
top: document.body.scrollTop, | |
left: 0, | |
width: window.innerWidth, | |
height: window.innerHeight |