This file contains 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(global) { | |
var subs = {}, | |
slice = Array.prototype.slice; | |
global.pubsub = { | |
sub: function(topic, fn, ctx) { | |
var sub = subs[topic] || (subs[topic] = []); | |
sub.push({ |
This file contains 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(global) { | |
function something() { | |
alert('something from lib1'); | |
} | |
global.something = something; | |
})(window.lib1 = {}); |
This file contains 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 something() { | |
alert('something 1'); | |
} |
This file contains 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($) { | |
$.fn.limit = function( n, callback ) { | |
callback = typeof( callback ) === 'function' ? callback : $.noop; | |
var elements = this; | |
return elements.click( function(e) { | |
var checkedCount = elements.filter(':checked').length; | |
if (checkedCount > n && !callback(checkedCount)) { | |
e.preventDefault(); | |
} | |
}); |
This file contains 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 ($) { | |
module('Details Pane', { | |
setup: function () { | |
this.details = $('<div id="details-pane"><div /></div>') | |
.appendTo('#qunit-fixture'); | |
this.ajax = $.ajax; | |
this.savedGet = mstats.datastore.get; | |
this.savedFetch = mstats.dataManager.fetch; |
This file contains 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 (mstats, $) { | |
$.widget('mstats.fillupsPane', { | |
options: { | |
active: false, | |
id: null | |
}, | |
_init: function () { | |
mstats.fillupsPane = this; | |
mstats.pubsub.subscribe(mstats.events.vehicle.fillups.data, this._newFillupsDataHandler, this); | |
this._fetchData(); |
This file contains 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
def something = { | |
response.status = 403 | |
render(text:'set a status code') | |
} |
This file contains 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
def 'something returns a particular status code'() { | |
when: | |
controller.something() | |
then: | |
mockResponse.status == 403 | |
} |
This file contains 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
def something = { | |
render(status:403, text: 'set a status code') | |
} |
This file contains 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>NYC CodeCamp Chat</title> | |
<style> | |
html, body { margin: 0; padding: 0; } | |
#msgs { | |
clear: both; | |
} | |
</style> |