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
#Make stuff happy | |
(window.TestDouble = {}).Views = {} | |
JST = "backbone/templates/inquiry": -> | |
class TestDouble.Views.InquiryView extends Backbone.View | |
template: JST["backbone/templates/inquiry"] | |
categories: [ | |
"build an application", | |
"receive training", |
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
window.MapPoint = Backbone.Model.extend({ | |
initialize: function(attrs,options){ | |
this.location = options.location; | |
}, | |
locationDescription: function(){ | |
var lat = this.location.get('lat'), | |
lng = this.location.get('lng'); | |
return "("+lat+","+lng+")"; | |
} |
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
SecretTreasure = (config) -> | |
somethingWasTyped: -> | |
if $('.secret').val() == config.secret | |
$('.treasure').removeClass('hidden') |
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
/Users/justin/.rvm/gems/[email protected]/gems/jasmine-headless-webkit-0.8.0/lib/jasmine/headless.rb:3: uninitialized constant Jasmine (NameError) | |
from /Users/justin/.rvm/gems/[email protected]/gems/jasmine-headless-webkit-0.8.0/lib/jasmine-headless-webkit.rb:1:in `require' | |
from /Users/justin/.rvm/gems/[email protected]/gems/jasmine-headless-webkit-0.8.0/lib/jasmine-headless-webkit.rb:1 | |
from /Users/justin/.rvm/gems/[email protected]/gems/jasmine-headless-webkit-0.8.0/bin/jasmine-headless-webkit:7:in `require' | |
from /Users/justin/.rvm/gems/[email protected]/gems/jasmine-headless-webkit-0.8.0/bin/jasmine-headless-webkit:7 | |
from /Users/justin/.rvm/gems/[email protected]/bin/jasmine-headless-webkit:19:in `load' | |
from /Users/justin/.rvm/gems/[email protected]/bin/jasmine-headless-webkit:19 |
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
var jquerify = function(callback) { | |
//ripped from karl: http://www.learningjquery.com/2009/04/better-stronger-safer-jquerify-bookmarklet/ | |
var el=document.createElement('div'), | |
b=document.getElementsByTagName('body')[0], | |
otherlib=false, | |
msg=''; | |
el.style.position='fixed'; | |
el.style.height='32px'; | |
el.style.width='220px'; | |
el.style.marginLeft='-110px'; |
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
↪ master(ahead)[dirty] tmp ≈ git clone https://github.com/ottobar/coderetreat_javascript_template.git | |
Cloning into coderetreat_javascript_template... | |
remote: Counting objects: 17, done. | |
remote: Compressing objects: 100% (15/15), done. | |
remote: Total 17 (delta 0), reused 17 (delta 0) | |
Unpacking objects: 100% (17/17), done. | |
↪ master(ahead)[dirty] tmp ≈ cd coderetreat_javascript_template/ | |
↪ master coderetreat_javascript_template ≈ bundle |
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
class window.Sudoku | |
constructor: (board) -> | |
@board = board | |
solve: -> | |
[] | |
column: (index) -> | |
(cell for cell,cellIndex in @board when cellIndex % 9 == index) |
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 is a template generated by eco | |
var ecoTemplate = function (__obj) { | |
if (!__obj) __obj = {}; | |
var __out = [], __capture = function(callback) { | |
var out = __out, result; | |
__out = []; | |
callback.call(this); | |
result = __out.join(''); | |
__out = out; | |
return __safe(result); |
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
expect($.fn.ajax).toHaveBeenCalledWith({ | |
url: "/1/3/3" | |
success: jasmine.any(Function); | |
}); | |
//.... | |
var callback = $.fn.ajax.mostRecentCall.args[0].success | |
//then you can write tests directly against the callback handler. |
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
foo = {} | |
bar = {} | |
baz = {} | |
o = | |
z: foo | |
foo: | |
a: bar | |
b: 3 | |
z: | |
lah: baz |