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
/** | |
* Given a list of items, adds and removes an active class as you hover over | |
* them. Used to create a dropdown menu. | |
* | |
* Copyright (c) 2012 Blake Haswell | |
* Licensed under the MIT license: http://opensource.org/licenses/MIT | |
* | |
* Example: | |
* var items = document.getElementById("dropdown").children; | |
* new Dropdown(items); |
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
var beverage = { | |
"SB" : "Short black", | |
"LB" : "Long black", | |
"Cap" : "Cappuccino", | |
"FW" : "Flat white" | |
}; | |
var milk = { | |
"reg" : "Regular", | |
"soy" : "Soy milk", |
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 (window, undefined) { | |
"use strict"; | |
var $ = window.jQuery; | |
$.fn.shrinkWrapText = function () { | |
return this.each(function () { | |
var $el = $(this); | |
var sw = new ShrinkWrapper($el); |
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
TestSuite.add({ | |
name: "List transformer", | |
getHtml: function () { | |
var html = []; | |
html.push("<ul class=\"unorderedList\">"); | |
html.push("<li>A list item</li>"); | |
html.push("<li>A second list item</li>"); |
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
module.exports = function (grunt) { | |
grunt.initConfig({ | |
connect: { | |
jasmine: { | |
options: { | |
hostname: 'localhost', | |
port: 9001 | |
} | |
} |
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 calculatePercentage($numerator, $denominator) { | |
@return ($numerator / $denominator) * 100%; | |
} |
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
module.exports = function (grunt) { | |
grunt.initConfig({ | |
jshint: { | |
all: { | |
src: 'public/javascripts/app/*.js', | |
options: { | |
bitwise: true, | |
camelcase: true, |
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>Search Box in CSS</title> | |
<style> | |
body { | |
background-color: #eee; | |
margin: 0; |
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
var _ = require('underscore'); | |
module.exports = function () { | |
var collectionArray = _.toArray(arguments); | |
return _.reduce(collectionArray, function (memo, collection) { | |
return memo.concat(collection.reject(function (model) { | |
return _.contains(_.pluck(memo, 'id'), model.id); | |
})); | |
}, []); | |
}; |
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
var q = require('q'); | |
var copy = q.denodeify(require('fs-extra').copy); | |
var exists = require('fs-extra').existsSync; | |
var csv = require('csv'); | |
var reduce = require('underscore').reduce; | |
function getTeams() { | |
var deferred = q.defer(); | |
var teams = []; | |
csv() |